diff --git a/docs/gluetun.md b/docs/gluetun.md new file mode 100644 index 0000000..2a0603d --- /dev/null +++ b/docs/gluetun.md @@ -0,0 +1,89 @@ +# Make Invidious requests data from YouTube through a VPN using Gluetun (in case your IP is blocked) + +## Create the docker network (must be done outside of the compose file): + +``` +docker network create --subnet=172.80.0.0/16 gluetun_network +``` + +Note: We're not using the Gluetun default of 172.18.0.0/16, because it might already be used which causes Gluetun to not start with the error `Error response from daemon: invalid pool request: Pool overlaps with other one on this address space`, if you have this issue with 172.80.0.0/16 just use a number higher than "80" (at the second byte) and apply the rest of the documentation accordingly + + +## Create the compose file for Gluetun + +- Global setup: https://github.com/qdm12/gluetun-wiki/tree/main/setup + +- Provider setup: https://github.com/qdm12/gluetun-wiki/tree/main/setup/providers + +``` +services: + gluetun: + image: ghcr.io/qdm12/gluetun + container_name: gluetun + cap_add: + - NET_ADMIN + devices: + - /dev/net/tun:/dev/net/tun + ports: +# - 8888:8888/tcp # HTTP proxy # Useless +# - 8388:8388/tcp # Shadowsocks # Useless +# - 8388:8388/udp # Shadowsocks # Useless + - "127.0.0.1:3000:3000" # Invidious (use the Invidious ports configuration) + volumes: + - /docker/gluetun/data:/gluetun + environment: + - VPN_SERVICE_PROVIDER= + - VPN_TYPE=openvpn # Use openvpn or wireguard + - OPENVPN_USER= + - OPENVPN_PASSWORD= + - SERVER_COUNTRIES=Germany # Use your server location + - UPDATER_PERIOD=24h + - TZ=Europe/Paris # Use your timezone + networks: + gluetun_network: + +networks: + gluetun_network: + external: true +``` + +## Make Invidious use gluetun + + +Add this to your DB: + +``` + networks: + gluetun_network: + ipv4_address: 172.80.0.22 +``` + +Add this to the end of your compose (to make the Invidious-Postgres stack connect to gluetun): + +``` +networks: + gluetun_network: + external: true +``` + + +Add this to the Invidious container: + +``` + network_mode: "container:gluetun" +``` + +Comment out the "- ports:" of the Invidious container (gluetun replaces it, reason why we configured it with the same value) + + +Update the Invidious config to use the new database address (since the network is "different", using the hostname wont work): + +``` + INVIDIOUS_CONFIG: | + db: + dbname: invidious + user: kemal + password: + host: 172.80.0.22 + port: 5432 +``` diff --git a/docs/index.md b/docs/index.md index 176730d..098e436 100644 --- a/docs/index.md +++ b/docs/index.md @@ -22,6 +22,7 @@ - [NGINX reverse proxy setup](./nginx.md) - [Caddy reverse proxy setup](./caddy.md) - [Apache2 reverse proxy setup](./apache2.md) +- [Make Invidious requests data from YouTube through a VPN using Gluetun (in case your IP is blocked)](./gluetun.md) - [Database maintenance](./db-maintenance.md) - [CAPTCHA bug on Debian and Ubuntu](./captcha-bug.md) - [Registering users manually](./register-user.md) diff --git a/mkdocs.yml b/mkdocs.yml index 855b177..51657a8 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -27,6 +27,7 @@ nav: - 'nginx.md' - 'caddy.md' - 'apache2.md' + - 'gluetun.md' - 'db-maintenance.md' - 'captcha-bug.md' - 'register-user.md'