supbuddy 3.1.7 → 3.1.8

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/dist/bin.js CHANGED
@@ -38962,6 +38962,10 @@ async function probe443(timeoutMs = 1e3) {
38962
38962
  return probePort(443, timeoutMs);
38963
38963
  }
38964
38964
  async function probePort(port, timeoutMs = 1e3) {
38965
+ const results = await Promise.all(["127.0.0.1", "::1"].map((host) => probeHost(host, port, timeoutMs)));
38966
+ return results.some(Boolean);
38967
+ }
38968
+ async function probeHost(host, port, timeoutMs) {
38965
38969
  const net2 = await import("net");
38966
38970
  return new Promise((resolve) => {
38967
38971
  let settled = false;
@@ -38971,7 +38975,7 @@ async function probePort(port, timeoutMs = 1e3) {
38971
38975
  clearTimeout(timeout);
38972
38976
  resolve(v);
38973
38977
  };
38974
- const socket2 = net2.createConnection({ host: "127.0.0.1", port });
38978
+ const socket2 = net2.createConnection({ host, port });
38975
38979
  const timeout = setTimeout(() => {
38976
38980
  socket2.destroy();
38977
38981
  done(false);
@@ -43536,7 +43540,7 @@ function cliBuildKind(env3 = process.env) {
43536
43540
  return raw === "host" || raw === "npm" ? raw : "dev";
43537
43541
  }
43538
43542
  function cliVersion(env3 = process.env) {
43539
- return "3.1.7".trim() || "0.0.0-dev";
43543
+ return "3.1.8".trim() || "0.0.0-dev";
43540
43544
  }
43541
43545
  function isDevBuild(env3) {
43542
43546
  return cliBuildKind(env3) === "dev";
@@ -30193,6 +30193,10 @@ async function probe443(timeoutMs = 1e3) {
30193
30193
  return probePort(443, timeoutMs);
30194
30194
  }
30195
30195
  async function probePort(port, timeoutMs = 1e3) {
30196
+ const results = await Promise.all(["127.0.0.1", "::1"].map((host) => probeHost(host, port, timeoutMs)));
30197
+ return results.some(Boolean);
30198
+ }
30199
+ async function probeHost(host, port, timeoutMs) {
30196
30200
  const net2 = await __vitePreload(() => import("net"), false ? __VITE_PRELOAD__ : void 0);
30197
30201
  return new Promise((resolve) => {
30198
30202
  let settled = false;
@@ -30202,7 +30206,7 @@ async function probePort(port, timeoutMs = 1e3) {
30202
30206
  clearTimeout(timeout);
30203
30207
  resolve(v);
30204
30208
  };
30205
- const socket2 = net2.createConnection({ host: "127.0.0.1", port });
30209
+ const socket2 = net2.createConnection({ host, port });
30206
30210
  const timeout = setTimeout(() => {
30207
30211
  socket2.destroy();
30208
30212
  done(false);
@@ -51665,8 +51669,22 @@ async function repairPortForwarding(opts) {
51665
51669
  }
51666
51670
  useStore.getState().setProxyFields({ networkingDegraded: false, needsPrivilegedRepair: false });
51667
51671
  console.log("[Proxy] pf redirect re-applied and confirmed on 443");
51672
+ await clearProxyFaultIfHealthy("a confirmed pf repair");
51668
51673
  return { ok: true };
51669
51674
  }
51675
+ async function clearProxyFaultIfHealthy(reason) {
51676
+ const store2 = useStore.getState();
51677
+ if (store2.proxyState.status !== "error") return;
51678
+ if (!isCaddyRunning()) return;
51679
+ if (!await probePort(store2.settings.httpsPort).catch(() => false)) return;
51680
+ if (store2.proxyState.portForwardingEnabled) {
51681
+ if (!await probe443().catch(() => false)) return;
51682
+ }
51683
+ lastPrivilegedError = null;
51684
+ store2.setProxyFields({ networkingDegraded: false, needsPrivilegedRepair: false });
51685
+ store2.setProxyStatus("running");
51686
+ console.log(`[Proxy] fault cleared after ${reason} — Caddy is serving and the redirect is enforced`);
51687
+ }
51670
51688
  async function reapplyProxyNetworkingAfterRestart() {
51671
51689
  const store2 = useStore.getState();
51672
51690
  if (!store2.proxyState.portForwardingEnabled) return;
@@ -51675,6 +51693,7 @@ async function reapplyProxyNetworkingAfterRestart() {
51675
51693
  if (store2.proxyState.networkingDegraded) {
51676
51694
  store2.setProxyFields({ networkingDegraded: false, needsPrivilegedRepair: false });
51677
51695
  }
51696
+ await clearProxyFaultIfHealthy("a restart that found pf intact");
51678
51697
  return;
51679
51698
  }
51680
51699
  console.warn(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "supbuddy",
3
- "version": "3.1.7",
3
+ "version": "3.1.8",
4
4
  "description": "Run multiple Supabase projects at once on custom local domains with HTTPS. A headless CLI and daemon (proxy, DNS, Supabase/Compose lifecycle, MCP) for macOS and Linux.",
5
5
  "keywords": [
6
6
  "supabase",