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
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
Thomas Gambier
slapos
Commits
2112ee3c
Commit
2112ee3c
authored
3 years ago
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
caddy-frontend: Fix log destination for failover access
parent
af9ab301
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
2 deletions
+25
-2
software/caddy-frontend/buildout.hash.cfg
software/caddy-frontend/buildout.hash.cfg
+1
-1
software/caddy-frontend/templates/backend-haproxy-rsyslogd.conf.in
...caddy-frontend/templates/backend-haproxy-rsyslogd.conf.in
+1
-1
software/caddy-frontend/test/test.py
software/caddy-frontend/test/test.py
+23
-0
No files found.
software/caddy-frontend/buildout.hash.cfg
View file @
2112ee3c
...
@@ -110,7 +110,7 @@ md5sum = 225ce18b9218de4169327a206051a92e
...
@@ -110,7 +110,7 @@ md5sum = 225ce18b9218de4169327a206051a92e
[template-backend-haproxy-rsyslogd-conf]
[template-backend-haproxy-rsyslogd-conf]
_update_hash_filename_ = templates/backend-haproxy-rsyslogd.conf.in
_update_hash_filename_ = templates/backend-haproxy-rsyslogd.conf.in
md5sum = 3
ec9e088817f6a0e3b3b71919590e6b3
md5sum = 3
336d554661b138dcef97b1d1866803c
[template-slave-introspection-httpd-nginx]
[template-slave-introspection-httpd-nginx]
_update_hash_filename_ = templates/slave-introspection-httpd-nginx.conf.in
_update_hash_filename_ = templates/slave-introspection-httpd-nginx.conf.in
...
...
This diff is collapsed.
Click to expand it.
software/caddy-frontend/templates/backend-haproxy-rsyslogd.conf.in
View file @
2112ee3c
...
@@ -16,7 +16,7 @@ $Umask 0022
...
@@ -16,7 +16,7 @@ $Umask 0022
$WorkDirectory {{ configuration['spool-directory'] }}
$WorkDirectory {{ configuration['spool-directory'] }}
# Setup logging per slave, by extracting the slave name from the log stream
# Setup logging per slave, by extracting the slave name from the log stream
{%- set regex = ".*-backend (.*)-http.{0,1}/" %}
{%- set regex = ".*-backend (.*)-http.{0,1}
(|-failover)
/" %}
template(name="extract_slave_name" type="string" string="%msg:R,ERE,1,FIELD:{{ regex }}--end%")
template(name="extract_slave_name" type="string" string="%msg:R,ERE,1,FIELD:{{ regex }}--end%")
set $!slave_name = exec_template("extract_slave_name");
set $!slave_name = exec_template("extract_slave_name");
template(name="slave_output" type="string" string="{{ configuration['caddy-log-directory'] }}/%$!slave_name%_backend_log")
template(name="slave_output" type="string" string="{{ configuration['caddy-log-directory'] }}/%$!slave_name%_backend_log")
...
...
This diff is collapsed.
Click to expand it.
software/caddy-frontend/test/test.py
View file @
2112ee3c
...
@@ -7329,9 +7329,32 @@ backend _health-check-default-http
...
@@ -7329,9 +7329,32 @@ backend _health-check-default-http
self
.
assertEqualResultJson
(
self
.
assertEqualResultJson
(
result
,
'Path'
,
'/failover-https-url?a=b&c=/failoverpath'
)
result
,
'Path'
,
'/failover-https-url?a=b&c=/failoverpath'
)
self
.
assertLastLogLineRegexp
(
'_health-check-failover-url_backend_log'
,
r'^\
d{
1,3}\
.
\d{1,3}\
.
\d{1,3}\
.
\d{1,3}:\
d+
'
r'
\
[
\
d
{
2
}
\
/
.{
3
}
\
/
\
d
{
4
}
\
:
\
d
{
2
}
\
:
\
d
{
2
}
\
:
\
d
{
2
}.
\
d
{
3
}
\
]
'
r'
https
-
backend
_health
-
check
-
failover
-
url
-
https
-
failover
'
r'
\
/
_health
-
check
-
failover
-
url
-
backend
'
r'
\
d
+/
\
d
+
\
/
\
d
+
\
/
\
d
+
\
/
\
d
+
'
r'
200
\
d
+
-
-
----
'
r'
\
d
+
\
/
\
d
+
\
/
\
d
+
\
/
\
d
+
\
/
\
d
+
\
d
+
\
/
\
d
+
'
r'"GET /failoverpath HTTP/1.1"'
)
result = fakeHTTPResult(parameter_dict['
domain
'], '
/
failoverpath
')
result = fakeHTTPResult(parameter_dict['
domain
'], '
/
failoverpath
')
self.assertEqualResultJson(
self.assertEqualResultJson(
result, '
Path
', '
/
failover
-
url
?
a
=
b
&
c
=/
failoverpath
')
result, '
Path
', '
/
failover
-
url
?
a
=
b
&
c
=/
failoverpath
')
self.assertLastLogLineRegexp(
'
_health
-
check
-
failover
-
url_backend_log
',
r'
^
\
d
{
1
,
3
}
\
.
\
d
{
1
,
3
}
\
.
\
d
{
1
,
3
}
\
.
\
d
{
1
,
3
}:
\
d
+
'
r'
\
[
\
d
{
2
}
\
/
.{
3
}
\
/
\
d
{
4
}
\
:
\
d
{
2
}
\
:
\
d
{
2
}
\
:
\
d
{
2
}.
\
d
{
3
}
\
]
'
r'
http
-
backend
_health
-
check
-
failover
-
url
-
http
-
failover
'
r'
\
/
_health
-
check
-
failover
-
url
-
backend
'
r'
\
d
+/
\
d
+
\
/
\
d
+
\
/
\
d
+
\
/
\
d
+
'
r'
200
\
d
+
-
-
----
'
r'
\
d
+
\
/
\
d
+
\
/
\
d
+
\
/
\
d
+
\
/
\
d
+
\
d
+
\
/
\
d
+
'
r'"GET /failoverpath HTTP/1.1"'
)
def test_health_check_failover_url_auth_to_backend(self):
def test_health_check_failover_url_auth_to_backend(self):
parameter_dict = self.assertSlaveBase(
parameter_dict = self.assertSlaveBase(
...
...
This diff is collapsed.
Click to expand it.
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