Skip to content

Commit e4ede92

Browse files
committed
Add VPN support (modularizable) + refactoring + variables changes
1 parent ef28630 commit e4ede92

35 files changed

+235
-45
lines changed

.env.sample

+13-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ TZ="Europe/Paris"
1010
HTTP_USER=myuser
1111
HTTP_PASSWORD='mypassword_encoded' # Keep these simple quotes!
1212

13-
# Containers permissions mapping
13+
# Host paths + containers permissions mapping
14+
HOST_CONFIG_PATH="/data/config"
15+
HOST_MEDIA_PATH="/data/torrents"
16+
# Will be located in $HOST_MEDIA_PATH
17+
DOWNLOAD_SUBFOLDER="deluge"
1418
PGID=1000
1519
PUID=1000
1620

@@ -29,4 +33,11 @@ PORTAINER_ADMIN_PASSWORD=h4ckMePleAse
2933

3034
# Flood username declared in deluge rpc daemon
3135
FLOOD_PASSWORD=myfloodpassword
32-
FLOOD_AUTOCREATE_USER_IN_DELUGE_DAEMON=false
36+
FLOOD_AUTOCREATE_USER_IN_DELUGE_DAEMON=false
37+
38+
# Wireguard custom endpoint
39+
WIREGUARD_ENDPOINT=<ENDPOINT>
40+
WIREGUARD_PORT=51820
41+
WIREGUARD_PUBLIC_KEY=<WIREGUARD_PUBLIC_KEY>
42+
WIREGUARD_PRIVATE_KEY=<WIREGUARD_PRIVATE_KEY>
43+
WIREGUARD_ADDRESS=<WIREGUARD_LAN_ADDRESS>

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@
66
**/traefik/http_auth
77
backup/
88
services.conf
9+
traefik/custom/dynamic*.yaml

