supbuddy 3.1.7 → 3.1.9

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.9".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);
@@ -51540,7 +51544,16 @@ async function handleStartProxy() {
51540
51544
  if (!alreadyRunning) {
51541
51545
  await startCaddyServer();
51542
51546
  }
51543
- if (privilegedFailure) {
51547
+ const pfWanted = store2.proxyState.portForwardingEnabled === true;
51548
+ const redirectOkNow = !pfWanted || await probe443().catch(() => false);
51549
+ const servingNow = await probePort(store2.settings.httpsPort).catch(() => false);
51550
+ const privilegedFailureMatters = !!privilegedFailure && !(servingNow && redirectOkNow);
51551
+ if (privilegedFailure && !privilegedFailureMatters) {
51552
+ console.warn(
51553
+ `[Proxy] privileged setup could not run (${privilegedFailure}) — but the proxy is serving and the redirect is enforced, so nothing is broken. Not reporting a fault.`
51554
+ );
51555
+ }
51556
+ if (privilegedFailureMatters) {
51544
51557
  lastPrivilegedError = privilegedFailure;
51545
51558
  store2.setProxyFields({ networkingDegraded: true, needsPrivilegedRepair: true });
51546
51559
  const httpsAlive = await probePort(store2.settings.httpsPort).catch(() => false);
@@ -51665,8 +51678,22 @@ async function repairPortForwarding(opts) {
51665
51678
  }
51666
51679
  useStore.getState().setProxyFields({ networkingDegraded: false, needsPrivilegedRepair: false });
51667
51680
  console.log("[Proxy] pf redirect re-applied and confirmed on 443");
51681
+ await clearProxyFaultIfHealthy("a confirmed pf repair");
51668
51682
  return { ok: true };
51669
51683
  }
51684
+ async function clearProxyFaultIfHealthy(reason) {
51685
+ const store2 = useStore.getState();
51686
+ if (store2.proxyState.status !== "error") return;
51687
+ if (!isCaddyRunning()) return;
51688
+ if (!await probePort(store2.settings.httpsPort).catch(() => false)) return;
51689
+ if (store2.proxyState.portForwardingEnabled) {
51690
+ if (!await probe443().catch(() => false)) return;
51691
+ }
51692
+ lastPrivilegedError = null;
51693
+ store2.setProxyFields({ networkingDegraded: false, needsPrivilegedRepair: false });
51694
+ store2.setProxyStatus("running");
51695
+ console.log(`[Proxy] fault cleared after ${reason} — Caddy is serving and the redirect is enforced`);
51696
+ }
51670
51697
  async function reapplyProxyNetworkingAfterRestart() {
51671
51698
  const store2 = useStore.getState();
51672
51699
  if (!store2.proxyState.portForwardingEnabled) return;
@@ -51675,6 +51702,7 @@ async function reapplyProxyNetworkingAfterRestart() {
51675
51702
  if (store2.proxyState.networkingDegraded) {
51676
51703
  store2.setProxyFields({ networkingDegraded: false, needsPrivilegedRepair: false });
51677
51704
  }
51705
+ await clearProxyFaultIfHealthy("a restart that found pf intact");
51678
51706
  return;
51679
51707
  }
51680
51708
  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.9",
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",