From d7904d2a5cb7820a6d89aa968e3ba99d70808051 Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Mon, 6 Jan 2025 19:23:15 +0100 Subject: [PATCH] Caddyfile.generate: Support redirect-only domains For example: > [libexpat.github.io] > aliases = > libexpat.org > www.libexpat.org --- Caddyfile.generate | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Caddyfile.generate b/Caddyfile.generate index 45558aa..e2fdc75 100755 --- a/Caddyfile.generate +++ b/Caddyfile.generate @@ -45,6 +45,9 @@ class CaddyfileGenerator: ) for domain, backend_authority in sorted(self._backend_of.items()): + if backend_authority is None: + continue + print( dedent(""" %s { @@ -80,7 +83,11 @@ def run(options): alias_domains = config.get(domain, "aliases").split() except NoOptionError: alias_domains = [] - backend_authority = config.get(domain, "backend") + + try: + backend_authority = config.get(domain, "backend") + except NoOptionError: + backend_authority = None site = CaddyfileGenerator.Site(alias_domains, backend_authority, domain) caddyfile.add(site)