mirror of
https://github.com/Dokploy/templates
synced 2025-06-26 18:16:07 +00:00
feat: migrate templates
This commit is contained in:
@@ -1,36 +0,0 @@
|
||||
import {
|
||||
type DomainSchema,
|
||||
type Schema,
|
||||
type Template,
|
||||
generateBase64,
|
||||
generatePassword,
|
||||
generateRandomDomain,
|
||||
} from "../utils";
|
||||
|
||||
export function generate(schema: Schema): Template {
|
||||
const mainDomain = generateRandomDomain(schema);
|
||||
const nextAuthSecret = generateBase64(32);
|
||||
const documensoEncryptionKey = generatePassword(32);
|
||||
const documensoSecondaryEncryptionKey = generatePassword(64);
|
||||
|
||||
const domains: DomainSchema[] = [
|
||||
{
|
||||
host: mainDomain,
|
||||
port: 3000,
|
||||
serviceName: "documenso",
|
||||
},
|
||||
];
|
||||
|
||||
const envs = [
|
||||
`DOCUMENSO_HOST=${mainDomain}`,
|
||||
"DOCUMENSO_PORT=3000",
|
||||
`NEXTAUTH_SECRET=${nextAuthSecret}`,
|
||||
`NEXT_PRIVATE_ENCRYPTION_KEY=${documensoEncryptionKey}`,
|
||||
`NEXT_PRIVATE_ENCRYPTION_SECONDARY_KEY=${documensoSecondaryEncryptionKey}`,
|
||||
];
|
||||
|
||||
return {
|
||||
envs,
|
||||
domains,
|
||||
};
|
||||
}
|
||||
20
blueprints/documenso/template.yml
Normal file
20
blueprints/documenso/template.yml
Normal file
@@ -0,0 +1,20 @@
|
||||
variables:
|
||||
main_domain: ${randomDomain}
|
||||
nextauth_secret: ${generateBase64(32)}
|
||||
encryption_key: ${generatePassword(32)}
|
||||
secondary_encryption_key: ${generatePassword(64)}
|
||||
|
||||
config:
|
||||
domains:
|
||||
- serviceName: documenso
|
||||
port: 3000
|
||||
host: ${main_domain}
|
||||
|
||||
env:
|
||||
- DOCUMENSO_HOST=${main_domain}
|
||||
- DOCUMENSO_PORT=3000
|
||||
- NEXTAUTH_SECRET=${nextauth_secret}
|
||||
- NEXT_PRIVATE_ENCRYPTION_KEY=${encryption_key}
|
||||
- NEXT_PRIVATE_ENCRYPTION_SECONDARY_KEY=${secondary_encryption_key}
|
||||
|
||||
mounts: []
|
||||
Reference in New Issue
Block a user