Remove Hardcoded Default Admin Username in Node.js Environment Config
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 72/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- docker, node.js, typescript
- Ambito
- authentication, devops, security
Direzione di ricerca
Start with apps/node/src/env.ts and trace how environment variables are validated and consumed at startup. Check .env.test.example, .dev.vars.example, and the Node/Docker self-hosting documentation for the required variable. Done means a missing or blank value produces the stated actionable error and the examples and documentation explain how to set it; run the listed typecheck, tests, and lint commands.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
When running Codra in Node.js / Docker mode without explicitly setting DASHBOARD_ALLOWED_USERS, the application defaults to granting dashboard admin access to a hardcoded GitHub username (devarshishimpi). Self-hosting operators who do not set this variable are locked out of their own dashboard while an unintended user may have access.
Affected File
apps/node/src/env.ts lines 59-60:
DASHBOARD_ALLOWED_USERS:
process.env.DASHBOARD_ALLOWED_USERS || "devarshishimpi",
Impact
- A self-hoster who follows the quickstart (
docker run -p 3000:3000 devarshishimpi/codra) without reading.env.exampleconfigures an instance that only allowsdevarshishimpito log in. - The self-hoster cannot access their own dashboard.
- If someone follows the Docker quickstart exactly as documented, they get a broken, inaccessible dashboard with no error message explaining why.
Proposed Fix
Replace the silent default with an explicit startup error:
const allowedUsers = process.env.DASHBOARD_ALLOWED_USERS;
if (!allowedUsers || allowedUsers.trim() === "") {
throw new Error(
"Missing required environment variable: DASHBOARD_ALLOWED_USERS\n" +
"Set it to a comma-separated list of GitHub usernames that are allowed to access the dashboard.\n" +
"Example: DASHBOARD_ALLOWED_USERS=your-github-username"
);
}
DASHBOARD_ALLOWED_USERS: allowedUsers,
Additionally:
- Update
.env.test.exampleand.dev.vars.exampleto include a clear placeholder forDASHBOARD_ALLOWED_USERS - Update the Node/Docker setup documentation to call out this variable as required
Done When
- Starting the Node server without
DASHBOARD_ALLOWED_USERSset throws a clear, actionable startup error -
.env.test.exampleand.dev.vars.exampleinclude a documented placeholder for this variable - The self-hosting documentation explains this variable is required
-
npm run typecheck,npm test, andnpm run lintall pass
- Lingua principale
- TypeScript
- Stelle
- 125
- Fork
- 23
- Merge medio
- 2g 13h
- PR unite (30g)
- 12
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di devarshishimpi/codra
-
bug good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
devarshishimpi/codra#178 ·
I maintainer di solito rispondono entro 1 giorno
-
bug good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
devarshishimpi/codra#176 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement good first issue
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
devarshishimpi/codra#186 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement good first issue
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
devarshishimpi/codra#185 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement good first issue
Difficoltà 4/5 3-5 giorni Idoneità per principianti 58/100
devarshishimpi/codra#184 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di devarshishimpi/codra
Issue simili
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 83/100
gofish-graphics/gofish-graphics#1384 ·
I maintainer di solito rispondono entro 1 giorno
-
adapter bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
Olanetsoft/agent-lookout#353 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
vicharanashala/vibe#1542 ·
I maintainer di solito rispondono entro 1 giorno
-
bug chore P2 size:XS
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
josephfung/curia#2666 ·
I maintainer di solito rispondono entro 1 giorno
-
area: batch
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
inabagumi/shinju-date#7294 ·
I maintainer di solito rispondono entro 1 giorno