Docs: say plainly that only the bot is open source; the dashboard and API are proprietary
- README, license section and architecture no longer point to the dashboard repositories - schema.sql is the schema for contributors; database changes only need schema.sql and a note in the PR - self-hosting: settings without a dashboard (SQL for security thresholds, beta settings, opted-in servers) - beta features, deployment and troubleshooting reworded for people who don't have the dashboard Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This commit is contained in:
1 parent
1fbc38ca56
commit
02b7db1813
11 files changed
+93
-77
No files matched your search
+11
-15
@@ -5,28 +5,27 @@ A beta feature is one that is still being tried out, so only chosen people can u
|
||||
1. **The person is a beta tester**: a member of the beta server who holds the Beta Tester role.
|
||||
2. **Beta features are on in the server they use it in**: the beta server itself, or any other server whose owner opted in.
|
||||
|
||||
The same rule applies on the bot and on the dashboard.
|
||||
The rule is the same on the bot and on the hosted Velox dashboard. The dashboard is proprietary and not part of this repository, so this page is about the bot, and mentions the dashboard only where it explains how the settings get into the database.
|
||||
|
||||
## Who the testers are
|
||||
|
||||
- The **beta server** and the **Beta Tester role** are chosen by the bot's owner on the dashboard, under **Admin, Beta access**. Only the owner can see or change that page.
|
||||
- Giving someone the role in Discord makes them a tester. Taking it away removes their access: within about 30 seconds on the bot (a few seconds if the bot has them cached), and within about 30 seconds on the dashboard API.
|
||||
- The **beta server** and the **Beta Tester role** live in the `beta_settings` table, one row. On the hosted Velox the owner sets them on the dashboard. If you host the bot yourself, set them with SQL (see [Settings without a dashboard](self-hosting.md#settings-without-a-dashboard)).
|
||||
- Giving someone the role in Discord makes them a tester. Taking it away removes their access, within about 30 seconds on the bot (a few seconds if the bot has them cached).
|
||||
- Until a role is chosen, **nobody** has beta access.
|
||||
- Being a tester is about the person, so it is always checked in the **beta server**, also when they use a feature somewhere else. Having a role with the same ID in another server means nothing.
|
||||
|
||||
## Which servers have beta features
|
||||
|
||||
- The beta server always has them.
|
||||
- Any other server gets them only when **its owner** switches on **Beta features** on that server's page of the dashboard. Beta features can act on a whole server (anti-raid behaviour, for example), so the people who answer for the server decide. A server's admins who are not its owner cannot switch it on.
|
||||
- The bot's owner can take a server out again from **Admin, Beta access**, but cannot put one in.
|
||||
- The list of opted-in servers is the `beta_guilds` table. The bot polls it every 30 seconds, together with the beta settings.
|
||||
- Any other server gets them only when it is in the `beta_guilds` table. Beta features can act on a whole server (anti-raid behaviour, for example), so a server should only be listed with its owner's agreement. On the hosted Velox, only the server's own owner can switch it on, from the dashboard. If you host the bot yourself, you add rows yourself.
|
||||
- The bot polls the table every 30 seconds, together with the beta settings.
|
||||
|
||||
Beta never replaces a feature's own permission checks. A beta command that needs Manage Server still needs it, a music command still needs the DJ role, and anything for the owner or trusted users still needs that.
|
||||
|
||||
## What a tester sees
|
||||
|
||||
- **Bot:** beta commands appear only in the beta server and in opted-in servers, and run only for testers. When a server opts in, the commands show up within about 30 seconds. When it opts out, they are removed.
|
||||
- **Dashboard:** beta pages and links show a **Beta** badge, and only to testers, and only for servers where beta features are on.
|
||||
- **On the hosted Velox dashboard:** beta pages and links show a **Beta** badge, only to testers and only for servers where beta features are on.
|
||||
|
||||
## On the bot
|
||||
|
||||
@@ -35,7 +34,7 @@ Code: `internal/beta` (the rules), `internal/commands/commands.go` (`RegisterBet
|
||||
- Beta commands are registered in each server where beta features are on, and only there. `/beta` is only in the beta server.
|
||||
- Each beta handler is wrapped in `beta.Gate`. It checks that beta is on in the server of the interaction and that the person is a tester, and otherwise answers "This feature is in beta and isn't available to you or this server yet." (Autocomplete requests get an empty list.) Hiding the command is never the only protection.
|
||||
- For a person using a command in another server, the bot looks up their roles in the beta server: first in its gateway cache, otherwise it asks Discord (remembered for 30 seconds). If anything fails, the answer is no.
|
||||
- If the owner changes the beta server on the dashboard, the beta commands move within 30 seconds. In the beta server, commands this bot left there that no longer exist are removed too. If the beta server is also `GUILD_ID`, the regular commands are kept.
|
||||
- If the beta server changes in `beta_settings`, the beta commands move within 30 seconds. In the beta server, commands this bot left there that no longer exist are removed too. If the beta server is also `GUILD_ID`, the regular commands are kept.
|
||||
- `/beta` shows the bot's owner how access is set up. Only the owner of the Discord application can run it, and it is hidden from everyone but administrators.
|
||||
- The bot remembers the servers where it registered beta commands (`beta_registered` table). A server that opted out while the bot was **offline** is cleaned up on the next start, and a cleanup that fails is retried every 30 seconds. A server the bot has left is forgotten.
|
||||
|
||||
@@ -67,17 +66,14 @@ Do not use this for anything that should only be for testers as people. It means
|
||||
|
||||
Move the definition into `AllCommands` and the handler into the `handlers` map, and delete the `RegisterBeta` call. On the next start the command appears everywhere, and the beta servers drop it from their own lists because it is now a regular command.
|
||||
|
||||
## On the API and dashboard
|
||||
## On the dashboard
|
||||
|
||||
These live in the other two repositories.
|
||||
|
||||
- **API**: put the feature's routes under `/api/v1/beta` (not tied to a server), or add the `betaGuildOnly()` middleware to a route under `/api/v1/guilds/:guild_id/...` (tied to a server). The first asks Discord whether the signed-in user holds the role in the beta server (30-second memory); the second also checks that the server is the beta server or opted in. Both answer `403` otherwise. `GET /users/me` returns `is_beta`, and `GET /guilds/:guild_id/beta` tells the dashboard whether beta features are on for that server and whether the caller owns it.
|
||||
- **Dashboard**: give a route `meta: { requiresBeta: true }` to keep its page away from non-testers, and mark navigation entries with `beta: true` so testers see them with a **Beta** badge (and nobody else sees them). This is only about display. The API checks access on every request, so a page that was shown by mistake still cannot read or change anything.
|
||||
The hosted Velox has a proprietary dashboard and API that apply the same rule to their own pages: a beta page is only shown, and its API routes only answer, for a tester in a server where beta features are on. Their code is not part of this repository. If you build your own tool on the same tables, apply the rule on your server side too: never rely on hiding a page.
|
||||
|
||||
## Why it works this way
|
||||
|
||||
- The role in Discord is the single list of testers, so there is no second list to keep in step with it.
|
||||
- Servers choose to take part, because a beta feature can affect everyone in them.
|
||||
- Access is decided by the server (bot and API), never by the browser.
|
||||
- Access is decided on the server, never in the browser.
|
||||
- Beta commands do not exist outside the beta server, and the gate checks again when they run.
|
||||
- The settings are in the database, not in the environment, so the owner can change them without a deploy.
|
||||
- The settings are in the database, not in the environment, so they can change without a deploy.
|
||||
Reference in new issue
Block a user