Commit Graph
109 Commits
Author SHA1 Message Date
nocodeandClaude Opus 5 e397abcfcd fix(web): make the whole repository card open the repository
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>
2026-09-23 23:20:06 +02:00
nocodeandClaude Opus 5 262274473a feat(web): publish the slash commands from the panel
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>
2026-09-23 23:20:05 +02:00
nocodeandClaude Opus 5 b42fb1065a feat(voice): take back the generated channels the database forgot
A voice channel outlives the process that made it. A restored backup, a
wiped `data/` folder or a redeployment shipping a fresh database all leave
real channels behind that nothing manages any more: they are never cleaned
up, and their owner can no longer rename or lock them.

At startup the bot now reclaims the channels sitting in a trigger's own
category and named after its template — a channel created by hand is never
touched. Those still in use go back to whoever is inside; the empty ones are
leftovers and are removed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-23 23:20:05 +02:00
nocodeandClaude Opus 5 406b5af3ea feat(settings): make the server settings real, and widen them
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>
2026-09-23 23:20:05 +02:00
nocodeandClaude Opus 5 d439b1b3e8 feat(web): make deploying reachable from where it is looked for
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>
2026-09-23 20:47:47 +02:00
nocodeandClaude Opus 5 a44ff0cb52 fix(web): pin the sidebar highlight to the route, and name the build
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>
2026-09-23 20:47:46 +02:00
nocodeandClaude Opus 5 2083133c7a docs(web): document the live updates
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-23 20:39:59 +02:00
nocodeandClaude Opus 5 5481e79dc4 feat(web): refresh the pages as the events arrive
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>
2026-09-23 20:39:59 +02:00
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 e63d6aa18e docs(web): document the dashboard and the configuration wizard
Both READMEs gain the same section and the same variables, as the
organisation requires them to stay in sync.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-23 20:09:14 +02:00
nocodeandClaude Opus 5 bd7fdea275 test(web): cover the router, configuration, auth, deployments and server
The schema test compares the declared variables against `.env.example`, so
the two cannot drift apart. The server tests drive the real handler over a
loopback socket rather than a mock, which is what caught the health probe
missing from bootstrap mode and the deployments recorded under the wrong
guild.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-23 20:09:14 +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
nocodeandClaude Opus 5 5abe713279 feat(database): store dashboard sessions, deploy targets and deployments
Sessions and API tokens keep only a hash of the value handed to the client,
so a database dump cannot be replayed. A deployment denormalises its target
name so the history survives the deletion of that target.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-23 20:09:13 +02:00
nocodeandClaude Opus 5 4b0737a512 feat(gitea): add an organization and repository administration client
`gitea-client.js` stays focused on the single repository the slash commands
talk to. The dashboard addresses any repository of the organization, so its
endpoints live apart instead of bloating the command path.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-23 20:09:12 +02:00
nocodeandClaude Opus 5 e4534d4d50 feat(config): declare the web dashboard environment variables
The dashboard is off by default and listens on the loopback interface: it
must be an explicit decision to expose it, not a side effect of upgrading.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-23 20:09:12 +02:00
nocodeandClaude Opus 5 92405ac618 fix(notifications): apply the channel overrides set from Discord
`/notify set` stores the types listed in `NOTIFICATION_TYPES` (`releases`,
`commits`, `pull_requests`) while the webhook handler looks them up under the
Gitea event names (`release`, `push`, `pull_request`), so an override chosen
from Discord was never found and the environment default always won.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-23 20:09:07 +02:00
BlackAngelTV 2ccb462e35 Merge pull request 'refactor(all): uniformisation' (#144) from build/project-structure into main
Reviewed-on: #144
2026-09-23 16:31:05 +00:00
BlackAngelTV 50665c8edd refactor(all): uniformisation 2026-09-23 18:25:28 +02:00
BlackAngelTV 865f2eb91b Merge pull request 'Build/project structure' (#142) from build/project-structure into main
Reviewed-on: #142
2026-09-23 12:31:21 +00:00
BlackAngelTV ee538cb943 docs(changelog): list the voice, status and tone work in the changelog
The generated file only knew the history of the previous pass, so the features
merged after it were missing from the notes.
2026-09-15 16:15:01 +02:00
BlackAngelTV 9bbe9cb0b4 docs(readme): translate the documentation and document the contribution workflow
The organisation asks every repository for both languages, for the issue and
pull request templates, and for the commit, branch and release rules; the
README now states them, README.en.md mirrors it, and a test keeps the two in
sync so a change on one side cannot be forgotten on the other.

The readme also documents what shipped since it was last written: several voice
triggers, the guaranteed cleanup of empty channels, the editable bot statuses,
the message tone and the variables they add.
2026-09-15 16:15:00 +02:00
BlackAngelTV 478ae41d86 build(changelog): generate the changelog from the commit history
Releases are expected to ship notes built from the Conventional Commits, and a
hand-written file drifts from the history within a few merges. The generator
reads the log directly, so it adds no dependency, and `npm run changelog:check`
gives CI a way to fail when the file was not regenerated.

A commit that only rewrites the changelog is left out of it, otherwise the
check could never be green once that file is committed.
2026-09-15 16:14:28 +02:00
BlackAngelTV 2df33c205c chore(gitignore): ignore the AI assistant data and the other toolchains
The organisation lists a minimum ignore set for every repository: the data
directory of the development assistants and the artefacts of the languages a
contributor may build next to this one must never reach the repository.
2026-09-15 16:13:52 +02:00
BlackAngelTV c785e9abb7 feat(status): rotate an editable list of bot statuses
The presence line was hard-coded, so advertising a different message meant
editing the source and restarting the bot. Statuses now live in the database
and are managed from Discord with /status — add, list, remove, pause and the
rotation interval, which applies without a restart.

An empty list falls back to a neutral "see the commands with /help" line, and
the first status added shows up right away instead of waiting a full turn.
2026-09-15 16:12:50 +02:00
BlackAngelTV ef8f09da10 refactor(ui): give every message one friendly, ungendered voice
Members read all replies as one voice, so the wording now lives in one place:
the shared titles, the list marker and the "what to do next" hint come from
src/ui/embeds.js, and every module follows them.

An error explains the cause, recalls the rule and offers the way out instead of
blaming; a success says what happens next. Nothing agrees on the gender of a
person ("utilisateur", "cher/chère", "ravie"), which also keeps the sentences
shorter. Two tests lock the shared titles and reject gendered descriptions.
2026-09-15 16:12:19 +02:00
BlackAngelTV 76e2269555 feat(voice): guarantee an empty generated channel disappears
A generated channel could survive with nobody in it: the row was dropped before
the channel was really gone, so a refused delete call left a room nothing could
track anymore, and an event missed while the bot was down was never retried.

The row is now kept until Discord confirms the channel is gone, and a sweep at
startup then every minute deletes whatever the event missed. The grace period
is tunable with VOICE_EMPTY_GRACE_MS, 0 deleting as soon as the room empties.
2026-09-15 16:11:30 +02:00
BlackAngelTV 836abeafd5 feat(voice): support several trigger channels with their own category
A server needs one "create your own room" channel per theme, which a single
trigger id could not express. Triggers are now stored as a list, each with its
own home category, name template and default limit.

Joining a trigger creates the channel at the bottom of that trigger's category,
and a member keeps one channel per trigger instead of one room for the whole
server. Triggers declared by the single-trigger version and
CHANNEL_VOICE_TRIGGER_ID still work as fallbacks, so no server has to be
reconfigured.
2026-09-15 16:09:39 +02:00
BlackAngelTV 66c04c617a docs(agents): add the shared agent instructions for FWS repositories 2026-09-15 15:23:25 +02:00
BlackAngelTV be4981aa75 docs(readme): document the implemented features and the voice manager
The status tables now describe real behaviour, and the required intents and invite permissions include the new voice features so a fresh install works on the first try.
2026-09-15 14:51:22 +02:00
BlackAngelTV aa5343b4b2 test(app): add command and event loading smoke tests
Loading every module catches broken imports and invalid slash command definitions, which unit tests on the services cannot see.
2026-09-15 14:51:18 +02:00
BlackAngelTV 5191942d5a feat(voice): add temporary voice channel manager
Joining the trigger channel must feel instant and never leave orphan channels behind, so the ownership is stored in SQLite, empty channels are deleted after a short grace period and a startup sweep cleans up whatever a restart left behind.
2026-09-15 14:51:17 +02:00
BlackAngelTV ef1bedbc65 feat(polls): implement polls, fun and statistics commands
A poll must end even when nobody is there to close it, so a scheduler reads the stored end dates and finalises the results at startup and while running.
2026-09-15 14:50:54 +02:00
BlackAngelTV f29c09577a feat(members): add welcome, default role and departure reporting
The welcome direct message is best effort: a member with closed private messages must still receive the channel message and the default role.
2026-09-15 14:50:48 +02:00
BlackAngelTV c49c60071d feat(moderation): implement the moderation service and commands
Every action checks the role hierarchy before touching Discord, then records the sanction in SQLite and mirrors it in the moderation log channel, so the history outlives the audit log.
2026-09-15 14:50:48 +02:00
BlackAngelTV e8c95b2ba3 feat(tickets): implement the ticket service, command and channel controls
Each ticket category is visible to a different set of staff roles, and the claim and close actions must also be reachable from the channel itself, so the buttons live in the ticket and share the service checks.
2026-09-15 14:50:47 +02:00
BlackAngelTV a5280ce205 feat(notifications): dispatch Gitea webhooks through the notification service
A guild can reroute a notification type to its own channel from SQLite, with the environment values as fallback, without editing the configuration or restarting the bot.
2026-09-15 14:50:41 +02:00
BlackAngelTV 26d7cce05f feat(fws): implement the version, status and changelog subcommands
Status reports each dependency separately so a Gitea outage never hides a database or webhook problem.
2026-09-15 14:50:41 +02:00
BlackAngelTV 76d0bf9250 feat(gitea): add embeds, modals and the issue and pull request commands
Creating an issue or a pull request needs a title and a description, which do not fit in a slash command option, so the branches chosen as options are kept in memory for a few minutes until the modal is submitted.
2026-09-15 14:50:40 +02:00
BlackAngelTV 66be463ba3 feat(core): add shared constants, interaction components and Gitea client helpers
Moderation, tickets, polls and Gitea events reuse the same labels, colours and buttons; normalising list responses in the client keeps both commands and webhooks free of version quirks.
2026-09-15 14:50:34 +02:00
BlackAngelTV 03a217c775 feat(database): add repositories for tickets, moderation, polls and notifications
Keep every SQL statement out of the command layer so each feature can be built and tested without a Discord dependency.
2026-09-15 14:50:34 +02:00
nocode abf6701bb0 docs(core): document project structure
Refs: #12
2026-09-13 12:25:12 +02:00
nocode fec8007c62 chore(docs): add screenshots directory
Refs: #101
2026-09-13 12:25:11 +02:00