diff options
author | Jesús <heckyel@hyperbola.info> | 2021-07-28 22:25:46 -0500 |
---|---|---|
committer | Jesús <heckyel@hyperbola.info> | 2021-07-28 22:25:46 -0500 |
commit | 89a254cd79c0eb524ce6dd3b7a67cc8879bad5fd (patch) | |
tree | 9f833d98846c1138845e0900adee5f56b6a35a14 /core/entrypoint.sh | |
parent | c826d1c7b537c2153ba4f632987d2fa40e484c6e (diff) | |
download | yt-local-docker-89a254cd79c0eb524ce6dd3b7a67cc8879bad5fd.tar.lz yt-local-docker-89a254cd79c0eb524ce6dd3b7a67cc8879bad5fd.tar.xz yt-local-docker-89a254cd79c0eb524ce6dd3b7a67cc8879bad5fd.zip |
separate TOR configuration
Diffstat (limited to 'core/entrypoint.sh')
-rw-r--r-- | core/entrypoint.sh | 30 |
1 files changed, 3 insertions, 27 deletions
diff --git a/core/entrypoint.sh b/core/entrypoint.sh index 5596bbd..c27698a 100644 --- a/core/entrypoint.sh +++ b/core/entrypoint.sh @@ -77,30 +77,6 @@ settings_version = 3 EOF fi -if [ "$ROUTE_TOR" = 1 ] || [ "$ROUTE_TOR" = 2 ]; then - cat > /etc/tor/torrc <<- EOF -Log notice stdout -SocksPort ${TOR_PORT:-9050} # Default: Bind to localhost:9050 for local connections. -MaxCircuitDirtiness ${MAX_CIRCUIT:-300} -CircuitBuildTimeout ${CIRCUIT_TIMEOUT:-300} -ExcludeExitNodes {US} -StrictNodes 1 -EOF - tor -f /etc/tor/torrc --runasdaemon 1 - - # check health tor - while :; do - checkurl=$(curl --socks5 "localhost:${TOR_PORT:-9050}" -o /dev/null -s -w "%{http_code}\n" "${URL_CHECK:-https://www.youtube.com/results?search_query=rms}") - if [ "$checkurl" = '502' ] || [ "$checkurl" = '302' ]; then - pkill tor && tor -f /etc/tor/torrc --runasdaemon 1 - pkill python3 || true - /usr/bin/python3 /srv/app/server.py || true - else - pgrep python3 > /dev/null || /usr/bin/python3 /srv/app/server.py - fi - sleep 5 - done - -else - exec /usr/bin/python3 /srv/app/server.py -fi +/entrypoint-tor.sh "$@" & + +exec /usr/bin/python3 /srv/app/server.py |