From ec00162120889935c38c8bf558434afc70872494 Mon Sep 17 00:00:00 2001 From: Nikhil Byadwal <32981566+darkbeast13@users.noreply.github.com> Date: Wed, 25 Jun 2025 22:38:27 +0530 Subject: [PATCH] feat: add debridav (#24) Co-authored-by: Viren070 --- apps/.env | 3 +- apps/compose.yaml | 1 + apps/debridav/.env | 66 ++++++++++++++++++++++++ apps/debridav/compose.yaml | 102 +++++++++++++++++++++++++++++++++++++ data/debridav/rclone.conf | 5 ++ 5 files changed, 176 insertions(+), 1 deletion(-) create mode 100644 apps/debridav/.env create mode 100644 apps/debridav/compose.yaml create mode 100644 data/debridav/rclone.conf diff --git a/apps/.env b/apps/.env index b6c0b99..d220b1c 100644 --- a/apps/.env +++ b/apps/.env @@ -124,6 +124,7 @@ BAZARR4K_HOSTNAME=4k.bazarr.${DOMAIN} BESZEL_HOSTNAME=beszel.${DOMAIN} COMET_HOSTNAME=comet.${DOMAIN} DASHDOT_HOSTNAME=dash.${DOMAIN} +DEBRIDAV_HOSTNAME=debridav.${DOMAIN} DECYPHARR_HOSTNAME=decypharr.${DOMAIN} DOCKGE_HOSTNAME=dockge.${DOMAIN} DOZZLE_HOSTNAME=dozzle.${DOMAIN} @@ -174,7 +175,7 @@ ZIPLINE_HOSTNAME=zipline.${DOMAIN} ZURG_HOSTNAME=zurg.${DOMAIN} # This is the list of all the domains for which Cloudflare DDNS will create A/AAAA records for. -DOMAINS=${ADDON_MANAGER_HOSTNAME},${AIOSTREAMS_HOSTNAME},${AIOSTREMIO_HOSTNAME},${ANIME_KITSU_HOSTNAME},${ARCANE_HOSTNAME},${AUTHELIA_HOSTNAME},${AUTOSYNC_HOSTNAME},${BAZARR_HOSTNAME},${BAZARR4K_HOSTNAME},${BESZEL_HOSTNAME},${COMET_HOSTNAME},${DASHDOT_HOSTNAME},${DECYPHARR_HOSTNAME},${DOCKGE_HOSTNAME},${DOZZLE_HOSTNAME},${EASYNEWS_PLUS_HOSTNAME},${EASYNEWS_PLUS_PLUS_HOSTNAME},${HONEY_HOSTNAME},${HUNTARR_HOSTNAME},${JACKETT_HOSTNAME},${JACKETTIO_HOSTNAME},${JELLYFIN_HOSTNAME},${JELLYSEER_HOSTNAME},${LIBRESPEED_HOSTNAME},${MEDIAFLOW_PROXY_HOSTNAME},${MEDIAFUSION_HOSTNAME},${MINECRAFT_HOSTNAME},${NZBHYDRA2_HOSTNAME},${OMG_TV_STREMIO_ADDON_HOSTNAME},${OVERSEERR_HOSTNAME},${PLAUSIBLE_HOSTNAME},${PLEX_HOSTNAME},${PORTAINER_HOSTNAME},${PROWLARR_HOSTNAME},${RADARR_HOSTNAME},${RADARR4K_HOSTNAME},${RADARRANIME_HOSTNAME},${SEANIME_HOSTNAME},${SEARXNG_HOSTNAME},${SONARR_HOSTNAME},${SONARR4K_HOSTNAME},${SONARRANIME_HOSTNAME},${SPEEDTEST_TRACKER_HOSTNAME},${STREAMYSTATS_HOSTNAME},${STREMIO_ACCOUNT_BOOTSTRAPPER_HOSTNAME},${STREMIO_CATALOG_PROVIDERS_HOSTNAME},${STREMIO_JACKETT_HOSTNAME},${STREMIO_SERVER_HOSTNAME},${STREMIO_TRAKT_ADDON_HOSTNAME},${STREMTHRU_HOSTNAME},${TAUTULLI_HOSTNAME},${TMDB_ADDON_HOSTNAME},${TORBOX_MANAGER_HOSTNAME},${TRAEFIK_HOSTNAME},${UPTIME_KUMA_HOSTNAME},${VAULTWARDEN_HOSTNAME},${YAMTRACK_HOSTNAME},${ZILEAN_HOSTNAME},${ZIPLINE_HOSTNAME},${ZURG_HOSTNAME} +DOMAINS=${ADDON_MANAGER_HOSTNAME},${AIOSTREAMS_HOSTNAME},${AIOSTREMIO_HOSTNAME},${ANIME_KITSU_HOSTNAME},${ARCANE_HOSTNAME},${AUTHELIA_HOSTNAME},${AUTOSYNC_HOSTNAME},${BAZARR_HOSTNAME},${BAZARR4K_HOSTNAME},${BESZEL_HOSTNAME},${COMET_HOSTNAME},${DASHDOT_HOSTNAME},${DEBRIDAV_HOSTNAME},${DECYPHARR_HOSTNAME},${DOCKGE_HOSTNAME},${DOZZLE_HOSTNAME},${EASYNEWS_PLUS_HOSTNAME},${EASYNEWS_PLUS_PLUS_HOSTNAME},${HONEY_HOSTNAME},${HUNTARR_HOSTNAME},${JACKETT_HOSTNAME},${JACKETTIO_HOSTNAME},${JELLYFIN_HOSTNAME},${JELLYSEER_HOSTNAME},${LIBRESPEED_HOSTNAME},${MEDIAFLOW_PROXY_HOSTNAME},${MEDIAFUSION_HOSTNAME},${MINECRAFT_HOSTNAME},${NZBHYDRA2_HOSTNAME},${OMG_TV_STREMIO_ADDON_HOSTNAME},${OVERSEERR_HOSTNAME},${PLAUSIBLE_HOSTNAME},${PLEX_HOSTNAME},${PORTAINER_HOSTNAME},${PROWLARR_HOSTNAME},${RADARR_HOSTNAME},${RADARR4K_HOSTNAME},${RADARRANIME_HOSTNAME},${SEANIME_HOSTNAME},${SEARXNG_HOSTNAME},${SONARR_HOSTNAME},${SONARR4K_HOSTNAME},${SONARRANIME_HOSTNAME},${SPEEDTEST_TRACKER_HOSTNAME},${STREAMYSTATS_HOSTNAME},${STREMIO_ACCOUNT_BOOTSTRAPPER_HOSTNAME},${STREMIO_CATALOG_PROVIDERS_HOSTNAME},${STREMIO_JACKETT_HOSTNAME},${STREMIO_SERVER_HOSTNAME},${STREMIO_TRAKT_ADDON_HOSTNAME},${STREMTHRU_HOSTNAME},${TAUTULLI_HOSTNAME},${TMDB_ADDON_HOSTNAME},${TORBOX_MANAGER_HOSTNAME},${TRAEFIK_HOSTNAME},${UPTIME_KUMA_HOSTNAME},${VAULTWARDEN_HOSTNAME},${YAMTRACK_HOSTNAME},${ZILEAN_HOSTNAME},${ZIPLINE_HOSTNAME},${ZURG_HOSTNAME} # ==================================================== # DOCKER COMPOSE CONFIGURATION diff --git a/apps/compose.yaml b/apps/compose.yaml index c584bb9..284e119 100644 --- a/apps/compose.yaml +++ b/apps/compose.yaml @@ -12,6 +12,7 @@ include: - cloudflare-ddns/compose.yaml - comet/compose.yaml - dash/compose.yaml + - debridav/compose.yaml - decypharr/compose.yaml - dockge/compose.yaml - dozzle/compose.yaml diff --git a/apps/debridav/.env b/apps/debridav/.env new file mode 100644 index 0000000..89e91cc --- /dev/null +++ b/apps/debridav/.env @@ -0,0 +1,66 @@ +# -------------- DebriDav Internal Paths -------------- + +# Internal path used inside the DebriDav container (should not be changed) +DEBRIDAV_ROOT_PATH=/mnt + +# Path on host that maps to DEBRIDAV_ROOT_PATH inside container +DEBRIDAV_ROOT_HOST_FS=/mnt + +# Subdirectory within DEBRIDAV_ROOT_PATH for downloads +DEBRIDAV_DOWNLOAD_PATH=/downloads + +# Path where DebriDav's WebDAV will be mounted inside other containers (e.g. Sonarr/Radarr) +DEBRIDAV_MOUNT_PATH_CONTAINERS=/mnt/remote/debridav + +# Host path where rclone mounts DebriDav WebDAV +DEBRIDAV_MOUNT_PATH_HOST_FS=/mnt/remote/debridav + +# -------------- DebriDav Web Interface -------------- + +# Port on the host to expose DebriDav’s web interface (internal port is always 8080) +DEBRIDAV_PORT=8889 + +# -------------- Debrid Providers Configuration -------------- + +# Comma-separated list of providers to enable. Allowed values: +# premiumize, real_debrid, easynews, torbox +DEBRIDAV_DEBRID_CLIENTS=premiumize + +# Premiumize API key (get from https://www.premiumize.me/account) +PREMIUMIZE_API_KEY=your_premiumize_api_key + +# Leave these blank if not using for now +REAL_DEBRID_API_KEY= +EASYNEWS_USERNAME= +EASYNEWS_PASSWORD= +TORBOX_API_KEY= + +# -------------- Sonarr/Radarr Integration -------------- + +# Enable integration with Sonarr and Radarr +SONARR_INTEGRATION_ENABLED=true +RADARR_INTEGRATION_ENABLED=true + +# Connection details for Sonarr (running in your stack) +SONARR_HOST=sonarr +SONARR_PORT=8989 +SONARR_API_KEY=your_sonarr_api_key + +# Connection details for Radarr +RADARR_HOST=radarr +RADARR_PORT=7878 +RADARR_API_KEY=your_radarr_api_key + +# -------------- Database Configuration -------------- + +# Postgres DB connection for DebriDav metadata +DEBRIDAV_DB_HOST=postgres-debridav +DEBRIDAV_DB_PORT=5432 +DEBRIDAV_DB_DATABASE_NAME=debridav +DEBRIDAV_DB_USERNAME=debridav +DEBRIDAV_DB_PASSWORD=debridav + +# -------------- Miscellaneous -------------- + +# Skip caching local files smaller than this (in MB) +DEBRIDAV_CACHE_LOCAL_DEBRID_FILES_THRESHOLD_MB=10 diff --git a/apps/debridav/compose.yaml b/apps/debridav/compose.yaml new file mode 100644 index 0000000..0d3145d --- /dev/null +++ b/apps/debridav/compose.yaml @@ -0,0 +1,102 @@ +services: + debridav: + image: ghcr.io/skjaere/debridav:v0 + container_name: debridav + restart: unless-stopped + user: "${PUID}:${PGID}" + security_opt: + - "apparmor:unconfined" + env_file: + - .env + environment: + - PUID=${PUID} + - PGID=${PGID} + - UMASK=002 + - TZ=${TZ} + + - DEBRIDAV_ROOTPATH=${DEBRIDAV_ROOT_PATH} + - DEBRIDAV_DOWNLOADPATH=${DEBRIDAV_DOWNLOAD_PATH} + - DEBRIDAV_MOUNTPATH=${DEBRIDAV_MOUNT_PATH_CONTAINERS} + - DEBRIDAV_DEBRIDCLIENTS=${DEBRIDAV_DEBRID_CLIENTS} + - SPRING_DATASOURCE_URL=jdbc:postgresql://${DEBRIDAV_DB_HOST}:${DEBRIDAV_DB_PORT}/${DEBRIDAV_DB_DATABASE_NAME}?user=${DEBRIDAV_DB_USERNAME}&password=${DEBRIDAV_DB_PASSWORD} + - PREMIUMIZE_APIKEY=${PREMIUMIZE_API_KEY} + - REALDEBRID_APIKEY=${REALDEBRID_API_KEY} + - SONARR_INTEGRATIONENABLED=${SONARR_INTEGRATION_ENABLED} + - SONARR_HOST=${SONARR_HOST} + - SONARR_PORT=${SONARR_PORT} + - SONARR_APIKEY=${SONARR_API_KEY} + - RADARR_INTEGRATIONENABLED=${RADARR_INTEGRATION_ENABLED} + - RADARR_HOST=${RADARR_HOST} + - RADARR_PORT=${RADARR_PORT} + - RADARR_APIKEY=${RADARR_API_KEY} + - EASYNEWS_USERNAME=${EASYNEWS_USERNAME} + - EASYNEWS_PASSWORD=${EASYNEWS_PASSWORD} + - TORBOX_APIKEY=${TORBOX_API_KEY} + volumes: + - ${DEBRIDAV_ROOT_HOST_FS}:${DEBRIDAV_ROOT_PATH} + expose: + - 8080 + labels: + - "traefik.enable=true" + - "traefik.http.routers.debridav.rule=Host(`${DEBRIDAV_HOSTNAME?}`)" + - "traefik.http.routers.debridav.entrypoints=websecure" + - "traefik.http.routers.debridav.tls.certresolver=letsencrypt" + - "traefik.http.routers.debridav.middlewares=authelia@docker" + - "traefik.http.services.debridav.loadbalancer.server.port=8080" + healthcheck: + test: [ "CMD", "curl", "-f", "http://localhost:8080/actuator/health/readiness" ] + interval: 2s + start_period: 2s + retries: 1000 + depends_on: + postgres-debridav: + condition: service_healthy + + rclone: + image: rclone/rclone:latest + container_name: rclone-debridav + restart: unless-stopped + environment: + - TZ=${TZ} + - PUID=${PUID} + - PGID=${PGID} + volumes: + - ${DEBRIDAV_MOUNT_PATH_HOST_FS}:${DEBRIDAV_MOUNT_PATH_CONTAINERS}:rshared + - /opt/docker/data/debridav/rclone.conf:/config/rclone/rclone.conf + - /dev/fuse:/dev/fuse + cap_add: + - SYS_ADMIN + security_opt: + - apparmor:unconfined + devices: + - /dev/fuse:/dev/fuse:rwm + depends_on: + debridav: + condition: service_healthy + command: > + mount debridav: ${DEBRIDAV_MOUNT_PATH_CONTAINERS} + --allow-other + --allow-non-empty + --vfs-cache-mode off + --rc-enable-metrics + --metrics-addr :9002 + --low-level-retries=1 + --dir-cache-time=1s + -vv + + postgres-debridav: + image: postgres:latest + container_name: postgres-debridav + restart: unless-stopped + environment: + - POSTGRES_USER=debridav + - POSTGRES_PASSWORD=debridav + - POSTGRES_DB=debridav + - PGUSER=debridav + - PGDATA=/var/lib/postgresql/data/pgdata + volumes: + - ${DOCKER_DATA_DIR}/debridav/postgres:/var/lib/postgresql/data + healthcheck: + test: [ "CMD-SHELL", "pg_isready -d debridav" ] + interval: 5s + retries: 10 diff --git a/data/debridav/rclone.conf b/data/debridav/rclone.conf new file mode 100644 index 0000000..88da8d0 --- /dev/null +++ b/data/debridav/rclone.conf @@ -0,0 +1,5 @@ +[debridav] +type = webdav +url = http://debridav:8080/webdav/premiumize +vendor = other +pacer_min_sleep = 0