diff --git a/app/script.js b/app/script.js index 87ed39b3..fd640008 100644 --- a/app/script.js +++ b/app/script.js @@ -22,11 +22,15 @@ function processDirectory(dirPath) { if (stat.isDirectory()) { processDirectory(filePath); } else if (file === "template.yml") { - console.log(`Deleting ${filePath}`); - fs.unlinkSync(filePath); + console.log(`Converting ${filePath}`); + const yamlContent = fs.readFileSync(filePath, "utf8"); + const tomlContent = convertYamlToToml(yamlContent); + const tomlPath = path.join(dirPath, "template.toml"); + fs.writeFileSync(tomlPath, tomlContent); } }); } +// Ruta al directorio blueprints relativa al script const blueprintsPath = path.join(__dirname, "..", "blueprints"); processDirectory(blueprintsPath); diff --git a/blueprints/backrest/template.toml b/blueprints/backrest/template.toml new file mode 100644 index 00000000..7e42678f --- /dev/null +++ b/blueprints/backrest/template.toml @@ -0,0 +1,11 @@ +[variables] +main_domain = "${domain}" + +[config] +env = ["TZ=Europe/Paris"] +mounts = [] + +[[config.domains]] +serviceName = "backrest" +port = 9_898 +host = "${main_domain}" diff --git a/blueprints/blinko/template.toml b/blueprints/blinko/template.toml new file mode 100644 index 00000000..127e39b8 --- /dev/null +++ b/blueprints/blinko/template.toml @@ -0,0 +1,20 @@ +[variables] +main_domain = "${domain}" +postgres_password = "${password:16}" +nextauth_secret = "${password:32}" +nextauth_url = "http://${main_domain}" +next_public_base_url = "http://${main_domain}" + +[config] +env = [ + "nextauth_secret=${nextauth_secret}", + "postgres_password=${postgres_password}", + "nextauth_url=${nextauth_url}", + "next_public_base_url=${next_public_base_url}", +] +mounts = [] + +[[config.domains]] +serviceName = "blinko-website" +port = 1_111 +host = "${main_domain}"