outposts/proxy: detect empty authentik_host
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
parent
26fd66d831
commit
a15571bd3e
|
@ -12,7 +12,7 @@
|
||||||
![Docker pulls](https://img.shields.io/docker/pulls/beryju/authentik.svg?style=for-the-badge)
|
![Docker pulls](https://img.shields.io/docker/pulls/beryju/authentik.svg?style=for-the-badge)
|
||||||
![Latest version](https://img.shields.io/docker/v/beryju/authentik?sort=semver&style=for-the-badge)
|
![Latest version](https://img.shields.io/docker/v/beryju/authentik?sort=semver&style=for-the-badge)
|
||||||
![LGTM Grade](https://img.shields.io/lgtm/grade/python/github/goauthentik/authentik?style=for-the-badge)
|
![LGTM Grade](https://img.shields.io/lgtm/grade/python/github/goauthentik/authentik?style=for-the-badge)
|
||||||
[Transifex](https://www.transifex.com/beryjuorg/authentik/)
|
[![](https://img.shields.io/badge/Help%20translate-transifex-blue?style=for-the-badge)](https://www.transifex.com/beryjuorg/authentik/)
|
||||||
|
|
||||||
## What is authentik?
|
## What is authentik?
|
||||||
|
|
||||||
|
|
|
@ -39,8 +39,8 @@ func intToPointer(i int) *int {
|
||||||
func (pb *providerBundle) replaceLocal(url string) string {
|
func (pb *providerBundle) replaceLocal(url string) string {
|
||||||
if strings.HasPrefix(url, "http://localhost:8000") {
|
if strings.HasPrefix(url, "http://localhost:8000") {
|
||||||
authentikHost, c := pb.s.ak.Outpost.Config["authentik_host"]
|
authentikHost, c := pb.s.ak.Outpost.Config["authentik_host"]
|
||||||
if !c {
|
if !c || authentikHost == "" {
|
||||||
pb.log.Warning("Outpost has localhost API Connection but no authentik_host is configured.")
|
pb.log.Warning("Outpost has localhost/blank API Connection but no authentik_host is configured.")
|
||||||
return url
|
return url
|
||||||
}
|
}
|
||||||
f := strings.ReplaceAll(url, "http://localhost:8000", authentikHost.(string))
|
f := strings.ReplaceAll(url, "http://localhost:8000", authentikHost.(string))
|
||||||
|
|
Reference in New Issue