Adding export, Adding hooks for automated installation#36
Open
jeremyd wants to merge 2 commits into
Open
Conversation
loadUserSettings returns early when settings.json doesn't exist yet and never built the KindIsAllowed function, so the first event to arrive before setup completed segfaulted the relay in basicRejectionLogic.
Non-interactive first-run setup for container/orchestrator deploys, driven by environment variables instead of the /setup/domain and /setup/root web pages. bootstrapFromEnv only acts when PYRAMID_ROOT_PUBKEY is set and the relay has no root users yet, so it is a no-op for interactively-configured relays and for anyone not using the env vars; it seeds domain, root and service members. applyPlatformEnvOverrides re-applies operator settings on every boot: the per-IP filter cost, and the host domain from PYRAMID_DOMAIN (so a restored settings.json can never leave the relay on the wrong domain and break login). The Dockerfile takes a VERSION build-arg for builds from trees without .git and installs curl. Full relay backup: GET /export streams a .tar.gz of every event layer as <name>.jsonl (excluding the re-derivable sdk cache and the legacy groups layer, whose events already live in main) plus settings.json, the membership log, grasp git repositories and (unless ?blossom=0) blossom media. Gated by an operator token (X-Export-Token, a 0600 file next to the data) or a logged-in root session; the token is generated at startup. A "download backup" button in the settings UI exposes it. Relay restore: the relay BECOMES the backup. POST /restore (or the settings UI button) validates and stages the upload at <data>/.restore.tar.gz — it is NOT applied until a real, full process restart (the in-app restart button does an in-process soft restart and will not apply it; docs and the response say so). On that clean boot the relay adopts the backup wholesale — settings incl. the internal signing key (so nip-29 groups keep their identity), membership, events, media, repos — only the host domain still follows the deployment. The import is synchronous: the relay is "down, restoring" until it completes (mmm fsyncs per event; progress logged), idempotent so an interrupted restore resumes, and a corrupt archive is quarantined to .restore.failed so it can never brick the relay. docs/backup-restore.md covers the whole thing incl. running behind a reverse proxy.
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.
It ain't much, but it's honest work