feat: migrate templates

This commit is contained in:
Mauricio Siu
2025-03-09 20:40:08 -06:00
parent fbbb4f46f3
commit 2956016dd3
215 changed files with 2533 additions and 4921 deletions

View File

@@ -1,43 +0,0 @@
import {
type DomainSchema,
type Schema,
type Template,
generateBase64,
generateRandomDomain,
} from "../utils";
export function generate(schema: Schema): Template {
const mainDomain = generateRandomDomain(schema);
const secretKeyBase = generateBase64(64);
const synthApiKey = generateBase64(32);
const domains: DomainSchema[] = [
{
host: mainDomain,
port: 3000,
serviceName: "app",
},
];
const envs = [
`SECRET_KEY_BASE=${secretKeyBase}`,
"SELF_HOSTED=true",
`SYNTH_API_KEY=${synthApiKey}`,
"RAILS_FORCE_SSL=false",
"RAILS_ASSUME_SSL=false",
"GOOD_JOB_EXECUTION_MODE=async",
];
const mounts: Template["mounts"] = [
{
filePath: "./uploads",
content: "This is where user uploads will be stored",
},
];
return {
envs,
mounts,
domains,
};
}

View File

@@ -0,0 +1,22 @@
variables:
main_domain: ${randomDomain}
secret_key_base: ${generateBase64(64)}
synth_api_key: ${generateBase64(32)}
config:
domains:
- serviceName: app
port: 3000
host: ${main_domain}
env:
SECRET_KEY_BASE: ${secret_key_base}
SELF_HOSTED: "true"
SYNTH_API_KEY: ${synth_api_key}
RAILS_FORCE_SSL: "false"
RAILS_ASSUME_SSL: "false"
GOOD_JOB_EXECUTION_MODE: "async"
mounts:
- filePath: ./uploads
content: "This is where user uploads will be stored"