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
Łukasz Nowak
slapos
Commits
1ab02f15
Commit
1ab02f15
authored
Jan 13, 2021
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
paczynek
parent
7ae4d914
Pipeline
#13103
running with stage
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
3 deletions
+18
-3
software/caddy-frontend/buildout.hash.cfg
software/caddy-frontend/buildout.hash.cfg
+2
-2
software/caddy-frontend/templates/apache-custom-slave-list.cfg.in
.../caddy-frontend/templates/apache-custom-slave-list.cfg.in
+1
-1
software/caddy-frontend/templates/frontend-haproxy.cfg.in
software/caddy-frontend/templates/frontend-haproxy.cfg.in
+15
-0
No files found.
software/caddy-frontend/buildout.hash.cfg
View file @
1ab02f15
...
...
@@ -30,7 +30,7 @@ md5sum = 5fb1da6ff50234870f25a86ae51f5d5e
[profile-slave-list]
_update_hash_filename_ = templates/apache-custom-slave-list.cfg.in
md5sum =
df4d0f71ec7bfc6cfc2650a3623de32a
md5sum =
a54fbc7d97cfc9bd32b819f51465c184
[profile-replicate-publish-slave-information]
_update_hash_filename_ = templates/replicate-publish-slave-information.cfg.in
...
...
@@ -38,7 +38,7 @@ md5sum = df304a8aee87b6f2425241016a48f7a5
[template-frontend-haproxy-configuration]
_update_hash_filename_ = templates/frontend-haproxy.cfg.in
md5sum = 6
6a197ba35871f6ea2c0607a3ca873e8
md5sum = 6
5e066c2522cdadef33e5b2d3f05b286
[template-not-found-html]
_update_hash_filename_ = templates/notfound.html
...
...
software/caddy-frontend/templates/apache-custom-slave-list.cfg.in
View file @
1ab02f15
...
...
@@ -54,7 +54,7 @@ context =
{#- * stabilise values for backend #}
{%- for key, prefix in [('url', 'http_backend'), ('https-url', 'https_backend')] %}
{%- set parsed = urlparse_module.urlparse(slave_instance.get(key, '').strip()) %}
{%- set info_dict = {'scheme': parsed.scheme, 'hostname': parsed.hostname, 'port': parsed.port or DEFAULT_PORT[parsed.scheme], 'path':
parsed.path, 'fragment': parsed.fragment
} %}
{%- set info_dict = {'scheme': parsed.scheme, 'hostname': parsed.hostname, 'port': parsed.port or DEFAULT_PORT[parsed.scheme], 'path':
(parsed.path or '').rstrip('/')
} %}
{%- do slave_instance.__setitem__(prefix, info_dict) %}
{%- endfor %}
{%- do slave_instance.__setitem__('ssl_proxy_verify', ('' ~ slave_instance.get('ssl-proxy-verify', '')).lower() in TRUE_VALUES) %}
...
...
software/caddy-frontend/templates/frontend-haproxy.cfg.in
View file @
1ab02f15
...
...
@@ -61,8 +61,23 @@ frontend https-frontend
{{ frontend_entry(slave_instance, 'https', True) }}
{%- endfor %}
# Backends
{%- for slave_instance in frontend_slave_list %}
{%- for (scheme, prefix) in SCHEME_PREFIX_MAPPING.items() %}
{%- set info_dict = slave_instance[prefix] %}
{%- if info_dict['hostname'] and info_dict['port'] %}
backend {{ slave_instance['slave_reference'] }}-{{ scheme }}
{%- if scheme == 'http' and slave_instance['https-only'] %}
redirect scheme https code 302
{%- else %}
server {{ slave_instance['slave_reference'] }}-backend {{ info_dict['hostname'] }}:{{ info_dict['port'] }}
{%- if info_dict['path'] %}
http-request set-path {{ info_dict['path'] }}%[path]
{%- endif %} {# if info_dict['path'] #}
{%- endif %} {# if scheme == 'http' and slave_instance['https-only'] #}
{%- endif %} {# if info_dict['hostname'] and info_dict['port'] #}
{%- endfor %} {# for (scheme, prefix) in SCHEME_PREFIX_MAPPING.items() #}
{%- for k, v in slave_instance.items() %}
{#- # {{ k }} => {{ v }} #}
{%- endfor %}
{%- endfor %}
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