Преглед на файлове

Refactoring, got gangplank and the public tracker Deluge in more working order.

master
treyzania преди 4 години
родител
ревизия
beaca83fde
променени са 5 файла, в които са добавени 52 реда и са изтрити 22 реда
  1. 10
    0
      Dockerfile-gangplank
  2. 27
    5
      compose-template.yml
  3. 10
    6
      gangplank.py
  4. 0
    7
      gangplank/Dockerfile
  5. 5
    4
      yarrbox.py

+ 10
- 0
Dockerfile-gangplank Целия файл

@@ -0,0 +1,10 @@
FROM python:3.7-alpine

COPY . /opt/yarrbox/

RUN apk add unzip unrar
RUN pip3 install inotify

WORKDIR /

ENTRYPOINT ["/opt/yarrbox/gangplank.py"]

+ 27
- 5
compose-template.yml Целия файл

@@ -19,8 +19,9 @@ services:
# - ADVERTISE_IP=http://<hostIPAddress>:32400/
volumes:
- ${vol.conf.plex}/config:/config
- ${vol.work.plextrans}:/transcode
- ${vol.conf.plex}/data:/data
- ${vol.work.plextrans}:/transcode
- ${vol.work.yarr}/bootybot-extract:/mnt/work
- /etc/localtime:/etc/localtime:ro
deluge_public:
container_name: delugepublic
@@ -34,14 +35,21 @@ services:
ports:
- 9091:9091
environment:
- DELUGE_DOWNLOAD_DIR=/mnt/torrent-seed
- DELUGE_INCOMPLETE_DIR=/mnt/torrent-download
- DELUGE_WATCH_DIR=/mnt/torrent-autoadd
- OPENVPN_PROVIDER=${net.vpn.host}
- OPENVPN_CONFIG=${net.vpn.config}
# - OPENVPN_CONFIG=${net.vpn.config}
- OPENVPN_USERNAME=${net.vpn.username}
- OPENVPN_PASSWORD=${net.vpn.password}
volumes:
# TODO Add Deluge config directory
- ${vol.torrent.active}/public:/data
- ${vol.torrent.seed}/public:/seeding
- ${vol.conf.torrent}/public:/config
- ${vol.ingest.torrent}/public:/mnt/torrent-autoadd
- ${vol.log.yarr}/bootybot:/mnt/log/bootybot
- ${vol.torrent.active}/public:/mnt/torent-download
- ${vol.torrent.seed}/public:/mnt/torrent-seed
- ${vol.work.yarr}/bootybot-extract:/mnt/work
- /etc/localtime:/etc/localtime:ro # suggested in their readme
deluge_private:
container_name: delugeprivate
@@ -49,6 +57,20 @@ services:
restart: unless-stopped
volumes:
- ${vol.conf.torrent}/private:/config
- ${vol.log.yarr}/bootybot:/mnt/log/bootybot
- ${vol.torrent.active}/private:/downloads
- ${vol.torrent.seed}/public:/seeding
- ${vol.torrent.seed}/private:/seeding
- ${vol.work.yarr}/bootybot-extract:/mnt/work
- /etc/localtime:/etc/localtime:ro
gangplank:
container_name: gangplank
restart: unless-stopped
build:
context: .
dockerfile: Dockerfile-gangplank
volumes:
- ${vol.ingest.media}:/mnt/ingest
- ${vol.log.yarr}/gangplank:/mnt/log/gangplank
- ${vol.work.yarr}/gangplank-extract:/mnt/work
- /etc/localtime:/etc/localtime:ro
command: /mnt/ingest /mnt/work

gangplank/gankplank.py → gangplank.py Целия файл

@@ -86,17 +86,21 @@ def main(args):
for event in watch.event_gen(yield_nones=False):
(_, type_names, path, filename) = event

fullpath = os.path.join(path, filename)
if os.path.isdir(fullpath):
print('Found new directory created:', filename)
continue

# Do some checking to see if it was something we care about.
wasclosewrite = False
for tns in type_names:
if tns == 'IN_CLOSE_WRITE':
wasclosewrite = True
if not wasclosewrite:
wasimportant = False
for tn in type_names:
if tn == 'IN_CLOSE_WRITE' or tn == 'IN_MOVED_TO':
wasimportant = True
if not wasimportant:
continue

# Actually deal with it.
try:
fullpath = os.path.join(path, filename)
did_something = process_file(fullpath, extractdir)
if did_something:
os.remove(fullpath)

+ 0
- 7
gangplank/Dockerfile Целия файл

@@ -1,7 +0,0 @@
FROM python:3.7-alpine

COPY gangplank.py /opt/yarrbox/gangplank.py

RUN pip3 install inotify

ENTRYPOINT /opt/yarrbox/gangplank.py

+ 5
- 4
yarrbox.py Целия файл

@@ -10,21 +10,22 @@ import json
# Each entry here is key => (label, hide input)
PROPS = OrderedDict([
('net.vpn.host', ('VPN Provider', 'See https://github.com/sscraggles/docker-deluge-openvpn for options')),
('net.vpn.config', ('VPN Config', 'See README for above, for PIA just say "Netherlands"')),
('net.vpn.config', ('VPN Config', 'See README for above, for PIA just say "Netherlands"')),
('net.vpn.username', ('VPN Username', None)),
('net.vpn.password', ('VPN Password', None)),
('vol.media.movies', ('Movies Storage Path', None)),
('vol.media.tv', ('TV Storage Path', None)),
('vol.media.anime', ('Anime Storage Path', None)),
('vol.conf.torrent', ('Torrent Data Dir', 'Directory for torrent client(s) to store configs and state')),
('vol.conf.bootybot', ('Bootybot Config Dir', 'Config directory for Bootybot')),
('vol.conf.yarr', ('Yarrbox Config Dir', 'Directory for Bootybot to store generated configs for live use')),
('vol.conf.plex', ('Plex Data Dir', 'Directory for all of Plex\'s stuff (databases, etc.)')),
('vol.ingest.torrent', ('Torrent Ingest Dir', 'Directory to drop .torrent files to download through VPN')),
('vol.ingest.media', ('Media Ingest Dir', 'Directory to drop full media files for Bootybot to later process')),
('vol.ingest.media', ('Media Ingest Dir', 'Directory to drop media files archives for gangplank/bootybot to deal with')),
('vol.log.yarr', ('Yarrbox Logs Dir', 'Yarrbox logs dirs')),
('vol.torrent.active', ('Torrent Download Dir', 'Directory for actively downloading torrents to be stored')),
('vol.torrent.seed', ('Torrent Seeding Dir', 'Directory to move torrents after download finished for seeding')),
('vol.work.plextrans', ('Plex Transcode Dir', 'Directory for Plex to store certain transcoded files')),
('vol.work.bootybot', ('Bootybot Extract Dir', 'Directory where Bootybot temporarily stores contents of archives, etc'))
('vol.work.yarr', ('Yarrbox Work Dirs', 'Directory where Yarrbox scripts store work data')),
])

PROMPT = '> '

Loading…
Отказ
Запис