Upload 17 files
Browse files- entrypoint.sh +7 -7
entrypoint.sh
CHANGED
|
@@ -1,16 +1,16 @@
|
|
| 1 |
#!/bin/sh
|
| 2 |
set -e
|
| 3 |
|
| 4 |
-
# This script configures and runs the application with proxychains if
|
| 5 |
# It is designed to be the ENTRYPOINT of a Docker container.
|
| 6 |
|
| 7 |
-
if [ -n "$
|
| 8 |
-
echo "
|
| 9 |
|
| 10 |
-
# Extract details from
|
| 11 |
# Format: http://user:pass@host:port
|
| 12 |
-
PROTO=$(echo "$
|
| 13 |
-
URL_NO_PROTO=$(echo "$
|
| 14 |
USER_PASS=$(echo "$URL_NO_PROTO" | grep -o '.*@' | sed 's/@//')
|
| 15 |
HOST_PORT=$(echo "$URL_NO_PROTO" | sed -e "s,$USER_PASS@,,g")
|
| 16 |
HOST=$(echo "$HOST_PORT" | cut -d: -f1)
|
|
@@ -49,7 +49,7 @@ EOF
|
|
| 49 |
# Execute the command passed to the script, wrapped in proxychains
|
| 50 |
exec proxychains4 "$@"
|
| 51 |
else
|
| 52 |
-
echo "
|
| 53 |
# Execute the command as is
|
| 54 |
exec "$@"
|
| 55 |
fi
|
|
|
|
| 1 |
#!/bin/sh
|
| 2 |
set -e
|
| 3 |
|
| 4 |
+
# This script configures and runs the application with proxychains if STASTIC_PROXY is set.
|
| 5 |
# It is designed to be the ENTRYPOINT of a Docker container.
|
| 6 |
|
| 7 |
+
if [ -n "$STASTIC_PROXY" ]; then
|
| 8 |
+
echo "STASTIC_PROXY is set. Configuring proxychains..."
|
| 9 |
|
| 10 |
+
# Extract details from STASTIC_PROXY
|
| 11 |
# Format: http://user:pass@host:port
|
| 12 |
+
PROTO=$(echo "$STASTIC_PROXY" | grep :// | sed -e's,^\(.*://\).*,\1,g' | sed -e 's,://,,g')
|
| 13 |
+
URL_NO_PROTO=$(echo "$STASTIC_PROXY" | sed -e 's,^.*://,,g')
|
| 14 |
USER_PASS=$(echo "$URL_NO_PROTO" | grep -o '.*@' | sed 's/@//')
|
| 15 |
HOST_PORT=$(echo "$URL_NO_PROTO" | sed -e "s,$USER_PASS@,,g")
|
| 16 |
HOST=$(echo "$HOST_PORT" | cut -d: -f1)
|
|
|
|
| 49 |
# Execute the command passed to the script, wrapped in proxychains
|
| 50 |
exec proxychains4 "$@"
|
| 51 |
else
|
| 52 |
+
echo "STASTIC_PROXY is not set. Starting application without proxy."
|
| 53 |
# Execute the command as is
|
| 54 |
exec "$@"
|
| 55 |
fi
|