Add Docker Registry AIO with Nuxt Token Auth and admin UI.
Compose brings up registry:3 plus a Prisma/SQLite Nuxt app for docker login, ACL management, and image browsing with shadcn-vue. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
commit
0fd00bfa37
120 files changed
+17094
No files matched your search
@@ -0,0 +1,23 @@
|
||||
import type { PrismaClient } from '../../generated/prisma/client'
|
||||
import { hashPassword } from '../server/utils/password'
|
||||
|
||||
type SeedPrisma = Pick<PrismaClient, 'user'>
|
||||
|
||||
export async function seedAdmin(prisma: SeedPrisma) {
|
||||
const username = process.env.ADMIN_USERNAME || 'admin'
|
||||
const password = process.env.ADMIN_PASSWORD || 'admin123'
|
||||
|
||||
const existing = await prisma.user.findUnique({ where: { username } })
|
||||
if (existing) {
|
||||
return existing
|
||||
}
|
||||
|
||||
return prisma.user.create({
|
||||
data: {
|
||||
username,
|
||||
passwordHash: await hashPassword(password),
|
||||
role: 'ADMIN',
|
||||
active: true,
|
||||
},
|
||||
})
|
||||
}
|
||||
Reference in new issue
Block a user