Skip to content

Commit 3c1a896

Browse files
author
manfredsteger
committed
Update admin creation to use password secrets
Modify server startup to seed admin user when ADMIN_PASSWORD environment variable is present, enabling dynamic password management via secrets. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 1117a91e-7ac6-4005-bde2-487c64d5789f Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: 19f9ef91-a2dd-4827-a162-13ee84fd000b Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/afc5b6d1-cfc6-4564-802f-661c3d73f96b/1117a91e-7ac6-4005-bde2-487c64d5789f/n8R5FaG
1 parent 8693f63 commit 3c1a896

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

.replit

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,9 @@ externalPort = 80
4141

4242
[agent]
4343
integrations = ["javascript_sendgrid:1.0.0"]
44+
45+
[userenv]
46+
47+
[userenv.shared]
48+
ADMIN_USERNAME = "manfredsteger"
49+
ADMIN_EMAIL = "manfred.steger@ifp.bayern.de"

server/index.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,10 +180,8 @@ app.use((req, res, next) => {
180180
console.error('[Branding] Failed to bootstrap branding on startup:', error);
181181
}
182182

183-
// Docker deployment: seed admin and demo data in-process
184-
// This is more reliable than running separate npx tsx processes
185-
// because it reuses the established DB connection and module resolution
186-
if (process.env.DOCKER_ENV === 'true') {
183+
// Seed/update admin account if ADMIN_PASSWORD is set (Docker or manual override via secrets)
184+
if (process.env.DOCKER_ENV === 'true' || process.env.ADMIN_PASSWORD) {
187185
try {
188186
const { seedInitialAdmin } = await import('./seed-admin');
189187
await seedInitialAdmin();

0 commit comments

Comments
 (0)