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,
|
||||
generateRandomDomain,
|
||||
} from "../utils";
|
||||
|
||||
export function generate(schema: Schema): Template {
|
||||
const mainDomain = generateRandomDomain(schema);
|
||||
|
||||
const apiKey = Array.from({ length: 32 }, () =>
|
||||
Math.floor(Math.random() * 16).toString(16),
|
||||
).join("");
|
||||
const encryptionKey = Array.from({ length: 32 }, () =>
|
||||
Math.floor(Math.random() * 16).toString(16),
|
||||
).join("");
|
||||
const jwtSecret = Array.from({ length: 32 }, () =>
|
||||
Math.floor(Math.random() * 16).toString(16),
|
||||
).join("");
|
||||
const postgresPassword = Array.from({ length: 32 }, () =>
|
||||
Math.floor(Math.random() * 16).toString(16),
|
||||
).join("");
|
||||
|
||||
const domains: DomainSchema[] = [
|
||||
{
|
||||
host: mainDomain,
|
||||
port: 80,
|
||||
serviceName: "activepieces",
|
||||
},
|
||||
];
|
||||
|
||||
const envs = [
|
||||
`AP_HOST=${mainDomain}`,
|
||||
`AP_API_KEY=${apiKey}`,
|
||||
`AP_ENCRYPTION_KEY=${encryptionKey}`,
|
||||
`AP_JWT_SECRET=${jwtSecret}`,
|
||||
`AP_POSTGRES_PASSWORD=${postgresPassword}`,
|
||||
];
|
||||
|
||||
return {
|
||||
domains,
|
||||
envs,
|
||||
};
|
||||
}
|
||||
21
blueprints/activepieces/template.yml
Normal file
21
blueprints/activepieces/template.yml
Normal file
@@ -0,0 +1,21 @@
|
||||
variables:
|
||||
main_domain: ${randomDomain}
|
||||
api_key: ${generatePassword(32)}
|
||||
encryption_key: ${generatePassword(32)}
|
||||
jwt_secret: ${generatePassword(32)}
|
||||
postgres_password: ${generatePassword(32)}
|
||||
|
||||
config:
|
||||
domains:
|
||||
- serviceName: activepieces
|
||||
port: 80
|
||||
host: ${main_domain}
|
||||
|
||||
env:
|
||||
- AP_HOST=${main_domain}
|
||||
- AP_API_KEY=${api_key}
|
||||
- AP_ENCRYPTION_KEY=${encryption_key}
|
||||
- AP_JWT_SECRET=${jwt_secret}
|
||||
- AP_POSTGRES_PASSWORD=${postgres_password}
|
||||
|
||||
mounts: []
|
||||
Reference in New Issue
Block a user