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
Paul Graydon
slapos
Commits
1593304e
Commit
1593304e
authored
Feb 02, 2021
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
caddy-frontend: Support query string of the backend url
parent
bb56f2d7
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
8 deletions
+14
-8
software/caddy-frontend/CHANGES.caddy_frontend.rst
software/caddy-frontend/CHANGES.caddy_frontend.rst
+1
-0
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/backend-haproxy.cfg.in
software/caddy-frontend/templates/backend-haproxy.cfg.in
+6
-1
software/caddy-frontend/test/test.py
software/caddy-frontend/test/test.py
+4
-4
No files found.
software/caddy-frontend/CHANGES.caddy_frontend.rst
View file @
1593304e
...
...
@@ -19,6 +19,7 @@ Here are listed the most important changes, which might affect upgrades.
* feature: dropped not used parameters
* feature: Strict-Transport-Security aka HSTS
* fix: use kedifa with with for file with multiple CAs
* feature: support query string (the characters after ? in the url) in url and https-url
1.0.164 (2020-09-24)
--------------------
...
...
software/caddy-frontend/buildout.hash.cfg
View file @
1593304e
...
...
@@ -30,7 +30,7 @@ md5sum = 7cb8157d2b368ab3b281ea42f743eb9c
[profile-slave-list]
_update_hash_filename_ = templates/apache-custom-slave-list.cfg.in
md5sum =
772c04c165fdae91299fd909e061f926
md5sum =
5f2c1f3f8eebc8f3453c223b30459722
[profile-replicate-publish-slave-information]
_update_hash_filename_ = templates/replicate-publish-slave-information.cfg.in
...
...
@@ -50,7 +50,7 @@ md5sum = a0ae858a3db8825c22d33d323392f588
[template-backend-haproxy-configuration]
_update_hash_filename_ = templates/backend-haproxy.cfg.in
md5sum =
0923a9227c131d2f1e11d7ddd5b15673
md5sum =
d86ae2fcf89deaa08d791da12d5897e4
[template-empty]
_update_hash_filename_ = templates/empty.in
...
...
software/caddy-frontend/templates/apache-custom-slave-list.cfg.in
View file @
1593304e
...
...
@@ -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, 'fragment': parsed.fragment
, 'query': parsed.query
} %}
{%- 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/backend-haproxy.cfg.in
View file @
1593304e
...
...
@@ -92,7 +92,12 @@ frontend https-backend
backend {{ slave_instance['slave_reference'] }}-{{ scheme }}
{%- set hostname = info_dict['hostname'] %}
{%- set port = info_dict['port'] %}
{%- set path = info_dict['path'].rstrip('/') %}
{%- set path_list = [info_dict['path'].rstrip('/')] %}
{%- set query = info_dict['query'] %}
{%- if query %}
{%- do path_list.append(query) %}
{%- endif %}
{%- set path = '?'.join(path_list) %}
{%- if hostname and port %}
timeout server {{ slave_instance['request-timeout'] }}s
timeout connect {{ slave_instance['backend-connect-timeout'] }}s
...
...
software/caddy-frontend/test/test.py
View file @
1593304e
...
...
@@ -1278,7 +1278,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
'Url'
:
{
# make URL "incorrect", with whitespace, nevertheless it shall be
# correctly handled
'url'
:
' '
+
cls
.
backend_url
+
' '
,
'url'
:
' '
+
cls
.
backend_url
+
'
/?a=b&c='
+
'
'
,
# authenticating to http backend shall be no-op
'authenticate-to-backend'
:
True
,
},
...
...
@@ -1683,8 +1683,8 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
},
'warning-slave-dict'
:
{
'_Url'
:
[
"slave url ' %(backend)s
' has been converted to '%(backend)s'"
%
{
'backend'
:
self
.
backend_url
}]}
"slave url ' %(backend)s
/?a=b&c= ' has been converted to "
"'%(backend)s/?a=b&c='"
%
{
'backend'
:
self
.
backend_url
}]}
}
self
.
assertEqual
(
...
...
@@ -1833,7 +1833,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
'secure_access'
:
'https://%s.example.com'
%
(
hostname
,
),
'backend-client-caucase-url'
:
'http://[%s]:8990'
%
self
.
_ipv6_address
,
'warning-list'
:
[
"slave url ' %s
' has been converted to '%s
'"
%
(
"slave url ' %s
/?a=b&c= ' has been converted to '%s/?a=b&c=
'"
%
(
self
.
backend_url
,
self
.
backend_url
)],
},
parameter_dict
...
...
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