feat(lego): make HTTP challenge port configurable

This commit is contained in:
Sebastian Fleer 2024-06-24 10:59:31 +02:00
parent 7c42199b1e
commit a821a2f405
No known key found for this signature in database
GPG key ID: C24CB83D52ADE8D6
2 changed files with 11 additions and 3 deletions

View file

@ -60,6 +60,7 @@ lego_letsencrypt_environment: "staging"
lego_challenge:
type: "http"
lego_challenge_http_port: 80
lego_letsencrypt_servers:
prod: "https://acme-v02.api.letsencrypt.org/directory"

View file

@ -2,9 +2,16 @@
lego_challenge_mergeable:
command_parameters:
global: "{'{{ lego_challenge.type }}': '{{ lego_challenge.provider | default('') }}'}"
lego_configuration_merged: >-
{{ lego_configuration_defaults | combine(lego_challenge_mergeable, recursive=True)
| combine(lego_configuration | default({}), recursive=True) }}
lego_challenge_http_mergeable:
command_parameters:
global: "{'http.port': ':{{ lego_challenge_http_port }}'}"
lego_configuration_merged: >-2
{{
lego_configuration_defaults
| combine(lego_challenge_mergeable, recursive=True)
| combine(lego_challenge_http_mergeable if lego_challenge.type == 'http' else {}, recursive=True)
| combine(lego_configuration | default({}), recursive=True)
}}
# Build global command
lego_command_domains: >-2