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,35 +0,0 @@
|
||||
import {
|
||||
type DomainSchema,
|
||||
type Schema,
|
||||
type Template,
|
||||
generatePassword,
|
||||
generateRandomDomain,
|
||||
} from "../utils";
|
||||
|
||||
export function generate(schema: Schema): Template {
|
||||
const mainDomain = generateRandomDomain(schema);
|
||||
const mysqlPassword = generatePassword();
|
||||
const mysqlRootPassword = generatePassword();
|
||||
const adminPassword = generatePassword();
|
||||
|
||||
const domains: DomainSchema[] = [
|
||||
{
|
||||
host: mainDomain,
|
||||
port: 80,
|
||||
serviceName: "yourls-app",
|
||||
},
|
||||
];
|
||||
|
||||
const envs = [
|
||||
`YOURLS_HOST=${mainDomain}`,
|
||||
"YOURLS_ADMIN_USER=admin",
|
||||
`YOURLS_ADMIN_PASSWORD=${adminPassword}`,
|
||||
`MYSQL_PASSWORD=${mysqlPassword}`,
|
||||
`MYSQL_ROOT_PASSWORD=${mysqlRootPassword}`,
|
||||
];
|
||||
|
||||
return {
|
||||
domains,
|
||||
envs,
|
||||
};
|
||||
}
|
||||
20
blueprints/yourls/template.yml
Normal file
20
blueprints/yourls/template.yml
Normal file
@@ -0,0 +1,20 @@
|
||||
variables:
|
||||
main_domain: ${randomDomain}
|
||||
mysql_password: ${generatePassword()}
|
||||
mysql_root_password: ${generatePassword()}
|
||||
admin_password: ${generatePassword()}
|
||||
|
||||
config:
|
||||
domains:
|
||||
- serviceName: yourls-app
|
||||
port: 80
|
||||
host: ${main_domain}
|
||||
|
||||
env:
|
||||
YOURLS_HOST: ${main_domain}
|
||||
YOURLS_ADMIN_USER: "admin"
|
||||
YOURLS_ADMIN_PASSWORD: ${admin_password}
|
||||
MYSQL_PASSWORD: ${mysql_password}
|
||||
MYSQL_ROOT_PASSWORD: ${mysql_root_password}
|
||||
|
||||
mounts: []
|
||||
Reference in New Issue
Block a user