mirror of
https://github.com/0rangebananaspy/authelia.git
synced 2024-09-14 22:47:21 +07:00
fix(suites): fix passive health checks for caddy suite (#3627)
This change fixes an issue that was incorrectly marking the primary load balancer target for the front end in dev mode as down.
This commit is contained in:
parent
60e1a9451b
commit
0f7da4fd90
|
@ -40,7 +40,6 @@ login.example.com:8080 {
|
||||||
fail_duration 10s
|
fail_duration 10s
|
||||||
max_fails 1
|
max_fails 1
|
||||||
unhealthy_status 5xx
|
unhealthy_status 5xx
|
||||||
unhealthy_request_count 1
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
7
internal/suites/example/compose/caddy/Dockerfile
Normal file
7
internal/suites/example/compose/caddy/Dockerfile
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
FROM caddy:2.5.1-builder AS builder
|
||||||
|
|
||||||
|
RUN xcaddy build fix-empty-copy-headers
|
||||||
|
|
||||||
|
FROM caddy:2.5.1
|
||||||
|
|
||||||
|
COPY --from=builder /usr/bin/caddy /usr/bin/caddy
|
|
@ -2,6 +2,7 @@
|
||||||
version: '3'
|
version: '3'
|
||||||
services:
|
services:
|
||||||
caddy:
|
caddy:
|
||||||
|
# build: ./example/compose/caddy/ # used for debugging
|
||||||
image: caddy:2.5.1-alpine
|
image: caddy:2.5.1-alpine
|
||||||
volumes:
|
volumes:
|
||||||
- ./example/compose/caddy/Caddyfile:/etc/caddy/Caddyfile
|
- ./example/compose/caddy/Caddyfile:/etc/caddy/Caddyfile
|
||||||
|
|
|
@ -251,7 +251,7 @@ http {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Example configuration of domains protected by Authelia.
|
# Example configuration of domains protected by Authelia.
|
||||||
server {
|
server {
|
||||||
listen 8080 ssl;
|
listen 8080 ssl;
|
||||||
server_name oidc.example.com
|
server_name oidc.example.com
|
||||||
|
|
|
@ -1,29 +1,14 @@
|
||||||
package suites
|
package suites
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
"strings"
|
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/go-rod/rod"
|
"github.com/go-rod/rod"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"github.com/stretchr/testify/require"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func (rs *RodSession) verifyBodyContains(t *testing.T, page *rod.Page, pattern string) {
|
func (rs *RodSession) verifyBodyContains(t *testing.T, page *rod.Page, pattern string) {
|
||||||
body, err := page.Element("body")
|
body, err := page.ElementR("body", pattern)
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
assert.NotNil(t, body)
|
assert.NotNil(t, body)
|
||||||
|
|
||||||
text, err := body.Text()
|
|
||||||
assert.NoError(t, err)
|
|
||||||
assert.NotNil(t, text)
|
|
||||||
|
|
||||||
if strings.Contains(text, pattern) {
|
|
||||||
err = nil
|
|
||||||
} else {
|
|
||||||
err = fmt.Errorf("body does not contain pattern: %s", pattern)
|
|
||||||
}
|
|
||||||
|
|
||||||
require.NoError(t, err)
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user