Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Lu Xu
slapos
Commits
0470062a
Commit
0470062a
authored
Oct 09, 2020
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
caddy-frontend: Reuse software_parameter_dict
parent
9071e3fd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
27 deletions
+21
-27
software/caddy-frontend/buildout.hash.cfg
software/caddy-frontend/buildout.hash.cfg
+2
-2
software/caddy-frontend/instance-apache-frontend.cfg.in
software/caddy-frontend/instance-apache-frontend.cfg.in
+8
-14
software/caddy-frontend/templates/apache-custom-slave-list.cfg.in
.../caddy-frontend/templates/apache-custom-slave-list.cfg.in
+11
-11
No files found.
software/caddy-frontend/buildout.hash.cfg
View file @
0470062a
...
@@ -22,7 +22,7 @@ md5sum = 5784bea3bd608913769ff9a8afcccb68
...
@@ -22,7 +22,7 @@ md5sum = 5784bea3bd608913769ff9a8afcccb68
[profile-caddy-frontend]
[profile-caddy-frontend]
filename = instance-apache-frontend.cfg.in
filename = instance-apache-frontend.cfg.in
md5sum =
0a01e9bcea1be615595cd0ac847f2032
md5sum =
1d7fa45d6379077047da8fb6c56121ac
[profile-caddy-replicate]
[profile-caddy-replicate]
filename = instance-apache-replicate.cfg.in
filename = instance-apache-replicate.cfg.in
...
@@ -30,7 +30,7 @@ md5sum = 4d4ace1bdad5adcf64d8dbf11d2fa21d
...
@@ -30,7 +30,7 @@ md5sum = 4d4ace1bdad5adcf64d8dbf11d2fa21d
[profile-slave-list]
[profile-slave-list]
_update_hash_filename_ = templates/apache-custom-slave-list.cfg.in
_update_hash_filename_ = templates/apache-custom-slave-list.cfg.in
md5sum =
74f075296c782e9f7b6d6fbdfe05768f
md5sum =
aeef424418e29a9d5257bf12582bfe04
[profile-replicate-publish-slave-information]
[profile-replicate-publish-slave-information]
_update_hash_filename_ = templates/replicate-publish-slave-information.cfg.in
_update_hash_filename_ = templates/replicate-publish-slave-information.cfg.in
...
...
software/caddy-frontend/instance-apache-frontend.cfg.in
View file @
0470062a
...
@@ -102,16 +102,10 @@ single-default = ${dynamic-custom-personal-profile-slave-list:rendered}
...
@@ -102,16 +102,10 @@ single-default = ${dynamic-custom-personal-profile-slave-list:rendered}
single-custom-personal = ${dynamic-custom-personal-profile-slave-list:rendered}
single-custom-personal = ${dynamic-custom-personal-profile-slave-list:rendered}
[frontend-configuration]
[frontend-configuration]
template-log-access = {{ software_parameter_dict['template_log_access'] }}
log-access-configuration = ${directory:etc}/log-access.conf
log-access-configuration = ${directory:etc}/log-access.conf
ip-access-certificate = ${self-signed-ip-access:certificate}
ip-access-certificate = ${self-signed-ip-access:certificate}
caddy-directory = {{ software_parameter_dict['caddy_location'] }}
caddy-ipv6 = {{ instance_parameter_dict['ipv6-random'] }}
caddy-ipv6 = {{ instance_parameter_dict['ipv6-random'] }}
caddy-https-port = ${configuration:port}
caddy-https-port = ${configuration:port}
nginx = {{ software_parameter_dict['nginx'] }}
nginx_mime = {{ software_parameter_dict['nginx_mime'] }}
htpasswd = {{ software_parameter_dict['htpasswd'] }}
slave-introspection-template = {{ software_parameter_dict['template_slave_introspection_httpd_nginx'] }}
slave-introspection-configuration = ${directory:etc}/slave-introspection-httpd-nginx.conf
slave-introspection-configuration = ${directory:etc}/slave-introspection-httpd-nginx.conf
slave-introspection-https-port = ${configuration:slave-introspection-https-port}
slave-introspection-https-port = ${configuration:slave-introspection-https-port}
slave-introspection-secure_access = ${slave-introspection-frontend:connection-secure_access}
slave-introspection-secure_access = ${slave-introspection-frontend:connection-secure_access}
...
@@ -231,7 +225,6 @@ certificate = ${kedifa-login-config:certificate}
...
@@ -231,7 +225,6 @@ certificate = ${kedifa-login-config:certificate}
cas-ca-certificate = ${kedifa-login-config:cas-ca-certificate}
cas-ca-certificate = ${kedifa-login-config:cas-ca-certificate}
csr = ${caucase-updater-csr:csr}
csr = ${caucase-updater-csr:csr}
crl = ${kedifa-login-config:crl}
crl = ${kedifa-login-config:crl}
kedifa-updater = {{ software_parameter_dict['kedifa-updater'] }}
kedifa-updater-mapping-file = ${directory:etc}/kedifa_updater_mapping.txt
kedifa-updater-mapping-file = ${directory:etc}/kedifa_updater_mapping.txt
kedifa-updater-state-file = ${directory:srv}/kedifa_updater_state.json
kedifa-updater-state-file = ${directory:srv}/kedifa_updater_state.json
slave_kedifa_information = {{ dumps(slapparameter_dict['slave-kedifa-information']) }}
slave_kedifa_information = {{ dumps(slapparameter_dict['slave-kedifa-information']) }}
...
@@ -284,9 +277,6 @@ template = {{ software_parameter_dict['profile_slave_list'] }}
...
@@ -284,9 +277,6 @@ template = {{ software_parameter_dict['profile_slave_list'] }}
filename = custom-personal-instance-slave-list.cfg
filename = custom-personal-instance-slave-list.cfg
master_key_download_url = {{ dumps(slapparameter_dict['master-key-download-url']) }}
master_key_download_url = {{ dumps(slapparameter_dict['master-key-download-url']) }}
software_type = single-custom-personal
software_type = single-custom-personal
bin_directory = {{ software_parameter_dict['bin_directory'] }}
caddy_executable = {{ software_parameter_dict['caddy'] }}
sixtunnel_executable = {{ software_parameter_dict['sixtunnel'] }}/bin/6tunnel
organization = {{ slapparameter_dict['cluster-identification'] }}
organization = {{ slapparameter_dict['cluster-identification'] }}
organizational-unit = {{ instance_parameter_dict['configuration.frontend-name'] }}
organizational-unit = {{ instance_parameter_dict['configuration.frontend-name'] }}
backend-client-caucase-url = {{ slapparameter_dict['backend-client-caucase-url'] }}
backend-client-caucase-url = {{ slapparameter_dict['backend-client-caucase-url'] }}
...
@@ -295,7 +285,6 @@ extra-context =
...
@@ -295,7 +285,6 @@ extra-context =
key backend_client_caucase_url :backend-client-caucase-url
key backend_client_caucase_url :backend-client-caucase-url
import urlparse_module urlparse
import urlparse_module urlparse
import furl_module furl
import furl_module furl
key caddy_executable :caddy_executable
key master_key_download_url :master_key_download_url
key master_key_download_url :master_key_download_url
key autocert caddy-directory:autocert
key autocert caddy-directory:autocert
key caddy_log_directory caddy-directory:slave-log
key caddy_log_directory caddy-directory:slave-log
...
@@ -307,8 +296,6 @@ extra-context =
...
@@ -307,8 +296,6 @@ extra-context =
key software_type :software_type
key software_type :software_type
key frontend_lazy_graceful_reload frontend-caddy-lazy-graceful:rendered
key frontend_lazy_graceful_reload frontend-caddy-lazy-graceful:rendered
key monitor_base_url monitor-instance-parameter:monitor-base-url
key monitor_base_url monitor-instance-parameter:monitor-base-url
key bin_directory :bin_directory
key sixtunnel_executable :sixtunnel_executable
key custom_ssl_directory caddy-directory:custom-ssl-directory
key custom_ssl_directory caddy-directory:custom-ssl-directory
# BBB: SlapOS Master non-zero knowledge BEGIN
# BBB: SlapOS Master non-zero knowledge BEGIN
key apache_certificate apache-certificate:rendered
key apache_certificate apache-certificate:rendered
...
@@ -322,6 +309,7 @@ extra-context =
...
@@ -322,6 +309,7 @@ extra-context =
section frontend_configuration frontend-configuration
section frontend_configuration frontend-configuration
section caddy_configuration caddy-configuration
section caddy_configuration caddy-configuration
section kedifa_configuration kedifa-configuration
section kedifa_configuration kedifa-configuration
section software_parameter_dict software-parameter-section
# Deploy Caddy Frontend with Jinja power
# Deploy Caddy Frontend with Jinja power
[dynamic-caddy-frontend-template]
[dynamic-caddy-frontend-template]
...
@@ -1027,5 +1015,11 @@ config-command =
...
@@ -1027,5 +1015,11 @@ config-command =
{%- if not key.startswith('configuration.') and key not in DROP_KEY_LIST %}
{%- if not key.startswith('configuration.') and key not in DROP_KEY_LIST %}
{{ key }} = {{ dumps(value) }}
{{ key }} = {{ dumps(value) }}
{%- endif -%}
{%- endif -%}
{%- endfor -%}
{%- endfor %}
[software-parameter-section]
{%- for key, value in software_parameter_dict.iteritems() %}
{{ key }} = {{ dumps(value) }}
{%- endfor %}
{%- endif -%} {# if instance_parameter_dict['slap-software-type'] == software_type #}
{%- endif -%} {# if instance_parameter_dict['slap-software-type'] == software_type #}
software/caddy-frontend/templates/apache-custom-slave-list.cfg.in
View file @
0470062a
...
@@ -179,7 +179,7 @@ bytes = 8
...
@@ -179,7 +179,7 @@ bytes = 8
recipe = plone.recipe.command
recipe = plone.recipe.command
stop-on-error = True
stop-on-error = True
file = {{ caddy_configuration_directory }}/.{{ slave_reference }}.htpasswd
file = {{ caddy_configuration_directory }}/.{{ slave_reference }}.htpasswd
command = {{
frontend_configuration
['htpasswd'] }} -cb ${:file} {{ slave_reference.lower() }} {{ '${' + slave_password_section + ':passwd}' }}
command = {{
software_parameter_dict
['htpasswd'] }} -cb ${:file} {{ slave_reference.lower() }} {{ '${' + slave_password_section + ':passwd}' }}
update-command = ${:command}
update-command = ${:command}
{#- ################################################## #}
{#- ################################################## #}
...
@@ -316,7 +316,7 @@ recipe = slapos.cookbook:wrapper
...
@@ -316,7 +316,7 @@ recipe = slapos.cookbook:wrapper
ipv4 = ${slap-network-information:local-ipv4}
ipv4 = ${slap-network-information:local-ipv4}
ipv6 = ${slap-network-information:global-ipv6}
ipv6 = ${slap-network-information:global-ipv6}
wrapper-path = {{ directory['service'] }}/6tunnel-${:ipv6-port}
wrapper-path = {{ directory['service'] }}/6tunnel-${:ipv6-port}
command-line = {{ s
ixtunnel_executable }}
-6 -4 -d -l ${:ipv6} ${:ipv6-port} ${:ipv4} ${:ipv4-port}
command-line = {{ s
oftware_parameter_dict['sixtunnel'] }}/bin/6tunnel
-6 -4 -d -l ${:ipv6} ${:ipv6-port} ${:ipv4} ${:ipv4-port}
hash-existing-files = ${buildout:directory}/software_release/buildout.cfg
hash-existing-files = ${buildout:directory}/software_release/buildout.cfg
[tunnel-6to4-base-http_port]
[tunnel-6to4-base-http_port]
...
@@ -345,7 +345,7 @@ not_found_file = {{ dumps(caddy_configuration['not-found-file']) }}
...
@@ -345,7 +345,7 @@ not_found_file = {{ dumps(caddy_configuration['not-found-file']) }}
[caddy-log-access]
[caddy-log-access]
< = jinja2-template-base
< = jinja2-template-base
template = {{
frontend_configuration.get('template-log-access')
}}
template = {{
software_parameter_dict['template_log_access']
}}
rendered = {{frontend_configuration.get('log-access-configuration')}}
rendered = {{frontend_configuration.get('log-access-configuration')}}
extra-context =
extra-context =
section slave_log_directory slave-log-directory-dict
section slave_log_directory slave-log-directory-dict
...
@@ -357,7 +357,7 @@ local-ipv4 = {{ dumps(instance_parameter_dict['ipv4-random']) }}
...
@@ -357,7 +357,7 @@ local-ipv4 = {{ dumps(instance_parameter_dict['ipv4-random']) }}
global-ipv6 = {{ dumps(global_ipv6) }}
global-ipv6 = {{ dumps(global_ipv6) }}
https-port = {{ frontend_configuration['slave-introspection-https-port'] }}
https-port = {{ frontend_configuration['slave-introspection-https-port'] }}
ip-access-certificate = {{ frontend_configuration.get('ip-access-certificate') }}
ip-access-certificate = {{ frontend_configuration.get('ip-access-certificate') }}
nginx-mime = {{
frontend_configuration
['nginx_mime'] }}
nginx-mime = {{
software_parameter_dict
['nginx_mime'] }}
access-log = {{ dumps(caddy_configuration['slave-introspection-access-log']) }}
access-log = {{ dumps(caddy_configuration['slave-introspection-access-log']) }}
error-log = {{ dumps(caddy_configuration['slave-introspection-error-log']) }}
error-log = {{ dumps(caddy_configuration['slave-introspection-error-log']) }}
var = {{ directory['slave-introspection-var'] }}
var = {{ directory['slave-introspection-var'] }}
...
@@ -365,7 +365,7 @@ pid = {{ caddy_configuration['slave-introspection-pid-file'] }}
...
@@ -365,7 +365,7 @@ pid = {{ caddy_configuration['slave-introspection-pid-file'] }}
[slave-introspection-config]
[slave-introspection-config]
<= jinja2-template-base
<= jinja2-template-base
template = {{
frontend_configuration['slave-introspection-template
'] }}
template = {{
software_parameter_dict['template_slave_introspection_httpd_nginx
'] }}
rendered = {{ frontend_configuration['slave-introspection-configuration'] }}
rendered = {{ frontend_configuration['slave-introspection-configuration'] }}
extra-context =
extra-context =
section slave_log_directory slave-log-directory-dict
section slave_log_directory slave-log-directory-dict
...
@@ -374,7 +374,7 @@ extra-context =
...
@@ -374,7 +374,7 @@ extra-context =
[slave-introspection]
[slave-introspection]
recipe = slapos.cookbook:wrapper
recipe = slapos.cookbook:wrapper
command-line = {{
frontend_configuration
['nginx'] }}
command-line = {{
software_parameter_dict
['nginx'] }}
-c ${slave-introspection-config:rendered}
-c ${slave-introspection-config:rendered}
wrapper-path = {{ directory['service'] }}/slave-instrospection-nginx
wrapper-path = {{ directory['service'] }}/slave-instrospection-nginx
...
@@ -405,7 +405,7 @@ backend-haproxy-statistic-url = {{ statistic_url }}
...
@@ -405,7 +405,7 @@ backend-haproxy-statistic-url = {{ statistic_url }}
[kedifa-updater]
[kedifa-updater]
recipe = slapos.cookbook:wrapper
recipe = slapos.cookbook:wrapper
command-line = {{
kedifa_configuration
['kedifa-updater'] }}
command-line = {{
software_parameter_dict
['kedifa-updater'] }}
--server-ca-certificate {{ kedifa_configuration['ca-certificate'] }}
--server-ca-certificate {{ kedifa_configuration['ca-certificate'] }}
--identity {{ kedifa_configuration['certificate'] }}
--identity {{ kedifa_configuration['certificate'] }}
--master-certificate {{ caddy_configuration['master-certificate'] }}
--master-certificate {{ caddy_configuration['master-certificate'] }}
...
@@ -419,7 +419,7 @@ hash-existing-files = ${buildout:directory}/software_release/buildout.cfg
...
@@ -419,7 +419,7 @@ hash-existing-files = ${buildout:directory}/software_release/buildout.cfg
[kedifa-updater-run]
[kedifa-updater-run]
recipe = plone.recipe.command
recipe = plone.recipe.command
stop-on-error = True
stop-on-error = True
command = {{
kedifa_configuration
['kedifa-updater'] }} --prepare-only ${kedifa-updater-mapping:file} --on-update "{{ caddy_configuration['frontend-graceful-command'] }}"
command = {{
software_parameter_dict
['kedifa-updater'] }} --prepare-only ${kedifa-updater-mapping:file} --on-update "{{ caddy_configuration['frontend-graceful-command'] }}"
update-command = ${:command}
update-command = ${:command}
[kedifa-updater-mapping]
[kedifa-updater-mapping]
...
@@ -468,7 +468,7 @@ csr_work_path = {{ directory['tmp'] }}/${:_buildout_section_name_}
...
@@ -468,7 +468,7 @@ csr_work_path = {{ directory['tmp'] }}/${:_buildout_section_name_}
stop-on-error = False
stop-on-error = False
update-command = ${:command}
update-command = ${:command}
command =
command =
{{
bin_directory
}}/caucase \
{{
software_parameter_dict['bin_directory']
}}/caucase \
--ca-url {{ backend_haproxy_configuration['caucase-url'] }} \
--ca-url {{ backend_haproxy_configuration['caucase-url'] }} \
--ca-crt {{ backend_haproxy_configuration['cas-ca-certificate'] }} \
--ca-crt {{ backend_haproxy_configuration['cas-ca-certificate'] }} \
--crl {{ backend_haproxy_configuration['crl'] }} \
--crl {{ backend_haproxy_configuration['crl'] }} \
...
@@ -512,7 +512,7 @@ csr_work_path = {{ directory['tmp'] }}/${:_buildout_section_name_}
...
@@ -512,7 +512,7 @@ csr_work_path = {{ directory['tmp'] }}/${:_buildout_section_name_}
stop-on-error = False
stop-on-error = False
update-command = ${:command}
update-command = ${:command}
command =
command =
{{
bin_directory
}}/caucase \
{{
software_parameter_dict['bin_directory']
}}/caucase \
--ca-url {{ kedifa_configuration['caucase-url'] }} \
--ca-url {{ kedifa_configuration['caucase-url'] }} \
--ca-crt {{ kedifa_configuration['cas-ca-certificate'] }} \
--ca-crt {{ kedifa_configuration['cas-ca-certificate'] }} \
--crl {{ kedifa_configuration['crl'] }} \
--crl {{ kedifa_configuration['crl'] }} \
...
@@ -564,7 +564,7 @@ depends =
...
@@ -564,7 +564,7 @@ depends =
${store-csr_id:command}
${store-csr_id:command}
${store-backend-haproxy-csr_id:command}
${store-backend-haproxy-csr_id:command}
recipe = slapos.cookbook:wrapper
recipe = slapos.cookbook:wrapper
command-line = {{
caddy_executable
}}
command-line = {{
software_parameter_dict['caddy']
}}
-conf ${expose-csr_id-template:rendered}
-conf ${expose-csr_id-template:rendered}
-log ${expose-csr_id-configuration:error-log}
-log ${expose-csr_id-configuration:error-log}
-http2=true
-http2=true
...
...
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