coredns subdomains from stack.toml [platform].subdomains
Removes hardcoded SUBDOMAINS list from gen_config.py. The subdomain list now lives in stack.toml alongside domain and host_ip. Matches the Traefik $reef service dict — add a new service there and to the subdomains list, commit, coredns/hosts updates automatically.
This commit is contained in:
@@ -1,17 +1,18 @@
|
||||
192.168.1.192 homelab.fhirworx.io
|
||||
192.168.1.192 dashboard.homelab.fhirworx.io
|
||||
192.168.1.192 docs.homelab.fhirworx.io
|
||||
192.168.1.192 gitea.homelab.fhirworx.io
|
||||
192.168.1.192 ci.homelab.fhirworx.io
|
||||
192.168.1.192 docs.homelab.fhirworx.io
|
||||
192.168.1.192 notebooks.homelab.fhirworx.io
|
||||
192.168.1.192 api.homelab.fhirworx.io
|
||||
192.168.1.192 s3.homelab.fhirworx.io
|
||||
192.168.1.192 s3console.homelab.fhirworx.io
|
||||
192.168.1.192 grafana.homelab.fhirworx.io
|
||||
192.168.1.192 traefik.homelab.fhirworx.io
|
||||
192.168.1.192 zotero.homelab.fhirworx.io
|
||||
192.168.1.192 webdav.homelab.fhirworx.io
|
||||
192.168.1.192 api.homelab.fhirworx.io
|
||||
192.168.1.192 nessie.homelab.fhirworx.io
|
||||
192.168.1.192 polaris.homelab.fhirworx.io
|
||||
192.168.1.192 trino.homelab.fhirworx.io
|
||||
192.168.1.192 polaris.homelab.fhirworx.io
|
||||
192.168.1.192 grafana.homelab.fhirworx.io
|
||||
192.168.1.192 prometheus.homelab.fhirworx.io
|
||||
192.168.1.192 jaeger.homelab.fhirworx.io
|
||||
192.168.1.192 loki.homelab.fhirworx.io
|
||||
192.168.1.192 s3.homelab.fhirworx.io
|
||||
192.168.1.192 s3console.homelab.fhirworx.io
|
||||
|
||||
@@ -55,32 +55,12 @@ def scannable(images: list[dict]) -> list[dict]:
|
||||
|
||||
# ── CoreDNS ──────────────────────────────────────────────────────
|
||||
|
||||
SUBDOMAINS = [
|
||||
"",
|
||||
"gitea",
|
||||
"ci",
|
||||
"docs",
|
||||
"notebooks",
|
||||
"api",
|
||||
"s3",
|
||||
"s3console",
|
||||
"grafana",
|
||||
"traefik",
|
||||
"zotero",
|
||||
"nessie",
|
||||
"polaris",
|
||||
"trino",
|
||||
"prometheus",
|
||||
"jaeger",
|
||||
"loki",
|
||||
]
|
||||
|
||||
|
||||
def gen_coredns() -> dict[str, str]:
|
||||
lines = []
|
||||
for sub in SUBDOMAINS:
|
||||
fqdn = f"{sub}.{DOMAIN}" if sub else DOMAIN
|
||||
lines.append(f"{HOST_IP} {fqdn}")
|
||||
subdomains = cfg._data.get("platform", {}).get("subdomains", [])
|
||||
lines = [f"{HOST_IP} {DOMAIN}"] # bare domain always first
|
||||
for sub in subdomains:
|
||||
lines.append(f"{HOST_IP} {sub}.{DOMAIN}")
|
||||
hosts = "\n".join(lines) + "\n"
|
||||
|
||||
corefile = f"""{DOMAIN} {{
|
||||
|
||||
@@ -20,6 +20,12 @@ image_prefix = "fhirworx"
|
||||
repo = "homelab/stack"
|
||||
ci_email = "ci@fhirworx.io"
|
||||
host_ip = "192.168.1.192"
|
||||
subdomains = [
|
||||
"dashboard", "docs", "gitea", "ci", "notebooks", "zotero",
|
||||
"webdav", "api", "nessie", "trino", "polaris",
|
||||
"grafana", "prometheus", "jaeger", "loki",
|
||||
"s3", "s3console",
|
||||
]
|
||||
|
||||
[services]
|
||||
gitea = "http://gitea:3000"
|
||||
|
||||
Reference in New Issue
Block a user