Commit 035c345c authored by Alain Takoudjou's avatar Alain Takoudjou

Fix dehydrated command

parent b9cae795
...@@ -19,7 +19,7 @@ md5sum = 9e584e5273ecf222da40b0f318fd62fd ...@@ -19,7 +19,7 @@ md5sum = 9e584e5273ecf222da40b0f318fd62fd
[template-autocert] [template-autocert]
filename = instance-autocert.cfg.jinja2.in filename = instance-autocert.cfg.jinja2.in
md5sum = 90f9070ee1ea7fa1c5b07558ed772888 md5sum = 4f914e5bf419009cb627f1314b76db63
[template-dehydrated-config] [template-dehydrated-config]
filename = config.in filename = config.in
......
{% set folder_list = [] -%} {% set folder_list = [] -%}
{% set part_list = [] -%} {% set part_list = [] -%}
{% set domain_list = [] -%}
[httpd-wrapper] [httpd-wrapper]
recipe = slapos.cookbook:simplehttpserver recipe = slapos.cookbook:simplehttpserver
...@@ -57,6 +58,16 @@ command-line = ...@@ -57,6 +58,16 @@ command-line =
--register --accept-terms --register --accept-terms
wrapper-path = ${directory:scripts}/dehydrated-register wrapper-path = ${directory:scripts}/dehydrated-register
[dehydrated-wrapper]
<= base-wrapper
command-line =
{{ parameter_dict['dehydrated-location'] }}/dehydrated
--config ${dehydrated-config:output}
--cron
wrapper-path = ${directory:scripts}/dehydrated
depends =
${dehydrated-domains.txt:recipe}
[caucase-updater] [caucase-updater]
recipe = slapos.cookbook:wrapper recipe = slapos.cookbook:wrapper
command-line = command-line =
...@@ -78,22 +89,7 @@ environment = ...@@ -78,22 +89,7 @@ environment =
{% set domain = domain_dict['domain-list'][0] -%} {% set domain = domain_dict['domain-list'][0] -%}
{% set kedifa_id = domain_dict['kedifa-id'] -%} {% set kedifa_id = domain_dict['kedifa-id'] -%}
{% do folder_list.append(domain) -%} {% do folder_list.append(domain) -%}
[dehydrated-domains-{{ domain }}] {% do domain_list.append(' '.join(domain_dict['domain-list'])) -%}
recipe = slapos.recipe.template
inline =
{{ ' ' ~ ' '.join(domain_dict['domain-list']) }}
output = ${directory:dehydrated}/{{ domain }}/domains.txt
[dehydrated-wrapper-{{ domain }}]
<= base-wrapper
command-line =
{{ parameter_dict['dehydrated-location'] }}/dehydrated
--config ${dehydrated-config:output}
--domains-txt {{ "${dehydrated-domains-" ~ domain ~ ":output}" }}
--cron
wrapper-path = ${directory:services}/dehydrated-{{ domain.replace('\.', '-') }}
depends =
{{ "${dehydrated-domains-" ~ domain ~ ":recipe}" }}
[kedifa-generate-auth-{{ domain }}] [kedifa-generate-auth-{{ domain }}]
<= base-wrapper <= base-wrapper
...@@ -112,25 +108,30 @@ wrapper-path = ${directory:scripts}/kedifa-genauth-{{ domain.replace('\.', '-') ...@@ -112,25 +108,30 @@ wrapper-path = ${directory:scripts}/kedifa-genauth-{{ domain.replace('\.', '-')
command-line = command-line =
{{ parameter_dict['kedifa-location'] }}/contrib/shell/kedifa_update_cert {{ parameter_dict['kedifa-location'] }}/contrib/shell/kedifa_update_cert
${directory:kedifa}/{{ domain }}.sh ${directory:kedifa}/{{ domain }}.sh
${directory:dehydrated}/{{ domain }}/certs/{{ domain }}/privkey.pem ${directory:dehydrated}/certs/{{ domain }}/privkey.pem
${directory:dehydrated}/{{ domain }}/certs/{{ domain }}/fullchain.pem ${directory:dehydrated}/certs/{{ domain }}/fullchain.pem
wait-for-files = wait-for-files =
${directory:dehydrated}/{{ domain }}/certs/{{ domain }}/fullchain.pem ${directory:dehydrated}/certs/{{ domain }}/fullchain.pem
wrapper-path = ${directory:bin}/kedifa-upload-{{ domain.replace('\.', '-') }} wrapper-path = ${directory:bin}/kedifa-upload-{{ domain.replace('\.', '-') }}
depends = depends =
{{ " ${dehydrated-wrapper-" ~ domain ~ ":recipe}" }} {{ "${kedifa-generate-auth-" ~ domain ~ ":recipe}" }}
{{ " ${kedifa-generate-auth-" ~ domain ~ ":recipe}" }}
[cron-entry-{{ domain }}] [cron-entry-{{ domain }}]
<= cron <= cron
recipe = slapos.cookbook:cron.d recipe = slapos.cookbook:cron.d
name = {{ domain }} name = upload-{{ domain }}
frequency = 0 0 * * 0 frequency = 0 0 * * 0
command = {{ "${kedifa-upload-" ~ domain ~ ":wrapper-path}" }} command = {{ "${kedifa-upload-" ~ domain ~ ":wrapper-path}" }}
{% do part_list.append("cron-entry-" ~ domain) -%} {% do part_list.append("cron-entry-" ~ domain) -%}
{% endfor %} {% endfor %}
[dehydrated-domains.txt]
recipe = slapos.recipe.template
inline =
{{ '\n '.join(domain_list) }}
output = ${directory:dehydrated}/domains.txt
[instance-parameter] [instance-parameter]
kedifa-caucase-url = {{ slapparameter_dict['kedifa-caucase-url'] }} kedifa-caucase-url = {{ slapparameter_dict['kedifa-caucase-url'] }}
kedifa-url = {{ slapparameter_dict['kedifa-base-url'] }} kedifa-url = {{ slapparameter_dict['kedifa-base-url'] }}
...@@ -156,6 +157,7 @@ tmp = ${:srv}/tmp ...@@ -156,6 +157,7 @@ tmp = ${:srv}/tmp
acme = ${:www}/.well-known/acme-challenge acme = ${:www}/.well-known/acme-challenge
caucase = ${:etc}/caucase caucase = ${:etc}/caucase
dehydrated = ${:etc}/dehydrated dehydrated = ${:etc}/dehydrated
domains.d = ${:dehydrated}/domains.txt.d
kedifa = ${:etc}/kedifa kedifa = ${:etc}/kedifa
{% for name in folder_list -%} {% for name in folder_list -%}
{{ name }} = ${:dehydrated}/{{ name }} {{ name }} = ${:dehydrated}/{{ name }}
...@@ -171,6 +173,7 @@ parts = ...@@ -171,6 +173,7 @@ parts =
httpd-listen-promise httpd-listen-promise
httpd-url-promise httpd-url-promise
dehydrated-register dehydrated-register
dehydrated-wrapper
# Complete parts with sections # Complete parts with sections
{{ part_list | join('\n ') }} {{ part_list | join('\n ') }}
......
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