Skip to content

Let admins update the server from the admin panel - #126

Merged
listixx merged 2 commits into
mainfrom
self-update
Oct 24, 2026
Merged

listixx merged 2 commits into
mainfrom
self-update

Conversation

@jyeridley

Copy link
Copy Markdown
Member

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.

jyeridley and others added 2 commits October 24, 2026 09:52
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
@listixx
listixx merged commit 6e62053 into main Oct 24, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants