Skip to content

Commit

Permalink
Merge pull request #25 from hartwork/fix-identation
Browse files Browse the repository at this point in the history
`Caddyfile.generate`: Fix dedent block indentation
  • Loading branch information
hartwork authored Jan 2, 2025
2 parents cef1b9d + c1dc36e commit a820107
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions Caddyfile.generate
Original file line number Diff line number Diff line change
Expand Up @@ -34,36 +34,36 @@ class CaddyfileGenerator:
def write_to(self, fp):
print(
dedent("""\
# NOTE: This file has been generated, do not edit
(common) {
encode zstd gzip
log {
output stdout
}
}"""),
# NOTE: This file has been generated, do not edit
(common) {
encode zstd gzip
log {
output stdout
}
}"""),
file=fp,
)

for domain, backend_authority in sorted(self._backend_of.items()):
print(
dedent("""
%s {
import common
reverse_proxy %s {
header_down +Strict-Transport-Security "max-age=63072000; includeSubDomains; preload"
}
}""") # noqa: E501
%s {
import common
reverse_proxy %s {
header_down +Strict-Transport-Security "max-age=63072000; includeSubDomains; preload"
}
}""") # noqa: E501
% (domain, backend_authority),
file=fp,
)

for source_domain, target_domain in sorted(self._redir_target_of.items()):
print(
dedent("""
%s {
import common
redir https://%s{uri}
}""")
%s {
import common
redir https://%s{uri}
}""")
% (source_domain, target_domain),
file=fp,
)
Expand Down

0 comments on commit a820107

Please sign in to comment.