mirror of
https://github.com/Dokploy/templates
synced 2025-06-26 18:16:07 +00:00
29 lines
545 B
TypeScript
29 lines
545 B
TypeScript
import {
|
|
type DomainSchema,
|
|
type Schema,
|
|
type Template,
|
|
generatePassword,
|
|
generateRandomDomain,
|
|
} from "../utils";
|
|
|
|
export function generate(schema: Schema): Template {
|
|
const randomDomain = generateRandomDomain(schema);
|
|
const secretKey = generatePassword();
|
|
const randomUsername = "admin"; // Default username
|
|
|
|
const domains: DomainSchema[] = [
|
|
{
|
|
host: randomDomain,
|
|
port: 8080,
|
|
serviceName: "server",
|
|
},
|
|
];
|
|
|
|
const envs = [`SD_USERNAME=${randomUsername}`, `SD_PASSWORD=${secretKey}`];
|
|
|
|
return {
|
|
envs,
|
|
domains,
|
|
};
|
|
}
|