Public: anyone can read this; the crew can change it.
Migrated from github.com/Trevato/SO-ARM100
Beside a live mute or ban on /admin, an Unmute or Unban button lifts it, same-origin, and the lift is logged #320
The Moderation section on /admin now lists every mute and ban in force, each with an Unmute or Unban button. The new test and the related admin, lobby, accounts and chat suites pass.
stopped parked by the crew deploy 876f712
The Moderation section on /admin now lists every mute and ban in force, each with an Unmute or Unban button. The new test and the related admin, lobby, accounts and chat suites pass. I couldn't run the type check: bun install and bun x tsc fail in this sandbox with "unable to write files to tempdir", so the forge's check is the first type check.
- No list existed to build on.
/adminonly showed the log, so I added the list of live mutes and bans as well as the buttons. - Button action. Each button posts a form with the
unmuteorunbanaction to the existing/adminhandler insrc/admin-routes.ts. The handler lifts the mute or ban and logs it asunmuted <name>orunbanned <name>, credited to whoever pressed the button. - Who can lift. The owner and verified moderators can lift mutes and bans. A moderator can't lift another moderator's mute, which matches the live mute rule. Every other action stays owner-only, so a moderator posting
pausestill gets 403. - Origin check. The same-origin check in the relay already covers every non-GET request, so a cross-origin POST gets 403 with no new code.
- Lobby changes. In
src/lobby.tsI addedliftMute,liftBanandafterBanChange. The/liveunban now uses them too, so both routes lift and log the same way and notify connected viewers. - Tests. The new test is in
src/admin-relay.test.ts. A moderator's unban and unmute work and appear in the log, and a cross-origin POST is refused with 403 and changes nothing.
Differs from the issue: a plain user's POST gets 404, not 403. /admin deliberately doesn't exist for anyone who isn't the owner or a verified moderator, and an existing test pins that, so I kept it. A moderator's disallowed POST does get 403.
forge.json is untouched.
🤖 Generated with Claude Code
Parked by the crew: the preview's deploy failed and the decider saw no point in another try
The Moderation section on
/adminnow lists every mute and ban in force, each with an Unmute or Unban button. The new test and the related admin, lobby, accounts and chat suites pass. I couldn't run the type check:bun installandbun x tscfail in this sandbox with "unable to write files to tempdir", so the forge's check is the first type check./adminonly showed the log, so I added the list of live mutes and bans as well as the buttons.unmuteorunbanaction to the existing/adminhandler insrc/admin-routes.ts. The handler lifts the mute or ban and logs it asunmuted <name>orunbanned <name>, credited to whoever pressed the button.pausestill gets 403.src/lobby.tsI addedliftMute,liftBanandafterBanChange. The/liveunban now uses them too, so both routes lift and log the same way and notify connected viewers.src/admin-relay.test.ts. A moderator's unban and unmute work and appear in the log, and a cross-origin POST is refused with 403 and changes nothing.Differs from the issue: a plain user's POST gets 404, not 403.
/admindeliberately doesn't exist for anyone who isn't the owner or a verified moderator, and an existing test pins that, so I kept it. A moderator's disallowed POST does get 403.forge.jsonis untouched.🤖 Generated with Claude Code
Closes #221