Autoheal functionality

This commit is contained in:
Ben Sarmiento
2023-10-24 14:56:03 +02:00
parent 16668b90a1
commit 003ba1eb51
8 changed files with 362 additions and 276 deletions

126
README.md
View File

@@ -1,16 +1,29 @@
# zurg
# zurg-testing
## Building
A self-hosted Real-Debrid webdav server written from scratch, alternative to rclone_rd
```bash
docker build -t ghcr.io/debridmediamanager/zurg:latest .
```
## How to run zurg in 5 steps
This builds zurg
1. Clone this repo `git clone https://github.com/debridmediamanager/zurg-testing.git`
2. Add your token in `config.yml`
3. `sudo mkdir -p /mnt/zurg`
4. Run `docker compose up -d`
5. `time ls -1R /mnt/zurg` You're done!
The server is also exposed to your localhost via port 9999. You can point [Infuse](https://firecore.com/infuse) or any webdav clients to it.
> Note: I have only tested this in Mac and Linux
## Why zurg? Why not rclone_rd? Why not Real-Debrid's own webdav?
- Better performance than anything out there; changes in your library appear instantly (assuming Plex picks it up fast enough)
- You should be able to access every file even if the torrent names are the same so if you have a lot of these, you might notice that zurg will have more files compared to others (e.g. 2 torrents named "Simpsons" but have different seasons, zurg merges all contents in that directory)
- You can configure a flexible directory structure in `config.yml`; you can select individual torrents that should appear on a directory by the ID you see in [DMM](https://debridmediamanager.com/)
- If you've ever experienced Plex scanner being stuck on a file and thereby freezing Plex completely, it should not happen anymore because zurg does a comprehensive check if a torrent is dead or not
## config.yml
You need a `config.yml` created before you use zurg
You need a `config.yml` created before you can use zurg
```yaml
# Zurg configuration version
@@ -18,27 +31,26 @@ zurg: v1
token: YOUR_TOKEN_HERE
port: 9999
concurrent_workers: 10
check_for_changes_every_secs: 15
info_cache_time_hours: 12
concurrent_workers: 10 # the higher the number the faster zurg runs through your library but too high and you will get rate limited
check_for_changes_every_secs: 15 # zurg polls real-debrid for changes in your library
info_cache_time_hours: 12 # how long do we want to check if a torrent is still alive or dead? 12 to 24 hours is good enough
# repair fixes broken links, but it doesn't mean it will appear on the same location (especially if there's only 1 episode missing)
enable_repair: false # BEWARE! THERE CAN ONLY BE 1 INSTANCE OF ZURG THAT SHOULD REPAIR YOUR TORRENTS
# List of directory definitions and their filtering rules
directories:
# Configuration for TV shows
shows:
group: media # directories on different groups have duplicates of the same torrent
filters:
- regex: /season[\s\.]?\d/i # Capture torrent names with the term 'season' in any case
- regex: /Saison[\s\.]?\d/i # For non-English namings
- regex: /stage[\s\.]?\d/i
- regex: /saison[\s\.]?\d/i # For non-English namings
- regex: /stagione[\s\.]?\d/i # if there's french, there should be italian too
- regex: /s\d\d/i # Capture common season notations like S01, S02, etc.
- regex: /\btv/i # anything that has TV in it is a TV show, right?
- contains: complete
- contains: seasons
- id: ATUWVRF53X5DA
- contains_strict: PM19
- contains_strict: Detective Conan Remastered
- contains_strict: Goblin Slayer
# Configuration for movies
movies:
@@ -46,87 +58,17 @@ directories:
filters:
- regex: /.*/ # you cannot leave a directory without filters because it will not have any torrents in it
# Configuration for Dolby Vision content
"hd movies":
group: another
filters:
- regex: /\b2160|\b4k|\buhd|\bdovi|\bdolby.?vision|\bdv|\bremux/i # Matches abbreviations of 'dolby vision'
"low quality":
group: another
"ALL MY STUFFS":
group: all # notice the group now is "all", which means it will have all the torrents of shows+movies combined because this directory is alone in this group
filters:
- regex: /.*/
# Configuration for children's content
kids:
"Kids":
group: kids
filters:
- contains: xxx # Ensures adult content is excluded
- id: XFPQ5UCMUVAEG # Specific inclusion by torrent ID
- not_contains: xxx # Ensures adult content is excluded
- id: XFPQ5UCMUVAEG # Specific inclusion by torrent ID
- id: VDRPYNRPQHEXC
- id: YELNX3XR5XJQM
```
## Running
### Standalone webdav server
```bash
docker run -v ./config.yml:/app/config.yml -v zurgdata:/app/data -p 9999:9999 ghcr.io/debridmediamanager/zurg:latest
```
- Runs zurg on port 9999 on your localhost
- Make sure you have config.yml on the current directory
- It creates a `zurgdata` volume for the data files
### with rclone
You will need to create a `media` directory to make the rclone mount work.
```yaml
version: '3.8'
services:
zurg:
image: ghcr.io/debridmediamanager/zurg:latest
restart: unless-stopped
ports:
- 9999
volumes:
- ./config.yml:/app/config.yml
- zurgdata:/app/data
rclone:
image: rclone/rclone:latest
restart: unless-stopped
environment:
TZ: Europe/Berlin
PUID: 1000
PGID: 1000
volumes:
- ./media:/data:rshared
- ./rclone.conf:/config/rclone/rclone.conf
cap_add:
- SYS_ADMIN
security_opt:
- apparmor:unconfined
devices:
- /dev/fuse:/dev/fuse:rwm
command: "mount zurg: /data --allow-non-empty --allow-other --uid 1000 --gid 1000 --dir-cache-time 1s --read-only"
volumes:
zurgdata:
```
Together with this `docker-compose.yml` you will need this `rclone.conf` as well on the same directory.
```
[zurg]
type = http
url = http://zurg:9999/http
no_head = false
no_slash = true
```