diff --git a/docker-start.sh b/docker-start.sh index a967ba6..7e225ea 100755 --- a/docker-start.sh +++ b/docker-start.sh @@ -2,16 +2,16 @@ 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 - echo "An example configuration was copied to /data/config.yaml - You want to edit that one!" - exit 1 + 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!" + exit 1 } echo "Starting nginx-sso" exec /usr/local/bin/nginx-sso \ - --config /data/config.yaml \ - --frontend-dir /data/frontend \ - $@ + --config /data/config.yaml \ + --frontend-dir /data/frontend \ + $@ diff --git a/main.go b/main.go index bf80f3d..470e21e 100644 --- a/main.go +++ b/main.go @@ -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)