README.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ seedbox and personal media server.
99
-----------------------|----------------------------|------------------------------------------------------------------------|-------------------------|---------------------|
1010
| Plex | plex.yourdomain.com | [linuxserver/plex](https://hub.docker.com/r/linuxserver/plex) | *latest* | Media Streaming |
1111
| Deluge | deluge.yourdomain.com | [linuxserver/deluge](https://hub.docker.com/r/linuxserver/deluge) | *latest* | Torrents downloader |
12+
| Deluge (VPN) | deluge.yourdomain.com | [linuxserver/deluge](https://hub.docker.com/r/linuxserver/deluge) | *latest* | Torrents downloader (behind VPN) |
1213
| Flood | flood.yourdomain.com | [jesec/flood](https://hub.docker.com/r/jesec/flood) | *latest* | Web client for Deluge (experimental) |
1314
| Sonarr | sonarr.yourdomain.com | [linuxserver/sonarr](https://hub.docker.com/r/linuxserver/sonarr) | *develop* | TV Shows monitor |
1415
| Radarr | radarr.yourdomain.com | [linuxserver/radarr](https://hub.docker.com/r/linuxserver/radarr) | *develop* | Movies monitor |
@@ -22,13 +23,15 @@ seedbox and personal media server.
2223
| Jackett | jackett.yourdomain.com | [linuxserver/jackett](https://hub.docker.com/r/linuxserver/jackett) | *latest* | Tracker indexer |
2324
| Prowlarr | prowlarr.yourdomain.com | [linuxserver/prowlarr](https://hub.docker.com/r/linuxserver/prowlarr) | *develop* | Tracker indexer |
2425
| JDownloader | jdownloader.yourdomain.com | [jlesage/jdownloader-2](https://hub.docker.com/r/jlesage/jdownloader-2)| *latest* | Direct downloader |
26+
| JDownloader (VPN) | jdownloader.yourdomain.com | [jlesage/jdownloader-2](https://hub.docker.com/r/jlesage/jdownloader-2)| *latest* | Direct downloader (behind VPN) |
2527
| Tautulli (plexPy) | tautulli.yourdomain.com | [linuxserver/tautulli](https://hub.docker.com/r/linuxserver/tautulli) | *latest* | Plex stats and admin|
2628
| Tdarr | tdarr.yourdomain.com | [haveagitgat/tdarr](https://hub.docker.com/r/haveagitgat/tdarr) | *latest* | Re-encode files |
2729
| NextCloud | nextcloud.yourdomain.com | [linuxserver/nextcloud](https://hub.docker.com/r/linuxserver/nextcloud) | *latest* | Files management |
2830
| NextCloud-db (MariaDB) | not reachable | [mariadb](https://hub.docker.com/r/_/mariadb) | *10* | DB for Nextcloud |
2931
| Portainer | portainer.yourdomain.com | [portainer/portainer](https://hub.docker.com/r/portainer/portainer) | *latest* | Container management|
3032
| Netdata | netdata.yourdomain.com | [netdata/netdata](https://hub.docker.com/r/netdata/netdata) | *latest* | Server monitoring |
3133
| Duplicati | duplicati.yourdomain.com | [linuxserver/duplicati](https://hub.docker.com/r/linuxserver/duplicati)| *latest* | Backups |
34+
| Gluetun | - | [qmcgaw/gluetun](https://hub.docker.com/r/qmcgaw/gluetun)| *latest* | VPN client (still WIP...) |
3235

3336
The front-end reverse proxy (Traefik - **check the next section if you have already the seedbox with Traefik v1**) routes based on the lowest level subdomain
3437
(e.g. `deluge.example.com` would route to deluge). Since this is how the router
@@ -77,6 +80,7 @@ sudo rm -rf /opt/traefik /tmp/migration
7780
## Configuration
7881

7982
Before running, please create the volumes which will be statically mapped to the ones on the host:
83+
For example:
8084

8185
```sh
8286
sudo su -c "mkdir /data && mkdir /data/config && mkdir /data/torrents"
@@ -106,7 +110,7 @@ this.
106110
## PlexPass
107111

108112
Just set the `VERSION` environment variable to `latest` on the Plex service (enabled by default).
109-
See https://hub.docker.com/r/linuxserver/plex.
113+
See [this link](https://hub.docker.com/r/linuxserver/plex).
110114

111115
## Where is my data?
112116

docker-compose.yaml

+5-6
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,20 @@ version: "3.8"
66

77
# Common network used by all services
88
networks:
9-
default:
10-
external:
11-
name: "traefik-network"
9+
default:
10+
name: "traefik-network"
1211

1312
# Common volumes used by at least 2 services
1413
volumes:
1514
config:
1615
driver: local-persist
1716
driver_opts:
18-
mountpoint: /data/config
17+
mountpoint: $HOST_CONFIG_PATH
1918
torrents:
2019
driver: local-persist
2120
driver_opts:
22-
mountpoint: /data/torrents
21+
mountpoint: $HOST_MEDIA_PATH
2322
downloads:
2423
driver: local-persist
2524
driver_opts:
26-
mountpoint: /data/torrents/deluge
25+
mountpoint: $HOST_MEDIA_PATH/$DOWNLOAD_SUBFOLDER

samples/traefik-deluge-vpn.yaml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
http:
2+
routers:
3+
deluge:
4+
rule: 'Host(`deluge.{{ env "TRAEFIK_DOMAIN" }}`)'
5+
middlewares:
6+
- common-auth@file
7+
service: deluge
8+
services:
9+
deluge:
10+
loadBalancer:
11+
servers:
12+
- url: "http://gluetun:8112"

samples/traefik-jdownloader-vpn.yaml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
http:
2+
routers:
3+
jdownloader:
4+
rule: 'Host(`jdownloader.{{ env "TRAEFIK_DOMAIN" }}`)'
5+
middlewares:
6+
- common-auth@file
7+
service: deluge
8+
services:
9+
jdownloader:
10+
loadBalancer:
11+
servers:
12+
- url: "http://gluetun:5800"

services.conf.sample

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
deluge: enable
2+
deluge-vpn: disable
23
flood: enable
34
plex: enable
5+
plex-hardware-transcoding: disable
46
flaresolverr: enable
57
jackett: enable
68
prowlarr: enable
@@ -19,4 +21,5 @@ tdarr: enable
1921
nextcloud: enable
2022
portainer: enable
2123
netdata: enable
22-
duplicati: enable
24+
duplicati: enable
25+
gluetun: disable

services/bazarr.yaml

100644100755
+1-1
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ volumes:
1919
configbazarr:
2020
driver: local-persist
2121
driver_opts:
22-
mountpoint: /data/config/bazarr
22+
mountpoint: $HOST_CONFIG_PATH/bazarr

services/deluge-vpn.yaml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
services:
2+
deluge:
3+
image: ghcr.io/linuxserver/deluge
4+
container_name: deluge
5+
restart: always
6+
network_mode: "service:gluetun"
7+
volumes:
8+
- torrents:/torrents
9+
- configdeluge:/config
10+
- downloads:/downloads
11+
environment:
12+
- PGID=${PGID}
13+
- PUID=${PUID}
14+
- TZ=${TZ}
15+
# Traefik labels are in Gluetun YAML as deluge must be accessed via Gluetun
16+
17+
volumes:
18+
configdeluge:
19+
driver: local-persist
20+
driver_opts:
21+
mountpoint: $HOST_CONFIG_PATH/deluge

services/deluge.yaml

100644100755
+1-1
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ volumes:
2020
configdeluge:
2121
driver: local-persist
2222
driver_opts:
23-
mountpoint: /data/config/deluge
23+
mountpoint: $HOST_CONFIG_PATH/deluge

services/duplicati.yaml

100644100755
+3-7
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,18 @@ services:
1010
volumes:
1111
- configduplicati:/config
1212
- backups:/backups
13-
- alldata:/source
13+
- config:/source
1414
labels:
1515
- "traefik.enable=true"
1616
- "traefik.http.routers.duplicati.rule=Host(`duplicati.${TRAEFIK_DOMAIN}`)"
1717
- "traefik.http.routers.duplicati.middlewares=common-auth@file"
1818

1919
volumes:
20-
alldata:
21-
driver: local-persist
22-
driver_opts:
23-
mountpoint: /data
2420
configduplicati:
2521
driver: local-persist
2622
driver_opts:
27-
mountpoint: /data/config/duplicati
23+
mountpoint: $HOST_CONFIG_PATH/duplicati
2824
backups:
2925
driver: local-persist
3026
driver_opts:
31-
mountpoint: /data/backups
27+
mountpoint: $HOST_CONFIG_PATH/backups

services/flaresolverr.yaml

100644100755
File mode changed.

services/flood.yaml

100644100755
+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ services:
88
user: ${PUID}:${PGID}
99
command:
1010
- --auth=none
11-
- --dehost=deluge
11+
- --dehost=${DELUGE_HOST}
1212
- --deport=58846
1313
- --deuser=flood
1414
- --depass=${FLOOD_PASSWORD}
@@ -29,4 +29,4 @@ volumes:
2929
configflood:
3030
driver: local-persist
3131
driver_opts:
32-
mountpoint: /data/config/flood
32+
mountpoint: $HOST_CONFIG_PATH/flood

services/gluetun.yaml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
services:
2+
gluetun:
3+
image: qmcgaw/gluetun
4+
container_name: gluetun
5+
restart: always
6+
cap_add:
7+
- NET_ADMIN
8+
environment:
9+
- PUID=${PUID}
10+
- PGIDq=${PGID}
11+
- TZ=${TZ}
12+
- VPNSP=custom
13+
- VPN_TYPE=wireguard
14+
# For Wireguard
15+
- VPN_ENDPOINT_IP=${WIREGUARD_ENDPOINT}
16+
- VPN_ENDPOINT_PORT=${WIREGUARD_PORT}
17+
- WIREGUARD_PUBLIC_KEY=${WIREGUARD_PUBLIC_KEY}
18+
- WIREGUARD_PRIVATE_KEY=${WIREGUARD_PRIVATE_KEY}
19+
- WIREGUARD_ADDRESS=${WIREGUARD_ADDRESS}
20+
#labels:
21+
# Control Panel
22+
# - "traefik.enable=true"
23+
# - "traefik.http.routers.gluetun.rule=Host(`gluetun.${TRAEFIK_DOMAIN}`)"
24+
# - "traefik.http.routers.gluetun.middlewares=common-auth@file"
25+
# - "traefik.http.routers.gluetun.service=gluetun"
26+
# - "traefik.http.services.gluetun.loadbalancer.server.port=8000"
27+
# Traefik rules for VPN-enabled services (which have ot be accessed through gluetun) are defined in the samples/ directory
28+
# and are applied automatically in the update-all.sh script.
29+
30+
volumes:
31+
configgluetun:
32+
driver: local-persist
33+
driver_opts:
34+
mountpoint: $HOST_CONFIG_PATH/gluetun

services/jackett.yaml

100644100755
File mode changed.

services/jdownloader-vpn.yaml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
services:
2+
jdownloader:
3+
image: jlesage/jdownloader-2
4+
container_name: jdownloader
5+
restart: always
6+
network_mode: "service:gluetun"
7+
volumes:
8+
- configjdownloader:/config
9+
- downloads:/output
10+
environment:
11+
- USER_ID=${PUID}
12+
- GROUP_ID=${PGID}
13+
- TZ=${TZ}
14+
# Traefik routing rules are defined in the samples/ directory and applied automatically when this service is enabled
15+
16+
volumes:
17+
configjdownloader:
18+
driver: local-persist
19+
driver_opts:
20+
mountpoint: $HOST_CONFIG_PATH/jdownloader

services/jdownloader.yaml

100644100755
+1-1
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ volumes:
2020
configjdownloader:
2121
driver: local-persist
2222
driver_opts:
23-
mountpoint: /data/config/jdownloader
23+
mountpoint: $HOST_CONFIG_PATH/jdownloader

services/kavita.yaml

100644100755
+1-1
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ volumes:
1919
configkavita:
2020
driver: local-persist
2121
driver_opts:
22-
mountpoint: /data/config/kavita
22+
mountpoint: $HOST_CONFIG_PATH/kavita

services/komga.yaml

100644100755
+1-1
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ volumes:
1818
configkomga:
1919
driver: local-persist
2020
driver_opts:
21-
mountpoint: /data/config/komga
21+
mountpoint: $HOST_CONFIG_PATH/komga

services/lidarr.yaml

100644100755
+1-1
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ volumes:
1919
configlidarr:
2020
driver: local-persist
2121
driver_opts:
22-
mountpoint: /data/config/lidarr
22+
mountpoint: $HOST_CONFIG_PATH/lidarr

services/netdata.yaml

100644100755
File mode changed.

services/nextcloud.yaml

100644100755
+3-3
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ volumes:
4141
nextclouddb:
4242
driver: local-persist
4343
driver_opts:
44-
mountpoint: /data/nextcloud-db
44+
mountpoint: $HOST_CONFIG_PATH/nextcloud-db
4545
confignextcloud:
4646
driver: local-persist
4747
driver_opts:
48-
mountpoint: /data/config/nextcloud
48+
mountpoint: $HOST_CONFIG_PATH/nextcloud
4949
nextclouddata:
5050
driver: local-persist
5151
driver_opts:
52-
mountpoint: /data/config/nextcloud-data
52+
mountpoint: $HOST_CONFIG_PATH/nextcloud-data

services/ombi.yaml

100644100755
+1-1
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ volumes:
1919
configombi:
2020
driver: local-persist
2121
driver_opts:
22-
mountpoint: /data/config/ombi
22+
mountpoint: $HOST_CONFIG_PATH/ombi

services/overseerr.yaml

100644100755
+1-1
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ volumes:
1717
configoverseerr:
1818
driver: local-persist
1919
driver_opts:
20-
mountpoint: /data/config/overseerr
20+
mountpoint: $HOST_CONFIG_PATH/overseerr
+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
services:
2+
plex:
3+
image: ghcr.io/linuxserver/plex
4+
container_name: plex
5+
restart: always
6+
ports:
7+
- "32400:32400"
8+
- "32400:32400/udp"
9+
- "32469:32469"
10+
- "32469:32469/udp"
11+
devices:
12+
- /dev/dri:/dev/dri # for hardware transcoding
13+
volumes:
14+
- configplex:/config
15+
- torrents:/torrents
16+
- /dev/shm:/transcode
17+
environment:
18+
- PGID=${PGID}
19+
- PUID=${PUID}
20+
- TZ=${TZ}
21+
- VERSION=latest
22+
labels:
23+
- "traefik.enable=true"
24+
- "traefik.http.services.plex-seedbox.loadbalancer.server.port=32400"
25+
- "traefik.http.routers.plex.rule=Host(`plex.${TRAEFIK_DOMAIN}`)"
26+
27+
volumes:
28+
configplex:
29+
driver: local-persist
30+
driver_opts:
31+
mountpoint: $HOST_CONFIG_PATH/Plex

0 commit comments

Comments
 (0)