Skip to content

Commit 5a30f47

Browse files
committed
Auto-set https/http in config based on TLS setting
1 parent b9c46d2 commit 5a30f47

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

matplotlib.org.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
vars:
44
caddy:
55
addresses:
6-
main: "https://matplotlib.org"
7-
webhook: "https://do.matplotlib.org"
6+
main: "matplotlib.org"
7+
webhook: "do.matplotlib.org"
88
site_dir: "/usr/share/caddy"
99
tls_config: "tls /etc/caddy/tls/cert.pem /etc/caddy/tls/privkey.pem"
1010
repos:

templates/Caddyfile.j2

+6-2
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@
1313
}
1414

1515
# Setup webhooks
16-
{{ caddy.addresses.webhook }} {
1716
{% if caddy.tls_config is defined %}
17+
https://{{ caddy.addresses.webhook }} {
1818
{{ caddy.tls_config }}
19+
{% else %}
20+
http://{{ caddy.addresses.webhook }} {
1921
{% endif %}
2022

2123
root * {{ caddy.site_dir }}
@@ -47,9 +49,11 @@
4749
}
4850
}
4951

50-
{{ caddy.addresses.main }} {
5152
{% if caddy.tls_config is defined %}
53+
https://{{ caddy.addresses.main }} {
5254
{{ caddy.tls_config }}
55+
{% else %}
56+
http://{{ caddy.addresses.main }} {
5357
{% endif %}
5458

5559
root * {{ caddy.site_dir }}

0 commit comments

Comments
 (0)