Skip to content
This repository has been archived by the owner on Nov 25, 2022. It is now read-only.

Docker-compose explanation #104

Open
jos149 opened this issue Nov 18, 2021 · 30 comments
Open

Docker-compose explanation #104

jos149 opened this issue Nov 18, 2021 · 30 comments
Assignees
Labels
bug Something isn't working

Comments

@jos149
Copy link

jos149 commented Nov 18, 2021

Information

Before starting my container with docker compose I want to know a few things. I am not a network expert so that's why I am asking you. I don't want to mess up my other services.

Current setup

I am running a raspberry pi server in my network with several services. As a gateway I have a DDWRT flashed router with a external HDD connected. This HDD is shared over samba. I have set the path of this drive in my docker-compose file. I am not running NordVPN on my router.

docker-compose.yml file or docker run command

I copied the docker-compose file and adjusted a few things. My question is: what do I have to fill in LAN? My gateway 192.168.1.1? Or what does it mean??? And; will this docker container only be connected over vpn on its own? Or will my other containers also be tunneled over VPN? Because this I want to avoid. Maybe you have other suggestions for me? I just want a torrenting service to download data to my hdd at my samba share. Thanks in advance. Underneath you can find my docker compose file.

version: "3.3"
services:
  alpine-qbittorrent-openvpn:
    volumes:
      - "/your/storage/path/:/downloads"
      - "/path/to/config/directory:/config"
      - "/etc/localtime:/etc/localtime:ro"
    environment:
      - OPENVPN_PROVIDER=NORDVPN
      - NORDVPN_COUNTRY=NL
      - OPENVPN_USERNAME=emailnordvpn
      - OPENVPN_PASSWORD=pass
      - PUID=1000
      - PGID=1000
      - LAN=192.168.0.0/16 <--my gateway LAN????
    ports:
      - "8888:8080"
    cap_add:
      - NET_ADMIN
    image: guillaumedsde/alpine-qbittorrent-openvpn:latest
@jos149 jos149 added the bug Something isn't working label Nov 18, 2021
@jos149
Copy link
Author

jos149 commented Nov 24, 2021

Anyone?

@MoistHoagie
Copy link

My understanding is this is the CIDR block for your local network. So like mine is 192.168.1.0/24 which is super common. You should be able to find this in your router or running something like ipconfig /all on Windows. Find your network device, and then check the subnet mask. Most likely it's 255.255.255.0 which is /24.

@jos149
Copy link
Author

jos149 commented Nov 25, 2021

My understanding is this is the CIDR block for your local network. So like mine is 192.168.1.0/24 which is super common. You should be able to find this in your router or running something like ipconfig /all on Windows. Find your network device, and then check the subnet mask. Most likely it's 255.255.255.0 which is /24.

Cool thanks! Explains a lot.

And do you also happen to know anything about the VPN settings and which traffic is tunneled over VPN?

@MoistHoagie
Copy link

Docker containers each have their own network so they should all go over your open internet, unless you specify a VPN connection for the container. If you have access into the container directly (I use Portainer and I can get into it easily), you can run something like curl ifconfig.io and it will return the IP so you can double verify.

@jos149
Copy link
Author

jos149 commented Nov 25, 2021

Docker containers each have their own network so they should all go over your open internet, unless you specify a VPN connection for the container. If you have access into the container directly (I use Portainer and I can get into it easily), you can run something like curl ifconfig.io and it will return the IP so you can double verify.

I run portainer too, so yes, I can verify. The thing is; with the configuration of my docker containers as displayed above I want to know if I am connecting my whole server or only that container over VPN.

@MoistHoagie
Copy link

MoistHoagie commented Nov 25, 2021

My understanding is it would just be that container over VPN. If you run that command in a different container to check take note of the IP. If it matches your public IP (You can check that by just typing What is my ip into Google), then it isn't going over VPN. If it doesn't match, then that public IP is from your VPN provider and that container is going over VPN. Hope that helps.

@jos149
Copy link
Author

jos149 commented Nov 26, 2021

Cool thanks.

I tried running docker-compose with the configuration as showed above. Sadly, I get stopped with exit code 0.
Portainer shows me the following log:

