Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Team 401's operations hub for projects, assignments, certifications, attendance,
- Full-team and subteam Kanban boards
- Certification-aware task assignment
- Task comments, links, prerequisites, images, and file attachments
- Calendar events and task deadlines
- Recurring calendar events and task deadlines
- Coach-managed attendance and kiosk timeclock
- Student reports, team metrics, and CSV exports
- Coach roster, account, PIN, and certification administration
Expand Down Expand Up @@ -82,6 +82,16 @@ Cloudflare Pages builds with `npm run build` and publishes `out`. Configure the

`workers/api/wrangler.jsonc` defines the `team401-ops-api` Worker, shared D1 database, R2 bucket, allowed browser origins, and `api.ops.team401.org` custom domain.

Password reset and QR device sign-in use the same Firebase project as normal login. The Worker requires these secrets:

```text
FIREBASE_WEB_API_KEY
FIREBASE_SERVICE_ACCOUNT_EMAIL
FIREBASE_SERVICE_ACCOUNT_PRIVATE_KEY
```

The web API key is the same public Firebase key used by `NEXT_PUBLIC_FIREBASE_API_KEY`. The service-account email and PKCS#8 private key come from a Firebase Admin service-account JSON key and must only be stored as Cloudflare Worker secrets. Apply D1 migrations before deploying the Worker. In Firebase Authentication → Templates → Password reset, set the custom action URL to `https://ops.team401.org/login` so reset links finish inside Ops.

Renovate targets `staging`. Routine non-major updates may auto-merge only after validation succeeds. Promotion to `main` remains manual.

## Kiosk security
Expand Down
20 changes: 20 additions & 0 deletions migrations/0008_device_sign_in.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
CREATE TABLE device_sign_in_requests (
id TEXT PRIMARY KEY NOT NULL,
approval_token_hash TEXT NOT NULL UNIQUE,
poll_token_hash TEXT NOT NULL UNIQUE,
approved_uid TEXT,
expires_at INTEGER NOT NULL,
approved_at INTEGER,
denied_at INTEGER,
consumed_at INTEGER,
created_at INTEGER NOT NULL
);

CREATE INDEX idx_device_sign_in_expiry
ON device_sign_in_requests(expires_at);

CREATE TABLE auth_rate_limits (
key TEXT PRIMARY KEY NOT NULL,
window_started_at INTEGER NOT NULL,
attempts INTEGER NOT NULL
);
Loading
Loading