fix: avoid using defined secrets in calcom template

This commit is contained in:
Ephraim Atta-Duncan 2024-06-30 00:33:49 +00:00
parent 85f025c729
commit f37f98aade
No known key found for this signature in database
GPG Key ID: 6FDED572E552BC67
2 changed files with 8 additions and 2 deletions

View File

@ -17,8 +17,8 @@ services:
depends_on:
- postgres
environment:
- NEXTAUTH_SECRET=asklmdaklsmdklasmdklasd
- CALENDSO_ENCRYPTION_KEY=asklmdaklsmdklasmdklasd
- NEXTAUTH_SECRET=${NEXTAUTH_SECRET}
- CALENDSO_ENCRYPTION_KEY=${CALENDSO_ENCRYPTION_KEY}
- DATABASE_URL=postgres://postgres:password@postgres:5432/db
- NEXT_PUBLIC_WEBAPP_URL=http://${CALCOM_HOST}
- NEXTAUTH_URL=http://${CALCOM_HOST}/api/auth

View File

@ -3,16 +3,22 @@ import {
generateRandomDomain,
type Template,
type Schema,
generateBase64,
} from "../utils";
// https://cal.com/
export function generate(schema: Schema): Template {
const mainServiceHash = generateHash(schema.projectName);
const randomDomain = generateRandomDomain(schema);
const calcomEncryptionKey = generateBase64(32);
const nextAuthSecret = generateBase64(32);
const envs = [
`CALCOM_HOST=${randomDomain}`,
"CALCOM_PORT=3000",
`HASH=${mainServiceHash}`,
`NEXTAUTH_SECRET=${nextAuthSecret}`,
`CALCOM_ENCRYPTION_KEY=${calcomEncryptionKey}`,
];
return {