s6-svscan: warning: unable to iopause: Operation not permitted
s6-svscan: warning: executing into .s6-svscan/crash
s6-supervise s6-fdholderd: fatal: unable to iopause: Operation not permitted
s6-svscan panicked! Dropping to a root shell.

Anyone?

@ankorite
Copy link

ankorite commented Nov 27, 2021

So did you run it with this:

Volumes:

 - "/your/storage/path/:/downloads"
 - "/path/to/config/directory:/config"
 - "/etc/localtime:/etc/localtime:ro"

Where is says "/your/storage/path/" it will need to be changed to your storage path on your host. Same with the config.

I am guessing /path/to/config/directory does not exist on your host system.

@jos149
Copy link
Author

jos149 commented Nov 28, 2021

I am guessing /path/to/config/directory does not exist on your host system.

I have a samba mount as a path to the storage.

My config folder exists but it does not contain anything. What should be in there?

About the docker compose file:
sometimes I see people using
NORDVPN_COUNTRY=NL
but instead some people are also using OPENVPN_CONFIG.
What is the difference and do both work?

@ankorite
Copy link

Ok, lets do these one at a time.

You are supposed to change the "/path/to/config/directory" part in the compose file to your actual config directory where the docker user has permissions to read and write. I thought you where using Portainer correct? If so you can use its volume manager to deal with the config dir.

Change this:
- "/path/to/config/directory:/config"
To this:
- qbittorrent-config:/config

What VPN provider are you paying for? That is going to dictate the VPN settings you will need to use. Do you have a subscription with NordVPN?

On the host system what is your storage path? "/your/storage/path" is a placeholder and you need to change it to your actual path where you are storing your downloads i.e. "/home/pi/downloads"

If you do not have an account with a supported VPN this container will not work as far as I know.

@jos149
Copy link
Author

jos149 commented Nov 29, 2021

You are supposed to change the "/path/to/config/directory" part in the compose file to your actual config directory where the docker user has permissions to read and write. I thought you where using Portainer correct? If so you can use its volume manager to deal with the config dir.

Yes I do use Portainer. But to clarify; I have my docker compose file placed in home/pi/torrent where the docker user has permissions.

Change this: - "/path/to/config/directory:/config" To this: - qbittorrent-config:/config

Done, already did it first time. My folder is named config instead of qbittorrent-config, is it a problem?

What VPN provider are you paying for? That is going to dictate the VPN settings you will need to use. Do you have a subscription with NordVPN?

Yes I have a paid subscription for NordVPN. So wondering what settings do apply. Is it also required to download these config files from their website?

On the host system what is your storage path? "/your/storage/path" is a placeholder and you need to change it to your actual path where you are storing your downloads i.e. "/home/pi/downloads"

I have a folder within the torrent folder which I mentioned before which is called NAS and this folder has the hard drive mounted over samba. I tested it functionality by placing a file from my laptop and checking whether it appears on my pi, it does!

Here you can find my current settings:

version: "3.3"
services:
  alpine-qbittorrent-openvpn:
    volumes:
      - "./NAS:/downloads"
      - "./config:/config"
      - "/etc/localtime:/etc/localtime:ro"
    environment:
      - OPENVPN_PROVIDER=NORDVPN
      - OPENVPN_CONFIG=NL
      - OPENVPN_USERNAME=user
      - OPENVPN_PASSWORD=pass
      - PUID=1000
      - PGID=1000
      - LAN=192.168.1.1/24
    ports:
      - "8888:8080"
    cap_add:
      - NET_ADMIN
    image: guillaumedsde/alpine-qbittorrent-openvpn:latest
    container_name: torrentserver
    restart: always

As you know, config is now still empty.

Hope you can help me out. Thanks in advance!

@ankorite
Copy link

I understand now. Try rolling back to a previous image? I had to roll back to dd4cd24 due to a syntax error in latest (looks to be a pull request to address it)

image: guillaumedsde/alpine-qbittorrent-openvpn:dd4cd24

Maybe that will help? My only other idea is to use the absolute path instead of relative in the volume section. The errors you where seeing make me think it is a permission issue.

In my Portainer I don't use Compose files or Stacks very often, most of my containers are configured via the Container tab. Here is my ENV:

