From a314d5b41b3c8862f7525c2e60dfdb1fe237678d Mon Sep 17 00:00:00 2001 From: Admin9705 <24727006+Admin9705@users.noreply.github.com> Date: Tue, 29 Jan 2019 00:00:06 -0500 Subject: [PATCH 01/14] update --- apps/templates/alltube.js2 | 40 ++++++++++++++++++++++++++++++++ apps/templates/docker-gc-exclude | 10 ++++++++ 2 files changed, 50 insertions(+) create mode 100644 apps/templates/alltube.js2 create mode 100644 apps/templates/docker-gc-exclude diff --git a/apps/templates/alltube.js2 b/apps/templates/alltube.js2 new file mode 100644 index 0000000..c616db5 --- /dev/null +++ b/apps/templates/alltube.js2 @@ -0,0 +1,40 @@ +--- +# Path to your youtube-dl binary +youtubedl: vendor/rg3/youtube-dl/youtube_dl/__main__.py + +# Path to your python binary +python: /usr/bin/python + +# An array of parameters to pass to youtube-dl +params: + - --no-warnings + - --ignore-errors + - --flat-playlist + - --restrict-filenames + +# True to enable audio conversion +convert: false + +# True to enable advanced conversion mode +convertAdvanced: false + +# List of formats available in advanced conversion mode +convertAdvancedFormats: [mp3, avi, flv, wav] + +# Path to your avconv or ffmpeg binary +avconv: vendor/bin/ffmpeg + +# avconv/ffmpeg logging level. +avconvVerbosity: error + +# Path to the directory that contains the phantomjs binary. +phantomjsDir: vendor/bin/ + +# True to disable URL rewriting +uglyUrls: false + +# True to stream videos through server +stream: false + +# MP3 bitrate when converting (in kbit/s) +audioBitrate: 128 diff --git a/apps/templates/docker-gc-exclude b/apps/templates/docker-gc-exclude new file mode 100644 index 0000000..146fb2a --- /dev/null +++ b/apps/templates/docker-gc-exclude @@ -0,0 +1,10 @@ +# If there is a dependent image it seems that the docker-gc can only identify them +# using the image id +# If you pull them specifically it will use the tag otherwise it uses the imageid +# +# The file consists of the name of the image followed by the image id (can be either the short version or the long version) +# +#################################################################################################### + +clockworksoul/docker-gc-cron:latest +e61267dbe31b From 7af407406bbc6c54815988af7c870b078fad1956 Mon Sep 17 00:00:00 2001 From: Robert Baker Date: Mon, 28 Jan 2019 23:20:14 -0700 Subject: [PATCH 02/14] fix --- apps/delugevpn.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/delugevpn.yml b/apps/delugevpn.yml index 1f97117..239b0d7 100644 --- a/apps/delugevpn.yml +++ b/apps/delugevpn.yml @@ -27,6 +27,9 @@ - name: 'Including cron job' include_tasks: '/opt/plexguide/containers/_core.yml' + - name: 'Including folders' + include_tasks: '/opt/plexguide/containers/_downloaders.yml' + - name: 'Checking for existing app data' stat: path: /opt/appdata/{{pgrole}}/core.conf @@ -281,7 +284,7 @@ line: '"seed_time_ratio_limit": 1.0,' state: present - #when: not confcheck.stat.exists + when: not confcheck.stat.exists - name: Restart {{pgrole}} docker_container: From 916169bb595182f0e569ddeb6aa84bdcf18defd0 Mon Sep 17 00:00:00 2001 From: Robert Baker Date: Mon, 28 Jan 2019 23:23:10 -0700 Subject: [PATCH 03/14] add _core files --- apps/_core.yml | 151 ++++++++++++++++++++++++++++++++++++++++++ apps/_downloaders.yml | 32 +++++++++ apps/_plugins.yml | 21 ++++++ 3 files changed, 204 insertions(+) create mode 100644 apps/_core.yml create mode 100644 apps/_downloaders.yml create mode 100644 apps/_plugins.yml diff --git a/apps/_core.yml b/apps/_core.yml new file mode 100644 index 0000000..4c3af00 --- /dev/null +++ b/apps/_core.yml @@ -0,0 +1,151 @@ +#!/bin/bash +# +# Title: PlexGuide (Reference Title File) +# Author(s): Admin9705 +# URL: https://plexguide.com - http://github.plexguide.com +# GNU: General Public License v3.0 +################################################################################ +--- +# RECALL KEY VARIABLES ######################################################### + +- name: 'Register TLD' + shell: 'cat /var/plexguide/tld.program' + register: toplevel + ignore_errors: True + +- name: Register Domain + shell: 'cat /var/plexguide/server.domain' + register: domain + ignore_errors: True + +- name: Register IP + shell: 'cat /var/plexguide/server.ip' + register: ipaddress + ignore_errors: True + +- name: Register Ports + shell: 'cat /var/plexguide/server.ports' + register: ports + ignore_errors: True + +- name: Register HD Path + shell: 'cat /var/plexguide/server.hd.path' + register: path + ignore_errors: True + +- name: Register incomplete Path + shell: 'cat /var/plexguide/server.incomplete.path' + register: incomplete + ignore_errors: True + +- name: Register Auth Path + shell: 'cat /var/plexguide/server.ht' + register: auth + ignore_errors: True + +- name: Remove {{pgrole}} Container + docker_container: + name: '{{pgrole}}' + state: absent + ignore_errors: True + +- name: Storing Role Name + shell: "echo '{{pgrole}}' > /tmp/program_var" + ignore_errors: True + + # APPDATA + +- name: 'Creating appdata folder if it does not exist.' + shell: 'mkdir -p /opt/appdata/{{pgrole}}' + +- name: 'Setting ownership on appdata' + shell: 'chown 1000:1000 /opt/appdata/{{pgrole}}' + when: '"plex" in pgrole' + +- name: 'Setting permissions on appdata' + shell: 'chmod 775 /opt/appdata/{{pgrole}}' + when: '"plex" in pgrole' + +- name: 'Setting ownership on appdata recursivley (this can take a while!)' + shell: 'chown -R 1000:1000 /opt/appdata/{{pgrole}}' + when: '"plex" not in pgrole' + +- name: 'Setting permissions on appdata recursivley (this can take a while!)' + shell: 'chmod -R 775 /opt/appdata/{{pgrole}}' + when: '"plex" not in pgrole' + + +# OVERWRITE IMAGES ############################################################# +- name: Check if Image Variable Exists + stat: + path: '/var/plexguide/image/{{pgrole}}' + register: imagecheck + +- name: 'Transfer Image Variable' + shell: 'cat /var/plexguide/image/{{pgrole}}' + register: imagetemp + when: imagecheck.stat.exists + +- name: 'If Fact Does Not Match - Disable TLD' + set_fact: + image: '{{imagetemp.stdout}}' + when: imagecheck.stat.exists + +# TOP LEVEL DOMAIN INFO SET #################################################### + +- debug: msg="Stored TLD - {{pgrole}} must match {{toplevel.stdout}} for TLD" + +- name: 'If Fact Matches - Enable TLD' + set_fact: + tldset: '{{domain.stdout}}' + when: 'toplevel.stdout == pgrole' + +- debug: msg="TLDSET is now for {{toplevel.stdout}}" + when: 'toplevel.stdout == pgrole' + +- name: 'If Fact Does Not Match - Disable TLD' + set_fact: + tldset: '' + when: 'not toplevel.stdout == pgrole' + +- debug: msg="TLD does not apply" + when: 'not toplevel.stdout == pgrole' + +# EXTERNAL PORT FOR END BANNER +- name: Export Internal Port + shell: 'echo {{extport}} > /tmp/program_port' + ignore_errors: True + +# FOR AUTHENTICATION +- name: 'Script Execute Part I' + shell: 'bash /opt/plexguide/menu/pgshield/drop.sh' + +- name: 'Script Execute Part II' + shell: 'cat /var/plexguide/auth.var' + register: oauth + +- name: 'OAuth Exe' + block: + - name: Check if Anti Auth Variable Exists + stat: + path: '/var/plexguide/auth/{{pgrole}}' + register: authcheck + + - name: 'Auth Check 1' + set_fact: + gauth: 'http://oauth:4181' + when: not authcheck.stat.exists + + - name: 'Auth Check 2' + set_fact: + gauth: '' + when: authcheck.stat.exists + + when: oauth.stdout == 'good' + +- name: 'OAuth Exe' + set_fact: + gauth: '' + when: not oauth.stdout == 'good' + +- debug: msg="OAuth - {{oauth.stdout}}" diff --git a/apps/_downloaders.yml b/apps/_downloaders.yml new file mode 100644 index 0000000..712647f --- /dev/null +++ b/apps/_downloaders.yml @@ -0,0 +1,32 @@ +- name: Creating download paths + file: 'path={{item}} state=directory mode=0775 owner=1000 group=1000' + with_items: + - '{{path.stdout}}/downloads/{{pgrole}}' + - '{{path.stdout}}/downloads/{{pgrole}}/tv' + - '{{path.stdout}}/downloads/{{pgrole}}/movies' + - '{{path.stdout}}/downloads/{{pgrole}}/music' + - '{{path.stdout}}/downloads/{{pgrole}}/ebooks' + - '{{path.stdout}}/downloads/{{pgrole}}/abooks' + +- name: Creating incomplete paths + file: 'path={{item}} state=directory mode=0775 owner=1000 group=1000' + with_items: + - '{{path.stdout}}/incomplete/{{pgrole}}' + - '{{path.stdout}}/incomplete/{{pgrole}}/tv' + - '{{path.stdout}}/incomplete/{{pgrole}}/movies' + - '{{path.stdout}}/incomplete/{{pgrole}}/music' + - '{{path.stdout}}/incomplete/{{pgrole}}/ebooks' + - '{{path.stdout}}/incomplete/{{pgrole}}/abooks' + when: incomplete.stdout | length == 0 + +- name: Creating incomplete paths + file: 'path={{item}} state=directory mode=0775 owner=1000 group=1000' + with_items: + - '{{incomplete.stdout}}/{{pgrole}}' + - '{{incomplete.stdout}}/{{pgrole}}/tv' + - '{{incomplete.stdout}}/{{pgrole}}/movies' + - '{{incomplete.stdout}}/{{pgrole}}/music' + - '{{incomplete.stdout}}/{{pgrole}}/ebooks' + - '{{incomplete.stdout}}/{{pgrole}}/abooks' + when: incomplete.stdout | length > 0 + ignore_errors: yes diff --git a/apps/_plugins.yml b/apps/_plugins.yml new file mode 100644 index 0000000..ba8d435 --- /dev/null +++ b/apps/_plugins.yml @@ -0,0 +1,21 @@ +- name: Creating scripts and plugins paths + file: 'path={{item}} state=directory mode=0775 owner=1000 group=1000' + with_items: + - '/opt/appdata/{{pgrole}}/scripts' + - '/opt/appdata/{{pgrole}}/plugins' + +- name: 'Check if Templates Exist for {{pgrole}}' + stat: + path: './templates/{{pgrole}}' + register: copycheck + +- name: 'Copying Scripts & Plugins' + copy: + src: ./templates/{{pgrole}} + dest: /opt/appdata + directory_mode: yes + force: yes + owner: 1000 + group: 1000 + mode: 0755 + when: copycheck.stat.exists From 671a53299579e4d4e0ab18041a30ddfb9fb9d952 Mon Sep 17 00:00:00 2001 From: Robert Baker Date: Fri, 1 Feb 2019 00:10:17 -0700 Subject: [PATCH 04/14] Add Bazarr --- apps/bazarr.yml | 62 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 apps/bazarr.yml diff --git a/apps/bazarr.yml b/apps/bazarr.yml new file mode 100644 index 0000000..b797ea6 --- /dev/null +++ b/apps/bazarr.yml @@ -0,0 +1,62 @@ +#!/bin/bash +# +# Title: PlexGuide (Reference Title File) +# Author(s): Admin9705 +# URL: https://plexguide.com - http://github.plexguide.com +# GNU: General Public License v3.0 +################################################################################ +--- +- hosts: localhost + gather_facts: false + tasks: + # FACTS ####################################################################### + - name: 'Set Known Facts' + set_fact: + pgrole: 'bazarr' + intport: '6767' + extport: '6767' + image: 'linuxserver/bazarr:latest' + + # CORE (MANDATORY) ############################################################ + - name: 'Including cron job' + include_tasks: '/opt/plexguide/containers/_core.yml' + + # LABELS ###################################################################### + - name: 'Adding Traefik' + set_fact: + pg_labels: + traefik.enable: 'true' + traefik.port: '{{intport}}' + traefik.frontend.auth.forward.address: '{{gauth}}' + traefik.frontend.rule: 'Host:{{pgrole}}.{{domain.stdout}},{{tldset}}' + + - name: 'Setting PG Volumes' + set_fact: + pg_volumes: + - '/etc/localtime:/etc/localtime:ro' + - '/opt/appdata/{{pgrole}}:/config' + - '{{path.stdout}}:{{path.stdout}}' + + - name: 'Setting PG ENV' + set_fact: + pg_env: + PUID: 1000 + PGID: 1000 + + # MAIN DEPLOYMENT ############################################################# + - name: 'Deploying {{pgrole}}' + docker_container: + name: '{{pgrole}}' + image: '{{image}}' + pull: yes + published_ports: + - '{{ports.stdout}}{{extport}}:{{intport}}' + volumes: '{{pg_volumes}}' + env: '{{pg_env}}' + restart_policy: unless-stopped + networks: + - name: plexguide + aliases: + - '{{pgrole}}' + state: started + labels: '{{pg_labels}}' From ff7c291fc10a8e3c1d0e467951449ea746e217f0 Mon Sep 17 00:00:00 2001 From: Robert Baker Date: Fri, 1 Feb 2019 00:10:24 -0700 Subject: [PATCH 05/14] Add bitwarden --- apps/bitwarden.yml | 60 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 apps/bitwarden.yml diff --git a/apps/bitwarden.yml b/apps/bitwarden.yml new file mode 100644 index 0000000..1d98565 --- /dev/null +++ b/apps/bitwarden.yml @@ -0,0 +1,60 @@ +#!/bin/bash +# +# Title: PlexGuide (Reference Title File) +# Author(s): Admin9705 +# URL: https://plexguide.com - http://github.plexguide.com +# GNU: General Public License v3.0 +################################################################################ +--- +- hosts: localhost + gather_facts: false + tasks: + # FACTS ####################################################################### + - name: 'Set Known Facts' + set_fact: + pgrole: 'bitwarden' + intport: '80' + extport: '2489' + image: 'mprasil/bitwarden' + + # CORE (MANDATORY) ############################################################ + - name: 'Including cron job' + include_tasks: '/opt/plexguide/containers/_core.yml' + + # LABELS ###################################################################### + - name: 'Adding Traefik' + set_fact: + pg_labels: + traefik.enable: 'true' + traefik.backend: "{{pgrole}}" + traefik.port: '80' + traefik.frontend.auth.forward.address: '{{gauth}}' + traefik.frontend.rule: 'Host:bit.{{domain.stdout}},{{pgrole}}.{{domain.stdout}},{{tldset}}' + + - name: 'Setting PG Volumes' + set_fact: + pg_volumes: + - '/opt/appdata/{{pgrole}}/data:/data' + - '/opt/appdata/{{pgrole}}/database:/database' + + - name: 'Setting PG ENV' + set_fact: + pg_env: + PUID: 1000 + PGID: 1000 + + # MAIN DEPLOYMENT ############################################################# + - name: 'Deploying {{pgrole}}' + docker_container: + name: '{{pgrole}}' + image: '{{image}}' + pull: yes + volumes: '{{pg_volumes}}' + env: '{{pg_env}}' + restart_policy: unless-stopped + networks: + - name: plexguide + aliases: + - '{{pgrole}}' + state: started + labels: '{{pg_labels}}' From fb9f5419a339c0c4c4c0414830396babab2aad91 Mon Sep 17 00:00:00 2001 From: Robert Baker Date: Fri, 1 Feb 2019 00:10:30 -0700 Subject: [PATCH 06/14] Add cloudcmd --- apps/cloudcmd.yml | 61 +++++++++++++++++++++++++++++++++++++ apps/cloudcmd/cloudcmd.json | 36 ++++++++++++++++++++++ 2 files changed, 97 insertions(+) create mode 100644 apps/cloudcmd.yml create mode 100644 apps/cloudcmd/cloudcmd.json diff --git a/apps/cloudcmd.yml b/apps/cloudcmd.yml new file mode 100644 index 0000000..82dca53 --- /dev/null +++ b/apps/cloudcmd.yml @@ -0,0 +1,61 @@ +#!/bin/bash +# +# Title: PlexGuide (Reference Title File) +# Author(s): Admin9705 +# URL: https://plexguide.com - http://github.plexguide.com +# GNU: General Public License v3.0 +################################################################################ +--- +- hosts: localhost + gather_facts: false + tasks: + # FACTS ####################################################################### + - name: 'Set Known Facts' + set_fact: + pgrole: 'cloudcmd' + intport: '8000' + extport: '7999' + image: 'coderaiser/cloudcmd' + + # CORE (MANDATORY) ############################################################ + - name: 'Including cron job' + include_tasks: '/opt/plexguide/containers/_core.yml' + + # LABELS ###################################################################### + - name: 'Adding Traefik' + set_fact: + pg_labels: + traefik.enable: 'true' + traefik.port: '{{intport}}' + traefik.frontend.auth.forward.address: '{{gauth}}' + traefik.frontend.rule: 'Host:{{pgrole}}.{{domain.stdout}},{{tldset}}' + + - name: 'Setting PG Volumes' + set_fact: + pg_volumes: + - /:/SERVER + - /opt/appdata/{{pgrole}}:/root/ + + - name: 'Setting PG ENV' + set_fact: + pg_env: + PUID: 1000 + PGID: 1000 + + # MAIN DEPLOYMENT ############################################################# + - name: 'Deploying {{pgrole}}' + docker_container: + name: '{{pgrole}}' + image: '{{image}}' + pull: yes + published_ports: + - '{{ports.stdout}}{{extport}}:{{intport}}' + volumes: '{{pg_volumes}}' + env: '{{pg_env}}' + restart_policy: unless-stopped + networks: + - name: plexguide + aliases: + - '{{pgrole}}' + state: started + labels: '{{pg_labels}}' diff --git a/apps/cloudcmd/cloudcmd.json b/apps/cloudcmd/cloudcmd.json new file mode 100644 index 0000000..8467513 --- /dev/null +++ b/apps/cloudcmd/cloudcmd.json @@ -0,0 +1,36 @@ +{ + "name": "", + "auth": true, + "username": "plex", + "password": "33449a17f325d04d86acfa00452b372c90742df5f9a10fee21673d9f384ab4bf536bce786034205b6496b559cece641f461c84df6a4eff220d1e66de09a29bde", + "algo": "sha512WithRSAEncryption", + "editor": "edward", + "packer": "tar", + "diff": true, + "zip": true, + "localStorage": true, + "buffer": true, + "dirStorage": false, + "online": true, + "open": false, + "cache": true, + "keysPanel": true, + "port": 8000, + "ip": null, + "root": "/SERVER", + "prefix": "", + "progress": true, + "htmlDialogs": true, + "contact": true, + "confirmCopy": true, + "confirmMove": true, + "configDialog": true, + "onePanelMode": false, + "console": true, + "syncConsolePath": false, + "terminal": "true", + "terminalPath": "gritty", + "showConfig": false, + "vim": false, + "columns": "name-size-date-owner-mode" +} \ No newline at end of file From e94fff5569962f5445b26a4a2b3fb2f073793cb1 Mon Sep 17 00:00:00 2001 From: Robert Baker Date: Fri, 1 Feb 2019 00:10:45 -0700 Subject: [PATCH 07/14] Add deluge --- apps/deluge.yml | 276 ++++++++++++++++++++++++ apps/deluge/plugins/autoremoveplus.conf | 23 ++ apps/deluge/plugins/core.conf | 104 +++++++++ apps/deluge/plugins/execute.conf | 12 ++ apps/deluge/plugins/extractor.conf | 7 + apps/deluge/plugins/label0.conf | 26 +++ apps/deluge/scripts/deluge_extract.sh | 34 +++ 7 files changed, 482 insertions(+) create mode 100644 apps/deluge.yml create mode 100644 apps/deluge/plugins/autoremoveplus.conf create mode 100644 apps/deluge/plugins/core.conf create mode 100644 apps/deluge/plugins/execute.conf create mode 100644 apps/deluge/plugins/extractor.conf create mode 100644 apps/deluge/plugins/label0.conf create mode 100644 apps/deluge/scripts/deluge_extract.sh diff --git a/apps/deluge.yml b/apps/deluge.yml new file mode 100644 index 0000000..6b46901 --- /dev/null +++ b/apps/deluge.yml @@ -0,0 +1,276 @@ +#!/bin/bash +# +# Title: PlexGuide (Reference Title File) +# Author(s): Admin9705 +# URL: https://plexguide.com - http://github.plexguide.com +# GNU: General Public License v3.0 +################################################################################ +--- +- hosts: localhost + gather_facts: false + tasks: + # FACTS ####################################################################### + - name: 'Set Known Facts' + set_fact: + pgrole: 'deluge' + intport: '8112' + extport: '8112' + intport2: '58846' + extport2: '58846' + intport3: '58946' + extport3: '58946' + image: 'linuxserver/deluge' + + # CORE (MANDATORY) ############################################################ + - name: 'Including cron job' + include_tasks: '/opt/plexguide/containers/_core.yml' + + - name: 'Including required folders' + include_tasks: '/opt/plexguide/containers/_downloaders.yml' + + - name: 'Including plugins' + include_tasks: '/opt/plexguide/containers/_plugins.yml' + + - name: 'Checking for existing app data' + stat: + path: /opt/appdata/{{pgrole}}/core.conf + register: confcheck + + # LABELS ###################################################################### + - name: 'Adding Traefik' + set_fact: + pg_labels: + traefik.frontend.auth.forward.address: '{{gauth}}' + traefik.enable: 'true' + traefik.port: '{{intport}}' + traefik.frontend.rule: 'Host:{{pgrole}}.{{domain.stdout}},{{tldset}}' + + - name: 'Setting PG Volumes' + set_fact: + pg_volumes: + - '/opt/appdata/{{pgrole}}:/config' + - '{{path.stdout}}:{{path.stdout}}' + - '/etc/localtime:/etc/localtime:ro' + - '/mnt:/mnt' + + - name: 'Setting PG ENV' + set_fact: + pg_env: + PUID: 1000 + PGID: 1000 + + # MAIN DEPLOYMENT ############################################################# + - name: 'Deploying {{pgrole}}' + docker_container: + name: '{{pgrole}}' + image: '{{image}}' + pull: yes + published_ports: + - '{{ports.stdout}}{{extport}}:{{intport}}' + - '{{ports.stdout}}{{extport2}}:{{intport2}}' + - '{{ports.stdout}}{{extport3}}:{{intport3}}' + volumes: '{{pg_volumes}}' + env: '{{pg_env}}' + restart_policy: unless-stopped + networks: + - name: plexguide + aliases: + - '{{pgrole}}' + state: started + labels: '{{pg_labels}}' + + # CONFIGURATION ########################################################### + - name: 'Waiting for {{pgrole}} to initialize' + wait_for: + timeout: 10 + + - name: Stopping {{pgrole}} + docker_container: + name: '{{pgrole}}' + state: stopped + + - name: 'Checking for appdata' + wait_for: + path: '/opt/appdata/{{pgrole}}/core.conf' + state: present + delay: 5 + + - name: Setting plugins directory + lineinfile: + path: '/opt/appdata/{{pgrole}}/core.conf' + regexp: '"plugins_location".*' + line: '"plugins_location": "/config/plugins",' + state: present + + - name: Set move completed location + lineinfile: + path: '/opt/appdata/{{pgrole}}/core.conf' + regexp: '"move_completed_path".*' + line: '"move_completed_path": "{{path.stdout}}/downloads/{{pgrole}}",' + state: present + when: incomplete.stdout | length == 0 + + - name: Set download location + lineinfile: + path: '/opt/appdata/{{pgrole}}/core.conf' + regexp: '"download_location".*' + line: '"download_location": "{{path.stdout}}/incomplete/{{pgrole}}",' + state: present + when: incomplete.stdout | length == 0 + + - name: Set download location + lineinfile: + path: '/opt/appdata/{{pgrole}}/core.conf' + regexp: '"download_location".*' + line: '"download_location": "{{incomplete.stdout}}/{{pgrole}}",' + state: present + when: incomplete.stdout | length > 0 + + - name: Setting torrent file directory + lineinfile: + path: '/opt/appdata/{{pgrole}}/core.conf' + regexp: '"torrentfiles_location".*' + line: '"torrentfiles_location": "{{path.stdout}}/torrent",' + state: present + + - name: Setting torrent watch directory + lineinfile: + path: '/opt/appdata/{{pgrole}}/core.conf' + regexp: '"autoadd_location".*' + line: '"autoadd_location": "{{path.stdout}}/torrent/watch",' + state: present + + - name: Setting move_completed + lineinfile: + path: '/opt/appdata/{{pgrole}}/core.conf' + regexp: '"move_completed".*' + line: '"move_completed": true,' + state: present + + - name: Setting extractor folder + lineinfile: + path: '/opt/appdata/{{pgrole}}/plugins/extractor.conf' + regexp: '"use_name_folder".*' + line: '"use_name_folder": true,' + state: present + + - name: Setting extractor + lineinfile: + path: '/opt/appdata/{{pgrole}}/plugins/extractor.conf' + regexp: '"extract_path".*' + line: '"extract_path": "{{path.stdout}}/downloads/deluge"' + state: present + + # FIRST TIME CONFIGURATION #################################################### + - name: 'Configuring {{pgrole}} for first time use' + block: + - name: set enabled_plugins + lineinfile: + path: '/opt/appdata/{{pgrole}}/core.conf' + regexp: '"enabled_plugins".*' + line: '"enabled_plugins": ["Extractor", "Label"],' + state: present + + - name: set compact_allocation + lineinfile: + path: '/opt/appdata/{{pgrole}}/core.conf' + regexp: '"compact_allocation".*' + line: '"compact_allocation": true,' + state: present + + - name: set stop_seed_ratio + lineinfile: + path: '/opt/appdata/{{pgrole}}/core.conf' + regexp: '"stop_seed_ratio"".*' + line: '"stop_seed_ratio": 1.0,' + state: present + + - name: set share_ratio_limit + lineinfile: + path: '/opt/appdata/{{pgrole}}/core.conf' + regexp: '"share_ratio_limit".*' + line: '"share_ratio_limit": 1.0,' + state: present + + - name: set remove_seed_at_ratio + lineinfile: + path: '/opt/appdata/{{pgrole}}/core.conf' + regexp: '"remove_seed_at_ratio".*' + line: '"remove_seed_at_ratio": true,' + state: present + + - name: set enc_prefer_rc4 + lineinfile: + path: '/opt/appdata/{{pgrole}}/core.conf' + regexp: '"enc_prefer_rc4".*' + line: '"enc_prefer_rc4": true,' + state: present + + - name: set enc_level + lineinfile: + path: '/opt/appdata/{{pgrole}}/core.conf' + regexp: '"enc_level".*' + line: '"enc_level": 1,' + state: present + + - name: set enc_in_policy + lineinfile: + path: '/opt/appdata/{{pgrole}}/core.conf' + regexp: '"enc_in_policy".*' + line: '"enc_in_policy": 1,' + state: present + + - name: set enc_out_policy + lineinfile: + path: '/opt/appdata/{{pgrole}}/core.conf' + regexp: '"enc_out_policy".*' + line: '"enc_out_policy": 1,' + state: present + + - name: set max_active_downloading + lineinfile: + path: '/opt/appdata/{{pgrole}}/core.conf' + regexp: '"max_active_downloading".*' + line: '"max_active_downloading": 4,' + state: present + + - name: set dont_count_slow_torrents + lineinfile: + path: '/opt/appdata/{{pgrole}}/core.conf' + regexp: '"dont_count_slow_torrents".*' + line: '"dont_count_slow_torrents": true,' + state: present + + - name: set max_active_seeding + lineinfile: + path: '/opt/appdata/{{pgrole}}/core.conf' + regexp: '"enabled_plugins".*' + line: '"max_active_seeding": 8,' + state: present + + - name: set share_ratio_limit + lineinfile: + path: '/opt/appdata/{{pgrole}}/core.conf' + regexp: '"share_ratio_limit".*' + line: '"share_ratio_limit": 1,' + state: present + + - name: set stop_seed_at_ratio + lineinfile: + path: '/opt/appdata/{{pgrole}}/core.conf' + regexp: '"stop_seed_at_ratio".*' + line: '"stop_seed_at_ratio": 1.0,' + state: present + + - name: set seed_time_ratio_limit + lineinfile: + path: '/opt/appdata/{{pgrole}}/core.conf' + regexp: '"seed_time_ratio_limit".*' + line: '"seed_time_ratio_limit": 1.0,' + state: present + when: not confcheck.stat.exists + + - name: Restart {{pgrole}} + docker_container: + name: '{{pgrole}}' + state: started diff --git a/apps/deluge/plugins/autoremoveplus.conf b/apps/deluge/plugins/autoremoveplus.conf new file mode 100644 index 0000000..f23c6ba --- /dev/null +++ b/apps/deluge/plugins/autoremoveplus.conf @@ -0,0 +1,23 @@ +{ + "file": 1, + "format": 1 +}{ + "interval": 1.0, + "max_seeds": 0, + "sel_func": "or", + "trackers": [], + "remove_data": true, + "labels": [], + "enabled": true, + "count_exempt": false, + "remove": true, + "filter": "func_ratio", + "tracker_rules": {}, + "min": 1.5, + "hdd_space": -1.0, + "filter2": "func_seed_time", + "rule_2_enabled": true, + "min2": 15.0, + "rule_1_enabled": true, + "label_rules": {} +} \ No newline at end of file diff --git a/apps/deluge/plugins/core.conf b/apps/deluge/plugins/core.conf new file mode 100644 index 0000000..c3bbdf3 --- /dev/null +++ b/apps/deluge/plugins/core.conf @@ -0,0 +1,104 @@ +{ + "file": 1, + "format": 1 +}{ + "info_sent": 0.0, + "lsd": false, + "send_info": false, + "move_completed_path": "{{ downloads }}/complete", + "enc_in_policy": 1, + "queue_new_to_top": true, + "ignore_limits_on_local_network": true, + "rate_limit_ip_overhead": false, + "daemon_port": 58846, + "natpmp": true, + "max_active_limit": "{{ max_active_limit }}", + "utpex": false, + "max_active_downloading": 5, + "max_active_seeding": 10, + "allow_remote": true, + "max_half_open_connections": 50, + "download_location": "{{ downloads }}/incomplete", + "compact_allocation": false, + "max_upload_speed": -1.0, + "cache_expiry": 60, + "prioritize_first_last_pieces": false, + "auto_managed": true, + "enc_level": 2, + "max_connections_per_second": 20, + "dont_count_slow_torrents": true, + "random_outgoing_ports": true, + "max_upload_slots_per_torrent": -1, + "new_release_check": false, + "enc_out_policy": 1, + "outgoing_ports": [ + 0, + 0 + ], + "seed_time_limit": 180, + "cache_size": 512, + "share_ratio_limit": 2.0, + "max_download_speed": -1.0, + "geoip_db_location": "/usr/share/GeoIP/GeoIP.dat", + "torrentfiles_location": "/data/torrents", + "stop_seed_at_ratio": false, + "peer_tos": "0x00", + "listen_interface": "0.0.0.0", + "upnp": true, + "max_download_speed_per_torrent": -1, + "max_upload_slots_global": 4, + "enabled_plugins": [ + "Label", + "Execute" + ], + "random_port": false, + "autoadd_enable": false, + "max_connections_global": 200, + "enc_prefer_rc4": true, + "listen_ports": [ + 58946, + 58946 + ], + "dht": false, + "stop_seed_ratio": 1.5, + "seed_time_ratio_limit": 7.0, + "max_upload_speed_per_torrent": -1, + "copy_torrent_file": false, + "del_copy_torrent_file": false, + "move_completed": true, + "proxies": { + "peer": { + "username": "", + "password": "", + "type": 0, + "hostname": "", + "port": 8080 + }, + "web_seed": { + "username": "", + "password": "", + "type": 0, + "hostname": "", + "port": 8080 + }, + "tracker": { + "username": "", + "password": "", + "type": 0, + "hostname": "", + "port": 8080 + }, + "dht": { + "username": "", + "password": "", + "type": 0, + "hostname": "", + "port": 8080 + } + }, + "add_paused": false, + "max_connections_per_torrent": -1, + "remove_seed_at_ratio": true, + "autoadd_location": "/data/watched", + "plugins_location": "/config/plugins" +} \ No newline at end of file diff --git a/apps/deluge/plugins/execute.conf b/apps/deluge/plugins/execute.conf new file mode 100644 index 0000000..f0f83b0 --- /dev/null +++ b/apps/deluge/plugins/execute.conf @@ -0,0 +1,12 @@ +{ + "file": 1, + "format": 1 +}{ + "commands": [ + [ + "0", + "complete", + "/config/scripts/extract.sh" + ] + ] +} \ No newline at end of file diff --git a/apps/deluge/plugins/extractor.conf b/apps/deluge/plugins/extractor.conf new file mode 100644 index 0000000..32e8ff4 --- /dev/null +++ b/apps/deluge/plugins/extractor.conf @@ -0,0 +1,7 @@ +{ + "file": 1, + "format": 1 +}{ + "use_name_folder": true, + "extract_path": "/downloads/deluge/" +} diff --git a/apps/deluge/plugins/label0.conf b/apps/deluge/plugins/label0.conf new file mode 100644 index 0000000..2b3d517 --- /dev/null +++ b/apps/deluge/plugins/label0.conf @@ -0,0 +1,26 @@ +{ + "file": 1, + "format": 1 +}{ + "labels": { + "main": { + "max_download_speed": -1, + "stop_at_ratio": true, + "apply_move_completed": false, + "apply_queue": true, + "auto_add": false, + "max_upload_slots": -1, + "prioritize_first_last": false, + "move_completed": false, + "max_connections": -1, + "is_auto_managed": true, + "max_upload_speed": -1, + "auto_add_trackers": [], + "remove_at_ratio": false, + "stop_ratio": 0, + "move_completed_path": "", + "apply_max": false + } + }, + "torrent_labels": {} +} \ No newline at end of file diff --git a/apps/deluge/scripts/deluge_extract.sh b/apps/deluge/scripts/deluge_extract.sh new file mode 100644 index 0000000..9c14361 --- /dev/null +++ b/apps/deluge/scripts/deluge_extract.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +# Copied from https://github.com/Radarr/Radarr/wiki/Common-Problems on August 19, 2018 +# the Radarr script was originally sourced from https://dev.deluge-torrent.org/wiki/Plugins/Execute + +formats=(zip rar) +commands=([zip]="unzip -u" [rar]="unrar -r -o- e") +extraction_subdir='deluge_extracted' + +torrentid=$1 +torrentname=$2 +torrentpath=$3 + +log() +{ + logger -t deluge-extractarchives "$@" +} + +log "Torrent complete: $@" +cd "${torrentpath}" +for format in "${formats[@]}"; do + while read file; do + log "Extracting \"$file\"" + cd "$(dirname "$file")" + file=$(basename "$file") + # if extraction_subdir is not empty, extract to subdirectory + if [[ ! -z "$extraction_subdir" ]] ; then + mkdir "$extraction_subdir" + cd "$extraction_subdir" + file="../$file" + fi + ${commands[$format]} "$file" + done < <(find "$torrentpath/$torrentname" -iname "*.${format}" ) +done \ No newline at end of file From c3ff19394fc4514577b7d425722fe93c4d0c79dd Mon Sep 17 00:00:00 2001 From: Robert Baker Date: Fri, 1 Feb 2019 00:10:54 -0700 Subject: [PATCH 08/14] add heimdall --- apps/heimdall.yml | 65 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 apps/heimdall.yml diff --git a/apps/heimdall.yml b/apps/heimdall.yml new file mode 100644 index 0000000..35ca418 --- /dev/null +++ b/apps/heimdall.yml @@ -0,0 +1,65 @@ +#!/bin/bash +# +# Title: PlexGuide (Reference Title File) +# Author(s): Admin9705 +# URL: https://plexguide.com - http://github.plexguide.com +# GNU: General Public License v3.0 +################################################################################ +--- +- hosts: localhost + gather_facts: false + tasks: + # FACTS ####################################################################### + + - name: 'Set Known Facts' + set_fact: + pgrole: 'heimdall' + intport: '443' + extport: '1111' + image: 'linuxserver/heimdall' + + # CORE (MANDATORY) ############################################################ + - name: 'Including cron job' + include_tasks: '/opt/plexguide/containers/_core.yml' + + # LABELS ###################################################################### + - name: 'Adding Traefik' + set_fact: + pg_labels: + traefik.frontend.auth.forward.address: '{{gauth}}' + traefik.protocol: 'https' + traefik.enable: 'true' + traefik.https.port: '443' + traefik.https.frontend.entryPoints: 'https' + traefik.https.frontend.rule: 'Host:{{pgrole}}.{{domain.stdout}},{{tldset}}' + + - name: 'Setting PG Volumes' + set_fact: + pg_volumes: + - '/opt/appdata/heimdall:/config' + - '/etc/localtime:/etc/localtime:ro' + + - name: 'Setting PG ENV' + set_fact: + pg_env: + PUID: 1000 + PGID: 1000 + + # MAIN DEPLOYMENT ############################################################# + - name: 'Deploying {{pgrole}}' + docker_container: + name: '{{pgrole}}' + image: '{{image}}' + pull: yes + published_ports: + - '127.0.0.0.1:1112:443' + - '{{ports.stdout}}1111:80' + volumes: '{{pg_volumes}}' + env: '{{pg_env}}' + restart_policy: unless-stopped + networks: + - name: plexguide + aliases: + - '{{pgrole}}' + state: started + labels: '{{pg_labels}}' From 635eac41749e9e109b274c7ab6ad4a55e0924b9b Mon Sep 17 00:00:00 2001 From: Robert Baker Date: Fri, 1 Feb 2019 00:11:21 -0700 Subject: [PATCH 09/14] add now showing --- apps/nowshowing.yml | 62 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 apps/nowshowing.yml diff --git a/apps/nowshowing.yml b/apps/nowshowing.yml new file mode 100644 index 0000000..75f41a0 --- /dev/null +++ b/apps/nowshowing.yml @@ -0,0 +1,62 @@ +#!/bin/bash +# +# Title: PlexGuide (Reference Title File) +# Author(s): Admin9705 +# URL: https://plexguide.com - http://github.plexguide.com +# GNU: General Public License v3.0 +################################################################################ +--- +- hosts: localhost + gather_facts: false + tasks: + # FACTS ####################################################################### + - name: 'Set Known Facts' + set_fact: + pgrole: 'nowshowing' + intport: '6878' + extport: '6878' + image: 'ninthwalker/nowshowing:v2' + + # CORE (MANDATORY) ############################################################ + - name: 'Including cron job' + include_tasks: '/opt/plexguide/containers/_core.yml' + + # LABELS ###################################################################### + - name: 'Adding Traefik' + set_fact: + pg_labels: + traefik.frontend.auth.forward.address: '{{gauth}}' + traefik.enable: 'true' + traefik.port: '{{intport}}' + + traefik.frontend.rule: 'Host:{{pgrole}}.{{domain.stdout}},{{tldset}}' + + - name: 'Setting PG Volumes' + set_fact: + pg_volumes: + - '/opt/appdata/{{pgrole}}:/config' + - '/etc/localtime:/etc/localtime:ro' + + - name: 'Setting PG ENV' + set_fact: + pg_env: + PUID: 1000 + PGID: 1000 + + # MAIN DEPLOYMENT ############################################################# + - name: 'Deploying {{pgrole}}' + docker_container: + name: '{{pgrole}}' + image: '{{image}}' + pull: yes + published_ports: + - '{{ports.stdout}}{{extport}}:{{intport}}' + volumes: '{{pg_volumes}}' + env: '{{pg_env}}' + restart_policy: unless-stopped + networks: + - name: plexguide + aliases: + - '{{pgrole}}' + state: started + labels: '{{pg_labels}}' From abc9a7028586bd6319c4fa0129ba2cec832c7eb1 Mon Sep 17 00:00:00 2001 From: Robert Baker Date: Fri, 1 Feb 2019 11:33:46 -0700 Subject: [PATCH 10/14] fix bazarr --- apps/bazarr.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/bazarr.yml b/apps/bazarr.yml index b797ea6..29bb7b5 100644 --- a/apps/bazarr.yml +++ b/apps/bazarr.yml @@ -36,6 +36,7 @@ - '/etc/localtime:/etc/localtime:ro' - '/opt/appdata/{{pgrole}}:/config' - '{{path.stdout}}:{{path.stdout}}' + - '/mnt:/mnt' - name: 'Setting PG ENV' set_fact: From 73242d45b0589bb36dc5797da14adc293713a593 Mon Sep 17 00:00:00 2001 From: Robert Baker Date: Fri, 1 Feb 2019 11:40:43 -0700 Subject: [PATCH 11/14] community fixes --- apps/beets.yml | 3 ++- apps/deezloaderremix.yml | 3 ++- apps/handbrake2.yml | 2 +- apps/jdownloader2.yml | 1 + apps/makemkv.yml | 17 ----------------- apps/mellow.yml | 1 - apps/monitorr.yml | 1 - apps/mylar.yml | 1 - apps/nextcloud.yml | 9 --------- apps/nowshowing.yml | 1 - apps/radarr4k.yml | 28 ---------------------------- apps/radarrhdr.yml | 28 ---------------------------- apps/sonarr4k.yml | 28 ---------------------------- apps/sonarrhdr.yml | 28 ---------------------------- apps/syncthing.yml | 2 +- apps/ubooquity.yml | 1 - 16 files changed, 7 insertions(+), 147 deletions(-) diff --git a/apps/beets.yml b/apps/beets.yml index 0503305..7a92541 100644 --- a/apps/beets.yml +++ b/apps/beets.yml @@ -43,7 +43,8 @@ - '/opt/appdata/{{pgrole}}:/config' - '/etc/localtime:/etc/localtime:ro' - '{{path.stdout}}:{{path.stdout}}' - + - '/mnt:/mnt' + - name: 'Setting PG ENV' set_fact: pg_env: diff --git a/apps/deezloaderremix.yml b/apps/deezloaderremix.yml index 30719ea..36debea 100644 --- a/apps/deezloaderremix.yml +++ b/apps/deezloaderremix.yml @@ -36,7 +36,8 @@ - '/opt/appdata/{{pgrole}}:/config' - '{{path.stdout}}:{{path.stdout}}' - '/etc/localtime:/etc/localtime:ro' - + - '/mnt:/mnt' + - name: 'Setting PG ENV' set_fact: pg_env: diff --git a/apps/handbrake2.yml b/apps/handbrake2.yml index 77c9138..41aaaea 100644 --- a/apps/handbrake2.yml +++ b/apps/handbrake2.yml @@ -43,7 +43,7 @@ - '/opt/appdata/{{pgrole}}/config:/config:rw' - '/:/storage:ro' - '{{path.stdout}}:{{path.stdout}}' - - '/mnt/unionfs:/mnt/unionfs' + - '/mnt:/mnt' - '{{path.stdout}}/{{pgrole}}/watch/Very_Fast_1080p30:/watch:rw' - '{{path.stdout}}/{{pgrole}}/watch/HQ_1080p30_Surround:/watch2:rw' - '{{path.stdout}}/{{pgrole}}/watch/1080mkv:/watch3:rw' diff --git a/apps/jdownloader2.yml b/apps/jdownloader2.yml index 6e7cdd6..6110d2c 100644 --- a/apps/jdownloader2.yml +++ b/apps/jdownloader2.yml @@ -63,6 +63,7 @@ - '/opt/appdata/{{pgrole}}:/config' - '{{path.stdout}}:{{path.stdout}}' - '/mnt/unionfs:/unionfs' + - '/mnt:/mnt' - '{{path.stdout}}/downloads/{{pgrole}}/:/output:rw' - '/etc/localtime:/etc/localtime:ro' diff --git a/apps/makemkv.yml b/apps/makemkv.yml index 6c0fbbc..da9bef8 100644 --- a/apps/makemkv.yml +++ b/apps/makemkv.yml @@ -24,23 +24,6 @@ - name: 'Including cron job' include_tasks: '/opt/plexguide/containers/_core.yml' - # MIGRATIONS (REMOVE SECTION ON MARCH 1st) ############################################################# - - name: 'Check for old volumes' - stat: - path: '{{path.stdout}}/{{pgrole}}' - register: oldcheck - - - name: 'Migrations' - block: - - name: 'Creating new downloads location' - command: 'mkdir -p {{path.stdout}}/downloads/{{pgrole}}' - - - name: 'Chown download folder' - shell: 'chown -R 1000:1000 {{path.stdout}}/downloads/{{pgrole}}/' - - - name: 'Chmod download folder' - shell: 'chmod -R 775 {{path.stdout}}/downloads/{{pgrole}}/' - - name: 'Ini Check' stat: path: /opt/appdata/{{pgrole}}/core.conf diff --git a/apps/mellow.yml b/apps/mellow.yml index 11cc683..b28ae39 100644 --- a/apps/mellow.yml +++ b/apps/mellow.yml @@ -28,7 +28,6 @@ traefik.frontend.auth.forward.address: '{{gauth}}' traefik.enable: 'true' traefik.port: '{{intport}}' - traefik.frontend.rule: 'Host:{{pgrole}}.{{domain.stdout}},{{tldset}}' - name: 'Setting PG Volumes' diff --git a/apps/monitorr.yml b/apps/monitorr.yml index 30e96f1..2e3031e 100644 --- a/apps/monitorr.yml +++ b/apps/monitorr.yml @@ -28,7 +28,6 @@ traefik.frontend.auth.forward.address: '{{gauth}}' traefik.enable: 'true' traefik.port: '{{intport}}' - traefik.frontend.rule: 'Host:{{pgrole}}.{{domain.stdout}},{{tldset}}' - name: 'Setting PG Volumes' diff --git a/apps/mylar.yml b/apps/mylar.yml index 1d94240..eb49636 100644 --- a/apps/mylar.yml +++ b/apps/mylar.yml @@ -28,7 +28,6 @@ traefik.frontend.auth.forward.address: '{{gauth}}' traefik.enable: 'true' traefik.port: '{{intport}}' - traefik.frontend.rule: 'Host:{{pgrole}}.{{domain.stdout}},{{tldset}}' - name: 'Setting PG Volumes' diff --git a/apps/nextcloud.yml b/apps/nextcloud.yml index 4b91f64..ade15b5 100644 --- a/apps/nextcloud.yml +++ b/apps/nextcloud.yml @@ -21,15 +21,6 @@ - name: 'Including cron job' include_tasks: '/opt/plexguide/containers/_core.yml' - # EXTRA ####################################################################### - - name: Create required directories - file: 'path={{item}} state=directory mode=0775 owner=1000 group=1000' - with_items: - - /opt/appdata/nextcloud - - /opt/appdata/nextcloud/conf - - /opt/appdata/nextcloud/data - - /mnt/unionfs/nextcloud - # LABELS ###################################################################### - name: 'Adding Traefik' set_fact: diff --git a/apps/nowshowing.yml b/apps/nowshowing.yml index 75f41a0..e22075d 100644 --- a/apps/nowshowing.yml +++ b/apps/nowshowing.yml @@ -28,7 +28,6 @@ traefik.frontend.auth.forward.address: '{{gauth}}' traefik.enable: 'true' traefik.port: '{{intport}}' - traefik.frontend.rule: 'Host:{{pgrole}}.{{domain.stdout}},{{tldset}}' - name: 'Setting PG Volumes' diff --git a/apps/radarr4k.yml b/apps/radarr4k.yml index bf994b6..9d1265f 100644 --- a/apps/radarr4k.yml +++ b/apps/radarr4k.yml @@ -21,34 +21,6 @@ - name: 'Including cron job' include_tasks: '/opt/plexguide/containers/_core.yml' - # EXTRA FUNCTIONS REQUIRED BY THE ROLE ##################################### - - - name: 'Create scripts directory for {{pgrole}}' - file: - path: /opt/appdata/{{pgrole}}/scripts - state: directory - owner: 1000 - group: 1000 - mode: 0755 - - - name: 'Create plugins directory for {{pgrole}}' - file: - path: /opt/appdata/{{pgrole}}/plugins - state: directory - owner: 1000 - group: 1000 - mode: 0755 - - - name: 'Copy scripts into directory for {{pgrole}}' - copy: - src: /opt/plexguide/containers/templates/radarr/scripts/cleanup-radarr.sh - dest: /opt/appdata/{{pgrole}}/scripts - directory_mode: yes - force: yes - owner: 1000 - group: 1000 - mode: 0755 - # LABELS #### KEEPS BOTTOM CLEAN ########################################### - name: 'Adding Traefik' set_fact: diff --git a/apps/radarrhdr.yml b/apps/radarrhdr.yml index bdb02cd..e5d509e 100644 --- a/apps/radarrhdr.yml +++ b/apps/radarrhdr.yml @@ -21,34 +21,6 @@ - name: 'Including cron job' include_tasks: '/opt/plexguide/containers/_core.yml' - # EXTRA FUNCTIONS REQUIRED BY THE ROLE ##################################### - - - name: 'Create scripts directory for {{pgrole}}' - file: - path: /opt/appdata/{{pgrole}}/scripts - state: directory - owner: 1000 - group: 1000 - mode: 0755 - - - name: 'Create plugins directory for {{pgrole}}' - file: - path: /opt/appdata/{{pgrole}}/plugins - state: directory - owner: 1000 - group: 1000 - mode: 0755 - - - name: 'Copy scripts into directory for {{pgrole}}' - copy: - src: /opt/plexguide/containers/templates/radarr/scripts/cleanup-radarr.sh - dest: /opt/appdata/{{pgrole}}/scripts - directory_mode: yes - force: yes - owner: 1000 - group: 1000 - mode: 0755 - # LABELS #### KEEPS BOTTOM CLEAN ########################################### - name: 'Adding Traefik' set_fact: diff --git a/apps/sonarr4k.yml b/apps/sonarr4k.yml index 0f87a1f..b5707c8 100644 --- a/apps/sonarr4k.yml +++ b/apps/sonarr4k.yml @@ -22,34 +22,6 @@ - name: 'Including cron job' include_tasks: '/opt/plexguide/containers/_core.yml' - # EXTRA FUNCTIONS REQUIRED BY THE ROLE ##################################### - - - name: 'Create scripts directory for {{pgrole}}' - file: - path: /opt/appdata/{{pgrole}}/scripts - state: directory - owner: 1000 - group: 1000 - mode: 0755 - - - name: 'Create plugins directory for {{pgrole}}' - file: - path: /opt/appdata/{{pgrole}}/plugins - state: directory - owner: 1000 - group: 1000 - mode: 0755 - - - name: 'Copy scripts into directory for {{pgrole}}' - copy: - src: /opt/plexguide/containers/templates/sonarr/scripts/cleanup-sonarr.sh - dest: /opt/appdata/{{pgrole}}/scripts - directory_mode: yes - force: yes - owner: 1000 - group: 1000 - mode: 0755 - # LABELS #### KEEPS BOTTOM CLEAN ########################################### - name: 'Adding Traefik' set_fact: diff --git a/apps/sonarrhdr.yml b/apps/sonarrhdr.yml index cc7c0e6..1f8887c 100644 --- a/apps/sonarrhdr.yml +++ b/apps/sonarrhdr.yml @@ -22,34 +22,6 @@ - name: 'Including cron job' include_tasks: '/opt/plexguide/containers/_core.yml' - # EXTRA FUNCTIONS REQUIRED BY THE ROLE ##################################### - - - name: 'Create scripts directory for {{pgrole}}' - file: - path: /opt/appdata/{{pgrole}}/scripts - state: directory - owner: 1000 - group: 1000 - mode: 0755 - - - name: 'Create plugins directory for {{pgrole}}' - file: - path: /opt/appdata/{{pgrole}}/plugins - state: directory - owner: 1000 - group: 1000 - mode: 0755 - - - name: 'Copy scripts into directory for {{pgrole}}' - copy: - src: /opt/plexguide/containers/templates/sonarr/scripts/cleanup-sonarr.sh - dest: /opt/appdata/{{pgrole}}/scripts - directory_mode: yes - force: yes - owner: 1000 - group: 1000 - mode: 0755 - # LABELS #### KEEPS BOTTOM CLEAN ########################################### - name: 'Adding Traefik' set_fact: diff --git a/apps/syncthing.yml b/apps/syncthing.yml index a171e00..f1e03e5 100644 --- a/apps/syncthing.yml +++ b/apps/syncthing.yml @@ -48,7 +48,7 @@ - '/opt/appdata/{{pgrole}}/config:/config' - '/opt/appdata/{{pgrole}}/sync:/sync' - '/mnt:/mnt' - + - '{{path.stdout}}:{{path.stdout}}' - name: 'Setting PG ENV' set_fact: diff --git a/apps/ubooquity.yml b/apps/ubooquity.yml index af9e85f..19e0b41 100644 --- a/apps/ubooquity.yml +++ b/apps/ubooquity.yml @@ -28,7 +28,6 @@ traefik.frontend.auth.forward.address: '{{gauth}}' traefik.enable: 'true' traefik.port: '{{intport}}' - traefik.frontend.rule: 'Host:{{pgrole}}.{{domain.stdout}},{{tldset}}' - name: 'Setting PG Volumes' From 265132e772f9efb4f8ea5e9b6299189957d2c639 Mon Sep 17 00:00:00 2001 From: Robert Baker Date: Fri, 1 Feb 2019 16:28:39 -0700 Subject: [PATCH 12/14] fixes --- apps/handbrake.yml | 41 ------------------------ apps/handbrake2.yml | 45 ++------------------------ apps/jdownloader2.yml | 73 ++----------------------------------------- apps/makemkv.yml | 37 +--------------------- 4 files changed, 6 insertions(+), 190 deletions(-) diff --git a/apps/handbrake.yml b/apps/handbrake.yml index dbbbc7a..b24d042 100644 --- a/apps/handbrake.yml +++ b/apps/handbrake.yml @@ -22,12 +22,6 @@ - name: 'Including cron job' include_tasks: '/opt/plexguide/containers/_core.yml' - # MIGRATIONS (REMOVE SECTION ON MARCH 1st) ############################################################# - - name: 'Check for old volumes' - stat: - path: '{{path.stdout}}/{{pgrole}}' - register: oldcheck - # LABELS ###################################################################### - name: 'Adding Traefik' set_fact: @@ -99,38 +93,3 @@ - '{{pgrole}}' state: started labels: '{{pg_labels}}' - - - name: 'Wait 6 Seconds' - wait_for: - timeout: 6 - - - name: Stop Container - docker_container: - name: '{{pgrole}}' - state: stopped - - # ENDING FOR HANDBRAKE ########################################################### - -# - name: 'Waiting for {{pgrole}} to initialize' -# wait_for: -# path: '/opt/appdata/{{pgrole}}/core.conf' -# state: present - - - name: 'Configuring {{pgrole}} for first time use' - block: - - name: 'Stopping {{pgrole}}' - docker_container: - name: '{{pgrole}}' - state: stopped - -# - name: Setting plugins directory -# lineinfile: -# path: '/opt/appdata/{{pgrole}}/core.conf' -# regexp: '"plugins_location"' -# line: '"plugins_location": "/config/plugins",' -# state: present - - - name: Restart Container - docker_container: - name: '{{pgrole}}' - state: started diff --git a/apps/handbrake2.yml b/apps/handbrake2.yml index 41aaaea..c18ce37 100644 --- a/apps/handbrake2.yml +++ b/apps/handbrake2.yml @@ -21,13 +21,7 @@ # CORE (MANDATORY) ############################################################ - name: 'Including cron job' include_tasks: '/opt/plexguide/containers/_core.yml' - - # MIGRATIONS (REMOVE SECTION ON MARCH 1st) ############################################################# - - name: 'Check for old volumes' - stat: - path: '{{path.stdout}}/{{pgrole}}' - register: oldcheck - + # LABELS ###################################################################### - name: 'Adding Traefik' set_fact: @@ -98,39 +92,4 @@ aliases: - '{{pgrole}}' state: started - labels: '{{pg_labels}}' - - - name: 'Wait 6 Seconds' - wait_for: - timeout: 6 - - - name: Stop Container - docker_container: - name: '{{pgrole}}' - state: stopped - - # ENDING FOR HANDBRAKE ########################################################### - -# - name: 'Waiting for {{pgrole}} to initialize' -# wait_for: -# path: '/opt/appdata/{{pgrole}}/core.conf' -# state: present - - - name: 'Configuring {{pgrole}} for first time use' - block: - - name: 'Stopping {{pgrole}}' - docker_container: - name: '{{pgrole}}' - state: stopped - -# - name: Setting plugins directory -# lineinfile: -# path: '/opt/appdata/{{pgrole}}/core.conf' -# regexp: '"plugins_location"' -# line: '"plugins_location": "/config/plugins",' -# state: present - - - name: Restart Container - docker_container: - name: '{{pgrole}}' - state: started + labels: '{{pg_labels}}' \ No newline at end of file diff --git a/apps/jdownloader2.yml b/apps/jdownloader2.yml index 6110d2c..6fd638d 100644 --- a/apps/jdownloader2.yml +++ b/apps/jdownloader2.yml @@ -26,22 +26,8 @@ - name: 'Including cron job' include_tasks: '/opt/plexguide/containers/_core.yml' - # MIGRATIONS (REMOVE SECTION ON MARCH 1st) ############################################################# - - name: 'Check for old volumes' - stat: - path: '{{path.stdout}}/{{pgrole}}' - register: oldcheck - - - name: 'Migrations' - block: - - name: 'Creating new downloads location' - command: 'mkdir -p {{path.stdout}}/downloads/{{pgrole}}' - - - name: 'Chown download folder' - shell: 'chown -R 1000:1000 {{path.stdout}}/downloads/{{pgrole}}/' - - - name: 'Chmod download folder' - shell: 'chmod -R 775 {{path.stdout}}/downloads/{{pgrole}}/' + - name: 'Including plugins' + include_tasks: '/opt/plexguide/containers/_plugins.yml' - name: 'Ini Check' stat: @@ -74,22 +60,6 @@ GID: 1000 # MAIN DEPLOYMENT ############################################################# - - name: 'Create scripts directory for {{pgrole}}' - file: - path: /opt/appdata/{{pgrole}}/scripts - state: directory - owner: 1000 - group: 1000 - mode: 0755 - -# - name: 'Create plugins directory for {{pgrole}}' -# file: -# path: /opt/appdata/{{pgrole}}/plugins -# state: directory -# owner: 1000 -# group: 1000 -# mode: 0755 - - name: 'Deploying {{pgrole}}' docker_container: name: '{{pgrole}}' @@ -105,41 +75,4 @@ aliases: - '{{pgrole}}' state: started - labels: '{{pg_labels}}' - - - name: 'Wait 6 Seconds' - wait_for: - timeout: 6 - - - name: Stop Container - docker_container: - name: '{{pgrole}}' - state: stopped - - # ENDING FOR JDOWNLOADER2 ########################################################### - -# - name: 'Waiting for {{pgrole}} to initialize' -# wait_for: -# path: '/opt/appdata/{{pgrole}}/core.conf' -# state: present - - - name: 'Configuring {{pgrole}} for first time use' - block: - - name: 'Stopping {{pgrole}}' - docker_container: - name: '{{pgrole}}' - state: stopped - -# - name: Setting plugins directory -# lineinfile: -# path: '/opt/appdata/{{pgrole}}/core.conf' -# regexp: '"plugins_location"' -# line: '"plugins_location": "/config/plugins",' -# state: present - - - name: Restart Container - docker_container: - name: '{{pgrole}}' - state: started - - when: not inicheck.stat.exists + labels: '{{pg_labels}}' \ No newline at end of file diff --git a/apps/makemkv.yml b/apps/makemkv.yml index da9bef8..a8de46e 100644 --- a/apps/makemkv.yml +++ b/apps/makemkv.yml @@ -24,11 +24,6 @@ - name: 'Including cron job' include_tasks: '/opt/plexguide/containers/_core.yml' - - name: 'Ini Check' - stat: - path: /opt/appdata/{{pgrole}}/core.conf - register: inicheck - # LABELS ###################################################################### - name: 'Adding Traefik' set_fact: @@ -75,34 +70,4 @@ aliases: - '{{pgrole}}' state: started - labels: '{{pg_labels}}' - - - name: 'Wait 7 Seconds' - wait_for: - timeout: 7 - - - name: Stop Container - docker_container: - name: '{{pgrole}}' - state: stopped - - # ENDING FOR JDOWNLOADER2 ########################################################### - -# - name: 'Waiting for {{pgrole}} to initialize' -# wait_for: -# path: '/opt/appdata/{{pgrole}}/core.conf' -# state: present - - - name: 'Configuring {{pgrole}} for first time use' - block: - - name: 'Stopping {{pgrole}}' - docker_container: - name: '{{pgrole}}' - state: stopped - - - name: Restart Container - docker_container: - name: '{{pgrole}}' - state: started - - when: not inicheck.stat.exists + labels: '{{pg_labels}}' \ No newline at end of file From 6fde75df5e8ad3890296aa7be7b745c0678ab04d Mon Sep 17 00:00:00 2001 From: Robert Baker Date: Fri, 1 Feb 2019 16:30:02 -0700 Subject: [PATCH 13/14] fix --- apps/jdownloader2.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/jdownloader2.yml b/apps/jdownloader2.yml index 6fd638d..404aef2 100644 --- a/apps/jdownloader2.yml +++ b/apps/jdownloader2.yml @@ -29,6 +29,9 @@ - name: 'Including plugins' include_tasks: '/opt/plexguide/containers/_plugins.yml' + - name: 'Including folders' + include_tasks: '/opt/plexguide/containers/_downloaders.yml' + - name: 'Ini Check' stat: path: /opt/appdata/{{pgrole}}/core.conf From 6345fb9e557b7b594b77acae7a5db2d063e29462 Mon Sep 17 00:00:00 2001 From: Robert Baker Date: Sun, 3 Feb 2019 15:36:08 -0700 Subject: [PATCH 14/14] fix --- apps/{ => templates}/cloudcmd/cloudcmd.json | 0 apps/{ => templates}/deluge/plugins/autoremoveplus.conf | 0 apps/{ => templates}/deluge/plugins/core.conf | 0 apps/{ => templates}/deluge/plugins/execute.conf | 0 apps/{ => templates}/deluge/plugins/extractor.conf | 0 apps/{ => templates}/deluge/plugins/label0.conf | 0 apps/{ => templates}/deluge/scripts/deluge_extract.sh | 0 7 files changed, 0 insertions(+), 0 deletions(-) rename apps/{ => templates}/cloudcmd/cloudcmd.json (100%) rename apps/{ => templates}/deluge/plugins/autoremoveplus.conf (100%) rename apps/{ => templates}/deluge/plugins/core.conf (100%) rename apps/{ => templates}/deluge/plugins/execute.conf (100%) rename apps/{ => templates}/deluge/plugins/extractor.conf (100%) rename apps/{ => templates}/deluge/plugins/label0.conf (100%) rename apps/{ => templates}/deluge/scripts/deluge_extract.sh (100%) diff --git a/apps/cloudcmd/cloudcmd.json b/apps/templates/cloudcmd/cloudcmd.json similarity index 100% rename from apps/cloudcmd/cloudcmd.json rename to apps/templates/cloudcmd/cloudcmd.json diff --git a/apps/deluge/plugins/autoremoveplus.conf b/apps/templates/deluge/plugins/autoremoveplus.conf similarity index 100% rename from apps/deluge/plugins/autoremoveplus.conf rename to apps/templates/deluge/plugins/autoremoveplus.conf diff --git a/apps/deluge/plugins/core.conf b/apps/templates/deluge/plugins/core.conf similarity index 100% rename from apps/deluge/plugins/core.conf rename to apps/templates/deluge/plugins/core.conf diff --git a/apps/deluge/plugins/execute.conf b/apps/templates/deluge/plugins/execute.conf similarity index 100% rename from apps/deluge/plugins/execute.conf rename to apps/templates/deluge/plugins/execute.conf diff --git a/apps/deluge/plugins/extractor.conf b/apps/templates/deluge/plugins/extractor.conf similarity index 100% rename from apps/deluge/plugins/extractor.conf rename to apps/templates/deluge/plugins/extractor.conf diff --git a/apps/deluge/plugins/label0.conf b/apps/templates/deluge/plugins/label0.conf similarity index 100% rename from apps/deluge/plugins/label0.conf rename to apps/templates/deluge/plugins/label0.conf diff --git a/apps/deluge/scripts/deluge_extract.sh b/apps/templates/deluge/scripts/deluge_extract.sh similarity index 100% rename from apps/deluge/scripts/deluge_extract.sh rename to apps/templates/deluge/scripts/deluge_extract.sh