You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(sharing-server): add ADMIN_GITHUB_LOGINS env var for declarative admin management
- Add syncAdminLogins() to db.ts: reads ADMIN_GITHUB_LOGINS (comma-separated),
grants is_admin=1 to listed logins and revokes from all others (authoritative sync)
- Apply admin grant in upsertUser() so new users get the role on first login
- Restructure server.ts startup: restore -> await initDbWithRetry -> syncAdminLogins
-> serve; fixes a pre-existing race where requests could arrive before DB was ready
- initDbWithRetry now throws after exhausting retries instead of silently continuing
- Wire ADMIN_GITHUB_LOGINS as a dynamic env var in Terraform (not set when empty,
matching the GITHUB_ORG_CHECK_TOKEN pattern)
- Add admin_github_logins variable to infra/variables.tf
- Document in .env.example and README.md
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
| `ALLOWED_GITHUB_ORG` | ❌ | If set, only members of this GitHub org can upload data |
170
+
| `ADMIN_GITHUB_LOGINS` | ❌ | Comma-separated GitHub logins to auto-grant admin access (e.g. `alice,bob`). When set, this list is authoritative: listed users get admin, all others do not. Leave unset to manage admins manually via SQLite. |
Copy file name to clipboardExpand all lines: sharing-server/infra/variables.tf
+6Lines changed: 6 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -62,6 +62,12 @@ variable "min_replicas" {
62
62
default=1
63
63
}
64
64
65
+
variable"admin_github_logins" {
66
+
description="Optional: comma-separated GitHub logins to auto-grant admin access (e.g. 'alice,bob'). When set, this list is authoritative — listed users get is_admin=1, all others get is_admin=0. Leave empty to manage admin access manually via the SQLite database."
0 commit comments