caddyship 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -91,6 +91,10 @@ password) and add the public IP of the computer you run `caddyship` from to the
91
91
  The config file `~/.config/caddyship/config.json` is created with mode `0600`.
92
92
  - Existing records are never overwritten silently: a differing A/AAAA record stops the run
93
93
  unless you confirm or pass `--update-dns`; an existing CNAME is refused.
94
+ - WEDOS checks the exact address your connection comes from. caddyship prefers IPv4, so only
95
+ your IPv4 address has to be on the allow-list (the panel takes addresses separated by spaces).
96
+ If WEDOS answers `2051 Access not allowed from this IP address (...)`, the address in that
97
+ message is the one to allow.
94
98
  - Apex records (no subdomain) are not supported yet.
95
99
 
96
100
  ## Security notes
package/dist/cli.js CHANGED
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  // src/cli.ts
4
+ import dns from "dns";
4
5
  import { Command } from "commander";
5
6
 
6
7
  // src/util.ts
@@ -474,7 +475,7 @@ var DnsConflictError = class extends CaddyshipError {
474
475
  existing;
475
476
  };
476
477
  var asArray = (v) => v === void 0 || v === null ? [] : Array.isArray(v) ? v : [v];
477
- var AUTH_HINT = "Check that you use the WAPI password (not your account password), that WAPI is enabled, and that this machine's public IP is on the WAPI allow-list in the WEDOS customer panel.";
478
+ var AUTH_HINT = "Check that you use the WAPI password (not your account password), that WAPI is enabled, and that this machine's public IP is on the WAPI allow-list in the WEDOS customer panel. If the message names an IP address you did not list (often an IPv6 address), add that address or run with NODE_OPTIONS=--dns-result-order=ipv4first. WEDOS applies WAPI setting changes within 30 minutes, and blocks an IP for a growing time after more than 10 failed requests, so wait instead of retrying repeatedly.";
478
479
  var WapiClient = class {
479
480
  constructor(o) {
480
481
  this.o = o;
@@ -521,7 +522,7 @@ var WapiClient = class {
521
522
  if (r.code === 1e3 || r.code === 1001) return r.data ?? {};
522
523
  if (attempt === 0 && pragueHour(sentAt) !== pragueHour(this.now())) continue;
523
524
  const text = r.result ?? "unknown error";
524
- const authish = /auth|ip|denied|forbidden|password|login|permission/i.test(text);
525
+ const authish = r.code >= 2e3 && /auth|credential|\bip\b|denied|forbidden|password|login|permission|block|limit/i.test(text);
525
526
  throw new WapiError(`WAPI ${command} failed (${r.code}): ${text}`, r.code, authish ? AUTH_HINT : void 0);
526
527
  }
527
528
  throw new WapiError("WAPI request failed");
@@ -1393,9 +1394,10 @@ async function remove(nickname, o) {
1393
1394
  }
1394
1395
 
1395
1396
  // src/version.ts
1396
- var VERSION = true ? "0.1.0" : "0.0.0-dev";
1397
+ var VERSION = true ? "0.1.1" : "0.0.0-dev";
1397
1398
 
1398
1399
  // src/cli.ts
1400
+ dns.setDefaultResultOrder("ipv4first");
1399
1401
  function report(e) {
1400
1402
  const err = e;
1401
1403
  p.log.error(err.message || String(e));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "caddyship",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Interactive CLI that publishes Docker apps behind Caddy over SSH, with optional WEDOS DNS automation.",
5
5
  "type": "module",
6
6
  "bin": {