Repository navigation
Add the Dropbox off-site backup destination (bring-your-own-credentials) - #245
Merged
Merged
Conversation
…ls) [skip ci] Dropbox becomes a connectable cloud place for off-site backups, built on the owner's own Dropbox app so Girru registers nothing, hosts nothing and pays nothing. The sign-in is secret-less PKCE OAuth on a loopback redirect (127.0.0.1), owner-gated; only a refresh token and the owner's app id live in the credential vault on this computer. The provider receives only the AES-256-GCM ciphertext the backup archive produces. Backend - net/oauth-loopback.ts: generic secret-less PKCE loopback flow (fixed port the owner registers once; state-checked; browser opened through a seam). - net/dropbox-client.ts: Dropbox REST over the shared HTTP transport — token exchange/refresh with an in-memory access-token cache, account email, upload (single shot or a chunked upload session for large archives), download, list, delete. Own code, no SDK. - services/cloud-connect.ts: owner-gated start/poll/cancel flow manager that runs the loopback OAuth and stores the token in the vault, handing back only a flow id and an opaque connection reference — never a token. - backup-destinations.ts: a Dropbox adapter on the existing ensure/put/get/ list/remove interface (App-folder scope, ciphertext-only, remote-verify); a cloud place reuses the stored connection instead of a pasted secret. - routes: POST /api/backups/cloud/connect, GET/POST .../:flowId(/cancel). UI - Settings › Backups: Dropbox is a selectable kind with a Connect step — a one-time app-key field with inline setup help, a browser sign-in with a connecting/cancel state, then folder + Test + Add. Google Drive and OneDrive stay "Coming". Errors are inline and recoverable. Contract keeps secrets and tokens off the wire: the connect responses carry only status + an opaque reference, and a Dropbox place projects its account only. Tests drive the OAuth and all Dropbox HTTP with in-memory fakes, so no real network and no live Dropbox call.
9mtm
force-pushed
the
backup/cloud-dropbox
branch
from
November 28, 2026 20:44
fe2fbf1 to
e7a2730
Compare
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.
Dropbox off-site backup destination (BACKUP-02, cloud phase 1)
Adds Dropbox as an owner-controlled off-site backup destination, the first cloud target after local folder / SFTP / WebDAV / S3. Bring-your-own-credentials: the owner registers their own Dropbox app once; we store nothing server-side and relay nothing.
What's new
net/oauth-loopback.ts): S256 challenge, state check, fixed loopback redirecthttp://localhost:53682/on127.0.0.1only. Reusable by Google Drive / OneDrive later.net/dropbox-client.ts) over the shared HTTP transport: token exchange + on-demand refresh with an in-memory cache, single and chunked (upload-session) upload, download, list, delete. Own code — no SDK, no new packages.cloud-connect.ts): start / poll / cancel. Opens the browser, exchanges the code, stores the token in the existing encrypted credential vault, and returns only an opaque reference — never a token.ensure/put/get/list/remove): App-folder scope, ciphertext only, remote read-back verify.Guards
Owner-gated · loopback-only (127.0.0.1) · ciphertext-only · tokens never leave the device, never logged, never echoed in a response.
Tests
Backend
tscclean; backend backup suite 25/25 (OAuth and all Dropbox HTTP faked — no live network call); core-ui typecheck + build + full suite 1999/1999 (source-boundary guard carved for the loopback-redirect help literal).Not covered here