-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Traefik: introduce domain redirect (1st version) (#925)
* Traefik: introduce domain redirect * Fix env vars * Update CI deps * Updates * Revert CI changes
- Loading branch information
1 parent
6f90f13
commit f9077d3
Showing
3 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
def _generate_domain_capture_all_rule(domain: str) -> str: | ||
rules = [ | ||
f"Host(`{domain}`)", | ||
f"Host(`www.{domain}`)", | ||
f"Host(`invitations.{domain}`)", | ||
f"Host(`services.{domain}`)", | ||
f"HostRegexp(`{{subhost:[a-zA-Z0-9-]+}}.services.{domain}`)", | ||
f"Host(`services.testing.{domain}`)", | ||
f"HostRegexp(`{{subhost:[a-zA-Z0-9-]+}}.services.testing.{domain}`)", | ||
f"Host(`pay.{domain}`)", | ||
f"Host(`api.{domain}`)", | ||
f"Host(`api.testing.{domain}`)", | ||
f"Host(`testing.{domain}`)", | ||
] | ||
return " || ".join(rules) | ||
|
||
|
||
def j2_environment(env): | ||
env.globals.update( | ||
generate_domain_capture_all_rule=_generate_domain_capture_all_rule | ||
) | ||
return env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters