supbuddy 3.1.1 → 3.1.2

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.
@@ -28948,12 +28948,11 @@ function parseKeychainSha1Fingerprints(securityOutput) {
28948
28948
  async function getCurrentCaddyRootSha1() {
28949
28949
  const caPath = await getCaddyCAPath();
28950
28950
  if (!caPath) return null;
28951
- const pem = await fs.readFile(caPath, "utf-8");
28952
- const { X509Certificate } = await __vitePreload(async () => {
28953
- const { X509Certificate: X509Certificate2 } = await import("crypto");
28954
- return { X509Certificate: X509Certificate2 };
28955
- }, false ? __VITE_PRELOAD__ : void 0);
28956
- return new X509Certificate(pem).fingerprint.replaceAll(":", "").toUpperCase();
28951
+ try {
28952
+ return await sha1OfPem(await fs.readFile(caPath, "utf-8"));
28953
+ } catch {
28954
+ return null;
28955
+ }
28957
28956
  }
28958
28957
  function buildDarwinCaInstallCommand(caPath, staleFingerprints) {
28959
28958
  return [
@@ -28976,6 +28975,12 @@ async function installCaddyCA(elevate = defaultElevate$1) {
28976
28975
  if (platform === "darwin") {
28977
28976
  const existing = await readSystemKeychainCaddyFingerprints();
28978
28977
  const current = await getCurrentCaddyRootSha1();
28978
+ if (!current) {
28979
+ return {
28980
+ success: false,
28981
+ error: `Could not read the current CA root at ${caPath}, so Supbuddy cannot tell which keychain certificates are stale. Nothing was changed. Restart the proxy to regenerate the root, then try again.`
28982
+ };
28983
+ }
28979
28984
  const stale = existing.filter((fp) => fp !== current);
28980
28985
  if (stale.length === 0 && await isCurrentRootTrustedDarwin(caPath, current, existing)) {
28981
28986
  return { success: true, message: "CA already trusted — nothing to do." };
@@ -30028,7 +30033,10 @@ function getEnablePortForwardingCommand(_httpPort, _httpsPort, _lanSharing, _cur
30028
30033
  `cp "${tmpPfConfPath}" /etc/pf.conf`
30029
30034
  );
30030
30035
  }
30031
- cmds.push("{ pfctl -e 2>/dev/null || true; }", "pfctl -f /etc/pf.conf");
30036
+ cmds.push(
30037
+ "{ pfctl -e 2>/dev/null || true; }",
30038
+ buildPfLoadCommand({ restoreBackupOnFailure: !!tmpPfConfPath })
30039
+ );
30032
30040
  return cmds.join(" && ");
30033
30041
  }
30034
30042
  function getDisablePortForwardingCommand() {
@@ -30045,6 +30053,14 @@ if [ -f /etc/pf.conf ]; then
30045
30053
  fi
30046
30054
  `.trim();
30047
30055
  }
30056
+ function buildPfLoadCommand(opts) {
30057
+ const pfConf = opts.pfConfPath ?? "/etc/pf.conf";
30058
+ const backup = opts.backupPath ?? "/etc/pf.conf.supbuddy-backup";
30059
+ const pfctl = opts.pfctl ?? "pfctl";
30060
+ const load2 = `${pfctl} -f "${pfConf}"`;
30061
+ if (!opts.restoreBackupOnFailure) return load2;
30062
+ return `{ ${load2} || { [ -f "${backup}" ] && cp "${backup}" "${pfConf}" && ${load2}; false; }; }`;
30063
+ }
30048
30064
  function getDefaultExportFromCjs(x) {
30049
30065
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
30050
30066
  }
@@ -50896,23 +50912,16 @@ async function requestPrivilegedBatch(command, prompt, tmpFiles = []) {
50896
50912
  }
50897
50913
  let guiProxyAutoStartDone = false;
50898
50914
  let lastPrivilegedError = null;
50915
+ const TRANSIENT_PRIVILEGED_FAILURE = /TTY|ASKPASS|detached/i;
50899
50916
  function shouldRetryPrivilegedSetup(proxyState, privilegedError) {
50900
50917
  if (!proxyState.needsPrivilegedRepair) return false;
50901
- return /TTY|ASKPASS/i.test(privilegedError || "");
50918
+ return TRANSIENT_PRIVILEGED_FAILURE.test(privilegedError || "");
50902
50919
  }
50903
50920
  function isPfRulesetRejection(err, stderr) {
50904
50921
  const status = err?.status;
50905
50922
  if (status == null || status === 0 || status === 127) return false;
50906
50923
  return stderr.trim().length > 0;
50907
50924
  }
50908
- function buildPfLoadCommand(opts) {
50909
- const pfConf = opts.pfConfPath ?? "/etc/pf.conf";
50910
- const backup = opts.backupPath ?? "/etc/pf.conf.supbuddy-backup";
50911
- const pfctl = opts.pfctl ?? "pfctl";
50912
- const load2 = `${pfctl} -f "${pfConf}"`;
50913
- if (!opts.restoreBackupOnFailure) return load2;
50914
- return `{ ${load2} || { [ -f "${backup}" ] && cp "${backup}" "${pfConf}" && ${load2}; false; }; }`;
50915
- }
50916
50925
  async function maybeAutoStartProxyForGui() {
50917
50926
  if (guiProxyAutoStartDone) return;
50918
50927
  const store2 = useStore.getState();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "supbuddy",
3
- "version": "3.1.1",
3
+ "version": "3.1.2",
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",