From 35348093a6c34c226f150cc0e924d1017c21cd10 Mon Sep 17 00:00:00 2001 From: Nystik <236107-Nystik@users.noreply.gitlab.com> Date: Sat, 6 Jun 2026 20:40:42 +0200 Subject: [PATCH] minor settings fixes --- apps/ignis-server/README.md | 2 +- apps/ignis-server/server/settings.js | 2 +- packages/bridge/src/settings/general-tab.js | 22 +++++++++++++-------- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/apps/ignis-server/README.md b/apps/ignis-server/README.md index 05125be..5ba0088 100644 --- a/apps/ignis-server/README.md +++ b/apps/ignis-server/README.md @@ -76,7 +76,7 @@ To build from source instead of pulling the image, clone the repo and run `docke | `AUTO_CREATE_DEFAULT` | When `true`, creates a "My Vault" vault on startup if no vaults exist. Useful for fresh installs. | `false` | | `PUID` | User ID for file ownership | `1000` | | `PGID` | Group ID for file ownership | `1000` | -| `WRITE_COALESCE_MS` | Debounce window (ms) for rapid writes. Useful for slow filesystems (rclone, NFS, SMB). Set to `0` to disable. | `5000` | +| `WRITE_COALESCE_MS` | Debounce window (ms) for rapid writes. On slow filesystems (rclone, NFS, SMB), set an appropriate duration. | `0` | | `WS_ORIGINS` | Comma-separated allowlist of `Origin` headers accepted on the WebSocket endpoint. When unset, any origin is accepted. | unset | Demo mode adds its own set of env vars (per-session vaults, auto-cleanup, proxy allowlist, login blocking). See [`examples/demo/`](examples/demo/) if you want to run a public demo deployment. diff --git a/apps/ignis-server/server/settings.js b/apps/ignis-server/server/settings.js index 597c2af..854d06d 100644 --- a/apps/ignis-server/server/settings.js +++ b/apps/ignis-server/server/settings.js @@ -10,7 +10,7 @@ const DEFAULTS = { contentCacheBytes: 50 * 1024 * 1024, inputCacheBytes: 200 * 1024 * 1024, inputCacheTtlMs: 5 * 60 * 1000, - writeCoalesceMs: 5000, + writeCoalesceMs: 0, maxBodyBytes: 50 * 1024 * 1024, // "any" reaches any public host, "allowlist" restricts to proxyAllowlist, "disabled" blocks all proxying. proxyMode: "any", diff --git a/packages/bridge/src/settings/general-tab.js b/packages/bridge/src/settings/general-tab.js index 40475b3..b8419fa 100644 --- a/packages/bridge/src/settings/general-tab.js +++ b/packages/bridge/src/settings/general-tab.js @@ -101,10 +101,6 @@ const STATUS_DOT_CLASSES = { closed: "ignis-status-disconnected", }; -// Obsidian's grouped-settings container. The .setting-group > .setting-items -// structure renders its child settings inside one shared box, with an optional -// heading as a sibling above the box. The shipped stylesheet supplies the -// styling from theme variables, so the rows need no custom CSS. function createSettingGroup(containerEl, heading) { const group = containerEl.createDiv("setting-group"); @@ -251,19 +247,24 @@ async function saveSetting(partial) { } function numberField(containerEl, { name, desc, value, key, toStored }) { + let committed = value; + new Setting(containerEl) .setName(name) .setDesc(desc) .addText((text) => { text.setValue(String(value)); - // Commit on blur or Enter, the way a native number setting behaves. + // Commit only on change. const commit = () => { const n = parseInt(text.getValue(), 10); - if (Number.isInteger(n) && n >= 0) { - saveSetting({ [key]: toStored(n) }); + if (!Number.isInteger(n) || n < 0 || n === committed) { + return; } + + committed = n; + saveSetting({ [key]: toStored(n) }); }; text.inputEl.addEventListener("blur", commit); @@ -296,7 +297,12 @@ function proxyAccessField(parent, current, app) { emptyNote: "No hosts yet.", recommended: { note: "Restricting the proxy stops Obsidian's plugin and theme browser and updates from working unless their hosts are allowed.", - hosts: ["releases.obsidian.md", "github.com", "raw.githubusercontent.com"], + hosts: [ + "releases.obsidian.md", + "github.com", + "api.github.com", + "raw.githubusercontent.com", + ], buttonText: "Add recommended hosts", }, },