mirror of
https://github.com/Luzifer/nginx-sso.git
synced 2024-12-20 12:51:17 +00:00
Add health-endpoint, fix copy on empty dir
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
cae187e39c
commit
f7685d6502
2 changed files with 8 additions and 7 deletions
|
@ -2,16 +2,16 @@
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
# Copy frontend if not available
|
# Copy frontend if not available
|
||||||
[ -d /data/frontend ] || cp -r /usr/local/share/nginx-sso/frontend /data/frontend
|
[ -d /data/frontend/index.html ] || cp -r /usr/local/share/nginx-sso/frontend /data/frontend
|
||||||
|
|
||||||
[ -e /data/config.yaml ] || {
|
[ -e /data/config.yaml ] || {
|
||||||
cp /usr/local/share/nginx-sso/config.yaml /data/config.yaml
|
cp /usr/local/share/nginx-sso/config.yaml /data/config.yaml
|
||||||
echo "An example configuration was copied to /data/config.yaml - You want to edit that one!"
|
echo "An example configuration was copied to /data/config.yaml - You want to edit that one!"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
echo "Starting nginx-sso"
|
echo "Starting nginx-sso"
|
||||||
exec /usr/local/bin/nginx-sso \
|
exec /usr/local/bin/nginx-sso \
|
||||||
--config /data/config.yaml \
|
--config /data/config.yaml \
|
||||||
--frontend-dir /data/frontend \
|
--frontend-dir /data/frontend \
|
||||||
$@
|
$@
|
||||||
|
|
1
main.go
1
main.go
|
@ -133,6 +133,7 @@ func main() {
|
||||||
http.HandleFunc("/", handleRootRequest)
|
http.HandleFunc("/", handleRootRequest)
|
||||||
http.HandleFunc("/auth", handleAuthRequest)
|
http.HandleFunc("/auth", handleAuthRequest)
|
||||||
http.HandleFunc("/debug", handleLoginDebug)
|
http.HandleFunc("/debug", handleLoginDebug)
|
||||||
|
http.HandleFunc("/health", func(w http.ResponseWriter, r *http.Request) { w.Write([]byte("OK")) })
|
||||||
http.HandleFunc("/login", handleLoginRequest)
|
http.HandleFunc("/login", handleLoginRequest)
|
||||||
http.HandleFunc("/logout", handleLogoutRequest)
|
http.HandleFunc("/logout", handleLogoutRequest)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue