feat: update environment variables for admin user and adjust signup username pattern
Build Images and Deploy / Update-PROD-Stack (push) Successful in 1m17s
Build Images and Deploy / Update-PROD-Stack (push) Successful in 1m17s
This commit is contained in:
@@ -20,6 +20,12 @@ PRICE_UPDATE_INTERVAL_MINUTES=60
|
||||
# Max pagination pages to fetch when counting posts (default: 5 = up to 200 posts)
|
||||
MAX_PAGES_PER_HASHTAG=5
|
||||
|
||||
# Initial admin user — only used by `npm run db:seed`, not the running app.
|
||||
# Pass these at seed time: docker exec -e ADMIN_USERNAME=x -e ADMIN_PASSWORD=y <container> npm run db:seed
|
||||
# If omitted, defaults to admin / changeme123 (change immediately after first login).
|
||||
# ADMIN_USERNAME=admin
|
||||
# ADMIN_PASSWORD=changeme123
|
||||
|
||||
# Postgres (used by postgres container in prod-compose.yml)
|
||||
POSTGRES_DB=hashex
|
||||
POSTGRES_USER=hashex
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ services:
|
||||
# Run migrations then start the web server
|
||||
command: sh -c "npx prisma db push --accept-data-loss && npm start"
|
||||
ports:
|
||||
- "3000:3000"
|
||||
- "12131:3000"
|
||||
environment:
|
||||
DATABASE_URL: "${DATABASE_URL}"
|
||||
NEXTAUTH_SECRET: "${NEXTAUTH_SECRET}"
|
||||
|
||||
@@ -3,7 +3,7 @@ import bcrypt from 'bcryptjs'
|
||||
import { prisma } from '@/lib/prisma'
|
||||
|
||||
// Simple username validation — alphanumeric + underscores, 3-20 chars
|
||||
const USERNAME_RE = /^[a-z0-9_]{3,20}$/
|
||||
const USERNAME_RE = /^[a-z0-9_]{3,20}$/ // validated after toLowerCase
|
||||
|
||||
export async function POST(req: NextRequest) {
|
||||
const body = await req.json().catch(() => null)
|
||||
|
||||
@@ -82,7 +82,7 @@ export default function SignUpPage() {
|
||||
type="text"
|
||||
value={username}
|
||||
onChange={(e) => setUsername(e.target.value)}
|
||||
pattern="^[a-z0-9_]{3,20}$"
|
||||
pattern="^[a-zA-Z0-9_]{3,20}$"
|
||||
title="3–20 characters: letters, numbers, underscores"
|
||||
className="w-full bg-surface border border-surface-border rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500"
|
||||
placeholder="yourname"
|
||||
|
||||
Reference in New Issue
Block a user