adds user accounts, service requests, dashboard, admin panel, better layout, db+altcha+auth support

This commit is contained in:
Aidan 2025-07-07 20:01:59 -04:00
parent dfbc3cade9
commit 0043a5bf3c
40 changed files with 3981 additions and 188 deletions

22
tools/hmac.ts Normal file
View file

@ -0,0 +1,22 @@
import crypto from 'crypto'
import fs from 'fs'
const hmacKey = crypto.randomBytes(32).toString('hex')
if (fs.existsSync('.env.local')) {
const envFile = fs.readFileSync('.env.local', 'utf8')
// Double-check it's not already set
if (!envFile.includes('ALTCHA_SECRET')) {
fs.appendFileSync('.env.local', `\nALTCHA_SECRET=${hmacKey}`)
}
console.log(`Successfully wrote ALTCHA_SECRET to .env.local`)
} else if (fs.existsSync('.env')) {
const envFile = fs.readFileSync('.env', 'utf8')
// Double-check it's not already set
if (!envFile.includes('ALTCHA_SECRET')) {
fs.appendFileSync('.env', `\nALTCHA_SECRET=${hmacKey}`)
}
console.log(`Successfully wrote ALTCHA_SECRET to .env`)
} else {
console.error('No .env/.env.local file found, please create one first.')
}