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,35 +0,0 @@
import {
type DomainSchema,
type Schema,
type Template,
generatePassword,
generateRandomDomain,
} from "../utils";
export function generate(schema: Schema): Template {
const domains: DomainSchema[] = [
{
host: generateRandomDomain(schema),
port: 5000,
serviceName: "registry",
},
];
const registryHttpSecret = generatePassword(30);
const envs = [`REGISTRY_HTTP_SECRET=${registryHttpSecret}`];
const mounts: Template["mounts"] = [
{
filePath: "/auth/registry.password",
content:
"# from: docker run --rm --entrypoint htpasswd httpd:2 -Bbn docker password\ndocker:$2y$10$qWZoWev/u5PV7WneFoRAMuoGpRcAQOgUuIIdLnU7pJXogrBSY23/2\n",
},
];
return {
domains,
envs,
mounts,
};
}

View File

@@ -0,0 +1,18 @@
variables:
main_domain: ${randomDomain}
registry_http_secret: ${generatePassword(30)}
config:
domains:
- serviceName: registry
port: 5000
host: ${main_domain}
env:
REGISTRY_HTTP_SECRET: ${registry_http_secret}
mounts:
- filePath: /auth/registry.password
content: |
# from: docker run --rm --entrypoint htpasswd httpd:2 -Bbn docker password
docker:$2y$10$qWZoWev/u5PV7WneFoRAMuoGpRcAQOgUuIIdLnU7pJXogrBSY23/2