mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
31 lines
774 B
TypeScript
31 lines
774 B
TypeScript
import {
|
|
generateHash,
|
|
generateRandomDomain,
|
|
type Template,
|
|
type Schema,
|
|
generateBase64,
|
|
generatePassword,
|
|
} from "../utils";
|
|
|
|
export function generate(schema: Schema): Template {
|
|
const mainServiceHash = generateHash(schema.projectName);
|
|
const randomDomain = generateRandomDomain(schema);
|
|
|
|
const nextAuthSecret = generateBase64(32);
|
|
const documensoEncryptionKey = generatePassword(32);
|
|
const documensoSecondaryEncryptionKey = generatePassword(64);
|
|
|
|
const envs = [
|
|
`DOCUMENSO_HOST=${randomDomain}`,
|
|
"DOCUMENSO_PORT=3000",
|
|
`HASH=${mainServiceHash}`,
|
|
`NEXTAUTH_SECRET=${nextAuthSecret}`,
|
|
`NEXT_PRIVATE_ENCRYPTION_KEY=${documensoEncryptionKey}`,
|
|
`NEXT_PRIVATE_ENCRYPTION_SECONDARY_KEY=${documensoSecondaryEncryptionKey}`,
|
|
];
|
|
|
|
return {
|
|
envs,
|
|
};
|
|
}
|