feat: add MINDWTR_REQUIRE_SYNC login gate for self-hosted web deployments - #1144
Closed
chief-nerd wants to merge 11 commits into
Closed
feat: add MINDWTR_REQUIRE_SYNC login gate for self-hosted web deployments#1144chief-nerd wants to merge 11 commits into
chief-nerd wants to merge 11 commits into
Conversation
…ic wording - sv.ts: Replace 'själv värdadad' (malformed) with 'egen' to match existing sv.ts terminology (egen server) - fa.ts: Replace 'خودمیزبان' with 'میزبانی شخصی' to match existing fa.ts terminology
…creen SyncService.performSync always pairs a requeue with success: true, so the provenEnough check (which only looked at .success) let a fully-requeued probe fall through and commit+log in without ever proving the connection. Add the missing skipped === 'requeued' guard (mirrors useSyncSettings) and fix the test's mock to use the real production shape.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…cument REQUIRE_SYNC Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
… form The encrypted-remote branch of provenEnough was independent of probeResult.success, so a pendingRemoteWriteBackoff (or busy remote fence) skip carrying a stale SYNC_ENCRYPTION_REMOTE_ENCRYPTED string in its carried-over lastSyncError could satisfy it without the probe ever talking to the server. Gate it on !success, matching Settings. Also prefill the URL field from the already-fetched runtime-config default (when the user hasn't typed anything) and show the existing settings.cloudHint / settings.cloudTokenHint text under each field. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
SyncLoginGate unmounts SyncLoginScreen the instant onLoggedIn() fires, but getWebDefaultCloudUrl()'s underlying fetch can take up to 3s to resolve, so a fast login could resolve the prefill after unmount. Add the same `active` flag guard already used in SyncLoginGate.tsx for the analogous race. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Closed
4 tasks
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
MINDWTR_REQUIRE_SYNC: set it to1on a self-hosted web/PWA deployment and the app shows a login screen (Self-Hosted URL + Access Token) before anything loads, instead of opening straight into a local, unsynced app.It reuses the existing self-hosted sync credential and the same probe-then-commit flow the Settings page already uses — no new auth system, no new session concept. "Logged in" just means valid sync config is already saved locally; a later revoked token surfaces through the normal sync-error UI, not a bounce back to this screen. The URL field prefills from the same runtime config the server already provides (e.g.
MINDWTR_DEFAULT_CLOUD_URL) when available, and both fields show the same hint text as the Settings page.Delivered via the same
runtime-config.jsonmechanism asMINDWTR_DEFAULT_CLOUD_URL(runtime, not build-time), so it works with the prebuilt Docker image. Only affects the browser/PWA build — Tauri and the quick-add window always skip it.Heads up: this is a convenience gate, not real authentication. It's client-side and fails open, so put a reverse proxy in front if you need actual access control (documented in
docker/README.md).Testing
Full workspace suite passes except a few pre-existing, unrelated failures — verified present on
maintoo (a date-dependent calendar test, the long-standing Korean locale gap, some attachment-GC tests). Everything this PR touches is green.Checklist