You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ansible-homelab/roles/setup_hosted_services/templates/vpn-stack.j2

204 lines
5.7 KiB
Django/Jinja

---
version: "3"
services:
surfshark:
image: ilteoood/docker-surfshark
container_name: surfshark
environment:
- SURFSHARK_USER={{ vpn.surfshark_username }}
- SURFSHARK_PASSWORD={{ vpn.surfshark_password }}
# must specify LAN_NETWORK otherwise you will not be able
# to access ports which are exposed here.
- LAN_NETWORK={{ vpn.lan_network }}
cap_add:
- NET_ADMIN
devices:
- /dev/net/tun
ports:
# qbittorrent
- 15000:15000
- 6881:6881
- 6881:6881/udp
# radarr
- 7878:7878
# sonarr
- 8989:8989
# jackett
- 9117:9117
# tube
- 8000:8000
restart: unless-stopped
dns:
- 1.1.1.1
- 8.8.8.8
{% if template_vars.qbittorrent %}
qbittorrent:
labels:
ie.cianhatton.backup.enabled: "true"
ie.cianhatton.backup.schedule: "{{ backups.schedule_keys.nightly }}"
depends_on:
- surfshark
image: lscr.io/linuxserver/qbittorrent:latest
container_name: qbittorrent
network_mode: service:surfshark
environment:
- PUID=1000
- PGID=1000
- TZ=Europe/London
- WEBUI_PORT=15000
volumes:
- qbittorrent_config:/config
- {{ directories.downloads_dir }}:/downloads
restart: unless-stopped
{% endif %}
{% if template_vars.radarr %}
radarr:
labels:
ie.cianhatton.backup.enabled: "true"
ie.cianhatton.backup.schedule: "{{ backups.schedule_keys.nightly }}"
depends_on:
- surfshark
image: lscr.io/linuxserver/radarr:latest
container_name: radarr
network_mode: service:surfshark
environment:
- PUID=1000
- PGID=1000
- TZ=Europe/London
volumes:
- radarr_config:/config
- {{ directories.movies_dir }}:/movies
- {{ directories.downloads_dir }}:/downloads
restart: unless-stopped
{% endif %}
{% if template_vars.sonarr %}
sonarr:
depends_on:
- surfshark
image: lscr.io/linuxserver/sonarr:latest
labels:
ie.cianhatton.backup.enabled: "true"
ie.cianhatton.backup.schedule: "{{ backups.schedule_keys.nightly }}"
container_name: sonarr
network_mode: service:surfshark
environment:
- PUID=1000
- PGID=1000
- TZ=Europe/London
volumes:
- sonarr_config:/config
- {{ directories.tv_dir }}:/tv
- {{ directories.downloads_dir }}:/downloads
restart: unless-stopped
{% endif %}
{% if template_vars.jackett %}
jackett:
labels:
ie.cianhatton.backup.enabled: "true"
ie.cianhatton.backup.schedule: "{{ backups.schedule_keys.nightly }}"
depends_on:
- surfshark
image: lscr.io/linuxserver/jackett:latest
container_name: jackett
network_mode: service:surfshark
environment:
- PUID=1000
- PGID=1000
- TZ=Europe/London
- AUTO_UPDATE=true
volumes:
- jackett_config:/config
- {{ directories.downloads_dir }}:/downloads
restart: unless-stopped
{% endif %}
{% if template_vars.tubearchivist %}
tubearchivist:
labels:
ie.cianhatton.backup.enabled: "true"
ie.cianhatton.backup.schedule: "{{ backups.schedule_keys.nightly }}"
container_name: tubearchivist
network_mode: service:surfshark
restart: unless-stopped
image: bbilly1/tubearchivist
volumes:
- {{ directories.youtube_dir }}:/youtube
- cache:/cache
environment:
- ES_URL=http://archivist-es:9200 # needs protocol e.g. http and port
- REDIS_HOST=archivist-redis # don't add protocol
- HOST_UID=1000
- HOST_GID=1000
- TA_HOST=qnap # set your host name
- TA_USERNAME=tubearchivist # your initial TA credentials
- "TA_PASSWORD={{ ta_password }}" # your initial TA credentials
- "ELASTIC_PASSWORD={{ elastic_password }}" # set password for Elasticsearch
- TZ=Europe/London # set your time zone
depends_on:
- archivist-es
- archivist-redis
- surfshark
archivist-redis:
labels:
ie.cianhatton.backup.enabled: "true"
ie.cianhatton.backup.schedule: "{{ backups.schedule_keys.nightly }}"
image: redislabs/rejson # for arm64 use bbilly1/rejson
container_name: archivist-redis
restart: unless-stopped
expose:
- "6379"
volumes:
- redis:/data
depends_on:
- archivist-es
archivist-es:
labels:
ie.cianhatton.backup.enabled: "true"
ie.cianhatton.backup.schedule: "{{ backups.schedule_keys.nightly }}"
image: bbilly1/tubearchivist-es # only for amd64, or use official es 8.4.3
container_name: archivist-es
restart: unless-stopped
environment:
- "xpack.security.enabled=true"
- "ELASTIC_PASSWORD={{ elastic_password }}" # matching Elasticsearch password
- "discovery.type=single-node"
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
ulimits:
memlock:
soft: -1
hard: -1
volumes:
- es:/usr/share/elasticsearch/data # check for permission error when using bind mount, see readme
expose:
- "9200"
{% endif %}
volumes:
{% if template_vars.jackett %}
jackett_config:
{% endif %}
{% if template_vars.qbittorrent %}
qbittorrent_config:
# https://askubuntu.com/questions/1203832/how-to-mount-smb-share-on-ubuntu-18-04-with-read-write-from-the-terminal
# downloads:
# driver: local
# driver_opts:
# type: "cifs"
# device: "//192.168.178.42/downloads"
# o: "username=cianhatton,password={{ cianhatton_password }},dir_mode=0777,file_mode=0777"
{% endif %}
{% if template_vars.radarr %}
radarr_config:
{% endif %}
{% if template_vars.sonarr %}
sonarr_config:
{% endif %}
{% if template_vars.tubearchivist %}
cache:
redis:
es:
{% endif %}