Spaces:
Sleeping
Sleeping
udbhav commited on
Commit ·
df81979
1
Parent(s): 3386db2
added certi
Browse files- entrypoint.sh +34 -9
entrypoint.sh
CHANGED
|
@@ -1,22 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
#!/bin/bash
|
| 2 |
set -e
|
| 3 |
|
| 4 |
-
#
|
| 5 |
if [ -n "$CORP_CERT1" ]; then
|
| 6 |
-
echo "$CORP_CERT1" | base64 -d
|
| 7 |
fi
|
| 8 |
if [ -n "$CORP_CERT2" ]; then
|
| 9 |
-
echo "$CORP_CERT2" | base64 -d
|
| 10 |
fi
|
| 11 |
if [ -n "$CORP_CERT3" ]; then
|
| 12 |
-
echo "$CORP_CERT3" | base64 -d
|
| 13 |
fi
|
| 14 |
if [ -n "$CORP_CERT4" ]; then
|
| 15 |
-
echo "$CORP_CERT4" | base64 -d
|
| 16 |
fi
|
| 17 |
|
| 18 |
-
# Update CA store if any certs were added
|
| 19 |
-
update-ca-certificates || true
|
| 20 |
|
| 21 |
-
#
|
| 22 |
-
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# #!/bin/bash
|
| 2 |
+
# set -e
|
| 3 |
+
|
| 4 |
+
# # If secrets exist, decode them
|
| 5 |
+
# if [ -n "$CORP_CERT1" ]; then
|
| 6 |
+
# echo "$CORP_CERT1" | base64 -d > /usr/local/share/ca-certificates/corp_cert1.crt
|
| 7 |
+
# fi
|
| 8 |
+
# if [ -n "$CORP_CERT2" ]; then
|
| 9 |
+
# echo "$CORP_CERT2" | base64 -d > /usr/local/share/ca-certificates/corp_cert2.crt
|
| 10 |
+
# fi
|
| 11 |
+
# if [ -n "$CORP_CERT3" ]; then
|
| 12 |
+
# echo "$CORP_CERT3" | base64 -d > /usr/local/share/ca-certificates/corp_cert3.crt
|
| 13 |
+
# fi
|
| 14 |
+
# if [ -n "$CORP_CERT4" ]; then
|
| 15 |
+
# echo "$CORP_CERT4" | base64 -d > /usr/local/share/ca-certificates/corp_cert4.crt
|
| 16 |
+
# fi
|
| 17 |
+
|
| 18 |
+
# # Update CA store if any certs were added
|
| 19 |
+
# update-ca-certificates || true
|
| 20 |
+
|
| 21 |
+
# # Finally run your app
|
| 22 |
+
# exec python app.py
|
| 23 |
+
|
| 24 |
+
|
| 25 |
#!/bin/bash
|
| 26 |
set -e
|
| 27 |
|
| 28 |
+
# Only root can write certs
|
| 29 |
if [ -n "$CORP_CERT1" ]; then
|
| 30 |
+
echo "$CORP_CERT1" | base64 -d | sudo tee /usr/local/share/ca-certificates/corp_cert1.crt > /dev/null
|
| 31 |
fi
|
| 32 |
if [ -n "$CORP_CERT2" ]; then
|
| 33 |
+
echo "$CORP_CERT2" | base64 -d | sudo tee /usr/local/share/ca-certificates/corp_cert2.crt > /dev/null
|
| 34 |
fi
|
| 35 |
if [ -n "$CORP_CERT3" ]; then
|
| 36 |
+
echo "$CORP_CERT3" | base64 -d | sudo tee /usr/local/share/ca-certificates/corp_cert3.crt > /dev/null
|
| 37 |
fi
|
| 38 |
if [ -n "$CORP_CERT4" ]; then
|
| 39 |
+
echo "$CORP_CERT4" | base64 -d | sudo tee /usr/local/share/ca-certificates/corp_cert4.crt > /dev/null
|
| 40 |
fi
|
| 41 |
|
|
|
|
|
|
|
| 42 |
|
| 43 |
+
# Update CA store
|
| 44 |
+
sudo update-ca-certificates || true
|
| 45 |
+
|
| 46 |
+
# Drop back to default CMD
|
| 47 |
+
exec "$@"
|