This site is protected with Google sign-in on the main site and a signed, HttpOnly cookie checked by an Edge Middleware on the docs site.
Quick admin tasksยถ
Add/remove a specific email quickly:
Edit
api/auth/whitelist.json the main repoAdd to
ALWAYS_ALLOWED_EMAILSto grant access immediatelyAdd to
NON_CNC_MEMBERS(by name) to block regardless of roster
Commit and push โ deploy triggers instantly
Update from the roster (canonical):
Edit the lab roster Google Sheet used by
getFormattedTeamMembers()Wait up to 1 hour for cache to refresh, or redeploy the main site to clear cache
Environment variablesยถ
Set in BOTH projects (same values):
DOCS_SESSION_SECRET: random URL-safe string (โฅ32 bytes) used to sign the cookieMain site only:
GOOGLE_CLIENT_ID
Generate a secret:
node -e "console.log(require('crypto').randomBytes(32).toString('base64').replace(/\+/g,'-').replace(/\//g,'_').replace(/=+$/g,''))"How it worksยถ
User visiting
docs.cnclab.iowithout a cookie โ redirected tocnclab.io/api/docs-login?next=...Main site verifies Google credential and checks whitelist โ sets
cnclab_docs_sessioncookie withDomain=.cnclab.io(HttpOnly, 24h)Docs Edge Middleware verifies signature and expiry โ serves docs if valid
Troubleshootingยถ
Getting redirected repeatedly:
Ensure
DOCS_SESSION_SECRETis set identically in both projectsConfirm cookie
cnclab_docs_sessionexists for.cnclab.io(HttpOnly)
โInvalid credentialโ on login:
Check
GOOGLE_CLIENT_IDmatches your OAuth clientVerify your email appears in
GET /api/auth/whitelist
Need to revoke access quickly:
Add the personโs name to
NON_CNC_MEMBERSand deploy