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,38 +0,0 @@
|
||||
import {
|
||||
type DomainSchema,
|
||||
type Schema,
|
||||
type Template,
|
||||
generateBase64,
|
||||
generateRandomDomain,
|
||||
} from "../utils";
|
||||
|
||||
export function generate(schema: Schema): Template {
|
||||
const mainDomain = generateRandomDomain(schema);
|
||||
const secretBase = generateBase64(64);
|
||||
const encryptionKey = generateBase64(48);
|
||||
const cronSecret = generateBase64(32);
|
||||
|
||||
const domains: DomainSchema[] = [
|
||||
{
|
||||
host: mainDomain,
|
||||
port: 3000,
|
||||
serviceName: "formbricks",
|
||||
},
|
||||
];
|
||||
|
||||
const envs = [
|
||||
`WEBAPP_URL=http://${mainDomain}`,
|
||||
`NEXTAUTH_URL=http://${mainDomain}`,
|
||||
`NEXTAUTH_SECRET=${secretBase}`,
|
||||
`ENCRYPTION_KEY=${encryptionKey}`,
|
||||
`CRON_SECRET=${cronSecret}`,
|
||||
];
|
||||
|
||||
const mounts: Template["mounts"] = [];
|
||||
|
||||
return {
|
||||
envs,
|
||||
mounts,
|
||||
domains,
|
||||
};
|
||||
}
|
||||
20
blueprints/formbricks/template.yml
Normal file
20
blueprints/formbricks/template.yml
Normal file
@@ -0,0 +1,20 @@
|
||||
variables:
|
||||
main_domain: ${randomDomain}
|
||||
secret_base: ${generateBase64(64)}
|
||||
encryption_key: ${generateBase64(48)}
|
||||
cron_secret: ${generateBase64(32)}
|
||||
|
||||
config:
|
||||
domains:
|
||||
- serviceName: formbricks
|
||||
port: 3000
|
||||
host: ${main_domain}
|
||||
|
||||
env:
|
||||
- WEBAPP_URL=http://${main_domain}
|
||||
- NEXTAUTH_URL=http://${main_domain}
|
||||
- NEXTAUTH_SECRET=${secret_base}
|
||||
- ENCRYPTION_KEY=${encryption_key}
|
||||
- CRON_SECRET=${cron_secret}
|
||||
|
||||
mounts: []
|
||||
Reference in New Issue
Block a user