Repository navigation
Let admins update the server from the admin panel - #126
Merged
Merged
Conversation
Admin > Server update runs the steps owners ran by hand over SSH: back up the database, note the commit, point origin at the repository, fetch the branch, check it out, bun install, restart. Admins can name any GitHub repository and branch (the default branch when left blank), so a fork or a test branch can be tried without shell access; "Go back" returns to the commit before the last update. The new code is bundled once before the restart, so a syntax error or a missing module leaves the server on its old commit rather than down. The branch is fetched by name because a single-branch clone's plain fetch never brings in other branches. It is off unless SELF_UPDATE=on, since the code picked runs as the server; SELF_UPDATE_REPOS can limit the repositories. The process restarts by exiting with code 75 for systemd or Docker to start it again, or runs SELF_UPDATE_RESTART. The update check follows the repository and branch last updated from. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016pBH2KgNjEo83ahNSFgFbV
SELF_UPDATE_REPOS unset now allows only the update repository (UPDATE_REPO, else Xittered/xitter) instead of any: with any allowed, one phished admin account was arbitrary code on the server. Owners open it with a list, or * for any repository. Updating and going back take the password and a two-factor code again, through superadmin.ts's reauthenticate(), now exported, so a session left open on a shared machine isn't enough to swap the server's code. The repository and branch are checked before the code is spent. The README says what to do when an update loads but fails on start (a migration that breaks): the panel is down with it, so going back is over SSH, or in a SELF_UPDATE_RESTART script that checks the server answers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016pBH2KgNjEo83ahNSFgFbV
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.
Admin > Server update runs the steps owners ran by hand over SSH: back up the database, note the commit, point origin at the repository, fetch the branch, check it out, bun install, restart. Admins can name any GitHub repository and branch (the default branch when left blank), so a fork or a test branch can be tried without shell access; "Go back" returns to the commit before the last update.
The new code is bundled once before the restart, so a syntax error or a missing module leaves the server on its old commit rather than down. The branch is fetched by name because a single-branch clone's plain fetch never brings in other branches.
It is off unless SELF_UPDATE=on, since the code picked runs as the server; SELF_UPDATE_REPOS can limit the repositories. The process restarts by exiting with code 75 for systemd or Docker to start it again, or runs SELF_UPDATE_RESTART. The update check follows the repository and branch last updated from.