mirror of
https://github.com/andwati/dokploy.git
synced 2026-10-30 08:42:16 +00:00
37 lines
809 B
TypeScript
37 lines
809 B
TypeScript
import {
|
|
type DomainSchema,
|
|
type Schema,
|
|
type Template,
|
|
generatePassword,
|
|
generateRandomDomain,
|
|
generateBase64,
|
|
} from "../utils";
|
|
|
|
export function generate(schema: Schema): Template {
|
|
const mainDomain = generateRandomDomain(schema);
|
|
const dbPassword = generatePassword();
|
|
const dbUser = "postiz";
|
|
const dbName = "postiz";
|
|
const jwtSecret = generateBase64(32);
|
|
|
|
const domains: DomainSchema[] = [
|
|
{
|
|
host: mainDomain,
|
|
port: 5000,
|
|
serviceName: "postiz",
|
|
},
|
|
];
|
|
|
|
const envs = [
|
|
`POSTIZ_HOST=${mainDomain}`,
|
|
`DB_PASSWORD=${dbPassword}`,
|
|
`DB_USER=${dbUser}`,
|
|
`DB_NAME=${dbName}`,
|
|
`JWT_SECRET=${jwtSecret}`,
|
|
];
|
|
|
|
return {
|
|
domains,
|
|
envs,
|
|
};
|
|
}
|