GroupVerify: Verification page, overrides and public Verified tags
Shown only where GroupVerify is: staff get the Verification page once its gv_* tables are in the database, and the public site shows "Verified" only while it's on (enabled, with a group) and not missing from css_plugins list, which the poller reads once a minute over RCON. - Verification page: plugin state and version, Steam group, saved member list, overrides. - Overrides (@zio/verify, not on yourself unless Root): give, change, remove; player drawer shows why a player is or isn't verified. - Root sets the group and turns it on/off: saved to gv_settings, and sent as css_gv_* when the plugin is loaded so it applies at once. - gv_* times use GroupVerify's own timezone setting. - MySQL integration test (SAW_TEST_DSN), unit tests for plugin list parsing and the show rule.
This commit is contained in:
parent
b2b4698776
commit
9e4bc63201
15 changed files with 1270 additions and 13 deletions
44
README.md
44
README.md
|
|
@ -9,6 +9,8 @@ A SourceBans-style web panel for [CS2-SimpleAdmin](https://github.com/daffyyyy/C
|
|||
- **Staff panel** (`/admin`): sign in through Steam. Ban, gag, mute, silence, warn and kick; lift
|
||||
bans and blocks; manage ranks, permissions and staff; change server cvars and SimpleAdmin's
|
||||
punishment settings.
|
||||
- **Verification** (optional): who our GroupVerify plugin verifies, with overrides to give and
|
||||
remove, and its settings. Only appears when GroupVerify is installed (see below).
|
||||
|
||||
Live data comes from the **WebPanelBridge** plugin (`plugins/WebPanelBridge` in this repo) over
|
||||
RCON. Without it the panel still works, but shows the server as offline and can't kick or warn.
|
||||
|
|
@ -42,7 +44,8 @@ RCON. Without it the panel still works, but shows the server as offline and can'
|
|||
| Change map | `@css/changemap` |
|
||||
| Server cvars | `@css/cvar` |
|
||||
| See the Staff & ranks page | `@zio/webpanel` |
|
||||
| Ranks, staff, SimpleAdmin settings, reload admins | `@css/root` |
|
||||
| Give and remove verification overrides | `@zio/verify` (not on themselves, unless Root) |
|
||||
| Ranks, staff, SimpleAdmin settings, reload admins, GroupVerify's group and on/off | `@css/root` |
|
||||
|
||||
`@css/root` grants everything. Nobody can act on a player whose immunity is higher than theirs,
|
||||
or on themselves, or give a rank with more immunity than their own.
|
||||
|
|
@ -100,6 +103,34 @@ and deleting a rank that people hold). Our SimpleAdmin fork (1.8.2b-zio10+) logs
|
|||
that lapse when their expiry passes, `css_delgroup`, and edits made straight in the database.
|
||||
History starts when the table is created.
|
||||
|
||||
### Verification (GroupVerify, optional)
|
||||
|
||||
[GroupVerify](https://git.zio.sh/cs2/GroupVerify) (`plugins/GroupVerify` in the cs2 repo) verifies
|
||||
players who are in the server's Steam group or have a manual override, and other plugins give
|
||||
verified players perks. It keeps everything in SimpleAdmin's database (`gv_verified`,
|
||||
`gv_settings`), so the panel needs no setup for it:
|
||||
|
||||
- **Staff** get a Verification page as soon as GroupVerify's tables are in the database: whether
|
||||
it's on, the plugin's state and version, the Steam group, its saved member list, and the
|
||||
overrides. The player drawer shows why a player is or isn't verified. With `@zio/verify` (give
|
||||
it to the ranks that should have it in the rank editor), staff give overrides for a day up to a
|
||||
year or with no expiry, change them and remove them. Root sets the group and turns verification
|
||||
on and off.
|
||||
- **Everyone** sees a "Verified" tag on the scoreboard and on player pages, but only while
|
||||
verification is on (enabled, with a group set) and GroupVerify isn't missing from the server's
|
||||
plugin list. The public site never shows why someone is verified, or who gave an override.
|
||||
- **Whether it's loaded** comes from `css_plugins list` over RCON, read once a minute alongside
|
||||
the live status. While the server is down it's unknown, and that doesn't hide anything.
|
||||
- **Changes**: overrides are written to `gv_verified` and GroupVerify picks them up on its next
|
||||
reload (`db_reload_seconds`, 60 by default). Settings are written to `gv_settings` and, when
|
||||
the plugin is loaded, also sent as its own `css_gv_group`/`css_gv_enable`/`css_gv_disable`, so
|
||||
they apply at once.
|
||||
- **Times** in its tables are in GroupVerify's own `timezone` setting, which the panel follows.
|
||||
Keep it the same as SimpleAdmin's `Timezone`.
|
||||
|
||||
The panel never shows a group member list from Steam itself: "Steam group members" is the list
|
||||
GroupVerify last fetched and saved.
|
||||
|
||||
### Name history (optional)
|
||||
|
||||
SimpleAdmin keeps one row per SteamID + IP in `sa_players_ips` and overwrites its name on each
|
||||
|
|
@ -129,5 +160,16 @@ SimpleAdmin database; the file has the revert. Names are still only recorded at
|
|||
go vet ./... && go test ./...
|
||||
```
|
||||
|
||||
`internal/web/verify_db_test.go` also runs the Verification endpoints against a real MySQL when
|
||||
`SAW_TEST_DSN` is set. It empties SimpleAdmin's admin and group tables and GroupVerify's, so give
|
||||
it a scratch database holding SimpleAdmin 1.8.2b's migrations and GroupVerify's
|
||||
`Migrations/001_CreateTables.sql`:
|
||||
|
||||
```
|
||||
podman run -d --rm --name sa-test -e MYSQL_ROOT_PASSWORD=test -e MYSQL_DATABASE=sa -p 127.0.0.1:33061:3306 mysql:8.4
|
||||
# apply the migrations, then:
|
||||
SAW_TEST_DSN='root:test@tcp(127.0.0.1:33061)/sa?parseTime=true&loc=UTC' go test ./internal/web -run VerifyDB
|
||||
```
|
||||
|
||||
The pages are plain HTML, CSS and JS in `internal/web/assets`, embedded into the binary. The
|
||||
design mockup they came from is in `docs/mockup` at the repo root.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue