Commit
•
41fa590
1
Parent(s):
470ab93
add oauth
Browse files- README.md +4 -0
- docker-entrypoint-wrapper.sh +8 -0
README.md
CHANGED
@@ -6,6 +6,10 @@ colorTo: indigo
|
|
6 |
sdk: docker
|
7 |
pinned: false
|
8 |
app_port: 3000
|
|
|
|
|
|
|
|
|
9 |
---
|
10 |
|
11 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
6 |
sdk: docker
|
7 |
pinned: false
|
8 |
app_port: 3000
|
9 |
+
hf_oauth: true
|
10 |
+
hf_oauth_expiration_minutes: 480
|
11 |
+
hf_oauth_scopes:
|
12 |
+
- email
|
13 |
---
|
14 |
|
15 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
docker-entrypoint-wrapper.sh
CHANGED
@@ -53,6 +53,14 @@ export HOSTNAME="0.0.0.0"
|
|
53 |
export HOST="0.0.0.0"
|
54 |
export PORT=3000
|
55 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
56 |
# Start Next.js in the background
|
57 |
echo "Starting Next.js..."
|
58 |
./web/entrypoint.sh node ./web/server.js \
|
|
|
53 |
export HOST="0.0.0.0"
|
54 |
export PORT=3000
|
55 |
|
56 |
+
# Preset oauth env vars based on injected space variables
|
57 |
+
# See https://huggingface.co/docs/hub/en/spaces-oauth#create-an-oauth-app
|
58 |
+
export AUTH_CUSTOM_CLIENT_ID=$OAUTH_CLIENT_ID
|
59 |
+
export AUTH_CUSTOM_CLIENT_SECRET=$OAUTH_CLIENT_SECRET
|
60 |
+
export AUTH_CUSTOM_ISSUER=$OPENID_PROVIDER_URL
|
61 |
+
export AUTH_CUSTOM_SCOPE=$OAUTH_SCOPES
|
62 |
+
export AUTH_CUSTOM_NAME="Hugging Face"
|
63 |
+
|
64 |
# Start Next.js in the background
|
65 |
echo "Starting Next.js..."
|
66 |
./web/entrypoint.sh node ./web/server.js \
|