Allow to create default user with env variables#4085
Allow to create default user with env variables#4085lvde0 wants to merge 2 commits intoumami-software:masterfrom
Conversation
|
@lvde0 is attempting to deploy a commit to the Umami Software Team on Vercel. A member of the Team first needs to authorize it. |
Greptile SummaryThis PR replaces the hardcoded admin user seed (previously embedded directly in the initial Prisma migration SQL) with a dynamic approach: a new Key changes and concerns:
Confidence Score: 2/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Docker as Docker Container
participant Script as check-db.js
participant DB as PostgreSQL
Docker->>Script: pnpm start-docker
Script->>Script: checkEnv()
Script->>DB: checkConnection()
DB-->>Script: Connected
Script->>DB: checkDatabaseVersion()
DB-->>Script: Version OK
Script->>DB: applyMigration() — prisma migrate deploy
DB-->>Script: Migrations applied
Script->>DB: createDefaultUser() — findFirst({ role: 'admin' })
DB-->>Script: null (no admin found)
Script->>Script: Read DEFAULT_ADMIN_USERNAME / DEFAULT_ADMIN_PASSWORD env vars
Script->>Script: bcrypt.hashSync(password, 10)
Script->>DB: prisma.user.create({ id, username, password, role:'admin' })
DB-->>Script: User created
Script-->>Docker: ✓ Admin user created
Last reviewed commit: 1cf30ac |
|
Any updates on this? |
|
@aaron3238 I don't know what the PR workflow is. Probably one of the maintainers has to look at the code as well. @mikecao |
Fixes #4083