Commit 9cfb2578 authored by Eteri's avatar Eteri

caddy: add bind to a specific ip

parent 09f2f83b
...@@ -10,6 +10,8 @@ tls {{ custom_cert_dict['cert-file'] }} {{ custom_cert_dict['key-file'] }} { ...@@ -10,6 +10,8 @@ tls {{ custom_cert_dict['cert-file'] }} {{ custom_cert_dict['key-file'] }} {
log {{caddy_configuration_dict['access_log']}} log {{caddy_configuration_dict['access_log']}}
errors {{caddy_configuration_dict['error_log']}}
root {{ directory_dict['public_html'] }} root {{ directory_dict['public_html'] }}
{% if parameter_dict['enable-basic-auth'] == 'true' -%} {% if parameter_dict['enable-basic-auth'] == 'true' -%}
...@@ -18,6 +20,8 @@ basicauth / {{ parameter_dict['username'] }} {{parameter_dict['password']}} ...@@ -18,6 +20,8 @@ basicauth / {{ parameter_dict['username'] }} {{parameter_dict['password']}}
} }
bind {{caddy_configuration_dict['ipv6']}}
{%- endif %} {%- endif %}
[{{caddy_configuration_dict['ipv6']}}]:{{parameter_dict['port-ipv6']}} { [{{caddy_configuration_dict['ipv6']}}]:{{parameter_dict['port-ipv6']}} {
...@@ -30,22 +34,30 @@ basicauth / {{ parameter_dict['username'] }} {{parameter_dict['password']}} ...@@ -30,22 +34,30 @@ basicauth / {{ parameter_dict['username'] }} {{parameter_dict['password']}}
log {{caddy_configuration_dict['access_log']}} log {{caddy_configuration_dict['access_log']}}
errors {{caddy_configuration_dict['error_log']}}
root {{ directory_dict['public_html'] }} root {{ directory_dict['public_html'] }}
{% if parameter_dict['enable-basic-auth'] == 'true' -%} {% if parameter_dict['enable-basic-auth'] == 'true' -%}
basicauth / {{ parameter_dict['username'] }} {{parameter_dict['password']}} basicauth / {{ parameter_dict['username'] }} {{parameter_dict['password']}}
{%- endif %} {%- endif %}
bind {{caddy_configuration_dict['ipv6']}}
} }
[{{caddy_configuration_dict['local_ip']}}]:{{parameter_dict['port-ipv4']}} { [{{caddy_configuration_dict['local_ip']}}]:{{parameter_dict['port-ipv4']}} {
log {{caddy_configuration_dict['access_log']}} log {{caddy_configuration_dict['access_log']}}
errors {{caddy_configuration_dict['error_log']}}
root {{ directory_dict['public_html'] }} root {{ directory_dict['public_html'] }}
{% if parameter_dict['enable-basic-auth'] == 'true' -%} {% if parameter_dict['enable-basic-auth'] == 'true' -%}
basicauth / {{ parameter_dict['username'] }} {{parameter_dict['password']}} basicauth / {{ parameter_dict['username'] }} {{parameter_dict['password']}}
{%- endif %} {%- endif %}
bind {{caddy_configuration_dict['local_ip']}}
} }
\ No newline at end of file
...@@ -27,7 +27,7 @@ mode = 0644 ...@@ -27,7 +27,7 @@ mode = 0644
[template-caddyfile] [template-caddyfile]
recipe = slapos.recipe.build:download recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/Caddyfile.in url = ${:_profile_base_location_}/Caddyfile.in
#md5sum = bb3b314ebeb58e9875d547a053a9f268 md5sum = 88c4c33e374ea3f61cdd36b2816d24ba
filename = Caddyfile.in filename = Caddyfile.in
location = ${buildout:parts-directory}/${:_buildout_section_name_} location = ${buildout:parts-directory}/${:_buildout_section_name_}
mode = 0644 mode = 0644
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment