fbi-proxy 1.10.1 → 1.11.0

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/cli.js CHANGED
@@ -5960,10 +5960,26 @@ async function startFbiAuth(opts) {
5960
5960
  console.error("[fbi-auth] --reconfigure requires a TTY (interactive terminal).");
5961
5961
  return;
5962
5962
  }
5963
+ if (cfg) {
5964
+ console.log(`[fbi-auth] --reconfigure: existing config at ${configPath} will be replaced.`);
5965
+ console.log(`[fbi-auth] previous values used as defaults; press Enter to keep each.`);
5966
+ }
5963
5967
  const prompter = readlinePrompter();
5964
- cfg = await runWizard(prompter, { domain: opts.domain, existing: cfg });
5968
+ const next = await runWizard(prompter, {
5969
+ domain: opts.domain,
5970
+ existing: cfg
5971
+ });
5972
+ if (cfg) {
5973
+ const changed = changedFields(cfg, next);
5974
+ if (changed.length === 0) {
5975
+ console.log("[fbi-auth] no changes \u2014 skipping write.");
5976
+ return;
5977
+ }
5978
+ console.log(`[fbi-auth] changed fields: ${changed.join(", ")}`);
5979
+ }
5965
5980
  console.log(`[fbi-auth] writing config from wizard \u2192 ${configPath}`);
5966
- await writeConfig(cfg, configPath);
5981
+ await writeConfig(next, configPath);
5982
+ cfg = next;
5967
5983
  } else if (!cfg) {
5968
5984
  if (isTty()) {
5969
5985
  const prompter = readlinePrompter();
@@ -6021,3 +6037,21 @@ async function startCaddy(opts) {
6021
6037
  }
6022
6038
  return handle;
6023
6039
  }
6040
+ function changedFields(prev, next) {
6041
+ const fields = [
6042
+ "domain",
6043
+ "cookieDomain",
6044
+ "ssoHost",
6045
+ "provider",
6046
+ "clientId",
6047
+ "clientSecret",
6048
+ "firebase",
6049
+ "allowlist"
6050
+ ];
6051
+ const changed = [];
6052
+ for (const k of fields) {
6053
+ if (JSON.stringify(prev[k]) !== JSON.stringify(next[k]))
6054
+ changed.push(k);
6055
+ }
6056
+ return changed;
6057
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fbi-proxy",
3
- "version": "1.10.1",
3
+ "version": "1.11.0",
4
4
  "description": "FBI-Proxy provides easy HTTPS access to your local services with intelligent domain routing",
5
5
  "keywords": [
6
6
  "development-tools",
@@ -46,7 +46,8 @@
46
46
  "test:ui": "vitest --ui",
47
47
  "test:e2e": "vitest run e2e",
48
48
  "test:e2e:watch": "vitest e2e",
49
- "test:coverage": "vitest run --coverage"
49
+ "test:coverage": "vitest run --coverage",
50
+ "dl-artifacts": "gh run list --workflow='Build and Release' --branch=main --limit=1 --json databaseId -q '.[0].databaseId' | xargs -I{} gh run download {} --dir release"
50
51
  },
51
52
  "dependencies": {
52
53
  "execa": "^9.6.1",
Binary file
Binary file
package/ts/cli.ts CHANGED
@@ -12,6 +12,7 @@ import {
12
12
  helpfulSetupMessage,
13
13
  readConfigOrNull,
14
14
  writeConfig,
15
+ type AuthConfigShape,
15
16
  } from "./auth/authConfig";
16
17
  import { spawnFbiAuth, type FbiAuthHandle } from "./auth/spawnFbiAuth";
17
18
  import { isTty, readlinePrompter, runWizard } from "./auth/setupWizard";
@@ -149,10 +150,30 @@ async function startFbiAuth(opts: {
149
150
  );
150
151
  return undefined;
151
152
  }
153
+ if (cfg) {
154
+ console.log(
155
+ `[fbi-auth] --reconfigure: existing config at ${configPath} will be replaced.`,
156
+ );
157
+ console.log(
158
+ `[fbi-auth] previous values used as defaults; press Enter to keep each.`,
159
+ );
160
+ }
152
161
  const prompter = readlinePrompter();
153
- cfg = await runWizard(prompter, { domain: opts.domain, existing: cfg });
162
+ const next = await runWizard(prompter, {
163
+ domain: opts.domain,
164
+ existing: cfg,
165
+ });
166
+ if (cfg) {
167
+ const changed = changedFields(cfg, next);
168
+ if (changed.length === 0) {
169
+ console.log("[fbi-auth] no changes — skipping write.");
170
+ return undefined;
171
+ }
172
+ console.log(`[fbi-auth] changed fields: ${changed.join(", ")}`);
173
+ }
154
174
  console.log(`[fbi-auth] writing config from wizard → ${configPath}`);
155
- await writeConfig(cfg, configPath);
175
+ await writeConfig(next, configPath);
176
+ cfg = next;
156
177
  } else if (!cfg) {
157
178
  if (isTty()) {
158
179
  const prompter = readlinePrompter();
@@ -241,3 +262,21 @@ async function startCaddy(opts: {
241
262
  }
242
263
  return handle;
243
264
  }
265
+
266
+ function changedFields(prev: AuthConfigShape, next: AuthConfigShape): string[] {
267
+ const fields: (keyof AuthConfigShape)[] = [
268
+ "domain",
269
+ "cookieDomain",
270
+ "ssoHost",
271
+ "provider",
272
+ "clientId",
273
+ "clientSecret",
274
+ "firebase",
275
+ "allowlist",
276
+ ];
277
+ const changed: string[] = [];
278
+ for (const k of fields) {
279
+ if (JSON.stringify(prev[k]) !== JSON.stringify(next[k])) changed.push(k);
280
+ }
281
+ return changed;
282
+ }