1
0
Fork 0
mirror of https://github.com/Luzifer/nginx-sso.git synced 2024-10-18 07:34:22 +00:00

Add health-endpoint, fix copy on empty dir

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2022-12-21 00:59:07 +01:00
parent cae187e39c
commit f7685d6502
Signed by: luzifer
GPG key ID: D91C3E91E4CAD6F5
2 changed files with 8 additions and 7 deletions

View file

@ -2,7 +2,7 @@
set -euo pipefail
# 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 ] || {
cp /usr/local/share/nginx-sso/config.yaml /data/config.yaml

View file

@ -133,6 +133,7 @@ func main() {
http.HandleFunc("/", handleRootRequest)
http.HandleFunc("/auth", handleAuthRequest)
http.HandleFunc("/debug", handleLoginDebug)
http.HandleFunc("/health", func(w http.ResponseWriter, r *http.Request) { w.Write([]byte("OK")) })
http.HandleFunc("/login", handleLoginRequest)
http.HandleFunc("/logout", handleLogoutRequest)