From 2287ee9cc4df6004869a4333b738306cd75a650c Mon Sep 17 00:00:00 2001 From: RickyXwang <896790683@qq.com> Date: Mon, 28 Sep 2020 19:51:34 -0400 Subject: [PATCH 1/3] Update HealthCheck for auto-recover TUN down (#1373) * Update tunnelDown.sh Add attempt to restart TUN --- scripts/healthcheck.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/scripts/healthcheck.sh b/scripts/healthcheck.sh index 77ddaf5e7..d24207c7a 100755 --- a/scripts/healthcheck.sh +++ b/scripts/healthcheck.sh @@ -16,6 +16,29 @@ STATUS=$? if [[ ${STATUS} -ne 0 ]] then echo "Network is down" + INTERFACE=$(ls /sys/class/net | grep tun) + ISINTERFACE=$? + + if [[ ${ISINTERFACE} -ne 0 ]] + then + echo "TUN Interface not found" + exit 1 + fi + + echo "Resetting TUN" + ip link set ${INTERFACE} down + sleep 1 + ip link set ${INTERFACE} up + echo "Sent kill SIGUSR1 to openvpn" + pkill -SIGUSR1 openvpn + sleep 20 +fi + +ping -c 1 $HOST +STATUS=$? +if [[ ${STATUS} -ne 0 ]] +then + echo "Network is still down" exit 1 fi From e3d27e8172fb50e1532f01a24420a34899285ae7 Mon Sep 17 00:00:00 2001 From: Kusha Gharahi <3326002+kushagharahi@users.noreply.github.com> Date: Mon, 28 Sep 2020 18:51:59 -0500 Subject: [PATCH 2/3] Add LOG_TO_STDOUT variable + documentation (#1379) --- DockerEnv | 1 + Dockerfile | 3 ++- Dockerfile.alpine | 1 + Dockerfile.armhf | 1 + docs/arguments.md | 8 ++++++++ transmission/environment-variables.tmpl | 5 +++-- transmission/start.sh | 2 +- transmission/userSetup.sh | 2 +- 8 files changed, 18 insertions(+), 5 deletions(-) diff --git a/DockerEnv b/DockerEnv index 78617adc0..03d6201dd 100644 --- a/DockerEnv +++ b/DockerEnv @@ -88,3 +88,4 @@ #WEBPROXY_USERNAME= #WEBPROXY_PASSWORD= #DOCKER_LOG=false +#LOG_TO_STDOUT=false diff --git a/Dockerfile b/Dockerfile index 6716ec9b9..21c8e6e21 100644 --- a/Dockerfile +++ b/Dockerfile @@ -136,7 +136,8 @@ ENV OPENVPN_USERNAME=**None** \ WEBPROXY_USERNAME= \ WEBPROXY_PASSWORD= \ HEALTH_CHECK_HOST=google.com \ - DOCKER_LOG=false + DOCKER_LOG=false \ + LOG_TO_STDOUT=false HEALTHCHECK --interval=5m CMD /etc/scripts/healthcheck.sh diff --git a/Dockerfile.alpine b/Dockerfile.alpine index a87cc5500..f2b834407 100644 --- a/Dockerfile.alpine +++ b/Dockerfile.alpine @@ -126,6 +126,7 @@ ENV OPENVPN_USERNAME=**None** \ WEBPROXY_USERNAME= \ WEBPROXY_PASSWORD= \ DOCKER_LOG=false \ + LOG_TO_STDOUT=false \ HEALTH_CHECK_HOST=google.com HEALTHCHECK --interval=5m CMD /etc/scripts/healthcheck.sh diff --git a/Dockerfile.armhf b/Dockerfile.armhf index de50bbc4d..ecbce3d85 100644 --- a/Dockerfile.armhf +++ b/Dockerfile.armhf @@ -130,6 +130,7 @@ ENV OPENVPN_USERNAME=**None** \ WEBPROXY_USERNAME= \ WEBPROXY_PASSWORD= \ DOCKER_LOG=false \ + LOG_TO_STDOUT=false \ HEALTH_CHECK_HOST=google.com HEALTHCHECK --interval=5m CMD /etc/scripts/healthcheck.sh diff --git a/docs/arguments.md b/docs/arguments.md index 74732cc30..534ec5a97 100755 --- a/docs/arguments.md +++ b/docs/arguments.md @@ -105,3 +105,11 @@ This might lead to the default route (your untunneled connection) to be used. To drop the default route set the environment variable `DROP_DEFAULT_ROUTE` to `true`. *Note*: This is not compatible with all VPNs. You can check your iptables routing with the `ip r` command in a running container. + +### Changing logging locations + +By default Transmission will log to a file in `TRANSMISSION_HOME/transmission.log`. + +To log to stdout instead set the environment variable `LOG_TO_STDOUT` to `true`. + +*Note*: By default stdout is what container engines read logs from. Set this to true to have Tranmission logs in commands like `docker logs` and `kubectl logs`. OpenVPN currently only logs to stdout. \ No newline at end of file diff --git a/transmission/environment-variables.tmpl b/transmission/environment-variables.tmpl index 556104793..93e8196f5 100644 --- a/transmission/environment-variables.tmpl +++ b/transmission/environment-variables.tmpl @@ -97,5 +97,6 @@ export DROP_DEFAULT_ROUTE={{ .Env.DROP_DEFAULT_ROUTE }} # Support using transmission ids for transmission paths export GLOBAL_APPLY_PERMISSIONS={{ .Env.GLOBAL_APPLY_PERMISSIONS }} -#Support logging to docker logs -export DOCKER_LOG={{ .Env.DOCKER_LOG }} +# Support logging to stdout which docker logs uses, mark either true +export DOCKER_LOG={{ .Env.DOCKER_LOG }} # DEPRECIATED -- variable name does not reflect usage +export LOG_TO_STDOUT={{ .Env.LOG_TO_STDOUT }} # Updated variable name diff --git a/transmission/start.sh b/transmission/start.sh index b97734530..dfe1cce72 100755 --- a/transmission/start.sh +++ b/transmission/start.sh @@ -60,7 +60,7 @@ if [[ "true" = "$DROP_DEFAULT_ROUTE" ]]; then ip r del default || exit 1 fi -if [[ "true" = "$DOCKER_LOG" ]]; then +if [[ "true" = "$DOCKER_LOG" || "true" = "$LOG_TO_STDOUT" ]]; then LOGFILE=/dev/stdout else LOGFILE=${TRANSMISSION_HOME}/transmission.log diff --git a/transmission/userSetup.sh b/transmission/userSetup.sh index e645abb74..576d844ca 100644 --- a/transmission/userSetup.sh +++ b/transmission/userSetup.sh @@ -13,7 +13,7 @@ if [ -n "$PUID" ] && [ ! "$(id -u root)" -eq "$PUID" ]; then groupmod -o -g "$PGID" ${RUN_AS}; fi - if [[ "true" = "$DOCKER_LOG" ]]; then + if [[ "true" = "$DOCKER_LOG" || "true" = "$LOG_TO_STDOUT" ]]; then chown ${RUN_AS}:${RUN_AS} /dev/stdout fi From a27b6e8f9db29404a0548bec9bbce8bb15e25dd1 Mon Sep 17 00:00:00 2001 From: mirx1 Date: Tue, 6 Oct 2020 10:29:16 -0300 Subject: [PATCH 3/3] Update SOURCE.txt New URL, old URL was 404 --- openvpn/frostvpn/SOURCE.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openvpn/frostvpn/SOURCE.txt b/openvpn/frostvpn/SOURCE.txt index beee78970..a5fba3260 100644 --- a/openvpn/frostvpn/SOURCE.txt +++ b/openvpn/frostvpn/SOURCE.txt @@ -1 +1 @@ -http://www.frostvpn.com/clients/server-list.htm +https://www.frostvpn.com/clients/servers.htm