Download entrypoint.sh from Menixis/auto-form: direct link, hf CLI and curl.
- Browser
- Download file 1.37 kB
-
https://huggingface.co/spaces/Menixis/auto-form/resolve/main/entrypoint.sh
- Command line
-
hf download hf://spaces/Menixis/auto-form/entrypoint.sh
-
curl -L -o entrypoint.sh https://huggingface.co/spaces/Menixis/auto-form/resolve/main/entrypoint.sh
1.37 kB
| # ============================================================================= | |
| # 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 <<EOF | |
| [auth] | |
| redirect_uri = "${AUTH_REDIRECT_URI}" | |
| cookie_secret = "${AUTH_COOKIE_SECRET}" | |
| client_id = "${AUTH_CLIENT_ID}" | |
| client_secret = "${AUTH_CLIENT_SECRET}" | |
| server_metadata_url = "${AUTH_SERVER_METADATA_URL}" | |
| EOF | |
| echo "[entrypoint] wrote .streamlit/secrets.toml from Space secrets" | |
| else | |
| echo "[entrypoint] WARNING: AUTH_CLIENT_ID not set — sign-in will not work until the Space secrets are configured" | |
| fi | |
| exec streamlit run streamlit_app.py --server.port "${PORT:-7860}" --server.address 0.0.0.0 | |