caddy: final integration with consul
This commit is contained in:
@@ -9,6 +9,19 @@
|
||||
admin off
|
||||
persist_config off
|
||||
|
||||
{% if caddy_consul %}
|
||||
storage consul {
|
||||
address "{{ caddy_consul_server }}"
|
||||
token "{{ caddy_out_consul_token.token.SecretID }}"
|
||||
timeout 10
|
||||
prefix "caddy-{{ caddy_my_name }}-tls"
|
||||
value_prefix "{{ caddy_my_name }}"
|
||||
aes_key "{{ caddy_consul_aes_key }}"
|
||||
tls_enabled "false"
|
||||
tls_insecure "false"
|
||||
}
|
||||
{% endif %}
|
||||
|
||||
{% if caddy_geoip_account_id != None and caddy_geoip_license_key != None %}
|
||||
geoip2 {
|
||||
accountId "{{ caddy_geoip_account_id }}"
|
||||
@@ -189,7 +202,20 @@
|
||||
|
||||
{% if site.rate_limit | default(caddy_sites_defaults.rate_limit) %}
|
||||
rate_limit @not_whitelisted {
|
||||
# distributed
|
||||
{% if caddy_consul %}
|
||||
distributed
|
||||
storage consul {
|
||||
address "{{ caddy_consul_server }}"
|
||||
token "{{ caddy_out_consul_token.token.SecretID }}"
|
||||
timeout 10
|
||||
prefix "caddy-{{ caddy_my_name }}-rl"
|
||||
value_prefix "{{ caddy_my_name }}"
|
||||
aes_key "{{ caddy_consul_aes_key }}"
|
||||
tls_enabled "false"
|
||||
tls_insecure "false"
|
||||
}
|
||||
{% endif %}
|
||||
log_key
|
||||
zone remote_ip {
|
||||
key {remote.ip}
|
||||
events {{ site.rate_limit_events | default(caddy_sites_defaults.rate_limit_events) }}
|
||||
|
||||
@@ -17,6 +17,10 @@ AmbientCapabilities=CAP_NET_ADMIN CAP_NET_BIND_SERVICE
|
||||
StandardOutput=journal
|
||||
StandardError=journal
|
||||
SyslogIdentifier={{ caddy_my_name }}
|
||||
{#
|
||||
# FIXME: SSL connexion doesn't work
|
||||
# Environment="CONSUL_CLIENT_CERT={{ caddy_consul_client_cert }}" "CONSUL_CLIENT_KEY={{ caddy_consul_client_key }}"
|
||||
#}
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
||||
Reference in New Issue
Block a user