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,44 +0,0 @@
|
||||
import {
|
||||
type DomainSchema,
|
||||
type Schema,
|
||||
type Template,
|
||||
generateBase64,
|
||||
generateRandomDomain,
|
||||
} from "../utils";
|
||||
|
||||
export function generate(schema: Schema): Template {
|
||||
const builderDomain = generateRandomDomain(schema);
|
||||
const viewerDomain = generateRandomDomain(schema);
|
||||
const encryptionSecret = generateBase64(24);
|
||||
|
||||
const domains: DomainSchema[] = [
|
||||
{
|
||||
host: builderDomain,
|
||||
port: 3000,
|
||||
serviceName: "typebot-builder",
|
||||
},
|
||||
{
|
||||
host: viewerDomain,
|
||||
port: 3000,
|
||||
serviceName: "typebot-viewer",
|
||||
},
|
||||
];
|
||||
|
||||
const envs = [
|
||||
`ENCRYPTION_SECRET=${encryptionSecret}`,
|
||||
`NEXTAUTH_URL=http://${builderDomain}`,
|
||||
`NEXT_PUBLIC_VIEWER_URL=http://${viewerDomain}`,
|
||||
"ADMIN_EMAIL=typebot@example.com",
|
||||
"SMTP_HOST='Fill'",
|
||||
"SMTP_PORT=25",
|
||||
"SMTP_USERNAME='Fill'",
|
||||
"SMTP_PASSWORD='Fill'",
|
||||
"NEXT_PUBLIC_SMTP_FROM=typebot@example.com",
|
||||
"DEFAULT_WORKSPACE_PLAN=UNLIMITED",
|
||||
];
|
||||
|
||||
return {
|
||||
envs,
|
||||
domains,
|
||||
};
|
||||
}
|
||||
27
blueprints/typebot/template.yml
Normal file
27
blueprints/typebot/template.yml
Normal file
@@ -0,0 +1,27 @@
|
||||
variables:
|
||||
builder_domain: ${randomDomain}
|
||||
viewer_domain: ${randomDomain}
|
||||
encryption_secret: ${generateBase64(24)}
|
||||
|
||||
config:
|
||||
domains:
|
||||
- serviceName: typebot-builder
|
||||
port: 3000
|
||||
host: ${builder_domain}
|
||||
- serviceName: typebot-viewer
|
||||
port: 3000
|
||||
host: ${viewer_domain}
|
||||
|
||||
env:
|
||||
ENCRYPTION_SECRET: ${encryption_secret}
|
||||
NEXTAUTH_URL: http://${builder_domain}
|
||||
NEXT_PUBLIC_VIEWER_URL: http://${viewer_domain}
|
||||
ADMIN_EMAIL: "typebot@example.com"
|
||||
SMTP_HOST: "'Fill'"
|
||||
SMTP_PORT: "25"
|
||||
SMTP_USERNAME: "'Fill'"
|
||||
SMTP_PASSWORD: "'Fill'"
|
||||
NEXT_PUBLIC_SMTP_FROM: "typebot@example.com"
|
||||
DEFAULT_WORKSPACE_PLAN: "UNLIMITED"
|
||||
|
||||
mounts: []
|
||||
Reference in New Issue
Block a user