#!/usr/bin/env bash # ============================================================================= # Container entrypoint (Hugging Face Spaces / Docker). # # Streamlit native auth reads its [auth] config from .streamlit/secrets.toml, # which is gitignored (it holds the client secret). On HF there's no such file, # so we materialise it here from Space secrets (injected as env vars) before # launching Streamlit. Local dev doesn't use this script — it runs # `streamlit run` directly against the local .streamlit/secrets.toml. # # Required HF Space secrets/variables: # AUTH_CLIENT_ID, AUTH_CLIENT_SECRET, AUTH_COOKIE_SECRET, # AUTH_REDIRECT_URI, AUTH_SERVER_METADATA_URL # ============================================================================= set -e if [ -n "$AUTH_CLIENT_ID" ]; then mkdir -p .streamlit cat > .streamlit/secrets.toml <