ENV VALUE
CONFIG_DIR /config
CREDENTIALS_FILE /config/openvpn/openvpn-credentials.txt
DNS 8.8.8.8
DOCKER_CIDR 172.17.0.0/16
HEALTH_CHECK_HOST google.com
LAN 192.168.0.0/24
OPENVPN_CONFIG_FILE /config/openvpn/config.ovpn
OPENVPN_PASSWORD REDACTED
OPENVPN_PROVIDER NORDVPN
OPENVPN_USERNAME REDACTED
PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
PGID 100
PUID 1000
QBT_SAVE_PATH /srv/dev-disk-by-label-Home/downloads/
QBT_WEBUI_PORT 8080
S6_BEHAVIOUR_IF_STAGE2_FAILS 2
TUN /dev/net/tun

And here is my VOLUMES:

Host/volume Path in container
/etc/localtime /etc/localtime
/srv/dev-disk-by-label-Home/downloads /srv/dev-disk-by-label-Home/downloads
/srv/25316426-d4ec-4d3d-934b-6facc3559108/Media/Anime /Anime
qBittorrent-config /config

for my config dir it is managed by Portainer's Volume system and its mount point is this on my host:
/srv/dev-disk-by-label-Home/docker/volumes/qBittorrent-config/_data

/srv/dev-disk-by-label-Home/docker has the owner:group as root:root with permisions set to drwx--x--- or 710

Hope this helps!

@jos149
Copy link
Author

jos149 commented Nov 29, 2021

I understand now. Try rolling back to a previous image? I had to roll back to dd4cd24 due to a syntax error in latest (looks to be a pull request to address it)

image: guillaumedsde/alpine-qbittorrent-openvpn:dd4cd24

Maybe that will help? My only other idea is to use the absolute path instead of relative in the volume section. The errors you where seeing make me think it is a permission issue.

In my Portainer I don't use Compose files or Stacks very often, most of my containers are configured via the Container tab. Here is my ENV:

ENV|VALUE

--|--

CONFIG_DIR | /config

CREDENTIALS_FILE | /config/openvpn/openvpn-credentials.txt

DNS | 8.8.8.8

DOCKER_CIDR | 172.17.0.0/16

HEALTH_CHECK_HOST | google.com

LAN | 192.168.0.0/24

OPENVPN_CONFIG_FILE | /config/openvpn/config.ovpn

OPENVPN_PASSWORD | REDACTED

OPENVPN_PROVIDER | NORDVPN

OPENVPN_USERNAME | REDACTED

PATH | /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

PGID | 100

PUID | 1000

QBT_SAVE_PATH | /srv/dev-disk-by-label-Home/downloads/

QBT_WEBUI_PORT | 8080

S6_BEHAVIOUR_IF_STAGE2_FAILS | 2

TUN | /dev/net/tun

And here is my VOLUMES:

Host/volume | Path in container

-- | --

/etc/localtime | /etc/localtime

/srv/dev-disk-by-label-Home/downloads | /srv/dev-disk-by-label-Home/downloads

/srv/25316426-d4ec-4d3d-934b-6facc3559108/Media/Anime | /Anime

qBittorrent-config | /config

for my config dir it is managed by Portainer's Volume system and its mount point is this on my host:

/srv/dev-disk-by-label-Home/docker/volumes/qBittorrent-config/_data

/srv/dev-disk-by-label-Home/docker has the owner:group as root:root with permisions set to drwx--x--- or 710

Hope this helps!

Thanks for your elaborate explanation. I will verify the permissions of the folder. Then my next step will be a rollback if that doesn't work.

I noticed that your PGID is 100 instead of 1000. Might this be a thing maybe?

Never had any problems with absolute or relative paths so I guess that might not be a thing.

And, I see you have a config.ovpn file. Is this created when running the image correctly or did you make it? What does it contain?

@ankorite
Copy link

The PGID is because on my Debian system the group "users" has ID 100. You should be able to check your GID by entering this command as your regular user:
id -g

here is some info from my logs. I don't think that config file is being used.

[cont-init.d] executing container initialization scripts...

[cont-init.d] 01-setup-permissions: executing...

