Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos-caddy
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Guillaume Hervier
slapos-caddy
Commits
ff09efe8
Commit
ff09efe8
authored
Nov 03, 2017
by
Eteri
Committed by
Rafael Monnerat
Nov 07, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
caddy: add optional authentication
parent
f0f126b2
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
17 deletions
+20
-17
stack/caddy/Caddyfile.in
stack/caddy/Caddyfile.in
+9
-7
stack/caddy/buildout.cfg
stack/caddy/buildout.cfg
+3
-3
stack/caddy/instance-caddy.cfg.in
stack/caddy/instance-caddy.cfg.in
+8
-7
No files found.
stack/caddy/Caddyfile.in
View file @
ff09efe8
...
@@ -2,21 +2,19 @@
...
@@ -2,21 +2,19 @@
{{ parameter_dict['domain'] }} {
{{ parameter_dict['domain'] }} {
{% if parameter_dict['cert-content'] and parameter_dict['key-content'] -%}
tls {{ custom_cert_dict['cert-file'] }} {{ custom_cert_dict['key-file'] }} {
tls {{ custom_cert_dict['cert-file'] }} {{ custom_cert_dict['key-file'] }} {
ca {{ca_custom_frontend_dict['rendered']}}
ca {{ca_custom_frontend_dict['rendered']}}
}
}
{%- endif %}
log {{caddy_configuration_dict['access_log']}}
log {{caddy_configuration_dict['access_log']}}
root {{ directory_dict['public_html'] }}
root {{ directory_dict['public_html'] }}
basicauth / admin {{htpasswd_dict}}
{% if parameter_dict['enable-basic-auth'] == 'true' -%}
basicauth / {{ parameter_dict['username'] }} {{parameter_dict['password']}}
{%- endif %}
}
}
...
@@ -34,7 +32,9 @@ basicauth / admin {{htpasswd_dict}}
...
@@ -34,7 +32,9 @@ basicauth / admin {{htpasswd_dict}}
root {{ directory_dict['public_html'] }}
root {{ directory_dict['public_html'] }}
basicauth / admin {{htpasswd_dict}}
{% if parameter_dict['enable-basic-auth'] == 'true' -%}
basicauth / {{ parameter_dict['username'] }} {{parameter_dict['password']}}
{%- endif %}
}
}
...
@@ -44,6 +44,8 @@ basicauth / admin {{htpasswd_dict}}
...
@@ -44,6 +44,8 @@ basicauth / admin {{htpasswd_dict}}
root {{ directory_dict['public_html'] }}
root {{ directory_dict['public_html'] }}
basicauth / admin {{htpasswd_dict}}
{% if parameter_dict['enable-basic-auth'] == 'true' -%}
basicauth / {{ parameter_dict['username'] }} {{parameter_dict['password']}}
{%- endif %}
}
}
\ No newline at end of file
stack/caddy/buildout.cfg
View file @
ff09efe8
...
@@ -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 =
5de9738527f48bc5480eeb0ad97727a5
md5sum =
bb3b314ebeb58e9875d547a053a9f268
filename = Caddyfile.in
filename = Caddyfile.in
location = ${buildout:parts-directory}/${:_buildout_section_name_}
location = ${buildout:parts-directory}/${:_buildout_section_name_}
mode = 0644
mode = 0644
...
@@ -35,7 +35,7 @@ mode = 0644
...
@@ -35,7 +35,7 @@ mode = 0644
[template-caddy]
[template-caddy]
recipe = slapos.recipe.template
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-caddy.cfg.in
url = ${:_profile_base_location_}/instance-caddy.cfg.in
md5sum =
cee290eac3f9f8dbc614ac7373f412fc
md5sum =
fe529c1911458fba92e93457c72a779a
output = ${buildout:directory}/instance-caddy.cfg.in
output = ${buildout:directory}/instance-caddy.cfg.in
mode = 0644
mode = 0644
...
@@ -49,7 +49,7 @@ mode = 0644
...
@@ -49,7 +49,7 @@ mode = 0644
[template-caddy-service]
[template-caddy-service]
recipe = slapos.recipe.template
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/template-caddy-service.sh.in
url = ${:_profile_base_location_}/template-caddy-service.sh.in
md5sum =
d3562acaac05be570d28e37a0d889eec
md5sum =
5467fac7b95acde681e613ae98ce990d
output = ${buildout:directory}/template-caddy-service.sh.in
output = ${buildout:directory}/template-caddy-service.sh.in
mode = 0644
mode = 0644
...
...
stack/caddy/instance-caddy.cfg.in
View file @
ff09efe8
...
@@ -114,16 +114,17 @@ mode = 0600
...
@@ -114,16 +114,17 @@ mode = 0600
[publish-connection-information]
[publish-connection-information]
recipe = slapos.cookbook:publish
recipe = slapos.cookbook:publish
#init-password = $${htpasswd:passwd}
url-ipv6 = https://$${slap-parameter:username}:$${slap-parameter:password}@[$${caddy-configuration:ipv6}]:$${slap-parameter:port-ipv6}
#init-user = admin
url-ipv4 = http://$${slap-parameter:username}:$${slap-parameter:password}@[$${caddy-configuration:local_ip}]:$${slap-parameter:port-ipv4}
url-ipv6 = https://admin:$${htpasswd:passwd}@[$${caddy-configuration:ipv6}]:$${slap-parameter:port-ipv6}
url-ipv4 = http://admin:$${htpasswd:passwd}@[$${caddy-configuration:local_ip}]:$${slap-parameter:port-ipv4}
[slap-parameter]
[slap-parameter]
domain =
domain =
key-content =
key-content =
cert-content =
cert-content =
caddy-ca-certificate =
caddy-ca-certificate =
port-ipv6 = 4443
port-ipv6 = 9443
port-ipv4 = 9443
port-ipv4 = 4443
enable-quic =
enable-quic = true
\ No newline at end of file
enable-basic-auth =
username = admin
password = $${htpasswd:passwd}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment