Commit Graph
10 Commits
Author SHA1 Message Date
nocodeandClaude Opus 5 df89cc5893 feat(web): push live updates to the dashboard
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>
2026-09-23 20:39:59 +02:00
nocodeandClaude Opus 5 9c6297e00e fix(web): always offer the bootstrap token on the sign-in page
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>
2026-09-23 20:34:16 +02:00
nocodeandClaude Opus 5 ff15dfe92f fix(web): let a deploy target be created without a reachable Gitea
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>
2026-09-23 20:34:16 +02:00
nocodeandClaude Opus 5 a0428e0549 fix(web): keep the sidebar in step with the page being shown
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>
2026-09-23 20:34:09 +02:00
nocodeandClaude Opus 5 20ff701430 fix(web): derive the OAuth2 redirect from the address actually used
`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>
2026-09-23 20:12:44 +02:00
nocodeandClaude Opus 5 06a9be0cba feat(web): serve the dashboard and its interface
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>
2026-09-23 20:09:14 +02:00
nocodeandClaude Opus 5 bf92badb05 feat(web): expose the dashboard API
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>
2026-09-23 20:09:13 +02:00
nocodeandClaude Opus 5 611129b23c feat(web): run and record release deployments
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>
2026-09-23 20:09:13 +02:00
nocodeandClaude Opus 5 efaaca35dd feat(web): read, validate and write the .env configuration
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>
2026-09-23 20:09:13 +02:00
nocodeandClaude Opus 5 e03b184d68 feat(web): add the HTTP layer and Discord-backed sessions
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>
2026-09-23 20:09:13 +02:00