tailscale-proxy 1.0.0 → 1.0.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.
Files changed (2) hide show
  1. package/bin/launcher.js +16 -5
  2. package/package.json +7 -7
package/bin/launcher.js CHANGED
@@ -43,15 +43,26 @@ function fromCache() {
43
43
  function downloadToCache() {
44
44
  const ext = PLATFORM === "win32" ? "zip" : "tar.gz";
45
45
  const asset = `tsp_${GOOS}_${GOARCH}.${ext}`;
46
- const url = `https://github.com/${REPO}/releases/download/v${VERSION}/${asset}`;
46
+ // Prefer the exact version; fall back to the latest release if that asset is
47
+ // missing (e.g. a stale/placeholder launcher version) so it always self-heals.
48
+ const urls = [
49
+ `https://github.com/${REPO}/releases/download/v${VERSION}/${asset}`,
50
+ `https://github.com/${REPO}/releases/latest/download/${asset}`,
51
+ ];
47
52
  const dir = cacheDir();
48
53
  fs.mkdirSync(dir, { recursive: true });
49
54
  const archive = path.join(dir, asset);
50
55
 
51
- process.stderr.write(`tailscale-proxy: fetching ${asset} (v${VERSION})…\n`);
52
- const dl = spawnSync("curl", ["-fsSL", "-o", archive, url], { stdio: ["ignore", "ignore", "inherit"] });
53
- if (dl.status !== 0) {
54
- throw new Error(`download failed: ${url}`);
56
+ let ok = false;
57
+ for (const url of urls) {
58
+ process.stderr.write(`tailscale-proxy: fetching ${asset}…\n`);
59
+ if (spawnSync("curl", ["-fsSL", "-o", archive, url], { stdio: ["ignore", "ignore", "inherit"] }).status === 0) {
60
+ ok = true;
61
+ break;
62
+ }
63
+ }
64
+ if (!ok) {
65
+ throw new Error(`could not download ${asset} for v${VERSION} or latest`);
55
66
  }
56
67
  // `tar` extracts both .tar.gz and .zip on macOS/Linux/Windows-10+.
57
68
  const ex = spawnSync("tar", ["-xf", archive, "-C", dir], { stdio: ["ignore", "ignore", "inherit"] });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tailscale-proxy",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Discover local dev servers by port and expose them through one Tailscale Serve/Funnel entry, routed by project name.",
5
5
  "keywords": [
6
6
  "tailscale",
@@ -71,12 +71,12 @@
71
71
  "semantic-release": "^25.0.3"
72
72
  },
73
73
  "optionalDependencies": {
74
- "tailscale-proxy-darwin-arm64": "1.0.0",
75
- "tailscale-proxy-darwin-x64": "1.0.0",
76
- "tailscale-proxy-linux-x64": "1.0.0",
77
- "tailscale-proxy-linux-arm64": "1.0.0",
78
- "tailscale-proxy-win32-x64": "1.0.0",
79
- "tailscale-proxy-win32-arm64": "1.0.0"
74
+ "tailscale-proxy-darwin-arm64": "1.0.1",
75
+ "tailscale-proxy-darwin-x64": "1.0.1",
76
+ "tailscale-proxy-linux-x64": "1.0.1",
77
+ "tailscale-proxy-linux-arm64": "1.0.1",
78
+ "tailscale-proxy-win32-x64": "1.0.1",
79
+ "tailscale-proxy-win32-arm64": "1.0.1"
80
80
  },
81
81
  "packageManager": "bun@1.3.14",
82
82
  "engines": {