wfg / docker-openvpn-client

OpenVPN client with killswitch and proxy servers; built on Alpine
MIT License
353 stars 107 forks source link

Tinyproxy doesn't start #79

Open Miraculix200 opened 2 years ago

Miraculix200 commented 2 years ago

For a reason unknown tinyproxy doesn't start when I run the docker image.

docker exec openvpn-client3 ps aux shows that it runs the run-http-proxy.sh script, but tinyproxy itself isn't running. There's also no open port visible when doing docker exec openvpn-client3 netstat -anp.

When I do docker exec openvpn-client3 tinyproxy (after editing the tinyproxy config to accept all connections and use the right port), it does run tinyproxy and the VPN connection works.

Any idea how to figure out what's wrong? I have no experience with docker.

Miraculix200 commented 2 years ago

Found the problem: The run-http-proxy.sh hangs at until ip link show tun0, because the network interface is actually tun1 (caused by my VPN provider)

pablos-here commented 1 year ago

Hi @Miraculix200 , A quick question, did this problem happen on the first run of the container or after a connection was dropped?

I'm asking because I'm finalizing a PR and one thing I've done is refactored the openvpn tear down phase.

If the problem manifested itself on the first run, I can expose a variable to remap tun0.

pablos-here commented 1 year ago

In the meantime, I've added some instrumentation around the check-code so there's information in the log about what's going on.

Below is an example:

2023-02-02 09:03:24 [entry.sh] Backgrounding HTTP proxy ...
2023-02-02 09:03:24 [entry.sh] Backgrounding SOCKS proxy ...
2023-02-02 09:03:24 [entry.sh] Backgrounding openvpn ...
2023-02-02 09:03:24 [run-socks-proxy.sh] Waiting for tun0 to become available.
2023-02-02 09:03:24 [run-http-proxy.sh] Waiting for tun0 to become available.
2023-02-02 09:03:24 OpenVPN 2.5.6 x86_64-alpine-linux-musl [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [MH/PKTINFO] [AEAD] built on Apr 17 2022
...
2023-02-02 09:03:25 [run-http-proxy.sh] Ready.  Continuing.
2023-02-02 09:03:25 [run-socks-proxy.sh] Ready.  Continuing.
2023-02-02 09:03:25 [run-socks-proxy.sh] info: starting socks proxy without credentials
2023-02-02 09:03:25 [run-http-proxy.sh] info: starting http proxy without credentials