[cont-init.d] 01-setup-permissions: exited 0.

[cont-init.d] 02-setup-openvpn: executing...

Mon Nov 29 10:29:01 2021 TUN/TAP device tun0 opened

Mon Nov 29 10:29:01 2021 Persist state set to: ON

INFO: Trying to use OpenVPN provider: NORDVPN

A nordvpn

A nordvpn/configure-openvpn.sh

A nordvpn/updateConfigs.sh

Exported revision 3246.

Provider NORDVPN has a custom startup script, executing it

Downloading user specified config. NORDVPN_PROTOCOL is set to: UDP

2021-11-29 10:29:04 Checking curl installation

2021-11-29 10:29:04 Removing existing configs

2021-11-29 10:29:04 Selecting the best server...

2021-11-29 10:29:04 Searching for group: legacy_p2p

2021-11-29 10:29:04 Searching for technology: openvpn_udp

2021-11-29 10:29:04 Best server : us8948.nordvpn.com

2021-11-29 10:29:04 Downloading config: default.ovpn

2021-11-29 10:29:04 Downloading from: https://downloads.nordcdn.com/configs/files/ovpn_udp/servers/us8948.nordvpn.com.udp.ovpn

2021-11-29 10:29:04 Using OpenVPN CONFIG ::

2021-11-29 10:29:04 Downloading config: .ovpn

2021-11-29 10:29:04 Downloading from: https://downloads.nordcdn.com/configs/files/ovpn_udp/servers/.udp.ovpn

INFO: Found OpenVPN configuration: "" for provider "NORDVPN" using it

[cont-init.d] 02-setup-openvpn: exited 0.

[cont-init.d] 03-setup-iptables: executing...

[cont-init.d] 03-setup-iptables: exited 0.

[cont-init.d] done.

[services.d] starting services

[services.d] done.

@jos149
Copy link
Author

jos149 commented Nov 30, 2021

The rollback has worked, we're one step further and this is one line which I noticed in the log:
ERROR: Could not find OpenVPN configuration "NL" for provider NORDVPN

Next to that, portainer gives me the so called 'last output':

Host not set! Set env 'HEALTH_CHECK_HOST'. For now, using default google.com PING google.com (...): 56 data bytes 64 bytes from ...: seq=0 ttl=57 time=15.810 ms --- google.com ping statistics --- 1 packets transmitted, 1 packets received, 0% packet loss round-trip min/avg/max = 15.810/15.810/15.810 ms Network is up Openvpn process not running 

