Spaces:
Sleeping
Sleeping
udbhav commited on
Commit ·
164917f
1
Parent(s): 0e6a3ee
added certi
Browse files- entrypoint.sh +8 -3
entrypoint.sh
CHANGED
|
@@ -25,8 +25,10 @@
|
|
| 25 |
#!/bin/bash
|
| 26 |
set -e
|
| 27 |
|
|
|
|
| 28 |
mkdir -p /app/certs
|
| 29 |
|
|
|
|
| 30 |
if [ -n "$CORP_CERT1" ]; then
|
| 31 |
echo "$CORP_CERT1" | base64 -d > /app/certs/corp_cert1.crt
|
| 32 |
fi
|
|
@@ -40,11 +42,14 @@ if [ -n "$CORP_CERT4" ]; then
|
|
| 40 |
echo "$CORP_CERT4" | base64 -d > /app/certs/corp_cert4.crt
|
| 41 |
fi
|
| 42 |
|
| 43 |
-
# Build a single bundle
|
| 44 |
cat /app/certs/*.crt > /app/certs/corp_bundle.crt 2>/dev/null || true
|
| 45 |
|
| 46 |
-
#
|
| 47 |
export REQUESTS_CA_BUNDLE=/app/certs/corp_bundle.crt
|
| 48 |
|
| 49 |
-
|
|
|
|
| 50 |
|
|
|
|
|
|
|
|
|
| 25 |
#!/bin/bash
|
| 26 |
set -e
|
| 27 |
|
| 28 |
+
# Make a writable certs directory
|
| 29 |
mkdir -p /app/certs
|
| 30 |
|
| 31 |
+
# Decode base64 certs from Hugging Face Secrets (if present)
|
| 32 |
if [ -n "$CORP_CERT1" ]; then
|
| 33 |
echo "$CORP_CERT1" | base64 -d > /app/certs/corp_cert1.crt
|
| 34 |
fi
|
|
|
|
| 42 |
echo "$CORP_CERT4" | base64 -d > /app/certs/corp_cert4.crt
|
| 43 |
fi
|
| 44 |
|
| 45 |
+
# Build a single bundle (ignore errors if no certs provided)
|
| 46 |
cat /app/certs/*.crt > /app/certs/corp_bundle.crt 2>/dev/null || true
|
| 47 |
|
| 48 |
+
# Point Python + requests + huggingface_hub to this bundle
|
| 49 |
export REQUESTS_CA_BUNDLE=/app/certs/corp_bundle.crt
|
| 50 |
|
| 51 |
+
echo "✅ Corporate certs configured (if provided)."
|
| 52 |
+
echo "🔗 REQUESTS_CA_BUNDLE set to $REQUESTS_CA_BUNDLE"
|
| 53 |
|
| 54 |
+
# Run the actual app
|
| 55 |
+
exec "$@"
|