FROM python:3.7-alpine | |||||
COPY . /opt/yarrbox/ | |||||
RUN apk add unzip unrar | |||||
RUN pip3 install inotify | |||||
WORKDIR / | |||||
ENTRYPOINT ["/opt/yarrbox/gangplank.py"] |
# - ADVERTISE_IP=http://<hostIPAddress>:32400/ | # - ADVERTISE_IP=http://<hostIPAddress>:32400/ | ||||
volumes: | volumes: | ||||
- ${vol.conf.plex}/config:/config | - ${vol.conf.plex}/config:/config | ||||
- ${vol.work.plextrans}:/transcode | |||||
- ${vol.conf.plex}/data:/data | - ${vol.conf.plex}/data:/data | ||||
- ${vol.work.plextrans}:/transcode | |||||
- ${vol.work.yarr}/bootybot-extract:/mnt/work | |||||
- /etc/localtime:/etc/localtime:ro | - /etc/localtime:/etc/localtime:ro | ||||
deluge_public: | deluge_public: | ||||
container_name: delugepublic | container_name: delugepublic | ||||
ports: | ports: | ||||
- 9091:9091 | - 9091:9091 | ||||
environment: | 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_PROVIDER=${net.vpn.host} | ||||
- OPENVPN_CONFIG=${net.vpn.config} | |||||
# - OPENVPN_CONFIG=${net.vpn.config} | |||||
- OPENVPN_USERNAME=${net.vpn.username} | - OPENVPN_USERNAME=${net.vpn.username} | ||||
- OPENVPN_PASSWORD=${net.vpn.password} | - OPENVPN_PASSWORD=${net.vpn.password} | ||||
volumes: | volumes: | ||||
# TODO Add Deluge config directory | # 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 | - /etc/localtime:/etc/localtime:ro # suggested in their readme | ||||
deluge_private: | deluge_private: | ||||
container_name: delugeprivate | container_name: delugeprivate | ||||
restart: unless-stopped | restart: unless-stopped | ||||
volumes: | volumes: | ||||
- ${vol.conf.torrent}/private:/config | - ${vol.conf.torrent}/private:/config | ||||
- ${vol.log.yarr}/bootybot:/mnt/log/bootybot | |||||
- ${vol.torrent.active}/private:/downloads | - ${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 | - /etc/localtime:/etc/localtime:ro | ||||
command: /mnt/ingest /mnt/work |
for event in watch.event_gen(yield_nones=False): | for event in watch.event_gen(yield_nones=False): | ||||
(_, type_names, path, filename) = event | (_, 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. | # 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 | continue | ||||
# Actually deal with it. | # Actually deal with it. | ||||
try: | try: | ||||
fullpath = os.path.join(path, filename) | |||||
did_something = process_file(fullpath, extractdir) | did_something = process_file(fullpath, extractdir) | ||||
if did_something: | if did_something: | ||||
os.remove(fullpath) | os.remove(fullpath) |
FROM python:3.7-alpine | |||||
COPY gangplank.py /opt/yarrbox/gangplank.py | |||||
RUN pip3 install inotify | |||||
ENTRYPOINT /opt/yarrbox/gangplank.py |
# Each entry here is key => (label, hide input) | # Each entry here is key => (label, hide input) | ||||
PROPS = OrderedDict([ | PROPS = OrderedDict([ | ||||
('net.vpn.host', ('VPN Provider', 'See https://github.com/sscraggles/docker-deluge-openvpn for options')), | ('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.username', ('VPN Username', None)), | ||||
('net.vpn.password', ('VPN Password', None)), | ('net.vpn.password', ('VPN Password', None)), | ||||
('vol.media.movies', ('Movies Storage Path', None)), | ('vol.media.movies', ('Movies Storage Path', None)), | ||||
('vol.media.tv', ('TV Storage Path', None)), | ('vol.media.tv', ('TV Storage Path', None)), | ||||
('vol.media.anime', ('Anime 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.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.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.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.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.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.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 = '> ' | PROMPT = '> ' |