When changing the line OPENVPN_CONFIG to NORDVPN_COUNTRY with the same =NL I get:

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.,
[s6-init] ensuring user provided files have correct perms...exited 0.,
[fix-attrs.d] applying ownership & permissions fixes...,
[fix-attrs.d] done.,
[cont-init.d] executing container initialization scripts...,
[cont-init.d] 01-setup-permissions: executing... ,
[cont-init.d] 01-setup-permissions: exited 0.,
[cont-init.d] 02-setup-openvpn: executing... ,
Tue Nov 30 17:53:50 2021 TUN/TAP device tun0 opened,
Tue Nov 30 17:53:50 2021 Persist state set to: ON,
INFO: Trying to use OpenVPN provider: NORDVPN,�������
A    nordvpn,
A    nordvpn/configure-openvpn.sh,
A    nordvpn/updateConfigs.sh,
Exported revision 3246.,
Provider NORDVPN has a custom startup script, executing it,
Downloading user specified config. NORDVPN_PROTOCOL is set to: UDP,
2021-11-30 17:53:52 Checking curl installation,
2021-11-30 17:53:52 Removing existing configs,
2021-11-30 17:53:52 Selecting the best server...,
2021-11-30 17:53:52 Searching for group: legacy_p2p,
2021-11-30 17:53:52 Searching for technology: openvpn_udp,
2021-11-30 17:53:52 Best server : nl956.nordvpn.com,
2021-11-30 17:53:52 Downloading config: default.ovpn,
2021-11-30 17:53:52 Downloading from: https://downloads.nordcdn.com/configs/files/ovpn_udp/servers/nl956.nordvpn.com.udp.ovpn,
2021-11-30 17:53:52 Using OpenVPN CONFIG :: ,
2021-11-30 17:53:52 Downloading config: .ovpn,
2021-11-30 17:53:52 Downloading from: https://downloads.nordcdn.com/configs/files/ovpn_udp/servers/.udp.ovpn,
INFO: Found OpenVPN configuration: "" for provider "NORDVPN" using it,
[cont-init.d] 02-setup-openvpn: exited 0.,
[cont-init.d] 03-setup-iptables: executing... ,
[cont-init.d] 03-setup-iptables: exited 0.,
[cont-init.d] done.,
[services.d] starting services,
Tue Nov 30 17:53:55 2021 OpenVPN 2.4.10 armv7-alpine-linux-musleabihf [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [MH/PKTINFO] [AEAD] built on Jan  4 2021,
Tue Nov 30 17:53:55 2021 library versions: OpenSSL 1.1.1i  8 Dec 2020, LZO 2.10,
Tue Nov 30 17:53:55 2021 WARNING: --ping should normally be used with --ping-restart or --ping-exit,
[services.d] done.,
Tue Nov 30 17:53:55 2021 Outgoing Control Channel Authentication: Using 512 bit message hash 'SHA512' for HMAC authentication,
Tue Nov 30 17:53:55 2021 Incoming Control Channel Authentication: Using 512 bit message hash 'SHA512' for HMAC authentication,
Tue Nov 30 17:53:55 2021 TCP/UDP: Preserving recently used remote address: [AF_INET]...,
Tue Nov 30 17:53:55 2021 Socket Buffers: R=[180224->180224] S=[180224->180224],
Tue Nov 30 17:53:55 2021 UDP link local: (not bound),
Tue Nov 30 17:53:55 2021 UDP link remote: [AF_INET]...,
Tue Nov 30 17:53:55 2021 TLS: Initial packet from [AF_INET]..., sid=...,
Tue Nov 30 17:53:55 2021 VERIFY OK: depth=2, C=PA, O=NordVPN, CN=NordVPN Root CA,
Tue Nov 30 17:53:55 2021 VERIFY OK: depth=1, C=PA, O=NordVPN, CN=NordVPN CA6,
Tue Nov 30 17:53:55 2021 VERIFY KU OK,
Tue Nov 30 17:53:55 2021 Validating certificate extended key usage,
Tue Nov 30 17:53:55 2021 ++ Certificate has EKU (str) TLS Web Server Authentication, expects TLS Web Server Authentication,
Tue Nov 30 17:53:55 2021 VERIFY EKU OK,
Tue Nov 30 17:53:55 2021 VERIFY OK: depth=0, CN=nl956.nordvpn.com,
Tue Nov 30 17:53:56 2021 Control Channel: TLSv1.3, cipher TLSv1.3 TLS_AES_256_GCM_SHA384, 4096 bit RSA,
Tue Nov 30 17:53:56 2021 [nl956.nordvpn.com] Peer Connection Initiated with [AF_INET]...,
Tue Nov 30 17:53:57 2021 SENT CONTROL [nl956.nordvpn.com]: 'PUSH_REQUEST' (status=1),
Tue Nov 30 17:53:57 2021 PUSH: Received control message: 'PUSH_REPLY,redirect-gateway def1,dhcp-option DNS ...dhcp-option DNS ...,sndbuf 524288,rcvbuf 524288,explicit-exit-notify,comp-lzo no,route-gateway 1...topology subnet,ping 60,ping-restart 180,ifconfig ... 255.255.255.0,peer-id 11,cipher AES-256-GCM',
Tue Nov 30 17:53:57 2021 Pushed option removed by filter: 'dhcp-option DNS 1...',
Tue Nov 30 17:53:57 2021 Pushed option removed by filter: 'dhcp-option DNS 1...',
Tue Nov 30 17:53:57 2021 OPTIONS IMPORT: timers and/or timeouts modified,
Tue Nov 30 17:53:57 2021 OPTIONS IMPORT: explicit notify parm(s) modified,
Tue Nov 30 17:53:57 2021 OPTIONS IMPORT: compression parms modified,
Tue Nov 30 17:53:57 2021 OPTIONS IMPORT: --sndbuf/--rcvbuf options modified,
Tue Nov 30 17:53:57 2021 Socket Buffers: R=[180224->360448] S=[180224->360448],
Tue Nov 30 17:53:57 2021 OPTIONS IMPORT: --ifconfig/up options modified,
Tue Nov 30 17:53:57 2021 OPTIONS IMPORT: route options modified,
Tue Nov 30 17:53:57 2021 OPTIONS IMPORT: route-related options modified,
Tue Nov 30 17:53:57 2021 OPTIONS IMPORT: peer-id set,
Tue Nov 30 17:53:57 2021 OPTIONS IMPORT: adjusting link_mtu to 1657,
Tue Nov 30 17:53:57 2021 OPTIONS IMPORT: data channel crypto options modified,
Tue Nov 30 17:53:57 2021 Data Channel: using negotiated cipher 'AES-256-GCM',
Tue Nov 30 17:53:57 2021 Outgoing Data Channel: Cipher 'AES-256-GCM' initialized with 256 bit key,
Tue Nov 30 17:53:57 2021 Incoming Data Channel: Cipher 'AES-256-GCM' initialized with 256 bit key,
Tue Nov 30 17:53:57 2021 ROUTE_GATEWAY .../255.255.0.0 IFACE=eth0 HWADDR=...,
Tue Nov 30 17:53:57 2021 TUN/TAP device tun1 opened,
Tue Nov 30 17:53:57 2021 TUN/TAP TX queue length set to 100,
Tue Nov 30 17:53:57 2021 /usr/sbin/ip-su link set dev tun1 up mtu 1500,
Tue Nov 30 17:53:57 2021 /usr/sbin/ip-su addr add dev tun1 1...24 broadcast ...,
Tue Nov 30 17:53:57 2021 /usr/sbin/ip-su route add ... via 1...,
Tue Nov 30 17:53:57 2021 /usr/sbin/ip-su route add 0.0.0.0/1 via 10.8.1.1,
Tue Nov 30 17:53:57 2021 /usr/sbin/ip-su route add 128.0.0.0/1 via 10.8.1.1,
Tue Nov 30 17:53:57 2021 /usr/sbin/ip-su route add 192.168.1.1/24 via ...,
INFO: no port updater for provider NORDVPN,
RTNETLINK answers: Invalid argument,
Tue Nov 30 17:53:57 2021 ERROR: Linux route add command failed: external program exited with error status: 2,
Tue Nov 30 17:53:57 2021 Initialization Sequence Completed,
,
******** Information ********,
To control qBittorrent, access the Web UI at http://localhost:8080

But cannot access....

Maybe it sounds weird but can it be that I cannot access the container because it was tunnelled over VPN?
And...how am I sure it is connected to VPN?

@jos149
Copy link
Author

jos149 commented Dec 3, 2021

The PGID is because on my Debian system the group "users" has ID 100. You should be able to check your GID by entering this command as your regular user: id -g

PGID is correct. Would you mind looking at my previous comment?

@ankorite
Copy link

ankorite commented Dec 3, 2021

RTNETLINK answers: Invalid argument,
Tue Nov 30 17:53:57 2021 ERROR: Linux route add command failed: external program exited with error status: 2,

Looks like the route could not be added to the routing table. I don't know if that is an issue or how to fix, maybe uncle Google will have some insight.

In your compose file it has port 8888 on host forwarded to 8080 on container. You need to go to http://localhost:8888 (if you are using the host machine browser) or http://192.168.1.2:8888 or whatever your host IP is.

Once you are in you should be able to check your VPN by going here https://ipleak.net/ and doing the torrent check on that page. The IP grabbed from the magnet link should be through the VPN if it all works right.

Good luck! You are almost there.

@jos149
Copy link
Author

jos149 commented Dec 3, 2021

Looks like the route could not be added to the routing table. I don't know if that is an issue or how to fix, maybe uncle Google will have some insight.
Good luck! You are almost there.

By changing LAN=ip/24 to LOCAL_NETWORK=ip/24,vpnip/24 it looks like we're getting closer. See first part of my log:

The Web UI administrator username is: admin

The Web UI administrator password is still the default one: adminadmin

This is a security risk, please consider changing your password from program preferences.

s6-svwait: fatal: supervisor died

[s6-finish] sending all processes the TERM signal.

Fri Dec  3 21:30:24 2021 event_wait : Interrupted system call (code=4)

Fri Dec  3 21:30:24 2021 /usr/sbin/ip-su route del 192.168.0.0/24

Fri Dec  3 21:30:24 2021 /usr/sbin/ip-su route del ..../32

Fri Dec  3 21:30:24 2021 /usr/sbin/ip-su route del 0.0.0.0/1

Fri Dec  3 21:30:24 2021 /usr/sbin/ip-su route del 128.0.0.0/1

Fri Dec  3 21:30:24 2021 Closing TUN/TAP interface

Fri Dec  3 21:30:24 2021 /usr/sbin/ip-su addr del dev tun1 10.8.3.27/24

Fri Dec  3 21:30:25 2021 SIGTERM[hard,] received, process exiting

[s6-finish] sending all processes the KILL signal and exiting.

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.

[s6-init] ensuring user provided files have correct perms...exited 0.

[fix-attrs.d] applying ownership & permissions fixes...

[fix-attrs.d] done.

[cont-init.d] executing container initialization scripts...

[cont-init.d] 01-setup-permissions: executing... 

[cont-init.d] 01-setup-permissions: exited 0.

[cont-init.d] 02-setup-openvpn: executing... 

Fri Dec  3 21:30:31 2021 TUN/TAP device tun0 opened

Fri Dec  3 21:30:31 2021 Persist state set to: ON

By going to localhost:8888 I sadly enough get: Unauthorized. Nothing else. Tried fixing in this way but didn't work

@ankorite
Copy link

ankorite commented Dec 4, 2021

Are you using the host machines browser or are you using another computer on the network like a laptop or desktop?

@jos149
Copy link
Author

jos149 commented Dec 4, 2021

Are you using the host machines browser or are you using another computer on the network like a laptop or desktop?

Just a computer in the network. The whole connecting to vpn appears to be working

@ankorite
Copy link

ankorite commented Dec 4, 2021

Just a computer in the network. The whole connecting to vpn appears to be working

Then localhost:8888 is not what will take you to the qbittorrent webui as localhost refers to the computer you are using (your local host). You need to enter the IP address to your docker host. For example in my setup I would go to http://192.168.0.13:8080 as my server is at IP 192.168.0.13 and the port I forwarded out of the container is 8080. You will need to go to http://your.server.ip.address:8888 to get to the qbittorrent webui.

@jos149
Copy link
Author

jos149 commented Dec 5, 2021

Just a computer in the network. The whole connecting to vpn appears to be working

Then localhost:8888 is not what will take you to the qbittorrent webui as localhost refers to the computer you are using (your local host). You need to enter the IP address to your docker host. For example in my setup I would go to http://192.168.0.13:8080 as my server is at IP 192.168.0.13 and the port I forwarded out of the container is 8080. You will need to go to http://your.server.ip.address:8888 to get to the qbittorrent webui.

Sorry, that's my typo! I go to the ip:port and get the message Unauthorized which I tried solving. Unsuccessful though.

@ankorite
Copy link

ankorite commented Dec 7, 2021

Do you need to change the port to 8888? I think qbittorrent is not a fan of port forwarding in docker due to CSRF. If you can have it on 8080 try that, if not then you will have to figure out how to change the webui port to 8888 in qbitorrent.conf.

@jos149
Copy link
Author

jos149 commented Dec 7, 2021

Do you need to change the port to 8888? I think qbittorrent is not a fan of port forwarding in docker due to CSRF. If you can have it on 8080 try that, if not then you will have to figure out how to change the webui port to 8888 in qbitorrent.conf.

Well, it is quite easy to change the port in the qbittorrent.conf, and I can also then change it in the docker compose file. But still, without success. My pihole is running on 8080

Changed the pi hole port, used 8080 for this one. No success.

Maybe it helps that it is mentioned:
HOST NOT SET and it mentions it now pings google, but that should not be a big problem I think.

Other findings are:
Now when I use the line LOCAL_NETWORK in docker compose and add the 10.8.0.0/24 because the logs tell me in portainer, everytime I reboot the container it is without range again because it is 10.8.3.0 for example. So I get the RNETLINK error again.

Maybe the env settings help:

CONFIG_DIR | /config
CREDENTIALS_FILE | /config/openvpn/openvpn-credentials.txt
DNS | 1.1.1.1
DOCKER_CIDR | 172.17.0.0/16
LAN | 192.168.1.1/24
LOCAL_NETWORK | 192.168.1.1/24,10.8.1.0/24
NORDVPN_COUNTRY | NL
OPENVPN_CONFIG_FILE | /config/openvpn/config.ovpn
OPENVPN_PASSWORD |
OPENVPN_PROVIDER | NORDVPN
OPENVPN_USERNAME |
PATH | /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
PGID | 1000
PUID | 1000
QBT_SAVE_PATH | /downloads
QBT_WEBUI_PORT | 8080
S6_BEHAVIOUR_IF_STAGE2_FAILS | 2
TUN | /dev/net/tun

I notice the OBT_WEBUI_PORT is still 8080 here, maybe it overrules?
And would the LAN and LOCAL network values be correct?

@ankorite
Copy link

ankorite commented Dec 7, 2021

Try changing the LAN and LOCAL_NETWORK to 192.168.1.0/24 from 192.168.1.1/24 leave the 10.8.1.0/24

You can always give the OBT_WEBUI_PORT a change and see what happens

@jos149
Copy link
Author

jos149 commented Dec 8, 2021

Try changing the LAN and LOCAL_NETWORK to 192.168.1.0/24 from 192.168.1.1/24 leave the 10.8.1.0/24

You can always give the OBT_WEBUI_PORT a change and see what happens

YES! This did the trick, it works!!! Thanks a lot for your great support. Now still need to check the ip address, but I guess I can do that through /bin/bash...

Oh, and it works over port 8888. The thing is: if you change port = 8888:8080 it will work too. If you want to change the port in the qbittorent.conf file....does not work. Because at every restart this file is changed again by QBT_WEBUI_PORT default value (8080). Unless you define it in your docker compose file to use a different port.

@ankorite
Copy link

ankorite commented Dec 8, 2021

Score. Go to ipleak.net to check your VPN torrent setup with their magnet link.

@jos149
Copy link
Author

jos149 commented Dec 9, 2021

Score. Go to ipleak.net to check your VPN torrent setup with their magnet link.

First need to figure out how to open magnet links. Currently, it reports I can only open magnet when I access the GUI through https, so not there yet.

Anyway, I want to access my torrent server only locally, so I think it is not required to use port 443 right?

@ankorite
Copy link

ankorite commented Dec 9, 2021

Right click and copy the magnet link then in qbittorent top left button is add torrent. Paste the magnet link into the text box. It's up to you and your local network security if you want to use https or not. I recommend using a reverse proxy if you want to access anything remotely that way everything is in https etc.

Looks like you got it.

@jos149
Copy link
Author

jos149 commented Dec 10, 2021

Right click and copy the magnet link then in qbittorent top left button is add torrent. Paste the magnet link into the text box. It's up to you and your local network security if you want to use https or not. I recommend using a reverse proxy if you want to access anything remotely that way everything is in https etc.

Looks like you got it.

Yeah, everything is working now. Also running a nginx proxy manager for reverse proxy, but I not really figured that out yet. For now, I copied the magnet link and dropped it in the text box to download the torrent. It is stuck on downloading metadeta. but it appears at the ipleak website so that is nice.

Now start downloading....if torrents still work nowadays.

It appears not a single torrents is actually downloading...too bad.

After some research decided to add a environment variable OPENVPN_CONFIG=P2P but when starting the container this gives me ERROR: Could not find OpenVPN configuration "P2P" for provider NORDVPN. Too bad. Maybe @guillaumedsde knows the correct config to be able to connect to p2p servers?

UPDATE: got it working. Somehow, when letting the downloads run my network speed drops to like 0.5 mbps and a ping of half a second. Even though the torrent speeds are limited and they download very slow. Any idea where this network flooding comes from?

Disabled utp, runs like a charm!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants