[PR #15] [MERGED] Staff dashboards: /staff sign-in, password setup, sign-out; the API proxy to Kira #18

Closed
opened 2026-11-03 04:02:24 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon-site/pull/15
Author: @ludovic111
Created: 10/30/2026
Status: ✅ Merged
Merged: 10/30/2026
Merged by: @ludovic111

Base: main ← Head: feat/staff-pages


📝 Commits (1)

  • 513bac6 Staff dashboards: /staff sign-in, password setup and sign-out; the API proxy to Kira

📊 Changes

8 files changed (+361 additions, -4 deletions)

View changed files

📝 Caddyfile (+18 -0)
📝 build.mjs (+5 -3)
📝 public/robots.txt (+1 -0)
📝 serve.mjs (+24 -1)
➕ src/staff-api.js (+76 -0)
➕ src/staff-page.js (+157 -0)
➕ src/staff.html (+65 -0)
📝 src/style.css (+15 -0)

📄 Description

🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself.

First site part of the staff dashboards (design v2, approved). Kira's side (accounts, sessions, API) is already merged and deployed in kira.

What it adds

  • /staff: sign in with the Discord username and the password each member sets for themselves. /staff/setup#<token>: set it with the one-time link Kira DMs (/staff password on Discord). The token leaves the address bar at once. Sign out, and sign out everywhere.
  • /staff/team and /staff/mod: the dashboard switch, shown to whoever holds both roles (and Ludovic). Someone without the role gets a refusal and a link to their own dashboard; the API refuses them too (403). The dashboards' content comes in the next PRs (S3–S5).
  • Caddy: /staff/api/* is reverse-proxied to Kira's existing public host with X-Staff-Proxy-Key (env STAFF_PROXY_KEY, set on Railway from 1Password) and the client IP for rate limiting. Without the key Kira answers 404. No new port, no new public service: the session cookie (__Host-staff, HttpOnly, Secure, SameSite=Strict) stays first-party on playhorizon.dev.
  • /staff pages: noindex, no-store, no-referrer, Disallow: /staff in robots.txt, never in the sitemap.
  • Fix in build.mjs: the import rewrite skipped hyphenated module names ("./staff-api.js" stayed unfingerprinted and 404'd).

Tests

  • npm test: 49 pass.
  • caddy validate: valid.
  • Local end to end (serve.mjs proxy → Kira's dev API with a fake store, scripts/staff-dev.mjs in kira): a wrong password is refused, sign in sets the cookie, me works, sign out works, a Mod-only account is refused on the Team dashboard, the setup link works.
  • Screenshots (fake data, Mac mini): ~/builds/horizon-site/staff-shots/s1-*.png (login, wrong password, signed in, signed out, setup link, Mod refused on /staff/team).

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon-site/pull/15 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/30/2026 **Status:** ✅ Merged **Merged:** 10/30/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/staff-pages` --- ### 📝 Commits (1) - [`513bac6`](https://github.com/horizon-rust/horizon-site/commit/513bac6607e298c63e1caa8c8527ba397c2887dd) Staff dashboards: /staff sign-in, password setup and sign-out; the API proxy to Kira ### 📊 Changes **8 files changed** (+361 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `Caddyfile` (+18 -0) 📝 `build.mjs` (+5 -3) 📝 `public/robots.txt` (+1 -0) 📝 `serve.mjs` (+24 -1) ➕ `src/staff-api.js` (+76 -0) ➕ `src/staff-page.js` (+157 -0) ➕ `src/staff.html` (+65 -0) 📝 `src/style.css` (+15 -0) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. First site part of the staff dashboards (design v2, approved). Kira's side (accounts, sessions, API) is already merged and deployed in kira. ## What it adds - `/staff`: sign in with the Discord username and the password each member sets for themselves. `/staff/setup#<token>`: set it with the one-time link Kira DMs (`/staff password` on Discord). The token leaves the address bar at once. Sign out, and sign out everywhere. - `/staff/team` and `/staff/mod`: the dashboard switch, shown to whoever holds both roles (and Ludovic). Someone without the role gets a refusal and a link to their own dashboard; the API refuses them too (403). The dashboards' content comes in the next PRs (S3–S5). - Caddy: `/staff/api/*` is reverse-proxied to Kira's existing public host with `X-Staff-Proxy-Key` (env `STAFF_PROXY_KEY`, set on Railway from 1Password) and the client IP for rate limiting. Without the key Kira answers 404. No new port, no new public service: the session cookie (`__Host-staff`, HttpOnly, Secure, SameSite=Strict) stays first-party on playhorizon.dev. - `/staff` pages: `noindex`, `no-store`, `no-referrer`, `Disallow: /staff` in robots.txt, never in the sitemap. - Fix in `build.mjs`: the import rewrite skipped hyphenated module names (`"./staff-api.js"` stayed unfingerprinted and 404'd). ## Tests - `npm test`: 49 pass. - `caddy validate`: valid. - Local end to end (serve.mjs proxy → Kira's dev API with a fake store, `scripts/staff-dev.mjs` in kira): a wrong password is refused, sign in sets the cookie, `me` works, sign out works, a Mod-only account is refused on the Team dashboard, the setup link works. - Screenshots (fake data, Mac mini): `~/builds/horizon-site/staff-shots/s1-*.png` (login, wrong password, signed in, signed out, setup link, Mod refused on /staff/team). 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:02:24 +07:00
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon-site#18
No description provided.