dsh-telegram-connector 0.13.0 → 0.13.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/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.13.1
4
+
5
+ - **`/system status` probes the advertised address.** The setup binds the LAN
6
+ address (for example `192.168.2.98`), so the old hardcoded
7
+ `127.0.0.1:4310` check reported `answered unreachable` while the Web UI was
8
+ serving. The probe now tries the URL the web app advertises and falls back to
9
+ loopback only when there is no advertised URL.
10
+
3
11
  ## 0.13.0
4
12
 
5
13
  - **npm distribution.** The package is published as
package/COMPATIBILITY.md CHANGED
@@ -6,6 +6,7 @@ every release.
6
6
 
7
7
  | Connector | DSH | Status | Notes |
8
8
  |---|---|---|---|
9
+ | 0.13.1 | `0.2.1-rc.5` | needs UAT | `/system status` probes the advertised web address, so a LAN-only bind no longer reports loopback as unreachable |
9
10
  | 0.13.0 | `0.2.1-rc.5` | needs UAT | independent semver; `/system update connector` resolves and installs the newest compatible connector tag; `/system update penpot` and `/system update plugin <name>` update bundles through the plugin manager; standalone mode documented |
10
11
  | 0.2.1-rc.5-0.12.11 | `0.2.1-rc.5` | tested | maintenance: setup keeps the Penpot token in both env files |
11
12
  | 0.2.1-rc.5-0.12.10 | `0.2.1-rc.5` | previous | maintenance: setup pins API-only penpot plugin 0.2.0 |
package/README.md CHANGED
@@ -154,7 +154,7 @@ install without the setup.
154
154
  The connector is published to npm as an exact version:
155
155
 
156
156
  ```sh
157
- dsh plugin --profile web add dsh-telegram-connector@0.13.0
157
+ dsh plugin --profile web add dsh-telegram-connector@0.13.1
158
158
  export DSH_TELEGRAM_BOT_TOKEN='123456:ABC…'
159
159
  ```
160
160
 
@@ -170,7 +170,7 @@ cat >> "$DSH_HOME/profiles/web/pnpm-workspace.yaml" <<'YAML'
170
170
  allowBuilds:
171
171
  dsh-telegram-connector@https://github.com/vladtsvirko/dsh-telegram-connector.git: true
172
172
  YAML
173
- dsh plugin --profile web add github:vladtsvirko/dsh-telegram-connector#v0.13.0
173
+ dsh plugin --profile web add github:vladtsvirko/dsh-telegram-connector#v0.13.1
174
174
  ```
175
175
 
176
176
  That path runs the package's `prepare` build; pnpm ≥ 10 refuses it until the
package/lib/index.js CHANGED
@@ -1617,13 +1617,37 @@ export function apply(ctx, config) {
1617
1617
  */
1618
1618
  const statusProbes = async () => {
1619
1619
  const port = (process.env.DSH_PORT ?? '4310').trim() || '4310';
1620
- let web = 'unreachable';
1621
- try {
1622
- const response = await fetch(`http://127.0.0.1:${port}/`, { signal: AbortSignal.timeout(2000) });
1623
- web = String(response.status);
1620
+ // Probe what the runtime advertises, not just loopback: a deployment may
1621
+ // bind only the LAN address (the setup does), which makes 127.0.0.1 look
1622
+ // down while the Web UI is answering on the host's LAN address.
1623
+ const probes = [];
1624
+ const link = webLink();
1625
+ if (link.root.length > 0) {
1626
+ try {
1627
+ const advertised = new URL(link.root);
1628
+ if (advertised.host.length > 0) {
1629
+ probes.push({ label: advertised.host, url: `${advertised.origin}/` });
1630
+ }
1631
+ }
1632
+ catch {
1633
+ // An unparseable advertised URL falls back to loopback below.
1634
+ }
1624
1635
  }
1625
- catch {
1626
- web = 'unreachable';
1636
+ const loopback = { label: `127.0.0.1:${port}`, url: `http://127.0.0.1:${port}/` };
1637
+ if (!probes.some((probe) => probe.url === loopback.url))
1638
+ probes.push(loopback);
1639
+ let web = 'unreachable';
1640
+ let where = probes[0]?.label ?? loopback.label;
1641
+ for (const probe of probes) {
1642
+ try {
1643
+ const response = await fetch(probe.url, { signal: AbortSignal.timeout(2000) });
1644
+ web = String(response.status);
1645
+ where = probe.label;
1646
+ break;
1647
+ }
1648
+ catch {
1649
+ // Try the next address; loopback is the last fallback.
1650
+ }
1627
1651
  }
1628
1652
  const names = providerKeyNames();
1629
1653
  const missing = names.filter((name) => (process.env[name] ?? '').trim().length === 0);
@@ -1643,7 +1667,7 @@ export function apply(ctx, config) {
1643
1667
  registryLine += ` · ${String(missing)} missing — run /sync to restore`;
1644
1668
  }
1645
1669
  return [
1646
- `web: 127.0.0.1:${port} answered ${web}`,
1670
+ `web: ${where} answered ${web}`,
1647
1671
  `key: ${key}`,
1648
1672
  `registry: ${registryLine}`,
1649
1673
  `data: ${dataDirectoryLine()}`,