The front-end was served with `no-cache` but no `ETag` and no
`Last-Modified`, so a cache had nothing to revalidate against and could keep
handing out modules older than the API they talk to — which surfaces as a
cryptic error in a view rather than as anything resembling a stale cache.
Assets now carry both, and an unchanged file answers 304.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
A failed `listen` only produced a generic line the bot then carried on past,
so the site was simply absent with nothing explaining why — and inside a
container a bind on an unpublished port succeeds while staying unreachable,
which looks identical to a crash from the browser.
The error now names the address, the port and the actual cause, and a
successful bind on `0.0.0.0` reminds that the port still has to be published
by the host.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
`WEB_HOST=127.0.0.1` is the right default behind a reverse proxy on the same
machine, and the wrong one inside a container or on a hosting panel, where
the process has to bind the allocation. The guidance only mentioned the
first case, so a `.env` written from the wizard could leave the dashboard
listening where nothing could reach it — every request timing out with
nothing saying why.
The wizard now flags the contradiction between a loopback bind and a public
URL, and both the help text and `.env.example` name the container case.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The renderer escapes HTML before any transformation and drops
`javascript:` links. Pages are written by the team, but a renderer that
relies on that is one mistake away from being a hole.
The editor previews as you type: legal pages are long, and writing Markdown
blind is how broken tables end up published.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Pages live in SQLite and are read without a session: documentation nobody
can reach without an account is not documentation. Drafts answer 404 even
when their address is guessed, and the site never falls back to the
dashboard shell, which would send a visitor to a login screen.
The wiki ships with terms of use and a privacy policy written against the
revised Swiss LPD, describing table by table what this codebase actually
stores. Both are marked protected: they can be rewritten, not deleted, and
a deleted one comes back on the next start — a bot that processes personal
data must always be able to show its notice.
The bracketed details still have to be completed and the whole reviewed;
this is a starting point written from the schema, not legal advice.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The placeholder mark was an Arch-blue chevron. The site now carries the FWS
logo — cyan ring on dark navy — and its accent colour follows, so the
dashboard and the brand no longer disagree.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Only the name was a link, so most of a rectangle that reacts to the pointer
led nowhere.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Registering the commands was the one routine step that still needed shell
access on the host, which is awkward when the bot runs behind a hosting
panel. Guild commands take effect immediately, so the button says what it
did as soon as it returns.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The dashboard offered seven switches that nothing read: they promised a
behaviour the bot did not have, which is worse than offering nothing.
Every setting is now declared once, with its type, its bounds and its
explanation, and the services read it: the welcome message and its wording,
the automatic role, departure notices, the private notice sent to a
sanctioned member, the default mute duration, how much history a ban erases,
whether a closed ticket is deleted or archived, and an optional role mention
on the Gitea notifications.
A test walks the sources and fails when a declared key is read nowhere, so
the list cannot drift back into decoration.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The « Déployer » button only existed on the row of an already created
target, so an empty list was a dead end whose only way out sat in the page
header. The empty state now carries the action that fills it.
A release also gains its own deploy button: wanting to ship a given version
is the moment people look for it, and sending them to another page to retype
the tag was needless.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The highlight compared hrefs, which a trailing slash or a query string in the
hash was enough to defeat, and it only ran once the view had loaded. Each
link now carries the route it stands for and the highlight is applied as soon
as the sidebar exists.
The footer also states the running version and the date of the newest
interface file. Deployments that ship an archive make it easy to look at a
stale copy and wonder why a fix is missing; the page can now say so.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
One `EventSource` for the whole dashboard, held in a single slot: a view that
re-renders itself would otherwise register a second listener each time and
double the work on every event.
A refresh landing under someone's fingers is worse than data a few seconds
old, so it waits while a dialog is open or a field has focus, a burst of
writes collapses into one reload, and a background tab closes its stream.
The Discord page stays off the tick because listing members calls the
Discord API. When the stream cannot be established a timer takes over.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Reading a page and wondering whether it is still true is a poor way to watch
a deployment, and polling every page on a timer costs far more than it
returns.
The server keeps one `text/event-stream` per open tab and publishes on it:
a write once it has actually succeeded, tagged with the page it concerns, a
deployment when it starts and when it ends, an incoming Gitea webhook, plus
a tick and a heartbeat that stops proxies closing an idle stream.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The field only appeared when a token was already configured, which hid the
one way back into the configuration exactly when Discord sign-in is broken
or not set up yet. It is now always present, and says how to obtain a token
when none is available.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The « Nouvelle cible » button was hidden whenever the repository list came
back empty, and a Gitea answering 403 took the whole page down with it — so
a forge problem removed every way to set up a deployment, including webhook
and shell targets that never talk to Gitea at all.
The list is now a convenience: its failure is reported as a warning and the
repository falls back to a free-text field.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Navigating only swapped the main area, so the highlighted entry stayed on
whichever page the shell was built with and nothing on screen said where you
were. The highlight is now refreshed on every navigation, carries
`aria-current` for screen readers and an inset marker that reads at a glance,
and the browser tab takes the page name.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
`WEB_PUBLIC_URL` was the only source of the `redirect_uri`, so a hosting
panel or a proxy publishing the dashboard on another port produced a link
Discord refuses, with nothing on screen pointing at the port mismatch.
The browser's own origin is what Discord compares against, so the redirect
now comes from the request, honouring `X-Forwarded-Host` and
`X-Forwarded-Proto` when a proxy sits in front. `WEB_PUBLIC_URL` stays as
the fallback for links built outside a request, and the sign-in page prints
the exact value to declare in the portal.
The `Secure` cookie flag follows the same rule: announcing HTTPS in the
configuration while serving plain HTTP made the browser drop the session.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The front-end is plain JavaScript served as is: no build step to run before
the bot starts, and no second toolchain to keep alive. A simple/advanced
switch hides the technical panels without ever standing in for a permission.
`npm run setup` starts the wizard alone, because the bot refuses to boot
without a token and the `.env` has to be writable from somewhere. When the
webhook and the dashboard share a port, a single HTTP server is started.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
One module per domain, each route declaring the minimum access level the
server enforces before the handler runs. Irreversible actions ask for the
exact name to be typed back, and every write lands in `event_logs` with its
author so the history says who did what.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Three kinds of target, ordered by how much they trust the caller: a signed
webhook runs nothing locally, a Gitea Action delegates to the forge, and a
shell command executes arbitrary code on the bot host — hence the double
lock of an environment flag plus the Owner level on that last one.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Every variable is described once, with its explanation and the steps to
obtain it. The form, the validation and the generated file all derive from
that description, so adding a variable to the bot means touching one file.
The previous file is backed up before being replaced, and an empty secret
means "keep the current value" so a token cannot be wiped by accident.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Visitors sign in with Discord and inherit the very same access levels as the
slash commands, so there is no second permission model to keep in sync.
Writes require a header a cross-site form cannot forge, on top of the
`SameSite=Lax` cookie, and a bootstrap token opens the configuration wizard
alone for the case where no Discord application exists yet.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>