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,45 +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 mysqlUser = "tickets";
|
||||
const mysqlDatabase = "tickets";
|
||||
|
||||
const encryptionKey = Array.from({ length: 48 }, () =>
|
||||
Math.floor(Math.random() * 16).toString(16),
|
||||
).join("");
|
||||
|
||||
const domains: DomainSchema[] = [
|
||||
{
|
||||
host: mainDomain,
|
||||
port: 8169,
|
||||
serviceName: "tickets-app",
|
||||
},
|
||||
];
|
||||
|
||||
const envs = [
|
||||
`TICKETS_HOST=${mainDomain}`,
|
||||
`MYSQL_DATABASE=${mysqlDatabase}`,
|
||||
`MYSQL_PASSWORD=${mysqlPassword}`,
|
||||
`MYSQL_ROOT_PASSWORD=${mysqlRootPassword}`,
|
||||
`MYSQL_USER=${mysqlUser}`,
|
||||
`ENCRYPTION_KEY=${encryptionKey}`,
|
||||
"# Follow the guide at: https://discordtickets.app/self-hosting/installation/docker/#creating-the-discord-application",
|
||||
"DISCORD_SECRET=",
|
||||
"DISCORD_TOKEN=",
|
||||
"SUPER_USERS=YOUR_DISCORD_USER_ID", // Default super user
|
||||
];
|
||||
|
||||
return {
|
||||
domains,
|
||||
envs,
|
||||
};
|
||||
}
|
||||
27
blueprints/discord-tickets/template.yml
Normal file
27
blueprints/discord-tickets/template.yml
Normal file
@@ -0,0 +1,27 @@
|
||||
variables:
|
||||
main_domain: ${randomDomain}
|
||||
mysql_password: ${generatePassword}
|
||||
mysql_root_password: ${generatePassword}
|
||||
mysql_user: tickets
|
||||
mysql_database: tickets
|
||||
encryption_key: ${generatePassword(48)}
|
||||
|
||||
config:
|
||||
domains:
|
||||
- serviceName: tickets-app
|
||||
port: 8169
|
||||
host: ${main_domain}
|
||||
|
||||
env:
|
||||
- TICKETS_HOST=${main_domain}
|
||||
- MYSQL_DATABASE=${mysql_database}
|
||||
- MYSQL_PASSWORD=${mysql_password}
|
||||
- MYSQL_ROOT_PASSWORD=${mysql_root_password}
|
||||
- MYSQL_USER=${mysql_user}
|
||||
- ENCRYPTION_KEY=${encryption_key}
|
||||
- "# Follow the guide at: https://discordtickets.app/self-hosting/installation/docker/#creating-the-discord-application"
|
||||
- DISCORD_SECRET=
|
||||
- DISCORD_TOKEN=
|
||||
- SUPER_USERS=YOUR_DISCORD_USER_ID
|
||||
|
||||
mounts: []
|
||||
Reference in New Issue
Block a user