You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit ad37c80
Browse filesBrowse the repository at this point in the historyBrowse files
Keep a board current on its own: check for releases, install, restart (#11)
Every self-hosted board has to be updated by hand — git fetch, checkout the
tag, pnpm install, restart — and a board nobody types that for drifts a
version further behind with each release. Now the board does it itself.
A minute after boot and every five minutes after that, the server asks
GitHub for the newest release. When one is newer than the running version
and the board runs from a git checkout, it fetches the tag, checks it out,
runs the install, and restarts itself. It is on by default; an
administrator turns it off under Board settings → Updates, and the overview
page always shows what is running, what is out, a Check now button, and an
Update now button when there is something to install.
What it refuses, deliberately:
- A checkout with local changes. That is somebody's work, and an update
that discarded it would be the worst thing this code could do.
- A container. The image is built from a tree with no .git, so there is
nothing to fetch into; the panel shows the new version and says to
redeploy. Both house boards run this way, so they are unaffected.
- Anything that is not a release tag of the form vX.Y.Z.
An install that fails puts the previous checkout back, and every check and
apply records its outcome in settings, so a failure shows on the overview
where the button was rather than only in a log.
The restart spawns a fresh copy of the process with the same command line
and environment and then exits, so `pnpm start` in a terminal, nohup or
tmux carries on with the new code. Under a supervisor that restarts on
exit, TSBB_RESTART=exit skips the spawn. TSBB_UPDATES=off stops the check
as well as the apply. `tsbb update [--check]` does the same from a shell.
Claude-Session: https://claude.ai/code/session_01PY5Y9gpnQ9kevUFwXJakyn
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
@@ -215,6 +244,8 @@ export function adminRoutes(services: Services) {
215
244
'posts.editWindowMinutes': 'How long an author may edit their own post. 0 means forever.',
216
245
'feeds.importEnabled':
217
246
'Whether the worker fetches the RSS and Atom feeds that fill forums. Which feeds fill which forum is set on each forum under Forums.',
247
+
'updates.auto':
248
+
'When a new release is published the board fetches it, installs it and restarts itself, within five minutes. Off means the overview still says a new version exists, and you install it. A board running from a container is never updated this way: redeploy the image.',
218
249
};
219
250
220
251
app.get('/admin/settings',async(c)=>{
@@ -909,6 +940,60 @@ function memberPostingField(current: string) {
909
940
</div>`;
910
941
}
911
942
943
+
/**
944
+
* The overview's Updates card: what is running, what is out, and the buttons.
945
+
*
946
+
* It reads only what the last cycle recorded, never the network, so the
947
+
* overview stays fast and the same whichever process rendered it.
0 commit comments