diff --git a/README.md b/README.md index 0718163..64834bd 100644 --- a/README.md +++ b/README.md @@ -1,45 +1,23 @@ -📂 [**Click Here**](https://goo.gl/7NR3Da) - Sign up for Google's Suite for Business - Unlimited Space - -📂 [**Click Here**](https://controlpanel.newshosting.com/signup/index.php?promo=partners&a_aid=5a65169240efd&a_bid=5ecfe99b) - NZB's with from NewsHost - PG Members Receive a 58% Discount - +##### WANT TO HELP? CLICK THE ★ (STAR LOGO) in the Upper-Right!
- -_**Table of Contents**_ - -1. [General Intro](#1-general-intro) -2. [YouTube Video - Intro](#2-youtube-video---intro) -3. [Summary](#3-summary) - ----- -# 1. General Intro - -**PG Box Community:** PG Community is a PG repo that collects and stores accepted user container writeups for community usage install. User can add programs such as Radarr4k or other unique programs that others may want to utlize. - -
Manage PlexGuide - AnyTime, Anywhere!
- -Forum Node for Community Box: [ CLICK HERE ](https://plexguide.com/forums/pg-app-community-box.191/) - -**WARNING: Wiki Under Construction** - -(BETTER EXAMPLES will be provided), but Radarr4k and Sonarr4k serve as general containers until posted! - -In order for apps show up under the Community App Store, users must select or push apps from within the app folder of this repo. Do not worry, the apps automatically show up under the community app store and are segerated from the official containers that are built and supported by PG. - -# 2. YouTube Video - Intro -NOT READY - -# 3. Summary - -PG Box Community Edition is dead simple to use! Have a container in mind? Push containers that benifit the community today! - -📂 [**Click Here**](http://usenetserver.com/partners/?a_aid=5a65169240efd&a_bid=5725b6ed) - NZB's from USENET Server - PG Members Receive a 60% Discount - - + +* 📂 [**[Click Here]**](https://goo.gl/7NR3Da) - Google G-Suite (Unlimited Hard Drive Space & Storage) +* 📂 [**[Click Here]**](https://controlpanel.newshosting.com/signup/index.php?promo=partners&a_aid=5a65169240efd&a_bid=5ecfe99b) - Top Performance NewsHost! - Blitz Members Receive a 58% Discount +---- +### **Reference Shortcut -** http://wiki.pgblitz.com | Discord ( !wiki ) +---- + +## 1. PG YouTube + + +PGBlitz Introduction Video
+ + +PGBlitz Installation Video
+ +[**[Click Here]**](https://pgblitz.com/threads/plexguide-install-instructions.243/) for installation instructions to start the process diff --git a/apps/_appsgen.sh b/apps/_appsgen.sh index 8a84e0a..a0e5ccd 100644 --- a/apps/_appsgen.sh +++ b/apps/_appsgen.sh @@ -1,14 +1,14 @@ #!/bin/bash # -# Title: PlexGuide (Reference Title File) +# Title: PGBlitz (Reference Title File) # Author(s): Admin9705 -# URL: https://plexguide.com - http://github.plexguide.com +# URL: https://pgblitz.com - http://github.pgblitz.com # GNU: General Public License v3.0 ################################################################################ # Generates App List -ls -la /opt/coreapps/apps/ | sed -e 's/.yml//g' \ -| awk '{print $9}' | tail -n +4 > /var/plexguide/app.list +ls -la /opt/communityapps/apps/ | sed -e 's/.yml//g' \ +| awk '{print $9}' | tail -n +4 >> /var/plexguide/app.list ls -la /opt/mycontainers/ | sed -e 's/.yml//g' \ | awk '{print $9}' | tail -n +4 >> /var/plexguide/app.list diff --git a/apps/_cron.list b/apps/_cron.list index 51857fe..d7eff0f 100644 --- a/apps/_cron.list +++ b/apps/_cron.list @@ -4,3 +4,4 @@ netdata alltube dockergc blitzui +watchtower diff --git a/apps/_plugins.yml b/apps/_plugins.yml index 7e6a747..7a557be 100644 --- a/apps/_plugins.yml +++ b/apps/_plugins.yml @@ -17,5 +17,5 @@ force: yes owner: '1000' group: '1000' - mode: 0755 + mode: 0775 when: copycheck.stat.exists diff --git a/apps/airsonic.yml b/apps/airsonic.yml index a014171..733afac 100644 --- a/apps/airsonic.yml +++ b/apps/airsonic.yml @@ -1,65 +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: 'airsonic' - intport: '4040' - extport: '4040' - image: 'airsonic/airsonic' - - # CORE (MANDATORY) ############################################################ - - name: 'Including cron job' - include_tasks: '/opt/communityapps/apps/_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}}:/airsonic/data' - - '/opt/appdata/{{pgrole}}/playlists:/airsonic/playlists' - - '/opt/appdata/{{pgrole}}/podcasts:/airsonic/podcasts' - - '{{path.stdout}}:{{path.stdout}}' - - '/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}}' - volumes: '{{pg_volumes}}' - env: '{{pg_env}}' - restart_policy: unless-stopped - networks: - - name: plexguide - aliases: - - '{{pgrole}}' - state: started - labels: '{{pg_labels}}' +#!/bin/bash +# +# Title: PGBlitz (linuxserver/airsonic) +# Author(s): MrDoob +# URL: https://pgblitz.com - http://github.pgblitz.com +# GNU: General Public License v3.0 +################################################################################ +--- +- hosts: localhost + gather_facts: false + tasks: + # FACTS ####################################################################### + - name: 'Set Known Facts' + set_fact: + pgrole: 'airsonic' + intport: '4040' + extport: '4040' + image: 'linuxserver/airsonic' + + # CORE (MANDATORY) ############################################################ + - name: 'Including cron job' + include_tasks: '/opt/communityapps/apps/_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: + - '/etc/localtime:/etc/localtime:ro' + - '/opt/appdata/{{pgrole}}:/airsonic/data' + - '/opt/appdata/{{pgrole}}/playlists:/airsonic/playlists' + - '/opt/appdata/{{pgrole}}/podcasts:/airsonic/podcasts' + - '{{path.stdout}}:{{path.stdout}}' + - '/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}}' + volumes: '{{pg_volumes}}' + env: '{{pg_env}}' + restart_policy: unless-stopped + networks: + - name: plexguide + aliases: + - '{{pgrole}}' + state: started + labels: '{{pg_labels}}' diff --git a/apps/alltube.yml b/apps/alltube.yml index 550f5cc..be82b40 100644 --- a/apps/alltube.yml +++ b/apps/alltube.yml @@ -1,8 +1,8 @@ #!/bin/bash # -# Title: PlexGuide (Reference Title File) +# Title: PGBlitz (Reference Title File) # Author(s): Admin9705 -# URL: https://plexguide.com - http://github.plexguide.com +# URL: https://pgblitz.com - http://github.pgblitz.com # GNU: General Public License v3.0 ################################################################################ --- diff --git a/apps/avidemux.yml b/apps/avidemux.yml new file mode 100644 index 0000000..8b78e56 --- /dev/null +++ b/apps/avidemux.yml @@ -0,0 +1,88 @@ +#!/bin/bash +# +# Title: avidemux +# Author(s): timekills +# URL: https://plexguide.com - http://github.plexguide.com +# GNU: General Public License v3.0 +################################################################################ +--- +- hosts: localhost + gather_facts: false + tasks: + # CORE (MANDATORY) DO NOT CHANGE ########################################### + + - name: 'Set Known Facts' + set_fact: + pgrole: 'avidemux' + intport: '5800' + extport: '5806' +# intport2: '25565' +# extport2: '25565' + image: 'jlesage/avidemux' + + - name: 'Including cron job' + include_tasks: '/opt/communityapps/apps/_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 + + # LABELS #### KEEPS BOTTOM CLEAN ########################################### + - 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:rw' + - '{{path.stdout}}:{{path.stdout}}' + - '/mnt:/mnt' + - '/etc/localtime:/etc/localtime:ro' + + - name: 'Setting PG ENV' + set_fact: + pg_env: + PUID: 1000 + PGID: 1000 + # Default width is 1280 If you comment out the next line it will use 1280. + DISPLAY_WIDTH: 1600 + # Default height is 768. If you comment out the next line it will use 768. + DISPLAY_HEIGHT: 960 + + # MAIN SCRIPT ############################################################## + + - 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/bazarr.yml b/apps/bazarr.yml index 1fac08d..3aded00 100644 --- a/apps/bazarr.yml +++ b/apps/bazarr.yml @@ -1,8 +1,8 @@ #!/bin/bash # -# Title: PlexGuide (Reference Title File) +# Title: PGBlitz (Reference Title File) # Author(s): Admin9705 -# URL: https://plexguide.com - http://github.plexguide.com +# URL: https://pgblitz.com - http://github.pgblitz.com # GNU: General Public License v3.0 ################################################################################ --- diff --git a/apps/beets.yml b/apps/beets.yml index 6427030..90a3ce0 100644 --- a/apps/beets.yml +++ b/apps/beets.yml @@ -1,8 +1,8 @@ #!/bin/bash # -# Title: PlexGuide (Reference Title File) +# Title: PGBlitz (Reference Title File) # Author(s): Admin9705 -# URL: https://plexguide.com - http://github.plexguide.com +# URL: https://pgblitz.com - http://github.pgblitz.com # GNU: General Public License v3.0 ################################################################################ --- diff --git a/apps/bitwarden.yml b/apps/bitwarden.yml index dd1bd07..f886a82 100644 --- a/apps/bitwarden.yml +++ b/apps/bitwarden.yml @@ -1,8 +1,8 @@ #!/bin/bash # -# Title: PlexGuide (Reference Title File) +# Title: PGBlitz (Reference Title File) # Author(s): Admin9705 -# URL: https://plexguide.com - http://github.plexguide.com +# URL: https://pgblitz.com - http://github.pgblitz.com # GNU: General Public License v3.0 ################################################################################ --- @@ -28,7 +28,6 @@ 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' diff --git a/apps/booksonic.yml b/apps/booksonic.yml index 7866260..ead0354 100644 --- a/apps/booksonic.yml +++ b/apps/booksonic.yml @@ -1,8 +1,8 @@ #!/bin/bash # -# Title: PlexGuide (Reference Title File) +# Title: PGBlitz (Reference Title File) # Author(s): Admin9705 -# URL: https://plexguide.com - http://github.plexguide.com +# URL: https://pgblitz.com - http://github.pgblitz.com # GNU: General Public License v3.0 ################################################################################ --- diff --git a/apps/cadvisor.yml b/apps/cadvisor.yml index 8db8d59..1f7c1f2 100644 --- a/apps/cadvisor.yml +++ b/apps/cadvisor.yml @@ -1,8 +1,8 @@ #!/bin/bash # -# Title: PlexGuide (Reference Title File) +# Title: PGBlitz (Reference Title File) # Author(s): Admin9705 -# URL: https://plexguide.com - http://github.plexguide.com +# URL: https://pgblitz.com - http://github.pgblitz.com # GNU: General Public License v3.0 ################################################################################ --- diff --git a/apps/calibre-web.yml b/apps/calibre-web.yml new file mode 100644 index 0000000..b2e93ac --- /dev/null +++ b/apps/calibre-web.yml @@ -0,0 +1,66 @@ +#!/bin/bash +# +# Title: PGBlitz (calibre-web) +# Author(s): Sejrup +# URL: https://pgblitz.com - http://github.pgblitz.com +# GNU: General Public License v3.0 +################################################################################ +--- +- hosts: localhost + gather_facts: false + tasks: + # FACTS ####################################################################### + - name: 'Set Known Facts' + set_fact: + pgrole: 'calibre-web' + intport: '8083' + extport: '8083' + image: 'technosoft2000/calibre-web' + + # CORE (MANDATORY) ############################################################ + - name: 'Including cron job' + include_tasks: '/opt/coreapps/apps/_core.yml' + + # LABELS ###################################################################### + - name: 'Adding Traefik' + set_fact: + pg_labels: + 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: + - '/opt/appdata/{{pgrole}}:/books' + - '/opt/appdata/{{pgrole}}/config:/calibre-web/config' + - '/etc/localtime:/etc/localtime:ro' + + - name: 'Setting PG ENV' + set_fact: + pg_env: + USE_CONFIG_DIR: 'true' + SET_CONTAINER_TIMEZONE: 'true' + CONTAINER_TIMEZONE: 'Europe/Copenhagen' + 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: always + networks: + - name: plexguide + aliases: + - '{{pgrole}}' + state: started + labels: '{{pg_labels}}' diff --git a/apps/cloudcmd.yml b/apps/cloudcmd.yml index bd301f3..799a4f8 100644 --- a/apps/cloudcmd.yml +++ b/apps/cloudcmd.yml @@ -1,8 +1,8 @@ #!/bin/bash # -# Title: PlexGuide (Reference Title File) +# Title: PGBlitz (Reference Title File) # Author(s): Admin9705 -# URL: https://plexguide.com - http://github.plexguide.com +# URL: https://pgblitz.com - http://github.pgblitz.com # GNU: General Public License v3.0 ################################################################################ --- diff --git a/apps/ddclient.yml b/apps/ddclient.yml index 06fdd62..625bb84 100644 --- a/apps/ddclient.yml +++ b/apps/ddclient.yml @@ -1,8 +1,8 @@ #!/bin/bash # -# Title: PlexGuide (Reference Title File) +# Title: PGBlitz (Reference Title File) # Author(s): Admin9705 -# URL: https://plexguide.com - http://github.plexguide.com +# URL: https://pgblitz.com - http://github.pgblitz.com # GNU: General Public License v3.0 ################################################################################ --- diff --git a/apps/deezloaderremix.yml b/apps/deezloaderremix.yml index 61dbb69..c0a1354 100644 --- a/apps/deezloaderremix.yml +++ b/apps/deezloaderremix.yml @@ -1,8 +1,8 @@ #!/bin/bash # -# Title: PlexGuide (Reference Title File) +# Title: PGBlitz (Reference Title File) # Author(s): Admin9705 -# URL: https://plexguide.com - http://github.plexguide.com +# URL: https://pgblitz.com - http://github.pgblitz.com # GNU: General Public License v3.0 ################################################################################ --- diff --git a/apps/delugevpn.yml b/apps/deluge-vpn.yml similarity index 95% rename from apps/delugevpn.yml rename to apps/deluge-vpn.yml index 7c2c007..9872189 100644 --- a/apps/delugevpn.yml +++ b/apps/deluge-vpn.yml @@ -1,8 +1,8 @@ #!/bin/bash # -# Title: PlexGuide (Reference Title File) +# Title: PGBlitz (Reference Title File) # Author(s): Admin9705 -# URL: https://plexguide.com - http://github.plexguide.com +# URL: https://pgblitz.com - http://github.pgblitz.com # GNU: General Public License v3.0 ################################################################################ --- @@ -141,14 +141,14 @@ lineinfile: path: '/opt/appdata/{{pgrole}}/core.conf' regexp: '"move_completed".*' - line: '"move_completed": true,' + 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,' + line: '"use_name_folder": True,' state: present - name: Setting extractor @@ -172,7 +172,7 @@ lineinfile: path: '/opt/appdata/{{pgrole}}/core.conf' regexp: '"compact_allocation".*' - line: '"compact_allocation": true,' + line: '"compact_allocation": True,' state: present - name: set stop_seed_ratio @@ -193,14 +193,14 @@ lineinfile: path: '/opt/appdata/{{pgrole}}/core.conf' regexp: '"remove_seed_at_ratio".*' - line: '"remove_seed_at_ratio": true,' + 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,' + line: '"enc_prefer_rc4": True,' state: present - name: set enc_level @@ -235,7 +235,7 @@ lineinfile: path: '/opt/appdata/{{pgrole}}/core.conf' regexp: '"dont_count_slow_torrents".*' - line: '"dont_count_slow_torrents": true,' + line: '"dont_count_slow_torrents": True,' state: present - name: set max_active_seeding diff --git a/apps/deluge.yml b/apps/deluge.yml index 08f8e0d..1450fe4 100644 --- a/apps/deluge.yml +++ b/apps/deluge.yml @@ -1,8 +1,8 @@ #!/bin/bash # -# Title: PlexGuide (Reference Title File) +# Title: PGBlitz (Reference Title File) # Author(s): Admin9705 -# URL: https://plexguide.com - http://github.plexguide.com +# URL: https://pgblitz.com - http://github.pgblitz.com # GNU: General Public License v3.0 ################################################################################ --- @@ -68,7 +68,7 @@ published_ports: - '{{ports.stdout}}{{extport}}:{{intport}}' - '{{ports.stdout}}{{extport2}}:{{intport2}}' - - '{{ports.stdout}}{{extport3}}:{{intport3}}' + - '{{extport3}}:{{intport3}}' volumes: '{{pg_volumes}}' env: '{{pg_env}}' restart_policy: unless-stopped diff --git a/apps/dockergc.yml b/apps/dockergc.yml index b8a1ed6..0f83a64 100644 --- a/apps/dockergc.yml +++ b/apps/dockergc.yml @@ -1,8 +1,8 @@ #!/bin/bash # -# Title: PlexGuide (Reference Title File) +# Title: PGBlitz (Reference Title File) # Author(s): Admin9705 -# URL: https://plexguide.com - http://github.plexguide.com +# URL: https://pgblitz.com - http://github.pgblitz.com # GNU: General Public License v3.0 ################################################################################ --- diff --git a/apps/domoticz.yml b/apps/domoticz.yml index 4054ac5..dc35552 100644 --- a/apps/domoticz.yml +++ b/apps/domoticz.yml @@ -19,7 +19,6 @@ extport2: '6144' intport3: '1443/tcp' extport3: '1443' - image: 'linuxserver/domoticz:stable' # CORE (MANDATORY) ############################################################ @@ -46,8 +45,7 @@ pg_env: PUID: '1000' PGID: '1000' - TZ: '${TZ}' - + # MAIN DEPLOYMENT ############################################################# - name: 'Deploying {{pgrole}}' docker_container: @@ -58,7 +56,6 @@ - '{{ports.stdout}}{{extport}}:{{intport}}' - '{{ports.stdout}}{{extport2}}:{{intport2}}' - '{{ports.stdout}}{{extport3}}:{{intport3}}' - - '{{ports.stdout}}{{extport4}}:{{intport4}}' volumes: '{{pg_volumes}}' env: '{{pg_env}}' restart_policy: unless-stopped diff --git a/apps/dozzle.yml b/apps/dozzle.yml new file mode 100644 index 0000000..f7f87a9 --- /dev/null +++ b/apps/dozzle.yml @@ -0,0 +1,64 @@ +#!/bin/bash +# +# Title: Dozzle +# Author(s): Amir Raminfar (amir20) +# URL: https://dozzle.dev/ - https://github.com/amir20/dozzle +# GNU: General Public License v3.0 +################################################################################ +--- +- hosts: localhost + gather_facts: false + tasks: + # CORE (MANDATORY) DO NOT CHANGE ########################################### + + - name: 'Set Known Facts' + set_fact: + pgrole: 'dozzle' + intport: '8080' + extport: '8383' + image: 'amir20/dozzle' + + - name: 'Including cron job' + include_tasks: '/opt/communityapps/apps/_core.yml' + + # LABELS #### KEEPS BOTTOM CLEAN ########################################### + - 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: + - '/var/run/docker.sock:/var/run/docker.sock' + - '/etc/localtime:/etc/localtime:ro' + + - name: 'Setting PG ENV' + set_fact: + pg_env: + DOZZLE_ADDR: ':8080' + DOZZLE_BASE: '/' + DOZZLE_LEVEL: 'info' + DOZZLE_TAILSIZE: '300' + + # MAIN SCRIPT ############################################################## + + - 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/duplicati.yml b/apps/duplicati.yml index 886b259..d14c2fd 100644 --- a/apps/duplicati.yml +++ b/apps/duplicati.yml @@ -1,8 +1,8 @@ #!/bin/bash # -# Title: PlexGuide (Reference Title File) +# Title: PGBlitz (Reference Title File) # Author(s): Admin9705 -# URL: https://plexguide.com - http://github.plexguide.com +# URL: https://pgblitz.com - http://github.pgblitz.com # GNU: General Public License v3.0 ################################################################################ --- diff --git a/apps/embystats.yml b/apps/embystats.yml index 567ed11..9d67b7a 100644 --- a/apps/embystats.yml +++ b/apps/embystats.yml @@ -1,8 +1,8 @@ #!/bin/bash # -# Title: PlexGuide (Reference Title File) +# Title: PGBlitz (Reference Title File) # Author(s): Admin9705 -# URL: https://plexguide.com - http://github.plexguide.com +# URL: https://pgblitz.com - http://github.pgblitz.com # GNU: General Public License v3.0 ################################################################################ --- @@ -14,7 +14,7 @@ - name: 'Set Known Facts' set_fact: pgrole: "embystats" - intport: "80" + intport: "5432" extport: "9049" image: "uping/embystat:beta-linux" diff --git a/apps/filebot.yml b/apps/filebot.yml new file mode 100644 index 0000000..7ba2310 --- /dev/null +++ b/apps/filebot.yml @@ -0,0 +1,66 @@ +#!/bin/bash +# +# Title: PGBlitz (jlesage/filebot) +# Author(s): MrDoob +# URL: https://pgblitz.com - http://github.pgblitz.com +# GNU: General Public License v3.0 +################################################################################ +--- +- hosts: localhost + gather_facts: false + tasks: + # FACTS ####################################################################### + - name: 'Set Known Facts' + set_fact: + pgrole: 'filebot' + intport: '5800' + extport: '5804' + intport2: '5900' + extport2: '5903' + image: 'jlesage/filebot' + + # CORE (MANDATORY) ############################################################ + - name: 'Including cron job' + include_tasks: '/opt/communityapps/apps/_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' + - '{{path.stdout}}:{{path.stdout}}' + - '/mnt:/storage:rw' + - '/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}}' + - '{{ports.stdout}}{{extport2}}:{{intport2}}' + volumes: '{{pg_volumes}}' + env: '{{pg_env}}' + restart_policy: unless-stopped + networks: + - name: plexguide + aliases: + - '{{pgrole}}' + state: started + labels: '{{pg_labels}}' diff --git a/apps/filezilla.yml b/apps/filezilla.yml new file mode 100644 index 0000000..ac8c81d --- /dev/null +++ b/apps/filezilla.yml @@ -0,0 +1,81 @@ +#!/bin/bash +# +# Title: Filezilla for PGBlitz (OAuth security) +# Author(s): CasperVN +# URL: https://pgblitz.com - https://github.com/jlesage/docker-filezilla +# GNU: General Public License v3.0 +################################################################################ +--- +- hosts: localhost + gather_facts: false + tasks: + # FACTS ####################################################################### + + - name: 'Set Known Facts' + set_fact: + pgrole: 'filezilla' + intport: '5800' + extport: '5803' + image: 'jlesage/filezilla' + + # CORE (MANDATORY) ############################################################ + - name: 'Including cron job' + include_tasks: '/opt/communityapps/apps/_core.yml' + + - name: 'Including plugins' + include_tasks: '/opt/communityapps/apps/_plugins.yml' + + - name: 'Including folders' + include_tasks: '/opt/communityapps/apps/_downloaders.yml' + + - name: 'Ini Check' + stat: + path: /opt/appdata/{{pgrole}}/core.conf + register: inicheck + + # 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: + - '/opt/appdata/{{pgrole}}:/config' + - '{{path.stdout}}:{{path.stdout}}' + - '/mnt/downloads:/storage:rw' + - '/etc/localtime:/etc/localtime:ro' + + - name: 'Setting PG ENV' + set_fact: + pg_env: + UID: '1000' + GID: '1000' + DISPLAY_WIDTH: '1920' + DISPLAY_HEIGHT: '1080' + + # 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}}' + +##PG-Community + +##PG-Community diff --git a/apps/firefox.yml b/apps/firefox.yml new file mode 100644 index 0000000..c1bd84c --- /dev/null +++ b/apps/firefox.yml @@ -0,0 +1,97 @@ +#!/bin/bash +# +# Title: firefox +# Author(s): timekills +# URL: https://plexguide.com - http://github.plexguide.com +# GNU: General Public License v3.0 +################################################################################ +--- +- hosts: localhost + gather_facts: false + tasks: + # CORE (MANDATORY) DO NOT CHANGE ########################################### + + - name: 'Set Known Facts' + set_fact: + pgrole: 'firefox' + intport: '5800' + extport: '5810' +# intport2: '25565' +# extport2: '25565' + image: 'jlesage/firefox' + + - name: 'Including cron job' + include_tasks: '/opt/communityapps/apps/_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 + + # LABELS #### KEEPS BOTTOM CLEAN ########################################### + - 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}}' + traefik.frontend.headers.SSLHost: '{{domain.stdout}}' + traefik.frontend.headers.SSLRedirect: 'true' + traefik.frontend.headers.STSIncludeSubdomains: 'true' + traefik.frontend.headers.STSPreload: 'true' + traefik.frontend.headers.STSSeconds: '315360000' + traefik.frontend.headers.browserXSSFilter: 'true' + traefik.frontend.headers.contentTypeNosniff: 'true' + traefik.frontend.headers.customResponseHeaders: 'X-Robots-Tag:noindex,nofollow,nosnippet,noarchive,notranslate,noimageindex' + traefik.frontend.headers.forceSTSHeader: 'true' + #traefik.frontend.headers.frameDeny: 'true' + + - name: 'Setting PG Volumes' + set_fact: + pg_volumes: + - '/opt/appdata/{{pgrole}}:/config:rw' + - '{{path.stdout}}:{{path.stdout}}' + - '/mnt:/mnt' + - '/etc/localtime:/etc/localtime:ro' + - '/dev/shm:/dev/shm:rw' + + - name: 'Setting PG ENV' + set_fact: + pg_env: + PUID: 1000 + PGID: 1000 + DISPLAY_WIDTH: 1600 + DISPLAY_HEIGHT: 960 + + # MAIN SCRIPT ############################################################## + + - 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/flexget.yml b/apps/flexget.yml new file mode 100644 index 0000000..7b375a6 --- /dev/null +++ b/apps/flexget.yml @@ -0,0 +1,63 @@ +#!/bin/bash +# +# Title: FlexGet +# Author(s): paranoidi, Chase Sterling, cpoppema +# URL: https://flexget.com/ | https://github.com/cpoppema/docker-flexget +# GNU: MIT +################################################################################ +--- +- hosts: localhost + gather_facts: false + tasks: + # FACTS ####################################################################### + - name: 'Set Known Facts' + set_fact: + pgrole: 'flexget' + intport: '5050' + extport: '6060' + image: 'cpoppema/docker-flexget:latest' + + # CORE (MANDATORY) ############################################################ + - name: 'Including cron job' + include_tasks: '/opt/communityapps/apps/_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: + - '/etc/localtime:/etc/localtime:ro' + - '/opt/appdata/{{pgrole}}:/config' + - '{{path.stdout}}:{{path.stdout}}' + - '/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}}' + volumes: '{{pg_volumes}}' + env: '{{pg_env}}' + restart_policy: unless-stopped + networks: + - name: plexguide + aliases: + - '{{pgrole}}' + state: started + labels: '{{pg_labels}}' diff --git a/apps/templates/broken/nzbthrottle.yml b/apps/flextv.yml similarity index 67% rename from apps/templates/broken/nzbthrottle.yml rename to apps/flextv.yml index 861ac01..ee73fbf 100644 --- a/apps/templates/broken/nzbthrottle.yml +++ b/apps/flextv.yml @@ -1,8 +1,8 @@ #!/bin/bash # -# Title: PlexGuide (Reference Title File) +# Title: PGBlitz (digitalhigh/FlexTV) # Author(s): Admin9705 -# URL: https://plexguide.com - http://github.plexguide.com +# URL: https://pgblitz.com - http://github.pgblitz.com # GNU: General Public License v3.0 ################################################################################ --- @@ -12,31 +12,15 @@ # FACTS ####################################################################### - name: 'Set Known Facts' set_fact: - pgrole: 'nzbthrottle' - intport: '0' - extport: '0' - image: 'daghaian/nzbthrottle' + pgrole: 'flextv' + intport: '80/tcp' + extport: '8987' + image: 'digitalhigh/flextv:latest' # CORE (MANDATORY) ############################################################ - name: 'Including cron job' include_tasks: '/opt/communityapps/apps/_core.yml' - - name: 'Checking {{pgrole}}'s json existance' - stat: - path: '/opt/communityapps/apps/templates/{{pgrole}}/config.json' - register: jsoncheck - - - name: 'Copying file for {{pgrole}}' - copy: - src: '/opt/communityapps/apps/templates/{{pgrole}}/config.json' - dest: '/opt/appdata/{{pgrole}}/{{pgrole}}/config.json' - directory_mode: yes - force: yes - owner: '1000' - group: '1000' - mode: 0755 - when: not jsoncheck.stat.exists - # LABELS ###################################################################### - name: 'Adding Traefik' set_fact: @@ -44,21 +28,20 @@ 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' - - '/opt/appdata/{{pgrole}}/config.json:/{{pgrole}}/config.json:ro' - name: 'Setting PG ENV' set_fact: pg_env: PUID: '1000' PGID: '1000' - + # MAIN DEPLOYMENT ############################################################# - name: 'Deploying {{pgrole}}' docker_container: diff --git a/apps/gazee.yml b/apps/gazee.yml index 53c40e9..ba2a63c 100644 --- a/apps/gazee.yml +++ b/apps/gazee.yml @@ -1,8 +1,8 @@ #!/bin/bash # -# Title: PlexGuide (Reference Title File) +# Title: PGBlitz (Reference Title File) # Author(s): Admin9705 -# URL: https://plexguide.com - http://github.plexguide.com +# URL: https://pgblitz.com - http://github.pgblitz.com # GNU: General Public License v3.0 ################################################################################ --- diff --git a/apps/gitea.yml b/apps/gitea.yml index 15aba27..54324fa 100644 --- a/apps/gitea.yml +++ b/apps/gitea.yml @@ -1,8 +1,8 @@ #!/bin/bash # -# Title: PlexGuide (Reference Title File) +# Title: PGBlitz (Reference Title File) # Author(s): Admin9705 -# URL: https://plexguide.com - http://github.plexguide.com +# URL: https://pgblitz.com - http://github.pgblitz.com # GNU: General Public License v3.0 ################################################################################ --- diff --git a/apps/handbrake.yml b/apps/handbrake.yml index 31dd645..d1013f4 100644 --- a/apps/handbrake.yml +++ b/apps/handbrake.yml @@ -1,8 +1,8 @@ #!/bin/bash # -# Title: Handbrake for PlexGuide +# Title: Handbrake for PGBlitz # Author(s): timekills -# URL: https://plexguide.com - https://github.com/timekills +# URL: https://pgblitz.com - https://github.com/timekills # GNU: General Public License v3.0 ################################################################################ --- @@ -65,7 +65,7 @@ state: directory owner: '1000' group: '1000' - mode: 0755 + mode: 0775 recurse: yes - name: 'Create complete directory for {{pgrole}}' @@ -74,7 +74,7 @@ state: directory owner: '1000' group: '1000' - mode: 0755 + mode: 0775 recurse: yes - name: 'Deploying {{pgrole}}' diff --git a/apps/handbrake2.yml b/apps/handbrake2.yml deleted file mode 100644 index ccaeefa..0000000 --- a/apps/handbrake2.yml +++ /dev/null @@ -1,95 +0,0 @@ -#!/bin/bash -# -# Title: Handbrake for PlexGuide Community (user/password) -# Author(s): timekills -# URL: https://plexguide.com - https://github.com/timekills -# GNU: General Public License v3.0 -################################################################################ ---- -- hosts: localhost - gather_facts: false - tasks: - # FACTS ####################################################################### - - - name: 'Set Known Facts' - set_fact: - pgrole: 'handbrake' - intport: '5800' - extport: '5800' - image: 'jlesage/handbrake:dev-latest' - - # CORE (MANDATORY) ############################################################ - - name: 'Including cron job' - include_tasks: '/opt/communityapps/apps/_core.yml' - - # LABELS ###################################################################### - - name: 'Adding Traefik' - set_fact: - pg_labels: - traefik.enable: 'true' - traefik.port: '{{intport}}' - traefik.frontend.auth.basic.users: "plex:$apr1$tosnCNtX$XKXnDaIiW7f0y1nwmd.KL0" - traefik.frontend.rule: 'Host:handbrake.{{domain.stdout}},{{tldset}}' - - - name: 'Setting PG Volumes' - set_fact: - pg_volumes: - - '/opt/appdata/{{pgrole}}/config:/config:rw' - - '/:/storage:ro' - - '{{path.stdout}}:{{path.stdout}}' - - '/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' - - '{{path.stdout}}/{{pgrole}}/complete/:/output:rw' - - '/dev/dri:/dev/dri:rw' - - '/etc/localtime:/etc/localtime:ro' - - - name: 'Setting PG ENV' - set_fact: - pg_env: - USER_ID: '1000' - GROUP_ID: '1000' - AUTOMATED_CONVERSION_PRESET: "Very Fast 1080p30" - AUTOMATED_CONVERSION_FORMAT: "mp4" - AUTOMATED_CONVERSION_PRESET_2: "HQ 1080p30 Surround" - AUTOMATED_CONVERSION_FORMAT_2: "mp4" - AUTOMATED_CONVERSION_PRESET_3: "H.264 MKV 1080p30" - AUTOMATED_CONVERSION_FORMAT_3: "mkv" -# SECURE_CONNECTION: 1 - - # MAIN DEPLOYMENT ############################################################# - - name: 'Create watch directory for {{pgrole}}' - file: - path: '{{path.stdout}}/handbrake/watch' - state: directory - owner: '1000' - group: '1000' - mode: 0755 - recurse: yes - - - name: 'Create complete directory for {{pgrole}}' - file: - path: '{{path.stdout}}/handbrake/complete' - state: directory - owner: '1000' - group: '1000' - mode: 0755 - recurse: yes - - - 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/headphones.yml b/apps/headphones.yml index a8804fc..53312f0 100644 --- a/apps/headphones.yml +++ b/apps/headphones.yml @@ -1,8 +1,8 @@ #!/bin/bash # -# Title: PlexGuide (Reference Title File) +# Title: PGBlitz (Reference Title File) # Author(s): Admin9705 -# URL: https://plexguide.com - http://github.plexguide.com +# URL: https://pgblitz.com - http://github.pgblitz.com # GNU: General Public License v3.0 ################################################################################ --- diff --git a/apps/heimdall.yml b/apps/heimdall.yml index 412a1c2..77fcf5f 100644 --- a/apps/heimdall.yml +++ b/apps/heimdall.yml @@ -1,8 +1,8 @@ #!/bin/bash # -# Title: PlexGuide (Reference Title File) +# Title: PGBlitz (Reference Title File) # Author(s): Admin9705 -# URL: https://plexguide.com - http://github.plexguide.com +# URL: https://pgblitz.com - http://github.pgblitz.com # GNU: General Public License v3.0 ################################################################################ --- diff --git a/apps/home-assistant.yml b/apps/home-assistant.yml index 0d7dd3b..b6f94a3 100644 --- a/apps/home-assistant.yml +++ b/apps/home-assistant.yml @@ -1,8 +1,8 @@ #!/bin/bash # -# Title: PlexGuide (Reference Title File) +# Title: PGBlitz (Reference Title File) # Author(s): Admin9705 -# URL: https://plexguide.com - http://github.plexguide.com +# URL: https://pgblitz.com - http://github.pgblitz.com # GNU: General Public License v3.0 ################################################################################ --- diff --git a/apps/htpcmanager.yml b/apps/htpcmanager.yml index 70ad6dd..207bcc0 100644 --- a/apps/htpcmanager.yml +++ b/apps/htpcmanager.yml @@ -1,8 +1,8 @@ #!/bin/bash # -# Title: PlexGuide (Reference Title File) +# Title: PGBlitz (Reference Title File) # Author(s): Admin9705 -# URL: https://plexguide.com - http://github.plexguide.com +# URL: https://pgblitz.com - http://github.pgblitz.com # GNU: General Public License v3.0 ################################################################################ --- diff --git a/apps/image/_image.sh b/apps/image/_image.sh index f806158..ee4ecdf 100644 --- a/apps/image/_image.sh +++ b/apps/image/_image.sh @@ -1,8 +1,8 @@ #!/bin/bash # -# Title: PlexGuide (Reference Title File) +# Title: PGBlitz (Reference Title File) # Author(s): Admin9705 -# URL: https://plexguide.com - http://github.plexguide.com +# URL: https://pgblitz.com - http://github.pgblitz.com # GNU: General Public License v3.0 ################################################################################ diff --git a/apps/image/nzbget b/apps/image/nzbget new file mode 100644 index 0000000..d8f3f35 --- /dev/null +++ b/apps/image/nzbget @@ -0,0 +1,2 @@ +linuxserver/nzbget +linuxserver/nzbget:testing diff --git a/apps/image/unifi-controller b/apps/image/unifi-controller new file mode 100644 index 0000000..371ec56 --- /dev/null +++ b/apps/image/unifi-controller @@ -0,0 +1,2 @@ +linuxserver/unifi-controller:latest +linuxserver/unifi-controller:LTS diff --git a/apps/jd2-openvpn.yml b/apps/jd2-openvpn.yml index 5af7044..26cf971 100644 --- a/apps/jd2-openvpn.yml +++ b/apps/jd2-openvpn.yml @@ -1,6 +1,6 @@ #!/bin/bash # -# Title: Jdownloader2 for PlexGuide (OAuth security) with OpenVPN integration +# Title: Jdownloader2 for PGBlitz (OAuth security) with OpenVPN integration # Author(s): timekills (mod. h1f0x) # URL: https://hub.docker.com/r/h1f0x/jd2-openvpn # GNU: General Public License v3.0 @@ -49,12 +49,11 @@ - name: 'Setting PG Volumes' set_fact: pg_volumes: - - '/opt/appdata/{{pgrole}}:/config' - - '{{path.stdout}}:{{path.stdout}}' - - '/mnt/unionfs:/unionfs' - - '/mnt:/mnt' - - '{{path.stdout}}/downloads/{{pgrole}}/:/output:rw' - '/etc/localtime:/etc/localtime:ro' + - '{{path.stdout}}:{{path.stdout}}' + - '/mnt:/mnt' + - '/opt/appdata/{{pgrole}}:/config' + - '{{path.stdout}}/downloads/{{pgrole}}/:/output:rw' - '/opt/appdata/{{pgrole}}/vpn:/vpn:rw' - name: 'Setting PG ENV' @@ -62,6 +61,8 @@ pg_env: UID: '1000' GID: '1000' + DISPLAY_WIDTH: '1600' + DISPLAY_HEIGHT: '960' # MAIN DEPLOYMENT ############################################################# - name: 'Deploying {{pgrole}}' diff --git a/apps/jdownloader2.yml b/apps/jdownloader2.yml index 7bbae15..addee0d 100644 --- a/apps/jdownloader2.yml +++ b/apps/jdownloader2.yml @@ -1,8 +1,8 @@ #!/bin/bash # -# Title: Jdownloader2 for PlexGuide (OAuth security) +# Title: Jdownloader2 for PGBlitz (OAuth security) # Author(s): timekills -# URL: https://plexguide.com - https://github.com/timekills/jdownloader2-for-Plexguide +# URL: https://pgblitz.com - https://github.com/timekills/jdownloader2-for-Plexguide # GNU: General Public License v3.0 ################################################################################ --- @@ -49,12 +49,11 @@ - name: 'Setting PG Volumes' set_fact: pg_volumes: - - '/opt/appdata/{{pgrole}}:/config' - - '{{path.stdout}}:{{path.stdout}}' - - '/mnt/unionfs:/unionfs' - - '/mnt:/mnt' - - '{{path.stdout}}/downloads/{{pgrole}}/:/output:rw' - '/etc/localtime:/etc/localtime:ro' + - '{{path.stdout}}:{{path.stdout}}' + - '/mnt:/mnt' + - '/opt/appdata/{{pgrole}}:/config' + - '{{path.stdout}}/downloads/{{pgrole}}/:/output:rw' - name: 'Setting PG ENV' set_fact: diff --git a/apps/kitana.yml b/apps/kitana.yml index 1e349c7..1591b0c 100644 --- a/apps/kitana.yml +++ b/apps/kitana.yml @@ -1,8 +1,8 @@ #!/bin/bash # -# Title: PlexGuide (Reference Title File) +# Title: PGBlitz (Reference Title File) # Author(s): Admin9705 -# URL: https://plexguide.com - http://github.plexguide.com +# URL: https://pgblitz.com - http://github.pgblitz.com # GNU: General Public License v3.0 ################################################################################ --- diff --git a/apps/logarr.yml b/apps/logarr.yml index b0d7f29..9e59173 100644 --- a/apps/logarr.yml +++ b/apps/logarr.yml @@ -1,8 +1,8 @@ #!/bin/bash # -# Title: PlexGuide (Reference Title File) +# Title: PGBlitz (Reference Title File) # Author(s): Admin9705 -# URL: https://plexguide.com - http://github.plexguide.com +# URL: https://pgblitz.com - http://github.pgblitz.com # GNU: General Public License v3.0 ################################################################################ --- @@ -14,7 +14,7 @@ set_fact: pgrole: 'logarr' intport: '80' - extport: '7555' + extport: '7755' image: 'monitorr/logarr:develop' # CORE (MANDATORY) ############################################################ diff --git a/apps/makemkv.yml b/apps/makemkv.yml index c768211..5171a58 100644 --- a/apps/makemkv.yml +++ b/apps/makemkv.yml @@ -1,8 +1,8 @@ #!/bin/bash # -# Title: MakeMKV for PlexGuide +# Title: MakeMKV for PGBlitz # Author(s): rla999 -# URL: https://plexguide.com - https://github.com/rla999/makemkv-for-plexguide/ +# URL: https://pgblitz.com - https://github.com/rla999/makemkv-for-plexguide/ # GNU: General Public License v3.0 ################################################################################ --- @@ -36,11 +36,11 @@ - name: 'Setting PG Volumes' set_fact: pg_volumes: - - '/opt/appdata/{{pgrole}}:/config' - - '{{path.stdout}}:{{path.stdout}}' - - '/mnt/unionfs:/unionfs' - - '{{path.stdout}}/downloads/{{pgrole}}/:/output:rw' - '/etc/localtime:/etc/localtime:ro' + - '{{path.stdout}}:{{path.stdout}}' + - '/mnt:/mnt' + - '/opt/appdata/{{pgrole}}:/config' + - '{{path.stdout}}/downloads/{{pgrole}}/:/output:rw' - name: 'Setting PG ENV' set_fact: diff --git a/apps/mariadb.yml b/apps/mariadb.yml new file mode 100644 index 0000000..ed9ee65 --- /dev/null +++ b/apps/mariadb.yml @@ -0,0 +1,68 @@ +#!/bin/bash +# +# Title: MariaDB +# Author(s): MariaDB Foundation +# URL: https://mariadb.com - https://github.com/docker-library/mariadb +# GNU: General Public License v2.0 +################################################################################ +--- +- hosts: localhost + gather_facts: false + tasks: +# CORE (MANDATORY) DO NOT CHANGE ########################################### + + - name: 'Set Known Facts' + set_fact: + pgrole: "mariadb" + intport: "3306" + extport: "6603" + image: "mariadb:latest" + + - name: 'Including cron job' + include_tasks: '/opt/communityapps/apps/_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}}:/var/lib/mysql' + - '/etc/localtime:/etc/localtime:ro' + + - name: 'Setting PG ENV' + set_fact: + pg_env: + MYSQL_ROOT_PASSWORD: plexguide + + # 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}}' + + # POST DEPLOYMENT ############################################################## + + - name: 'Post Deployment Notes' + debug: + msg: |- + * Login Information * root:plexguide * This should be changed * \ No newline at end of file diff --git a/apps/mcmyadmin.yml b/apps/mcmyadmin.yml index ce1ecca..ff4957e 100644 --- a/apps/mcmyadmin.yml +++ b/apps/mcmyadmin.yml @@ -2,7 +2,7 @@ # # Title: McMyadmin (v2) # Author(s): timekills -# URL: https://plexguide.com - http://github.plexguide.com +# URL: https://pgblitz.com - http://github.pgblitz.com # GNU: General Public License v3.0 ################################################################################ --- @@ -15,7 +15,7 @@ set_fact: pgrole: 'mcmyadmin' intport: '8080' - extport: '8088' + extport: '8087' image: 'linuxserver/mcmyadmin2' - name: 'Including cron job' diff --git a/apps/mediainfo.yml b/apps/mediainfo.yml new file mode 100644 index 0000000..026f6b5 --- /dev/null +++ b/apps/mediainfo.yml @@ -0,0 +1,67 @@ +#!/bin/bash +# +# Title: PGBlitz (jlesage/mediainfo) +# Author(s): MrDoob +# URL: https://pgblitz.com - http://github.pgblitz.com +# GNU: General Public License v3.0 +################################################################################ +--- +- hosts: localhost + gather_facts: false + tasks: + # FACTS ####################################################################### + - name: 'Set Known Facts' + set_fact: + pgrole: 'mediainfo' + intport: '5800' + extport: '5806' + intport2: '5900' + extport2: '5907' + image: 'jlesage/mediainfo:latest' + + # CORE (MANDATORY) ############################################################ + - name: 'Including cron job' + include_tasks: '/opt/communityapps/apps/_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' + - '{{path.stdout}}:{{path.stdout}}' + - '/mnt/unionfs:/unionfs:rw' + - '/mnt:/mnt:rw' + - '/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}}' + - '{{ports.stdout}}{{extport2}}:{{intport2}}' + volumes: '{{pg_volumes}}' + env: '{{pg_env}}' + restart_policy: unless-stopped + networks: + - name: plexguide + aliases: + - '{{pgrole}}' + state: started + labels: '{{pg_labels}}' diff --git a/apps/medusa.yml b/apps/medusa.yml index 5569455..ce96bfb 100644 --- a/apps/medusa.yml +++ b/apps/medusa.yml @@ -1,8 +1,8 @@ #!/bin/bash # -# Title: PlexGuide (Reference Title File) +# Title: PGBlitz (Reference Title File) # Author(s): Admin9705 -# URL: https://plexguide.com - http://github.plexguide.com +# URL: https://pgblitz.com - http://github.pgblitz.com # GNU: General Public License v3.0 ################################################################################ --- @@ -29,7 +29,6 @@ - name: 'Adding Traefik' set_fact: pg_labels: - traefik.protocol: 'https' traefik.frontend.auth.forward.address: '{{gauth}}' traefik.enable: 'true' traefik.port: '{{intport}}' diff --git a/apps/mellow.yml b/apps/mellow.yml index f08cd72..8460dad 100644 --- a/apps/mellow.yml +++ b/apps/mellow.yml @@ -1,8 +1,8 @@ #!/bin/bash # -# Title: PlexGuide (Reference Title File) +# Title: PGBlitz (Reference Title File) # Author(s): Admin9705 -# URL: https://plexguide.com - http://github.plexguide.com +# URL: https://pgblitz.com - http://github.pgblitz.com # GNU: General Public License v3.0 ################################################################################ --- diff --git a/apps/mkvtoolnix.yml b/apps/mkvtoolnix.yml index 0c2bb30..e39bbd3 100644 --- a/apps/mkvtoolnix.yml +++ b/apps/mkvtoolnix.yml @@ -2,7 +2,7 @@ # # Title: MKVToolNix # Author(s): jlesage/timekills -# URL: https://plexguide.com - http://github.plexguide.com +# URL: https://pgblitz.com - http://github.pgblitz.com # GNU: General Public License v3.0 # Docker: Docker image is available at: https://hub.docker.com/r/metabrainz/picard-website ################################################################################ diff --git a/apps/monitorr.yml b/apps/monitorr.yml index 56dc800..7c6cbe2 100644 --- a/apps/monitorr.yml +++ b/apps/monitorr.yml @@ -1,8 +1,8 @@ #!/bin/bash # -# Title: PlexGuide (Reference Title File) +# Title: PGBlitz (Reference Title File) # Author(s): Admin9705 -# URL: https://plexguide.com - http://github.plexguide.com +# URL: https://pgblitz.com - http://github.pgblitz.com # GNU: General Public License v3.0 ################################################################################ --- diff --git a/apps/muximux.yml b/apps/muximux.yml index ceffacc..fce2d5f 100644 --- a/apps/muximux.yml +++ b/apps/muximux.yml @@ -1,8 +1,8 @@ #!/bin/bash # -# Title: PlexGuide (Reference Title File) +# Title: PGBlitz (Reference Title File) # Author(s): Admin9705 -# URL: https://plexguide.com - http://github.plexguide.com +# URL: https://pgblitz.com - http://github.pgblitz.com # GNU: General Public License v3.0 ################################################################################ --- diff --git a/apps/mylar.yml b/apps/mylar.yml index dacd214..1f737bf 100644 --- a/apps/mylar.yml +++ b/apps/mylar.yml @@ -1,8 +1,8 @@ #!/bin/bash # -# Title: PlexGuide (Reference Title File) +# Title: PGBlitz (Reference Title File) # Author(s): Admin9705 -# URL: https://plexguide.com - http://github.plexguide.com +# URL: https://pgblitz.com - http://github.pgblitz.com # GNU: General Public License v3.0 ################################################################################ --- diff --git a/apps/nextcloud.yml b/apps/nextcloud.yml index 1b23a12..3c75ef8 100644 --- a/apps/nextcloud.yml +++ b/apps/nextcloud.yml @@ -1,8 +1,8 @@ #!/bin/bash # -# Title: PlexGuide (Reference Title File) +# Title: PGBlitz (Reference Title File) # Author(s): Admin9705 -# URL: https://plexguide.com - http://github.plexguide.com +# URL: https://pgblitz.com - http://github.pgblitz.com # GNU: General Public License v3.0 ################################################################################ --- diff --git a/apps/nowshowing.yml b/apps/nowshowing.yml index 4f63f74..9303c25 100644 --- a/apps/nowshowing.yml +++ b/apps/nowshowing.yml @@ -1,8 +1,8 @@ #!/bin/bash # -# Title: PlexGuide (Reference Title File) +# Title: PGBlitz (Reference Title File) # Author(s): Admin9705 -# URL: https://plexguide.com - http://github.plexguide.com +# URL: https://pgblitz.com - http://github.pgblitz.com # GNU: General Public License v3.0 ################################################################################ --- diff --git a/apps/nzbget-mp4.yml b/apps/nzbget-mp4.yml new file mode 100644 index 0000000..3303ba7 --- /dev/null +++ b/apps/nzbget-mp4.yml @@ -0,0 +1,402 @@ +#!/bin/bash +# +# NzbGet, with build in sickbeard_mp4_automator and ffmpeg build script +# Built for PGBlitz version 8.5.6 +# Should be fine for versions above this too +# +# Title: PGBlitz (Reference Title File) +# Author(s): Admin9705 +# URL: https://pgblitz.com - http://github.pgblitz.com +# GNU: General Public License v3.0 +################################################################################# +--- +- hosts: localhost + gather_facts: false + tasks: + # FACTS ####################################################################### + + - name: 'Set Known Facts' + set_fact: + pgrole: 'nzbget' + intport: '6789' + extport: '6789' + image: 'linuxserver/nzbget' + + # CORE (MANDATORY) ############################################################ + - name: 'Including cron job' + include_tasks: '/opt/communityapps/apps/_core.yml' + + - name: 'Including folders' + include_tasks: '/opt/communityapps/apps/_downloaders.yml' + + - name: Create nzb folder + file: 'path={{item}} state=directory mode=0775 owner=1000 group=1000' + with_items: + - '{{path.stdout}}/nzb' +# force: yes + + - name: 'Including plugins' + include_tasks: '/opt/communityapps/apps/_plugins.yml' + + - name: 'Checking for existing app data' + stat: + path: /opt/appdata/{{pgrole}}/nzbget.conf + register: confcheck + + # EXTRAS FOR MP4 MODS ########################################################## + - name: 'Create {{pgrole}} mp4 directories' + file: 'path={{item}} state=directory mode=0775 owner=1000 group=1000 recurse=yes' + with_items: + - '/opt/appdata/{{pgrole}}' + - '/opt/appdata/{{pgrole}}/cont-init.d' + - '/opt/appdata/{{pgrole}}/installer' + - '/opt/appdata/{{pgrole}}/scripts' + - '/opt/appdata/{{pgrole}}/scripts/MP4_Automator' + - '/opt/appdata/{{pgrole}}/ffmpeg-build' + - '/opt/appdata/{{pgrole}}/services.d' + + - name: 'Copy custom init scripts into directory for {{pgrole}}' + copy: + src: /opt/communityapps/apps/templates/{{pgrole}}/cont-init.d/30-config + dest: /opt/appdata/{{pgrole}}/cont-init.d + directory_mode: yes + force: yes + owner: 1000 + group: 1000 + mode: 0775 + + - name: 'Copy custom install scripts into directory for {{pgrole}}' + copy: + src: /opt/communityapps/apps/templates/{{pgrole}}/installer/installer.sh + dest: /opt/appdata/{{pgrole}}/installer + directory_mode: yes + force: yes + owner: 1000 + group: 1000 + mode: 0775 + + - name: 'Copy custom mp4 config into directory for {{pgrole}}' + copy: + src: /opt/communityapps/apps/templates/{{pgrole}}/MP4_Automator/autoProcess.ini + dest: /opt/appdata/{{pgrole}}/scripts/MP4_Automator + directory_mode: yes + force: yes + owner: 1000 + group: 1000 + mode: 0775 + + - name: 'Copy custom NZBGetPostProcess script config into directory for {{pgrole}}' + copy: + src: /opt/communityapps/apps/templates/{{pgrole}}/MP4_Automator/TEMPLATEPPScript + dest: /opt/appdata/{{pgrole}}/ + directory_mode: yes + force: yes + owner: 1000 + group: 1000 + mode: 0775 + + - name: 'Copy ffmpeg build script into directory for {{pgrole}}' + copy: + src: /opt/communityapps/apps/templates/{{pgrole}}/ffmpeg-build/web-install.sh + dest: /opt/appdata/{{pgrole}}/ffmpeg-build + directory_mode: yes + force: yes + owner: 1000 + group: 1000 + mode: 0775 + + - name: 'Copy ffmpeg build script into directory for {{pgrole}}' + copy: + src: /opt/communityapps/apps/templates/{{pgrole}}/ffmpeg-build/build-ffmpeg + dest: /opt/appdata/{{pgrole}}/ffmpeg-build + directory_mode: yes + force: yes + owner: 1000 + group: 1000 + mode: 0775 + + - name: 'Copy custom init scripts into directory for {{pgrole}}' + copy: + src: /opt/communityapps/apps/templates/{{pgrole}}/services.d/run + dest: /opt/appdata/{{pgrole}}/services.d + directory_mode: yes + force: yes + owner: 1000 + group: 1000 + mode: 0775 + + # LABELS ###################################################################### + - name: 'Adding Traefik' + set_fact: + pg_labels: + traefik.enable: 'true' + traefik.port: '{{intport}}' + traefik.frontend.rule: 'Host:{{pgrole}}.{{domain.stdout}},{{tldset}}' + traefik.frontend.auth.forward.address: '{{gauth}}' + + - name: 'Setting PG Volumes' + set_fact: + pg_volumes: + - '/etc/localtime:/etc/localtime:ro' + - '{{path.stdout}}:{{path.stdout}}' + - '/mnt:/mnt' + - '/opt/appdata/{{pgrole}}:/config' + - '/tmp:/tmp' + - '/opt/appdata/{{pgrole}}/cont-init.d:/etc/cont-init.d' + - '/opt/appdata/{{pgrole}}/services.d:/etc/services.d/nzbget' + + - name: 'Setting PG ENV' + set_fact: + pg_env: + PUID: '1000' + PGID: '1000' + LC_ALL: 'C' + + # 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}}' + + # CONFIGURATION ############################################################# + - name: 'Waiting for {{pgrole}} to initialize' + wait_for: + path: '/opt/appdata/{{pgrole}}/nzbget.conf' + state: present + delay: 5 + + - name: 'Stopping {{pgrole}}' + docker_container: + name: '{{pgrole}}' + state: stopped + + - name: Set Main Location + lineinfile: + path: '/opt/appdata/{{pgrole}}/nzbget.conf' + regexp: '^MainDir\s*=.*' + line: 'MainDir=/config' + state: present + + - name: Set download location + lineinfile: + path: '/opt/appdata/{{pgrole}}/nzbget.conf' + regexp: '^DestDir\s*=.*' + line: 'DestDir={{path.stdout}}/downloads/{{pgrole}}' + state: present + + - name: Set incomplete location + lineinfile: + path: '/opt/appdata/{{pgrole}}/nzbget.conf' + regexp: '^InterDir\s*=.*' + line: 'InterDir={{path.stdout}}/incomplete/{{pgrole}}' + state: present + + - name: Set TempDir + lineinfile: + path: '/opt/appdata/{{pgrole}}/nzbget.conf' + regexp: '^TempDir\s*=.*' + line: 'TempDir=/tmp' + state: present + + - name: Set NzbDir Location + lineinfile: + path: '/opt/appdata/{{pgrole}}/nzbget.conf' + regexp: '^NzbDir\s*=.*' + line: 'NzbDir={{path.stdout}}/nzb' + state: present + + - name: ScriptDir + lineinfile: + path: '/opt/appdata/{{pgrole}}/nzbget.conf' + regexp: '^ScriptDir\s*=.*' + line: 'ScriptDir=${MainDir}/scripts' + state: present + + # FIRST TIME CONFIGURATION ############################################################# + - name: 'Configuring {{pgrole}} for first time use' + block: + - name: Lowercase & Set Movie Category + lineinfile: + path: '/opt/appdata/{{pgrole}}/nzbget.conf' + regexp: '^Category1.Name\s*=.*' + line: 'Category1.Name=movies' + state: present + + - name: Set Location of Movies + lineinfile: + path: '/opt/appdata/{{pgrole}}/nzbget.conf' + regexp: '^Category1.DestDir\s*=.*' + line: 'Category1.DestDir=' + state: present + + - name: Set postprocess of Movies + lineinfile: + path: '/opt/appdata/{{pgrole}}/nzbget.conf' + regexp: '^Category1.Extensions\s*=.*' + line: 'Category1.Extensions=MP4_Automator/NZBGetPostProcess.py' + state: present + + - name: Lowercase & Set TV Category + lineinfile: + path: '/opt/appdata/{{pgrole}}/nzbget.conf' + regexp: '^Category2.Name\s*=.*' + line: 'Category2.Name=tv' + state: present + + - name: Set Location of TV + lineinfile: + path: '/opt/appdata/{{pgrole}}/nzbget.conf' + regexp: '^Category2.DestDir\s*=.*' + line: 'Category2.DestDir=' + state: present + + - name: Set postprocess of TV + lineinfile: + path: '/opt/appdata/{{pgrole}}/nzbget.conf' + regexp: '^Category2.Extensions\s*=.*' + line: 'Category2.Extensions=MP4_Automator/NZBGetPostProcess.py' + state: present + + - name: Lowercase & Set Music Category + lineinfile: + path: '/opt/appdata/{{pgrole}}/nzbget.conf' + regexp: '^Category3.Name\s*=.*' + line: 'Category3.Name=music' + state: present + + - name: Set Location of Music + lineinfile: + path: '/opt/appdata/{{pgrole}}/nzbget.conf' + regexp: '^Category3.DestDir\s*=.*' + line: 'Category3.DestDir=' + state: present + + - name: Lowercase & Set EBook Category + lineinfile: + path: '/opt/appdata/{{pgrole}}/nzbget.conf' + regexp: '^Category4.Name\s*=.*' + line: 'Category4.Name=ebooks' + state: present + + - name: Set Location of EBooks + lineinfile: + path: '/opt/appdata/{{pgrole}}/nzbget.conf' + regexp: '^Category4.DestDir\s*=.*' + line: 'Category4.DestDir=' + state: present + + - name: Lowercase & Set abook Category + lineinfile: + path: '/opt/appdata/{{pgrole}}/nzbget.conf' + regexp: 'Category5.Name\s*=.*' + line: 'Category5.Name=abooks' + state: present + + - name: Set Location of aBooks + lineinfile: + path: '/opt/appdata/{{pgrole}}/nzbget.conf' + regexp: 'Category5.DestDir\s*=.*' + line: 'Category5.DestDir=' + state: present + + - name: Set Global Extensions + lineinfile: + path: '/opt/appdata/{{pgrole}}/nzbget.conf' + regexp: '^Extensions\s*=.*' + line: 'Extensions=unzip.py' + state: present + + - name: Set ScriptOrder + lineinfile: + path: '/opt/appdata/{{pgrole}}/nzbget.conf' + regexp: '^ScriptOrder\s*=.*' + line: 'ScriptOrder=unzip.py, MP4_Automator/NZBGetPostProcess.py' + state: present + + - name: Set mp4 script location + lineinfile: + path: '/opt/appdata/{{pgrole}}/nzbget.conf' + regexp: '^MP4_Automator/NZBGetPostProcess.py:MP4_FOLDER\s*=.*' + line: 'MP4_Automator/NZBGetPostProcess.py:MP4_FOLDER=/config/scripts/MP4_Automator/' + state: present + + - name: Set mp4 conversion true + lineinfile: + path: '/opt/appdata/{{pgrole}}/nzbget.conf' + regexp: '^MP4_Automator/NZBGetPostProcess.py:SHOULDCONVERT\s*=.*' + line: 'MP4_Automator/NZBGetPostProcess.py:SHOULDCONVERT=True' + state: present + + - name: Default User + lineinfile: + path: '/opt/appdata/{{pgrole}}/nzbget.conf' + regexp: '^ControlUsername\s*=.*' + line: 'ControlUsername=' + state: present + + - name: Default Password + lineinfile: + path: '/opt/appdata/{{pgrole}}/nzbget.conf' + regexp: 'ControlPassword\s*=.*' + line: 'ControlPassword=' + state: present + + - name: DirectUnpack Set to On + lineinfile: + path: '/opt/appdata/{{pgrole}}/nzbget.conf' + regexp: '^DirectUnpack\s*=.*' + line: 'DirectUnpack=yes' + state: present + + - name: HealthCheck + lineinfile: + path: '/opt/appdata/{{pgrole}}/nzbget.conf' + regexp: '^HealthCheck\s*=.*' + line: 'HealthCheck=Delete' + state: present + + - name: Set DiskSpace + lineinfile: + path: '/opt/appdata/{{pgrole}}/nzbget.conf' + regexp: '^DiskSpace\s*=.*' + line: 'DiskSpace=25000' + state: present + + - name: Remove Generic Task + lineinfile: + path: '/opt/appdata/{{pgrole}}/nzbget.conf' + regexp: '{{ item.regexp }}' + state: absent + with_items: + - { regexp: '.Task1\.Time\=' } + - { regexp: '.Task1\.WeekDays\=' } + - { regexp: '.Task1\.Command\=' } + - { regexp: '.Task1\.Param\=' } + + - name: Unpause + blockinfile: + path: '/opt/appdata/{{pgrole}}/nzbget.conf' + block: | + Task1.Time=*,*:00,*:30 + Task1.WeekDays=1-7 + Task1.Command=UnpauseDownload + Task1.Param= + insertafter: '^### SCHEDULER' + when: not confcheck.stat.exists + + - name: Restart {{pgrole}} + docker_container: + name: '{{pgrole}}' + state: started diff --git a/apps/ombi4k.yml b/apps/ombi4k.yml new file mode 100644 index 0000000..fcfd8f1 --- /dev/null +++ b/apps/ombi4k.yml @@ -0,0 +1,80 @@ +#!/bin/bash +# +# Title: Ombi4k (Reference Title File) +# Author(s): Admin9705; timekills mod +# URL: https://pgblitz.com - http://github.pgblitz.com +# GNU: General Public License v3.0 +################################################################################ +--- +- hosts: localhost + gather_facts: false + tasks: + # FACTS ####################################################################### + + - name: 'Set Known Facts' + set_fact: + pgrole: 'ombi4k' + intport: '3579' + extport: '3580' + image: 'linuxserver/ombi' + + # CORE (MANDATORY) ############################################################ + - name: 'Including cron job' + include_tasks: '/opt/coreapps/apps/_core.yml' + + # PRETASKS #################################################################### + - name: Check JSON exists + stat: + path: '/opt/appdata/{{pgrole}}/appsettings.json' + register: jsonfile + + - name: 'Download {{pgrole}} appsettings.json config file' + get_url: + url: https://raw.githubusercontent.com/tidusjar/Ombi/master/src/Ombi/appsettings.json + dest: /opt/appdata/{{pgrole}}/appsettings.json + owner: '1000' + group: '1000' + force: no + ignore_errors: True + when: jsonfile.stat.exists == False + + # 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' + - '/opt/appdata/{{pgrole}}/appsettings.json:/opt/{{pgrole}}/appsettings.json' + + - 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/ombiHDR.yml b/apps/ombiHDR.yml new file mode 100644 index 0000000..61d0a23 --- /dev/null +++ b/apps/ombiHDR.yml @@ -0,0 +1,80 @@ +#!/bin/bash +# +# Title: OmbiHDR +# Author(s): Admin9705; timekills mod +# URL: https://pgblitz.com - http://github.pgblitz.com +# GNU: General Public License v3.0 +################################################################################ +--- +- hosts: localhost + gather_facts: false + tasks: + # FACTS ####################################################################### + + - name: 'Set Known Facts' + set_fact: + pgrole: 'ombiHDR' + intport: '3579' + extport: '3581' + image: 'linuxserver/ombi' + + # CORE (MANDATORY) ############################################################ + - name: 'Including cron job' + include_tasks: '/opt/coreapps/apps/_core.yml' + + # PRETASKS #################################################################### + - name: Check JSON exists + stat: + path: '/opt/appdata/{{pgrole}}/appsettings.json' + register: jsonfile + + - name: 'Download {{pgrole}} appsettings.json config file' + get_url: + url: https://raw.githubusercontent.com/tidusjar/Ombi/master/src/Ombi/appsettings.json + dest: /opt/appdata/{{pgrole}}/appsettings.json + owner: '1000' + group: '1000' + force: no + ignore_errors: True + when: jsonfile.stat.exists == False + + # 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' + - '/opt/appdata/{{pgrole}}/appsettings.json:/opt/{{pgrole}}/appsettings.json' + + - 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/organizr.yml b/apps/organizr.yml index 47563ff..2a89008 100644 --- a/apps/organizr.yml +++ b/apps/organizr.yml @@ -1,8 +1,8 @@ #!/bin/bash # -# Title: PlexGuide (Reference Title File) +# Title: PGBlitz (Reference Title File) # Author(s): Admin9705 -# URL: https://plexguide.com - http://github.plexguide.com +# URL: https://pgblitz.com - http://github.pgblitz.com # GNU: General Public License v3.0 ################################################################################ --- @@ -29,6 +29,16 @@ traefik.enable: 'true' traefik.port: '{{intport}}' traefik.frontend.rule: 'Host:{{pgrole}}.{{domain.stdout}},{{tldset}}' + traefik.frontend.headers.SSLHost: '{{domain.stdout}}' + traefik.frontend.headers.SSLRedirect: 'true' + traefik.frontend.headers.STSIncludeSubdomains: 'true' + traefik.frontend.headers.STSPreload: 'true' + traefik.frontend.headers.STSSeconds: '315360000' + traefik.frontend.headers.browserXSSFilter: 'true' + traefik.frontend.headers.contentTypeNosniff: 'true' + traefik.frontend.headers.customResponseHeaders: 'X-Robots-Tag:noindex,nofollow,nosnippet,noarchive,notranslate,noimageindex' + traefik.frontend.headers.forceSTSHeader: 'true' + traefik.frontend.headers.frameDeny: 'true' - name: 'Setting PG Volumes' set_fact: diff --git a/apps/pyload.yml b/apps/pyload.yml index 4a65137..ee21ab0 100644 --- a/apps/pyload.yml +++ b/apps/pyload.yml @@ -1,8 +1,8 @@ #!/bin/bash # -# Title: PlexGuide (Reference Title File) +# Title: PGBlitz (Reference Title File) # Author(s): Admin9705 -# URL: https://plexguide.com - http://github.plexguide.com +# URL: https://pgblitz.com - http://github.pgblitz.com # GNU: General Public License v3.0 ################################################################################ --- diff --git a/apps/qbittorrent-vpn.yml b/apps/qbittorrent-vpn.yml new file mode 100644 index 0000000..74d5c73 --- /dev/null +++ b/apps/qbittorrent-vpn.yml @@ -0,0 +1,356 @@ +#!/bin/bash +# +# Title: qBittorrent (with OpenVPN and Privoxy) +# Author(s): Mike Tzou (Chocobo1), Vladimir Golovnev (glassez), Diego Heras (ngosang), binhex +# URL: https://www.qbittorrent.org/ - https://github.com/binhex/arch-qbittorrentvpn +# GNU: General Public License v2.0 (w/ exception) +################################################################################ +--- +- hosts: localhost + gather_facts: false + tasks: + # FACTS ####################################################################### + + - name: 'Set Known Facts' + set_fact: + pgrole: 'qbittorrent' + intport: '8998' + extport: '8998' + intport1: '8118' + extport1: '8118' + intport2: '6881' + extport2: '6881' + dnsserver1: '1.1.1.1' + dnsserver2: '84.200.69.80' + dnsserver3: '37.235.1.174' + dnsserver4: '185.121.177.177' + puid: '1000' + pgid: '1000' + image: 'binhex/arch-qbittorrentvpn:latest' + + # CORE (MANDATORY) ############################################################# + - name: 'Including cron job' + include_tasks: '/opt/coreapps/apps/_core.yml' + + - name: 'Including folders' + include_tasks: '/opt/coreapps/apps/_downloaders.yml' + + - name: 'Including plugins' + include_tasks: '/opt/coreapps/apps/_plugins.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: + - '/etc/localtime:/etc/localtime:ro' + - '{{path.stdout}}:{{path.stdout}}' + - '/mnt:/mnt' + - '/opt/appdata/{{pgrole}}:/config' + + - name: 'Setting PG ENV' + set_fact: + pg_env: + PUID: '{{puid}}' + PGID: '{{pgid}}' + UMASK: '000' + VPN_ENABLED: 'no' + VPN_USER: 'username' + VPN_PASS: 'password' + VPN_PROV: 'custom' + VPN_OPTIONS: '' + STRICT_PORT_FORWARD: 'no' + ENABLE_PRIVOXY: 'no' + LAN_NETWORK: '127.20.0.0/16' + NAME_SERVERS: '{{dnsserver1}},{{dnsserver2}},{{dnsserver3}},{{dnsserver4}}' + DEBUG: 'false' + WEBUI_PORT: '{{intport}}' + + + + + # MAIN DEPLOYMENT ############################################################# + - name: 'Checking for existing app data' + stat: + path: '/opt/appdata/{{pgrole}}/qBittorrent/config/qBittorrent.conf' + register: confcheck + + - name: 'Deploying {{pgrole}}' + docker_container: + name: '{{pgrole}}' + image: '{{image}}' + pull: yes + published_ports: + - '{{ports.stdout}}{{extport}}:{{intport}}' + - '{{ports.stdout}}{{extport1}}:{{intport1}}' + - '{{ports.stdout}}{{extport2}}:{{intport2}}' + volumes: '{{pg_volumes}}' + env: '{{pg_env}}' + restart_policy: unless-stopped + devices: + - '/dev/net/tun:/dev/net/tun:rwm' + dns_servers: + - '{{dnsserver1}}' + - '{{dnsserver2}}' + - '{{dnsserver3}}' + - '{{dnsserver4}}' + capabilities: + - NET_ADMIN + networks: + - name: plexguide + aliases: + - '{{pgrole}}' + state: started + labels: '{{pg_labels}}' + + # CONFIGURATION #################################################### + - name: 'Waiting for {{pgrole}} to initialize' + wait_for: + path: '/opt/appdata/{{pgrole}}/qBittorrent/config/qBittorrent.conf' + state: present + timeout: 15 + delay: 5 + + - name: 'Stopping {{pgrole}}' + docker_container: + name: '{{pgrole}}' + state: stopped + + - name: Set SavePath + ini_file: + path: '/opt/appdata/{{pgrole}}/qBittorrent/config/qBittorrent.conf' + section: Preferences + option: Downloads\SavePath + value: '{{path.stdout}}/downloads/{{pgrole}}' + state: present + + + - name: Set TempPathEnabled + ini_file: + path: '/opt/appdata/{{pgrole}}/qBittorrent/config/qBittorrent.conf' + section: Preferences + option: Downloads\TempPathEnabled + value: True + state: present + + - name: Get latest blocklist + shell: curl -L http://john.bitsurge.net/public/biglist.p2p.gz | gzip -cdf > /opt/appdata/{{pgrole}}/qBittorrent/config/biglist.p2p + + - name: 'Checking for existing openvpn folder' + stat: + path: '/opt/appdata/{{pgrole}}/openvpn' + register: ovpncheck + + - name: Initialize opvn + block: + - name: Create opvn folder + shell: mkdir /opt/appdata/{{pgrole}}/openvpn && touch mkdir /opt/appdata/{{pgrole}}/openvpn/OVPN\ files\ go\ here && chown -R {{puid}}:{{pgid}} /opt/appdata/{{pgrole}}/openvpn + when: not ovpncheck.stat.exists + + + # FIRST TIME CONFIGURATION #################################################### + - name: 'Configuring {{pgrole}} for first time use' + block: + - name: Enable AutoRun + ini_file: + path: '/opt/appdata/{{pgrole}}/qBittorrent/config/qBittorrent.conf' + section: AutoRun + option: enabled + value: True + state: present + + - name: Enable Auto UnRar + ini_file: + path: '/opt/appdata/{{pgrole}}/qBittorrent/config/qBittorrent.conf' + section: AutoRun + option: program + value: '/usr/bin/unrar x -r \"%F/.\" \"%F/\"' + state: present + + - name: Disable DHT + ini_file: + path: '/opt/appdata/{{pgrole}}/qBittorrent/config/qBittorrent.conf' + section: Preferences + option: Bittorrent\DHT + value: false + state: present + + - name: Disable PeX + ini_file: + path: '/opt/appdata/{{pgrole}}/qBittorrent/config/qBittorrent.conf' + section: Preferences + option: Bittorrent\PeX + value: false + state: present + + - name: Disable LSD + ini_file: + path: '/opt/appdata/{{pgrole}}/qBittorrent/config/qBittorrent.conf' + section: Preferences + option: Bittorrent\LSD + value: false + state: present + + - name: Enable Encryption + ini_file: + path: '/opt/appdata/{{pgrole}}/qBittorrent/config/qBittorrent.conf' + section: Preferences + option: Bittorrent\Encryption + value: 1 + state: present + + - name: Don't use incomplete extension + ini_file: + path: '/opt/appdata/{{pgrole}}/qBittorrent/config/qBittorrent.conf' + section: Preferences + option: Downloads\UseIncompleteExtension + value: false + state: present + - name: Ignore slow torrents + ini_file: + path: '/opt/appdata/{{pgrole}}/qBittorrent/config/qBittorrent.conf' + section: Preferences + option: Queueing\IgnoreSlowTorrents + value: True + state: present + - name: Set MaxActiveDownloads + ini_file: + path: '/opt/appdata/{{pgrole}}/qBittorrent/config/qBittorrent.conf' + section: Preferences + option: Queueing\MaxActiveDownloads + value: 10 + state: present + - name: Set MaxActiveTorrents + ini_file: + path: '/opt/appdata/{{pgrole}}/qBittorrent/config/qBittorrent.conf' + section: Preferences + option: Queueing\MaxActiveTorrents + value: 100 + state: present + - name: Set MaxActiveUploads + ini_file: + path: '/opt/appdata/{{pgrole}}/qBittorrent/config/qBittorrent.conf' + section: Preferences + option: Queueing\MaxActiveUploads + value: 100 + state: present + - name: Set GlobalMaxSeedingMinutes + ini_file: + path: '/opt/appdata/{{pgrole}}/qBittorrent/config/qBittorrent.conf' + section: BitTorrent + option: Session\GlobalMaxSeedingMinutes + value: 20160 + state: present + - name: Set MaxRatio + ini_file: + path: '/opt/appdata/{{pgrole}}/qBittorrent/config/qBittorrent.conf' + section: Preferences + option: Bittorrent\MaxRatio + value: 1 + state: present + - name: pause on MaxRatioAction + ini_file: + path: '/opt/appdata/{{pgrole}}/qBittorrent/config/qBittorrent.conf' + section: Preferences + option: Bittorrent\MaxRatioAction + value: 1 + state: present + - name: Disable csrf + ini_file: + path: '/opt/appdata/{{pgrole}}/qBittorrent/config/qBittorrent.conf' + section: Preferences + option: WebUI\CSRFProtection + value: false + force: yes + state: present + - name: Disable HostHeaderValidation + ini_file: + path: '/opt/appdata/{{pgrole}}/qBittorrent/config/qBittorrent.conf' + section: Preferences + option: WebUI\HostHeaderValidation + value: false + force: yes + state: present + - name: Disable ClickjackingProtection + ini_file: + path: '/opt/appdata/{{pgrole}}/qBittorrent/config/qBittorrent.conf' + section: Preferences + option: WebUI\ClickjackingProtection + value: false + force: yes + state: present + + - name: Set ServerDomains + ini_file: + path: '/opt/appdata/{{pgrole}}/qBittorrent/config/qBittorrent.conf' + section: Preferences + option: WebUI\ServerDomains + value: '*' + force: yes + state: present + - name: Set Address + ini_file: + path: '/opt/appdata/{{pgrole}}/qBittorrent/config/qBittorrent.conf' + section: Preferences + option: WebUI\Address + value: '*' + force: yes + state: present + + - name: Set Port + ini_file: + path: '/opt/appdata/{{pgrole}}/qBittorrent/config/qBittorrent.conf' + section: Preferences + option: Connection\PortRangeMin + value: '{{intport2}}' + force: yes + state: present + + - name: Set torrent Watch folder + ini_file: + path: '/opt/appdata/{{pgrole}}/qBittorrent/config/qBittorrent.conf' + section: Preferences + option: Downloads\ScanDirsV2 + value: '@Variant(\0\0\0\x1c\0\0\0\x1\0\0\0$\0/\0m\0n\0t\0/\0t\0o\0r\0r\0\x65\0n\0t\0/\0w\0\x61\0t\0\x63\0h\0\0\0\x2\0\0\0\0)' + force: yes + state: present + + - name: Set Blocklist enabled + ini_file: + path: '/opt/appdata/{{pgrole}}/qBittorrent/config/qBittorrent.conf' + section: Preferences + option: IPFilter\Enabled + value: 'true' + force: yes + state: present + + - name: Set Blocklist location + ini_file: + path: '/opt/appdata/{{pgrole}}/qBittorrent/config/qBittorrent.conf' + section: Preferences + option: IPFilter\File + value: '/config/qBittorrent/config/biglist.p2p' + force: yes + state: present + + - name: Set default login + ini_file: + path: '/opt/appdata/{{pgrole}}/qBittorrent/config/qBittorrent.conf' + section: Preferences + option: WebUI\Password_ha1 + value: '@ByteArray(22f616dbc8cdb4aa96105b1c8f36ea63)' + force: yes + state: present + + when: not confcheck.stat.exists + - name: Restart {{pgrole}} + docker_container: + name: '{{pgrole}}' + state: started diff --git a/apps/radarr4k.yml b/apps/radarr4k.yml index 0afb988..4437ba2 100644 --- a/apps/radarr4k.yml +++ b/apps/radarr4k.yml @@ -1,8 +1,8 @@ #!/bin/bash # -# Title: PlexGuide (Reference Title File) +# Title: PGBlitz (Reference Title File) # Author(s): Admin9705 -# URL: https://plexguide.com - http://github.plexguide.com +# URL: https://pgblitz.com - http://github.pgblitz.com # GNU: General Public License v3.0 ################################################################################ --- @@ -33,10 +33,10 @@ - name: 'Setting PG Volumes' set_fact: pg_volumes: - - '/opt/appdata/{{pgrole}}:/config' + - '/etc/localtime:/etc/localtime:ro' - '{{path.stdout}}:{{path.stdout}}' - '/mnt:/mnt' - - '/etc/localtime:/etc/localtime:ro' + - '/opt/appdata/{{pgrole}}:/config' - name: 'Setting PG ENV' set_fact: diff --git a/apps/radarrhdr.yml b/apps/radarrhdr.yml index 214f6ea..b9674b2 100644 --- a/apps/radarrhdr.yml +++ b/apps/radarrhdr.yml @@ -1,8 +1,8 @@ #!/bin/bash # -# Title: PlexGuide (Reference Title File) +# Title: PGBlitz (Reference Title File) # Author(s): Admin9705 -# URL: https://plexguide.com - http://github.plexguide.com +# URL: https://pgblitz.com - http://github.pgblitz.com # GNU: General Public License v3.0 ################################################################################ --- @@ -33,10 +33,10 @@ - name: 'Setting PG Volumes' set_fact: pg_volumes: - - '/opt/appdata/{{pgrole}}:/config' + - '/etc/localtime:/etc/localtime:ro' - '{{path.stdout}}:{{path.stdout}}' - '/mnt:/mnt' - - '/etc/localtime:/etc/localtime:ro' + - '/opt/appdata/{{pgrole}}:/config' - name: 'Setting PG ENV' set_fact: diff --git a/apps/rclonebrowser.yml b/apps/rclonebrowser.yml new file mode 100644 index 0000000..d8ad471 --- /dev/null +++ b/apps/rclonebrowser.yml @@ -0,0 +1,67 @@ +#!/bin/bash +# +# Title: PGBlitz (rclone browser) +# Author(s): MrDoob +# URL: https://pgblitz.com - http://github.pgblitz.com +# GNU: General Public License v3.0 +################################################################################ +--- +- hosts: localhost + gather_facts: false + tasks: + # FACTS ####################################################################### + - name: 'Set Known Facts' + set_fact: + pgrole: 'rclonebrowser' + intport: '5800' + extport: '5808' + intport2: '5900' + extport2: '5909' + image: 'romancin/rclonebrowser:latest' + + # CORE (MANDATORY) ############################################################ + - name: 'Including cron job' + include_tasks: '/opt/communityapps/apps/_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' + - '{{path.stdout}}:{{path.stdout}}' + - '/mnt/unionfs:/unionfs:rw' + - '/mnt:/mnt:rw' + - '/opt/appdata/plexguide:/host_rcloneconf_folder:ro' + - '/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}}' diff --git a/apps/rdp-calibre.yml b/apps/rdp-calibre.yml new file mode 100644 index 0000000..41f6d98 --- /dev/null +++ b/apps/rdp-calibre.yml @@ -0,0 +1,70 @@ +#!/bin/bash +# +# Title: PGBlitz (rdp-calibre) +# Author(s): MrDoob +# URL: https://pgblitz.com - http://github.pgblitz.com +# GNU: General Public License v3.0 +################################################################################ +--- +- hosts: localhost + gather_facts: false + tasks: + # FACTS ####################################################################### + - name: 'Set Known Facts' + set_fact: + pgrole: 'rdp-calibre' + intport: '8080' + extport: '8089' + intport2: '8081' + extport2: '8090' + image: 'aptalca/docker-rdp-calibre:latest' + + # CORE (MANDATORY) ############################################################ + - name: 'Including cron job' + include_tasks: '/opt/communityapps/apps/_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:rw' + - '{{path.stdout}}:{{path.stdout}}' + - '/mnt/unionfs:/unionfs:rw' + - '/mnt:/mnt:rw' + - '/etc/localtime:/etc/localtime:ro' + - '/mnt/unionfs/libary:/library:rw' + + - name: 'Setting PG ENV' + set_fact: + pg_env: + PUID: '1000' + PGID: '1000' + WIDTH: '1280' + HEIGHT: '720' + + # MAIN DEPLOYMENT ############################################################# + - name: 'Deploying {{pgrole}}' + docker_container: + name: '{{pgrole}}' + image: '{{image}}' + pull: yes + published_ports: + - '{{ports.stdout}}{{extport}}:{{intport}}' + - '{{ports.stdout}}{{extport2}}:{{intport2}}' + volumes: '{{pg_volumes}}' + env: '{{pg_env}}' + restart_policy: unless-stopped + networks: + - name: plexguide + aliases: + - '{{pgrole}}' + state: started + labels: '{{pg_labels}}' diff --git a/apps/resilio.yml b/apps/resilio.yml index ff4b576..9af7405 100644 --- a/apps/resilio.yml +++ b/apps/resilio.yml @@ -1,10 +1,10 @@ #!/bin/bash # -# GitHub: https://github.com/Admin9705/PlexGuide.com-The-Awesome-Plex-Server +# GitHub: https://github.com/PGBlitz/PGBlitz.com # Author: Admin9705 -# URL: https://plexguide.com +# URL: https://pgblitz.com # -# PlexGuide Copyright (C) 2018 PlexGuide.com +# PGBlitz Copyright (C) 2018 PGBlitz.com # Licensed under GNU General Public License v3.0 GPL-3 (in short) # # You may copy, distribute and modify the software as long as you track diff --git a/apps/rflood-vpn.yml b/apps/rflood-vpn.yml new file mode 100644 index 0000000..c5cd676 --- /dev/null +++ b/apps/rflood-vpn.yml @@ -0,0 +1,76 @@ +#!/bin/bash +# +# Title: rTorrent + FloodUI integrated OpenVPN +# Author(s): h1f0x +# URL: https://github.com/h1f0x/rtorrent-flood-openvpn +# GNU: General Public License v3.0 +################################################################################ +--- +- hosts: localhost + gather_facts: false + tasks: + # FACTS ####################################################################### + + - name: 'Set Known Facts' + set_fact: + pgrole: 'rflood' + intport: '80' + extport: '5896' + image: 'h1f0x/rtorrent-flood-openvpn' + + # CORE (MANDATORY) ############################################################ + - name: 'Including cron job' + include_tasks: '/opt/communityapps/apps/_core.yml' + + - name: 'Including plugins' + include_tasks: '/opt/communityapps/apps/_plugins.yml' + + - name: 'Including folders' + include_tasks: '/opt/communityapps/apps/_downloaders.yml' + + - name: 'Ini Check' + stat: + path: /opt/appdata/{{pgrole}}/core.conf + register: inicheck + + # 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' + - '{{path.stdout}}:{{path.stdout}}' + - '/mnt:/mnt' + - '/opt/appdata/{{pgrole}}:/config' + + - name: 'Setting PG ENV' + set_fact: + pg_env: + UID: 1000 + GID: 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}}' + privileged: yes + state: started + labels: '{{pg_labels}}' diff --git a/apps/rutorrent-vpn.yml b/apps/rutorrent-vpn.yml new file mode 100644 index 0000000..efc5406 --- /dev/null +++ b/apps/rutorrent-vpn.yml @@ -0,0 +1,77 @@ +#!/bin/bash +# +# Title: rTorrent + ruTorrent integrated OpenVPN +# Author(s): h1f0x +# URL: https://github.com/h1f0x/rtorrent-flood-openvpn +# GNU: General Public License v3.0 +################################################################################ +--- +- hosts: localhost + gather_facts: false + tasks: + # FACTS ####################################################################### + + - name: 'Set Known Facts' + set_fact: + pgrole: 'rutorrent-vpn' + intport: '80' + extport: '5897' + image: 'h1f0x/rtorrent-rutorrent-openvpn' + + # CORE (MANDATORY) ############################################################ + - name: 'Including cron job' + include_tasks: '/opt/communityapps/apps/_core.yml' + + - name: 'Including plugins' + include_tasks: '/opt/communityapps/apps/_plugins.yml' + + - name: 'Including folders' + include_tasks: '/opt/communityapps/apps/_downloaders.yml' + + - name: 'Ini Check' + stat: + path: /opt/appdata/{{pgrole}}/core.conf + register: inicheck + + # 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' + - '{{path.stdout}}:{{path.stdout}}' + - '/mnt:/mnt' + - '/opt/appdata/{{pgrole}}:/config' + - '/opt/appdata/{{pgrole}}/sock:/run/php' + + - name: 'Setting PG ENV' + set_fact: + pg_env: + UID: '1000' + GID: '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}}' + privileged: yes + state: started + labels: '{{pg_labels}}' diff --git a/apps/sharesite.yml b/apps/sharesite.yml index af4f066..91056a1 100644 --- a/apps/sharesite.yml +++ b/apps/sharesite.yml @@ -1,10 +1,10 @@ #!/bin/bash # -# GitHub: https://github.com/Admin9705/PlexGuide.com-The-Awesome-Plex-Server +# GitHub: https://github.com/PGBlitz/PGBlitz.com # Author: Admin9705 -# URL: https://plexguide.com +# URL: https://pgblitz.com # -# PlexGuide Copyright (C) 2018 PlexGuide.com +# PGBlitz Copyright (C) 2018 PGBlitz.com # Licensed under GNU General Public License v3.0 GPL-3 (in short) # # You may copy, distribute and modify the software as long as you track diff --git a/apps/sonarr4k.yml b/apps/sonarr4k.yml index acb0e40..f3aa995 100644 --- a/apps/sonarr4k.yml +++ b/apps/sonarr4k.yml @@ -1,8 +1,8 @@ #!/bin/bash # -# Title: PlexGuide (Reference Title File) +# Title: PGBlitz (Reference Title File) # Author(s): Admin9705 -# URL: https://plexguide.com - http://github.plexguide.com +# URL: https://pgblitz.com - http://github.pgblitz.com # GNU: General Public License v3.0 ################################################################################ --- @@ -34,10 +34,10 @@ - name: 'Setting PG Volumes' set_fact: pg_volumes: - - '/opt/appdata/{{pgrole}}:/config' + - '/etc/localtime:/etc/localtime:ro' - '{{path.stdout}}:{{path.stdout}}' - '/mnt:/mnt' - - '/etc/localtime:/etc/localtime:ro' + - '/opt/appdata/{{pgrole}}:/config' - name: 'Setting PG ENV' set_fact: diff --git a/apps/sonarrhdr.yml b/apps/sonarrhdr.yml index 04e59fe..22699eb 100644 --- a/apps/sonarrhdr.yml +++ b/apps/sonarrhdr.yml @@ -1,8 +1,8 @@ #!/bin/bash # -# Title: PlexGuide (Reference Title File) +# Title: PGBlitz (Reference Title File) # Author(s): Admin9705 -# URL: https://plexguide.com - http://github.plexguide.com +# URL: https://pgblitz.com - http://github.pgblitz.com # GNU: General Public License v3.0 ################################################################################ --- @@ -16,7 +16,7 @@ pgrole: 'sonarrhdr' intport: '8989' extport: '8987' - image: 'lsiodev/sonarr-preview' + image: 'linuxserver/sonarr:preview' # CORE (MANDATORY) ############################################################ - name: 'Including cron job' @@ -34,10 +34,10 @@ - name: 'Setting PG Volumes' set_fact: pg_volumes: - - '/opt/appdata/{{pgrole}}:/config' + - '/etc/localtime:/etc/localtime:ro' - '{{path.stdout}}:{{path.stdout}}' - '/mnt:/mnt' - - '/etc/localtime:/etc/localtime:ro' + - '/opt/appdata/{{pgrole}}:/config' - name: 'Setting PG ENV' set_fact: diff --git a/apps/speedtest.yml b/apps/speedtest.yml index dc516a0..1c29241 100644 --- a/apps/speedtest.yml +++ b/apps/speedtest.yml @@ -1,8 +1,8 @@ #!/bin/bash # -# Title: PlexGuide (Reference Title File) +# Title: PGBlitz (Reference Title File) # Author(s): Admin9705 -# URL: https://plexguide.com - http://github.plexguide.com +# URL: https://pgblitz.com - http://github.pgblitz.com # GNU: General Public License v3.0 ################################################################################ --- diff --git a/apps/subsonic.yml b/apps/subsonic.yml new file mode 100644 index 0000000..b81db75 --- /dev/null +++ b/apps/subsonic.yml @@ -0,0 +1,63 @@ +#!/bin/bash +# +# Title: PGBlitz (danisla/subsonic) +# Author(s): MrDoob +# URL: https://pgblitz.com - http://github.pgblitz.com +# GNU: General Public License v3.0 +################################################################################ +--- +- hosts: localhost + gather_facts: false + tasks: + # FACTS ####################################################################### + - name: 'Set Known Facts' + set_fact: + pgrole: 'subsonic' + intport: '4040' + extport: '4040' + image: 'danisla/subsonic' + + # CORE (MANDATORY) ############################################################ + - name: 'Including cron job' + include_tasks: '/opt/communityapps/apps/_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}}/state:/opt/app/state:rw' + - '{{path.stdout}}:{{path.stdout}}' + - '/mnt/unionfs:/mnt/music:ro' + - '/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}}' diff --git a/apps/synclounge.yml b/apps/synclounge.yml index 2aa5d17..80eb4fa 100644 --- a/apps/synclounge.yml +++ b/apps/synclounge.yml @@ -1,8 +1,8 @@ #!/bin/bash # -# Title: PlexGuide (Reference Title File) +# Title: PGBlitz (Reference Title File) # Author(s): Admin9705 -# URL: https://plexguide.com - http://github.plexguide.com +# URL: https://pgblitz.com - http://github.pgblitz.com # GNU: General Public License v3.0 ################################################################################ --- @@ -48,7 +48,7 @@ pg_env: UID: '1000' GID: '1000' - DOMAIN: {{pgrole}}.{{domain.stdout}} + DOMAIN: '{{pgrole}}.{{domain.stdout}}' # MAIN DEPLOYMENT ############################################################# - name: 'Deploying {{pgrole}}' diff --git a/apps/syncthing.yml b/apps/syncthing.yml index 5ce7764..cff6db7 100644 --- a/apps/syncthing.yml +++ b/apps/syncthing.yml @@ -1,8 +1,8 @@ #!/bin/bash # -# Title: PlexGuide (Reference Title File) +# Title: PGBlitz (Reference Title File) # Author(s): Admin9705 -# URL: https://plexguide.com - http://github.plexguide.com +# URL: https://pgblitz.com - http://github.pgblitz.com # GNU: General Public License v3.0 ################################################################################ --- diff --git a/apps/teamspeak3.yml b/apps/teamspeak3.yml new file mode 100644 index 0000000..cf1b51e --- /dev/null +++ b/apps/teamspeak3.yml @@ -0,0 +1,86 @@ +#!/bin/bash +# +# Title: Teamspeak 3 Alpine +# Author(s): N1ghtshade +# 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: 'teamspeak3' + intport: '9987/udp' + extport: '9987' + intport2: '10011/tcp' + extport2: '10011' + intport3: '30033/tcp' + extport3: '30033' + image: 'qmcgaw/teamspeak3-alpine:latest' + + # CORE (MANDATORY) ############################################################ + - name: 'Including cron job' + include_tasks: '/opt/communityapps/apps/_core.yml' + + # EXTRA FOR TS3 ######################################################### + - name: 'Create {{pgrole}} data and log directories' + file: 'path={{item}} state=directory mode=0700 owner=1000 group=1000 recurse=yes' + with_items: + - '/opt/appdata/{{pgrole}}' + - '/opt/appdata/{{pgrole}}/data' + - '/opt/appdata/{{pgrole}}/logs' + + # LABELS ###################################################################### + + - name: 'Adding Traefik' + set_fact: + pg_labels: + traefik.enable: 'false' + traefik.port: '{{intport}}' + traefik.frontend.auth.forward.address: '{{gauth}}' + traefik.frontend.rule: 'Host:{{pgrole}}.{{domain.stdout}},{{tldset}}' + # VOLUMES ######### + + - name: 'Setting PG Volumes' + set_fact: + pg_volumes: + - '/opt/appdata/{{pgrole}}/data:/data' + - '/opt/appdata/{{pgrole}}/logs:/logs' + + - 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: + - '{{extport}}:{{intport}}' + - '{{extport2}}:{{intport2}}' + - '{{extport3}}:{{intport3}}' + volumes: '{{pg_volumes}}' + env: '{{pg_env}}' + command: license_accepted=1 + restart_policy: unless-stopped + networks: + - name: plexguide + aliases: + - '{{pgrole}}' + state: started + labels: '{{pg_labels}}' + + # ENDING TASK FOR TS3 #################################################### + - name: 'Configuring {{pgrole}} for first time use' + block: + - name: 'Wait 30 Seconds' + wait_for: + timeout: 30 diff --git a/apps/templates/dokuwiki/users.auth.php b/apps/templates/dokuwiki/users.auth.php new file mode 100644 index 0000000..052a42b --- /dev/null +++ b/apps/templates/dokuwiki/users.auth.php @@ -0,0 +1 @@ +admin:$1$4fd0ad31$.cId7p1uxI4a.RcrH81On0:DokuWiki Administrator:mail@host.com:admin,user diff --git a/apps/templates/nzbget/MP4_Automator/TEMPLATEPPScript b/apps/templates/nzbget/MP4_Automator/TEMPLATEPPScript new file mode 100644 index 0000000..6eb7055 --- /dev/null +++ b/apps/templates/nzbget/MP4_Automator/TEMPLATEPPScript @@ -0,0 +1,244 @@ +#!/usr/bin/env python +# +############################################################################## +### NZBGET POST-PROCESSING SCRIPT ### + +# Modified to enable multiple bypass categories, +# as per: https://github.com/mdhiggins/sickbeard_mp4_automator/issues/509 +# +# Converts files and passes them to Sonarr for further processing. +# +# NOTE: This script requires Python to be installed on your system. + +############################################################################## +### OPTIONS ### + +# Change to full path to MP4 Automator folder. No quotes and a trailing / +#MP4_FOLDER=~/sickbeard_mp4_automator/ + +# Convert file before passing to destination (True, False) +#SHOULDCONVERT=False + +# Category for Couchpotato +#CP_CAT=Couchpotato + +# Category for Sonarr +#SONARR_CAT=Sonarr + +# Category for Radarr +#RADARR_CAT=Radarr + +# Category for Sickbeard +#SICKBEARD_CAT=Sickbeard + +# Category for Sickrage +#SICKRAGE_CAT=Sickrage + +# Category list (comma seperated) for bypassing any further processing but still converting +#BYPASS_CAT=tv,movies + +# Custom output_directory setting +#OUTPUT_DIR= + +### NZBGET POST-PROCESSING SCRIPT ### +############################################################################## + +import os +import sys +import re +import json +import traceback + +# Sanity checks for path string +MP4folder = os.environ['NZBPO_MP4_FOLDER'].strip() +MP4folder = MP4folder.replace('"', '') +MP4folder = MP4folder.replace("'", "") +MP4folder = MP4folder.replace("\\", "/") +if not(MP4folder.endswith("/")): + MP4folder += "/" +#DEBUG#print MP4folder+" the original is "+os.environ['NZBPO_MP4_FOLDER'] + +output_dir = None +if 'NZBPO_OUTPUT_DIR' in os.environ: + output_dir = os.environ['NZBPO_OUTPUT_DIR'].strip() + if len(output_dir) > 0: + output_dir = output_dir.replace('"', '') + output_dir = output_dir.replace("'", "") + output_dir = output_dir.replace("\\", "/") + if not(output_dir.endswith("/")): + output_dir += "/" + #DEBUG#print Overriding output directory + +sys.path.append(MP4folder) +try: + from readSettings import ReadSettings + from mkvtomp4 import MkvtoMp4 + from autoprocess import autoProcessMovie, autoProcessTV, autoProcessTVSR, sonarr, radarr + import logging + from logging.config import fileConfig +except ImportError: + print("[ERROR] Wrong path to sickbeard_mp4_automator: " + os.environ['NZBPO_MP4_FOLDER']) + print("[ERROR] %s" % traceback.print_exc()) + sys.exit(0) + +# Setup Logging +logpath = '/var/log/sickbeard_mp4_automator' +if os.name == 'nt': + logpath = MP4folder +elif not os.path.isdir(logpath): + try: + os.mkdir(logpath) + except: + logpath = MP4folder +configPath = os.path.abspath(os.path.join(MP4folder, 'logging.ini')).replace("\\", "\\\\") +logPath = os.path.abspath(os.path.join(logpath, 'index.log')).replace("\\", "\\\\") +fileConfig(configPath, defaults={'logfilename': logPath}) +log = logging.getLogger("NZBGetPostProcess") + +# Determine if conversion will take place +shouldConvert = (os.environ['NZBPO_SHOULDCONVERT'].lower() in ("yes", "true", "t", "1")) + +if 'NZBOP_SCRIPTDIR' in os.environ and not os.environ['NZBOP_VERSION'][0:5] < '11.0': + log.info("Script triggered from NZBGet (11.0 or later).") + + path = os.environ['NZBPP_DIRECTORY'] # Path to NZB directory + nzb = os.environ['NZBPP_NZBFILENAME'] # Original NZB name + category = os.environ['NZBPP_CATEGORY'] # NZB Category to determine destination + #DEBUG#print "Category is %s." % category + + couchcat = os.environ['NZBPO_CP_CAT'].lower() + sonarrcat = os.environ['NZBPO_SONARR_CAT'].lower() + radarrcat = os.environ['NZBPO_RADARR_CAT'].lower() + sickbeardcat = os.environ['NZBPO_SICKBEARD_CAT'].lower() + sickragecat = os.environ['NZBPO_SICKRAGE_CAT'].lower() + bypass = os.environ['NZBPO_BYPASS_CAT'].lower().replace(' ','').split(',') + + categories = [sickbeardcat, couchcat, sonarrcat, radarrcat, sickragecat] + + log.debug("Path: %s" % path) + log.debug("NZB: %s" % nzb) + log.debug("Category: %s" % category) + log.debug("Categories: %s" % categories) + + # NZBGet argv: all passed as environment variables. + clientAgent = "nzbget" + # Exit codes used by NZBGet + POSTPROCESS_PARCHECK = 92 + POSTPROCESS_SUCCESS = 93 + POSTPROCESS_ERROR = 94 + POSTPROCESS_NONE = 95 + + # Check nzbget.conf options + status = 0 + + if os.environ['NZBOP_UNPACK'] != 'yes': + log.error("Please enable option \"Unpack\" in nzbget configuration file, exiting.") + sys.exit(POSTPROCESS_NONE) + + # Check par status + if os.environ['NZBPP_PARSTATUS'] == '3': + log.error("Par-check successful, but Par-repair disabled, exiting") + sys.exit(POSTPROCESS_NONE) + + if os.environ['NZBPP_PARSTATUS'] == '1': + log.error("Par-check failed, setting status \"failed\".") + status = 1 + sys.exit(POSTPROCESS_NONE) + + # Check unpack status + if os.environ['NZBPP_UNPACKSTATUS'] == '1': + log.error("Unpack failed, setting status \"failed\".") + status = 1 + sys.exit(POSTPROCESS_NONE) + + if os.environ['NZBPP_UNPACKSTATUS'] == '0' and os.environ['NZBPP_PARSTATUS'] != '2': + # Unpack is disabled or was skipped due to nzb-file properties or due to errors during par-check + + for dirpath, dirnames, filenames in os.walk(os.environ['NZBPP_DIRECTORY']): + for file in filenames: + fileExtension = os.path.splitext(file)[1] + + if fileExtension in ['.par2']: + log.error("Post-Process: Unpack skipped and par-check skipped (although par2-files exist), setting status \"failed\".") + status = 1 + break + + if os.path.isfile(os.path.join(os.environ['NZBPP_DIRECTORY'], "_brokenlog.txt")) and not status == 1: + log.error("Post-Process: _brokenlog.txt exists, download is probably damaged, exiting.") + status = 1 + + if not status == 1: + log.error("Neither par2-files found, _brokenlog.txt doesn't exist, considering download successful.") + + # Check if destination directory exists (important for reprocessing of history items) + if not os.path.isdir(os.environ['NZBPP_DIRECTORY']): + log.error("Post-Process: Nothing to post-process: destination directory ", os.environ['NZBPP_DIRECTORY'], "doesn't exist.") + status = 1 + sys.exit(POSTPROCESS_NONE) + + # Make sure one of the appropriate categories is set + if category.lower() not in categories and category.lower() not in bypass: + log.error("Post-Process: No valid category detected. Category was %s." % (category)) + status = 1 + sys.exit(POSTPROCESS_NONE) + + # Make sure there are no duplicate categories + if len(categories) != len(set(categories)): + log.error("Duplicate category detected. Category names must be unique.") + status = 1 + sys.exit(POSTPROCESS_NONE) + + # All checks done, now launching the script. + settings = ReadSettings(MP4folder, "autoProcess.ini") + + if shouldConvert: + if output_dir: + settings.output_dir = output_dir + converter = MkvtoMp4(settings, logger=log) + for r, d, f in os.walk(path): + for files in f: + inputfile = os.path.join(r, files) + #DEBUG#print inputfile + #Ignores files under 50MB + if os.path.getsize(inputfile) > 50000000: + if MkvtoMp4(settings, logger=log).validSource(inputfile): + try: + output = converter.process(inputfile) + log.info("Successfully processed %s." % inputfile) + except: + log.exception("File processing failed.") + if converter.output_dir: + path = converter.output_dir + if (category.lower() == categories[0]): + #DEBUG#print "Sickbeard Processing Activated" + autoProcessTV.processEpisode(path, settings, nzb) + sys.exit(POSTPROCESS_SUCCESS) + elif (category.lower() == categories[1]): + #DEBUG#print "CouchPotato Processing Activated" + autoProcessMovie.process(path, settings, nzb, status) + sys.exit(POSTPROCESS_SUCCESS) + elif (category.lower() == categories[2]): + #DEBUG#print "Sonarr Processing Activated" + success = sonarr.processEpisode(path, settings, True) + if success: + sys.exit(POSTPROCESS_SUCCESS) + else: + sys.exit(POSTPROCESS_ERROR) + elif (category.lower() == categories[3]): + #DEBUG#print "Radarr Processing Activated" + success = radarr.processMovie(path, settings, True) + if success: + sys.exit(POSTPROCESS_SUCCESS) + else: + sys.exit(POSTPROCESS_ERROR) + elif (category.lower() == categories[4]): + #DEBUG#print "Sickrage Processing Activated" + autoProcessTVSR.processEpisode(path, settings, nzb) + sys.exit(POSTPROCESS_SUCCESS) + elif (category.lower() in bypass): + #DEBUG#print "Bypass Further Processing" + sys.exit(POSTPROCESS_NONE) + +else: + log.error("This script can only be called from NZBGet (11.0 or later).") + sys.exit(0) diff --git a/apps/templates/nzbget/MP4_Automator/autoProcess.ini b/apps/templates/nzbget/MP4_Automator/autoProcess.ini new file mode 100644 index 0000000..8122743 --- /dev/null +++ b/apps/templates/nzbget/MP4_Automator/autoProcess.ini @@ -0,0 +1,144 @@ +[SickBeard] +host = sickbeard +port = 8081 +username = +password = +web_root = +ssl = False +api_key = + +[Sonarr] +host = sonarr +port = 8989 +web_root = +ssl = False +apikey = + +[Radarr] +host = radarr +port = 7878 +web_root = +ssl = False +apikey = + +[MP4] +ffmpeg = /config/ffmpeg-build/workspace/bin/ffmpeg +ffprobe = /config/ffmpeg-build/workspace/bin/ffprobe +threads = 0 +output_directory = +copy_to = +move_to = +output_extension = mp4 +output_format = mp4 +delete_original = True +relocate_moov = True +video-codec = h264,x264 +video-bitrate = +video-crf = 18 +video-max-width = +h264-max-level = 4.1 +use-qsv-decoder-with-encoder = True +use-hevc-qsv-decoder = False +ios-audio = libfdk_aac +ios-first-track-only = False +ios-audio-filter = dynaudnorm +max-audio-channels = +audio-codec = ac3,mp3,dts,dca,aac,libfdk_aac +audio-language = eng +audio-default-language = eng +audio-channel-bitrate = 256 +audio-filter = +subtitle-codec = srt +subtitle-language = eng +subtitle-default-language = +subtitle-encoding = +fullpathguess = True +convert-mp4 = False +tagfile = True +tag-language = en +download-artwork = Poster +download-subs = True +embed-subs = False +sub-providers = addic7ed,podnapisi,thesubdb,opensubtitles +permissions = 0777 +post-process = False +pix-fmt = +aac_adtstoasc = False +postopts = -preset,slower +preopts = +audio-copy-original = False +enable_dxva2_gpu_decode = False +ios-move-last = False +use-hevc-qsv-decoder = False +embed-only-internal-subs = False +audio-first-track-of-language = False +video-profile = + +[CouchPotato] +host = couchpotato +port = 5050 +username = +password = +web_root = +ssl = False +apikey = +delay = 65 +method = renamer +delete_failed = False + +[uTorrent] +convert = +couchpotato-label = couchpotato +sickbeard-label = sickbeard +sonarr-label = sonarr +bypass-label = bypass +sickrage-label = sickrage +webui = False +action_before = stop +action_after = removedata +host = http://utorrent:8080/ +username = +password = +output_directory = +radarr-label = radarr + +[Deluge] +host = deluge +username = +convert = True +password = +sonarr-label = sonarr +radarr-label = radarr +bypass-label = bypass +sickbeard-label = sickbeard +port = 12569 +sickrage-label = sickrage +couchpotato-label = couchpotato +output_directory = +remove = true + +[SABNZBD] +convert = True +sickrage-category = sickrage +sonarr-category = sonarr +radarr-category = radarr +bypass-category = bypass +couchpotato-category = couchpotato +sickbeard-category = sickbeard +output_directory = + +[Sickrage] +host = sickrage +port = 8081 +username = +password = +web_root = +ssl = False +api_key = + +[Plex] +host = plex +port = 32400 +refresh = False +token = + diff --git a/apps/templates/nzbget/cont-init.d/30-config b/apps/templates/nzbget/cont-init.d/30-config new file mode 100644 index 0000000..deaaacd --- /dev/null +++ b/apps/templates/nzbget/cont-init.d/30-config @@ -0,0 +1,27 @@ +#!/usr/bin/with-contenv bash + +#Â delete lock file if found +[[ -f /downloads/nzbget.lock ]] && \ + rm /downloads/nzbget.lock + +#Â check if config file exists in /config +[[ ! -f /config/nzbget.conf ]] && \ + cp /defaults/nzbget.conf /config/nzbget.conf + +#Â permissions +chown 1000:1000 \ + /downloads +chown 1000:1000 -R \ + /app/nzbget \ + /config +chmod u+rw \ + /config/nzbget.conf + +chmod 777 -R \ + /config +chmod 777 -R \ + /app/nzbget +chmod 777 -R \ + /downloads + +exec /config/installer/installer.sh diff --git a/apps/templates/nzbget/ffmpeg-build/build-ffmpeg b/apps/templates/nzbget/ffmpeg-build/build-ffmpeg new file mode 100644 index 0000000..fc9fee9 --- /dev/null +++ b/apps/templates/nzbget/ffmpeg-build/build-ffmpeg @@ -0,0 +1,400 @@ +#!/bin/bash + +# https://github.com/markus-perl/ffmpeg-build-script + +VERSION=1.1 +CWD=$(pwd) +PACKAGES="$CWD/packages" +WORKSPACE="$CWD/workspace" +CC=clang +LDFLAGS="-L${WORKSPACE}/lib -lm" +CFLAGS="-I${WORKSPACE}/include" +PKG_CONFIG_PATH="${WORKSPACE}/lib/pkgconfig" +ADDITIONAL_CONFIGURE_OPTIONS="" + +# Speed up the process +# Env Var NUMJOBS overrides automatic detection +if [[ -n $NUMJOBS ]]; then + MJOBS=$NUMJOBS +elif [[ -f /proc/cpuinfo ]]; then + MJOBS=$(grep -c processor /proc/cpuinfo) +elif [[ "$OSTYPE" == "darwin"* ]]; then + MJOBS=$(sysctl -n machdep.cpu.thread_count) + ADDITIONAL_CONFIGURE_OPTIONS="--enable-videotoolbox" +else + MJOBS=4 +fi + +make_dir () { + if [ ! -d $1 ]; then + if ! mkdir $1; then + printf "\n Failed to create dir %s" "$1"; + exit 1 + fi + fi +} + +remove_dir () { + if [ -d $1 ]; then + rm -r "$1" + fi +} + +download () { + + DOWNLOAD_PATH=$PACKAGES; + + if [ ! -z "$3" ]; then + mkdir -p $PACKAGES/$3 + DOWNLOAD_PATH=$PACKAGES/$3 + fi; + + if [ ! -f "$DOWNLOAD_PATH/$2" ]; then + + echo "Downloading $1" + curl -L --silent -o "$DOWNLOAD_PATH/$2" "$1" + + EXITCODE=$? + if [ $EXITCODE -ne 0 ]; then + echo "" + echo "Failed to download $1. Exitcode $EXITCODE. Retrying in 10 seconds"; + sleep 10 + curl -L --silent -o "$DOWNLOAD_PATH/$2" "$1" + fi + + EXITCODE=$? + if [ $EXITCODE -ne 0 ]; then + echo "" + echo "Failed to download $1. Exitcode $EXITCODE"; + exit 1 + fi + + echo "... Done" + + if ! tar -xvf "$DOWNLOAD_PATH/$2" -C "$DOWNLOAD_PATH" 2>/dev/null >/dev/null; then + echo "Failed to extract $2"; + exit 1 + fi + + fi +} + +execute () { + echo "$ $*" + + OUTPUT=$($@ 2>&1) + + if [ $? -ne 0 ]; then + echo "$OUTPUT" + echo "" + echo "Failed to Execute $*" >&2 + exit 1 + fi +} + +build () { + echo "" + echo "building $1" + echo "=======================" + + if [ -f "$PACKAGES/$1.done" ]; then + echo "$1 already built. Remove $PACKAGES/$1.done lockfile to rebuild it." + return 1 + fi + + return 0 +} + +command_exists() { + if ! [[ -x $(command -v "$1") ]]; then + return 1 + fi + + return 0 +} + + +build_done () { + touch "$PACKAGES/$1.done" +} + +echo "ffmpeg-build-script v$VERSION" +echo "=========================" +echo "" + +case "$1" in +"--cleanup") + remove_dir $PACKAGES + remove_dir $WORKSPACE + echo "Cleanup done." + echo "" + exit 0 + ;; +"--build") + + ;; +*) + echo "Usage: $0" + echo " --build: start building process" + echo " --cleanup: remove all working dirs" + echo " --help: show this help" + echo "" + exit 0 + ;; +esac + +echo "Using $MJOBS make jobs simultaneously." + +make_dir $PACKAGES +make_dir $WORKSPACE + +export PATH=${WORKSPACE}/bin:$PATH + +if ! command_exists "make"; then + echo "make not installed."; + exit 1 +fi + +if ! command_exists "g++"; then + echo "g++ not installed."; + exit 1 +fi + +if ! command_exists "curl"; then + echo "curl not installed."; + exit 1 +fi + +if build "yasm"; then + download "http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz" "yasm-1.3.0.tar.gz" + cd $PACKAGES/yasm-1.3.0 || exit + execute ./configure --prefix=${WORKSPACE} + execute make -j $MJOBS + execute make install + build_done "yasm" +fi + +if build "nasm"; then + download "http://www.nasm.us/pub/nasm/releasebuilds/2.14.02/nasm-2.14.02.tar.gz" "nasm.tar.gz" + cd $PACKAGES/nasm-2.14.02 || exit + execute ./configure --prefix=${WORKSPACE} --disable-shared --enable-static + execute make -j $MJOBS + execute make install + build_done "nasm" +fi + +if build "opencore"; then + download "http://downloads.sourceforge.net/project/opencore-amr/opencore-amr/opencore-amr-0.1.5.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fopencore-amr%2Ffiles%2Fopencore-amr%2F&ts=1442256558&use_mirror=netassist" "opencore-amr-0.1.5.tar.gz" + cd $PACKAGES/opencore-amr-0.1.5 || exit + execute ./configure --prefix=${WORKSPACE} --disable-shared --enable-static + execute make -j $MJOBS + execute make install + build_done "opencore" +fi + +if build "libvpx"; then + download "https://github.com/webmproject/libvpx/archive/v1.7.0.tar.gz" "libvpx-1.7.0.tar.gz" + cd $PACKAGES/libvpx-*0 || exit + + if [[ "$OSTYPE" == "darwin"* ]]; then + echo "Applying Darwin patch" + sed "s/,--version-script//g" build/make/Makefile > build/make/Makefile.patched + sed "s/-Wl,--no-undefined -Wl,-soname/-Wl,-undefined,error -Wl,-install_name/g" build/make/Makefile.patched > build/make/Makefile + fi + + execute ./configure --prefix=${WORKSPACE} --disable-unit-tests --disable-shared + execute make -j $MJOBS + execute make install + build_done "libvpx" +fi + +if build "lame"; then + download "http://kent.dl.sourceforge.net/project/lame/lame/3.100/lame-3.100.tar.gz" "lame-3.100.tar.gz" + cd $PACKAGES/lame-3.100 || exit + execute ./configure --prefix=${WORKSPACE} --disable-shared --enable-static + execute make -j $MJOBS + execute make install + build_done "lame" +fi + +if build "xvidcore"; then + download "http://downloads.xvid.org/downloads/xvidcore-1.3.4.tar.gz" "xvidcore-1.3.4.tar.gz" + cd $PACKAGES/xvidcore || exit + cd build/generic || exit + execute ./configure --prefix=${WORKSPACE} --disable-shared --enable-static + execute make -j $MJOBS + execute make install + + if [[ -f ${WORKSPACE}/lib/libxvidcore.4.dylib ]]; then + execute rm "${WORKSPACE}/lib/libxvidcore.4.dylib" + fi + + build_done "xvidcore" +fi + +if build "x264"; then + download "http://ftp.videolan.org/pub/x264/snapshots/x264-snapshot-20190204-2245-stable.tar.bz2" "last_x264.tar.bz2" + cd $PACKAGES/x264-snapshot-* || exit + + if [[ "$OSTYPE" == "linux-gnu" ]]; then + execute ./configure --prefix=${WORKSPACE} --enable-static --enable-pic CXXFLAGS="-fPIC" + else + execute ./configure --prefix=${WORKSPACE} --enable-static --enable-pic + fi + + execute make -j $MJOBS + execute make install + execute make install-lib-static + build_done "x264" +fi + +if build "libogg"; then + download "http://downloads.xiph.org/releases/ogg/libogg-1.3.3.tar.gz" "libogg-1.3.3.tar.gz" + cd $PACKAGES/libogg-1.3.3 || exit + execute ./configure --prefix=${WORKSPACE} --disable-shared --enable-static + execute make -j $MJOBS + execute make install + build_done "libogg" +fi + +if build "libvorbis"; then + download "http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.6.tar.gz" "libvorbis-1.3.6.tar.gz" + cd $PACKAGES/libvorbis-1.3.6 || exit + execute ./configure --prefix=${WORKSPACE} --with-ogg-libraries=${WORKSPACE}/lib --with-ogg-includes=${WORKSPACE}/include/ --enable-static --disable-shared --disable-oggtest + execute make -j $MJOBS + execute make install + build_done "libvorbis" +fi + +if build "libtheora"; then + download "http://downloads.xiph.org/releases/theora/libtheora-1.1.1.tar.gz" "libtheora-1.1.1.tar.bz" + cd $PACKAGES/libtheora-1.1.1 || exit + sed "s/-fforce-addr//g" configure > configure.patched + chmod +x configure.patched + mv configure.patched configure + execute ./configure --prefix=${WORKSPACE} --with-ogg-libraries=${WORKSPACE}/lib --with-ogg-includes=${WORKSPACE}/include/ --with-vorbis-libraries=${WORKSPACE}/lib --with-vorbis-includes=${WORKSPACE}/include/ --enable-static --disable-shared --disable-oggtest --disable-vorbistest --disable-examples --disable-asm + execute make -j $MJOBS + execute make install + build_done "libtheora" +fi + +if build "pkg-config"; then + download "http://pkgconfig.freedesktop.org/releases/pkg-config-0.29.2.tar.gz" "pkg-config-0.29.2.tar.gz" + cd $PACKAGES/pkg-config-0.29.2 || exit + execute ./configure --silent --prefix=${WORKSPACE} --with-pc-path=${WORKSPACE}/lib/pkgconfig --with-internal-glib + execute make -j $MJOBS + execute make install + build_done "pkg-config" +fi + +if build "cmake"; then + download "https://cmake.org/files/v3.11/cmake-3.11.3.tar.gz" "cmake-3.11.3.tar.gz" + cd $PACKAGES/cmake-3.11.3 || exit + rm Modules/FindJava.cmake + perl -p -i -e "s/get_filename_component.JNIPATH/#get_filename_component(JNIPATH/g" Tests/CMakeLists.txt + perl -p -i -e "s/get_filename_component.JNIPATH/#get_filename_component(JNIPATH/g" Tests/CMakeLists.txt + execute ./configure --prefix=${WORKSPACE} + execute make -j $MJOBS + execute make install + build_done "cmake" +fi + +if build "vid_stab"; then + download "https://codeload.github.com/georgmartius/vid.stab/legacy.tar.gz/release-0.98b" "vid.stab-0.98b-transcode-1.1-binary-x86_64.tgz" + cd $PACKAGES/georgmartius-vid* || exit + perl -p -i -e "s/vidstab SHARED/vidstab STATIC/" CMakeLists.txt + execute cmake -DCMAKE_INSTALL_PREFIX:PATH=${WORKSPACE} . + execute make install + build_done "vid_stab" +fi + +if build "x265"; then + download "https://bitbucket.org/multicoreware/x265/downloads/x265_3.0.tar.gz" "x265-3.0.tar.gz" + cd $PACKAGES/x265_* || exit + cd source || exit + execute cmake -DCMAKE_INSTALL_PREFIX:PATH=${WORKSPACE} -DENABLE_SHARED:bool=off . + execute make -j $MJOBS + execute make install + sed "s/-lx265/-lx265 -lstdc++/g" "$WORKSPACE/lib/pkgconfig/x265.pc" > "$WORKSPACE/lib/pkgconfig/x265.pc.tmp" + mv "$WORKSPACE/lib/pkgconfig/x265.pc.tmp" "$WORKSPACE/lib/pkgconfig/x265.pc" + build_done "x265" +fi + +if build "fdk_aac"; then + download "http://downloads.sourceforge.net/project/opencore-amr/fdk-aac/fdk-aac-0.1.6.tar.gz?r=https%3A%2F%2Fsourceforge.net%2Fprojects%2Fopencore-amr%2Ffiles%2Ffdk-aac%2F&ts=1457561564&use_mirror=kent" "fdk-aac-0.1.6.tar.gz" + cd $PACKAGES/fdk-aac-0.1.6 || exit + execute ./configure --prefix=${WORKSPACE} --disable-shared --enable-static + execute make -j $MJOBS + execute make install + build_done "fdk_aac" +fi + + +build "ffmpeg" +download "http://ffmpeg.org/releases/ffmpeg-4.1.tar.bz2" "ffmpeg-snapshot.tar.bz2" +cd $PACKAGES/ffmpeg-4.1 || exit +./configure $ADDITIONAL_CONFIGURE_OPTIONS \ + --pkgconfigdir="$WORKSPACE/lib/pkgconfig" \ + --prefix=${WORKSPACE} \ + --pkg-config-flags="--static" \ + --extra-cflags="-I$WORKSPACE/include" \ + --extra-ldflags="-L$WORKSPACE/lib" \ + --extra-libs="-lpthread -lm" \ + --enable-static \ + --disable-debug \ + --disable-shared \ + --disable-ffplay \ + --disable-doc \ + --enable-gpl \ + --enable-version3 \ + --enable-nonfree \ + --enable-pthreads \ + --enable-libvpx \ + --enable-libmp3lame \ + --enable-libtheora \ + --enable-libvorbis \ + --enable-libx264 \ + --enable-libx265 \ + --enable-runtime-cpudetect \ + --enable-libfdk-aac \ + --enable-avfilter \ + --enable-libopencore_amrwb \ + --enable-libopencore_amrnb \ + --enable-filters \ + --enable-libvidstab + +execute make -j $MJOBS +execute make install + +INSTALL_FOLDER="/usr/bin" +if [[ "$OSTYPE" == "darwin"* ]]; then +INSTALL_FOLDER="/usr/local/bin" +fi + +echo "" +echo "Building done. The binary can be found here: $WORKSPACE/bin/ffmpeg" +echo "" + + +if [[ $AUTOINSTALL == "yes" ]]; then + if command_exists "sudo"; then + sudo cp "$WORKSPACE/bin/ffmpeg" "$INSTALL_FOLDER/ffmpeg" + sudo cp "$WORKSPACE/bin/ffprobe" "$INSTALL_FOLDER/ffprobe" + echo "Done. ffmpeg is now installed to your system" + fi +elif [[ ! $SKIPINSTALL == "yes" ]]; then + if command_exists "sudo"; then + + read -r -p "Install the binary to your $INSTALL_FOLDER folder? [Y/n] " response + + case $response in + [yY][eE][sS]|[yY]) + sudo cp "$WORKSPACE/bin/ffmpeg" "$INSTALL_FOLDER/ffmpeg" + sudo cp "$WORKSPACE/bin/ffprobe" "$INSTALL_FOLDER/ffprobe" + echo "Done. ffmpeg is now installed to your system" + ;; + esac + fi +fi + +exit 0 diff --git a/apps/templates/nzbget/ffmpeg-build/web-install.sh b/apps/templates/nzbget/ffmpeg-build/web-install.sh new file mode 100644 index 0000000..ffe4158 --- /dev/null +++ b/apps/templates/nzbget/ffmpeg-build/web-install.sh @@ -0,0 +1,40 @@ +#!/bin/bash +# Helper script to download and run the build-ffmpeg script. + +make_dir () { + if [ ! -d $1 ]; then + if ! mkdir $1; then + printf "\n Failed to create dir %s" "$1"; + exit 1 + fi + fi +} + +command_exists() { + if ! [[ -x $(command -v "$1") ]]; then + return 1 + fi + + return 0 +} + +TARGET='ffmpeg-build' + +if ! command_exists "curl"; then + echo "curl not installed."; + exit 1 +fi + +echo "ffmpeg-build-script-downloader v0.1" +echo "=========================================" +echo "" + +echo "First we create the ffmpeg build directory $TARGET" +make_dir $TARGET +cd $TARGET + +echo "Now we download and execute the build script" +echo "" + +bash build-ffmpeg --build + diff --git a/apps/templates/nzbget/installer/installer.sh b/apps/templates/nzbget/installer/installer.sh new file mode 100644 index 0000000..8c26cf9 --- /dev/null +++ b/apps/templates/nzbget/installer/installer.sh @@ -0,0 +1,30 @@ +#!/bin/bash +apk update +apk upgrade +apk add --no-cache git +apk add build-base gcc wget diffutils perl +apk add curl +git clone https://github.com/mdhiggins/sickbeard_mp4_automator.git /config/scripts/MP4_Automator/tmp +cp -r /config/scripts/MP4_Automator/tmp/* /config/scripts/MP4_Automator +rm -rf /config/scripts/MP4_Automator/tmp +git unstage +apk add --no-cache py-setuptools py-pip python-dev libffi-dev gcc musl-dev openssl-dev +pip install --upgrade PIP +pip install requests +pip install requests[security] +pip install requests-cache +pip install babelfish +pip install "guessit<2" +pip install "subliminal<2" +pip install qtfaststart +# As per https://github.com/mdhiggins/sickbeard_mp4_automator/issues/643 +pip uninstall -y stevedore +pip install stevedore==1.19.1 +#Remove default NZBGetPostProcess script settings, and replace with our own +rm /config/scripts/MP4_Automator/NZBGetPostProcess.py +cp /config/TEMPLATEPPScript /config/scripts/MP4_Automator/NZBGetPostProcess.py +#Build ffmpeg +cd /config +. /config/ffmpeg-build/web-install.sh +#Set script file permissions +chmod 777 -R /config/scripts diff --git a/apps/templates/nzbget/scripts/DeleteSamples.py b/apps/templates/nzbget/scripts/DeleteSamples.py new file mode 100644 index 0000000..395628f --- /dev/null +++ b/apps/templates/nzbget/scripts/DeleteSamples.py @@ -0,0 +1,93 @@ +#!/usr/bin/env python +# +# Title: PGBlitz (Reference Title File) +# Maintainer: Admin9705 +# URL: https://pgblitz.com - http://github.pgblitz.com +# GNU: General Public License v3.0 +# +# Additions: clinton-hall - https://github.com/Prinz23 +################################################################################ +import os +import sys + +# NZBGet Exit Codes +NZBGET_POSTPROCESS_PARCHECK = 92 +NZBGET_POSTPROCESS_SUCCESS = 93 +NZBGET_POSTPROCESS_ERROR = 94 +NZBGET_POSTPROCESS_NONE = 95 + +def is_sample(filePath, inputName, maxSampleSize, SampleIDs): + # 200 MB in bytes + SIZE_CUTOFF = int(maxSampleSize) * 1024 * 1024 + if os.path.getsize(filePath) < SIZE_CUTOFF: + if 'SizeOnly' in SampleIDs: + return True + # Ignore 'sample' in files unless 'sample' in Torrent Name + for ident in SampleIDs: + if ident.lower() in filePath.lower() and not ident.lower() in inputName.lower(): + return True + # Return False if none of these were met. + return False + +if not os.environ.has_key('NZBOP_SCRIPTDIR'): + print "This script can only be called from NZBGet (11.0 or later)." + sys.exit(0) + +if os.environ['NZBOP_VERSION'][0:5] < '11.0': + print "NZBGet Version %s is not supported. Please update NZBGet." % (str(os.environ['NZBOP_VERSION'])) + sys.exit(0) + +print "Script triggered from NZBGet Version %s." % (str(os.environ['NZBOP_VERSION'])) +status = 0 +if os.environ.has_key('NZBPP_TOTALSTATUS'): + if not os.environ['NZBPP_TOTALSTATUS'] == 'SUCCESS': + print "Download failed with status %s." % (os.environ['NZBPP_STATUS']) + status = 1 + +else: + # Check par status + if os.environ['NZBPP_PARSTATUS'] == '1' or os.environ['NZBPP_PARSTATUS'] == '4': + print "Par-repair failed, setting status \"failed\"." + status = 1 + + # Check unpack status + if os.environ['NZBPP_UNPACKSTATUS'] == '1': + print "Unpack failed, setting status \"failed\"." + status = 1 + + if os.environ['NZBPP_UNPACKSTATUS'] == '0' and os.environ['NZBPP_PARSTATUS'] == '0': + # Unpack was skipped due to nzb-file properties or due to errors during par-check + + if os.environ['NZBPP_HEALTH'] < 1000: + print "Download health is compromised and Par-check/repair disabled or no .par2 files found. Setting status \"failed\"." + print "Please check your Par-check/repair settings for future downloads." + status = 1 + + else: + print "Par-check/repair disabled or no .par2 files found, and Unpack not required. Health is ok so handle as though download successful." + print "Please check your Par-check/repair settings for future downloads." + +# Check if destination directory exists (important for reprocessing of history items) +if not os.path.isdir(os.environ['NZBPP_DIRECTORY']): + print "Nothing to post-process: destination directory", os.environ['NZBPP_DIRECTORY'], "doesn't exist. Setting status \"failed\"." + status = 1 + +# All checks done, now launching the script. +if status == 1: + sys.exit(NZBGET_POSTPROCESS_NONE) + +mediaContainer = os.environ['NZBPO_MEDIAEXTENSIONS'].split(',') +SampleIDs = os.environ['NZBPO_SAMPLEIDS'].split(',') +for dirpath, dirnames, filenames in os.walk(os.environ['NZBPP_DIRECTORY']): + for file in filenames: + filePath = os.path.join(dirpath, file) + fileName, fileExtension = os.path.splitext(file) + if fileExtension in mediaContainer or ".*" in mediaContainer : # If the file is a video file + if is_sample(filePath, os.environ['NZBPP_NZBNAME'], os.environ['NZBPO_MAXSAMPLESIZE'], SampleIDs): # Ignore samples + print "Deleting sample file: ", filePath + try: + os.unlink(filePath) + except: + print "Error: unable to delete file", filePath + sys.exit(NZBGET_POSTPROCESS_ERROR) +sys.exit(NZBGET_POSTPROCESS_SUCCESS) diff --git a/apps/templates/nzbget/scripts/flatten.py b/apps/templates/nzbget/scripts/flatten.py new file mode 100644 index 0000000..73dd0d5 --- /dev/null +++ b/apps/templates/nzbget/scripts/flatten.py @@ -0,0 +1,106 @@ +#!/usr/bin/env python +# +# Title: PGBlitz (Reference Title File) +# Maintainer: Admin9705 +# URL: https://pgblitz.com - http://github.pgblitz.com +# GNU: General Public License v3.0 +# +# Additions: clinton-hall - https://github.com/Prinz23 +################################################################################ +import os +import sys +import shutil + +# NZBGet Exit Codes +NZBGET_POSTPROCESS_PARCHECK = 92 +NZBGET_POSTPROCESS_SUCCESS = 93 +NZBGET_POSTPROCESS_ERROR = 94 +NZBGET_POSTPROCESS_NONE = 95 + +if not os.environ.has_key('NZBOP_SCRIPTDIR'): + print "This script can only be called from NZBGet (11.0 or later)." + sys.exit(0) + +if os.environ['NZBOP_VERSION'][0:5] < '11.0': + print "[ERROR] NZBGet Version %s is not supported. Please update NZBGet." % (str(os.environ['NZBOP_VERSION'])) + sys.exit(0) + +print "Script triggered from NZBGet Version %s." % (str(os.environ['NZBOP_VERSION'])) +status = 0 +if os.environ.has_key('NZBPP_TOTALSTATUS'): + if not os.environ['NZBPP_TOTALSTATUS'] == 'SUCCESS': + print "[ERROR] Download failed with status %s." % (os.environ['NZBPP_STATUS']) + status = 1 + +else: + # Check par status + if os.environ['NZBPP_PARSTATUS'] == '1' or os.environ['NZBPP_PARSTATUS'] == '4': + print "[ERROR] Par-repair failed, setting status \"failed\"." + status = 1 + + # Check unpack status + if os.environ['NZBPP_UNPACKSTATUS'] == '1': + print "[ERROR] Unpack failed, setting status \"failed\"." + status = 1 + + if os.environ['NZBPP_UNPACKSTATUS'] == '0' and os.environ['NZBPP_PARSTATUS'] == '0': + # Unpack was skipped due to nzb-file properties or due to errors during par-check + + if os.environ['NZBPP_HEALTH'] < 1000: + print "[ERROR] Download health is compromised and Par-check/repair disabled or no .par2 files found. Setting status \"failed\"." + print "[ERROR] Please check your Par-check/repair settings for future downloads." + status = 1 + + else: + print "[ERROR] Par-check/repair disabled or no .par2 files found, and Unpack not required. Health is ok so handle as though download successful." + print "[WARNING] Please check your Par-check/repair settings for future downloads." + +# Check if destination directory exists (important for reprocessing of history items) +if not os.path.isdir(os.environ['NZBPP_DIRECTORY']): + print "[ERROR] Nothing to post-process: destination directory", os.environ['NZBPP_DIRECTORY'], "doesn't exist. Setting status \"failed\"." + status = 1 + +# All checks done, now launching the script. +if status == 1: + sys.exit(NZBGET_POSTPROCESS_NONE) + +def removeEmptyFolders(path, removeRoot=True): + #Function to remove empty folders + if not os.path.isdir(path): + return + + # remove empty subfolders + print "[INFO] Checking for empty folders in:%s" % path + files = os.listdir(path) + if len(files): + for f in files: + fullpath = os.path.join(path, f) + if os.path.isdir(fullpath): + removeEmptyFolders(fullpath) + + # if folder empty, delete it + files = os.listdir(path) + if len(files) == 0 and removeRoot: + print "[INFO] Removing empty folder:%s" % path + os.rmdir(path) + +directory = os.path.normpath(os.environ['NZBPP_DIRECTORY']) +if os.environ['NZBPO_DESTINATIONDIRECTORY'] and os.path.isdir(os.environ['NZBPO_DESTINATIONDIRECTORY']): + destination = os.environ['NZBPO_DESTINATIONDIRECTORY'] + if os.environ['NZBPO_APPENDCATEGORIES'] == 'yes': + destination = os.path.join(destination, os.environ['NZBPP_CATEGORY']) +else: + destination = directory +print "Flattening directory: %s" % (directory) +for dirpath, dirnames, filenames in os.walk(directory): + for fileName in filenames: + outputFile = os.path.join(dirpath, fileName) + if dirpath == directory: + continue + target = os.path.join(destination, fileName) + try: + shutil.move(outputFile, target) + except: + print "[ERROR] Could not flatten %s" % outputFile +removeEmptyFolders(directory) # Cleanup empty directories +sys.exit(NZBGET_POSTPROCESS_SUCCESS) diff --git a/apps/templates/nzbget/scripts/hash.py b/apps/templates/nzbget/scripts/hash.py new file mode 100644 index 0000000..f2fbec1 --- /dev/null +++ b/apps/templates/nzbget/scripts/hash.py @@ -0,0 +1,167 @@ +#!/usr/bin/env python +# +# Title: PGBlitz (Reference Title File) +# Maintainer: Admin9705 +# URL: https://pgblitz.com - http://github.pgblitz.com +# GNU: General Public License v3.0 +# +# Original Author: clinton-hall +# https://github.com/clinton-hall/GetScripts/blob/master/SafeRename.py +# +# Modified By: desimaniac (No Acknowledgement of Source Above) +################################################################################ +import os +import re +import shutil +import sys + +# NZBGet Exit Codes +NZBGET_POSTPROCESS_PARCHECK = 92 +NZBGET_POSTPROCESS_SUCCESS = 93 +NZBGET_POSTPROCESS_ERROR = 94 +NZBGET_POSTPROCESS_NONE = 95 + +############################################################ +# EXTENSION STUFF +############################################################ + +def do_check(): + if not os.environ.has_key('NZBOP_SCRIPTDIR'): + print "This script can only be called from NZBGet (11.0 or later)." + sys.exit(0) + + if os.environ['NZBOP_VERSION'][0:5] < '11.0': + print "[ERROR] NZBGet Version %s is not supported. Please update NZBGet." % (str(os.environ['NZBOP_VERSION'])) + sys.exit(0) + + print "Script triggered from NZBGet Version %s." % (str(os.environ['NZBOP_VERSION'])) + + status = 0 + if 'NZBPP_TOTALSTATUS' in os.environ: + if not os.environ['NZBPP_TOTALSTATUS'] == 'SUCCESS': + print "[ERROR] Download failed with status %s." % (os.environ['NZBPP_STATUS']) + status = 1 + else: + # Check par status + if os.environ['NZBPP_PARSTATUS'] == '1' or os.environ['NZBPP_PARSTATUS'] == '4': + print "[ERROR] Par-repair failed, setting status \"failed\"." + status = 1 + + # Check unpack status + if os.environ['NZBPP_UNPACKSTATUS'] == '1': + print "[ERROR] Unpack failed, setting status \"failed\"." + status = 1 + + if os.environ['NZBPP_UNPACKSTATUS'] == '0' and os.environ['NZBPP_PARSTATUS'] == '0': + # Unpack was skipped due to nzb-file properties or due to errors during par-check + + if os.environ['NZBPP_HEALTH'] < 1000: + print "[ERROR] Download health is compromised and Par-check/repair disabled or no .par2 files found. " \ + "Setting status \"failed\"." + print "[ERROR] Please check your Par-check/repair settings for future downloads." + status = 1 + + else: + print "[ERROR] Par-check/repair disabled or no .par2 files found, and Unpack not required. Health is " \ + "ok so handle as though download successful." + print "[WARNING] Please check your Par-check/repair settings for future downloads." + + # Check if destination directory exists (important for reprocessing of history items) + if not os.path.isdir(os.environ['NZBPP_DIRECTORY']): + print "[ERROR] Nothing to post-process: destination directory", os.environ[ + 'NZBPP_DIRECTORY'], "doesn't exist. Setting status \"failed\"." + status = 1 + + # All checks done, now launching the script. + if status == 1: + sys.exit(NZBGET_POSTPROCESS_NONE) + + +def get_file_name(path): + try: + file_name = os.path.basename(path) + extensions = re.findall(r'\.([^.]+)', file_name) + ext = '.'.join(extensions) + name = file_name.replace(".%s" % ext, '') + return name, ext + except Exception: + pass + return None + + +def is_file_hash(file_name): + hash_regexp = [ + r'^[a-fA-F0-9]{40}$', + r'^[a-fA-F0-9]{32}$', + r'^[a-f0-9]{128}$', + r'^[a-zA-Z0-9]{42}$' + ] + for hash in hash_regexp: + if re.match(hash, file_name): + return True + return False + + +def find_files(folder, extension=None, depth=None): + file_list = [] + start_count = folder.count(os.sep) + for path, subdirs, files in os.walk(folder, topdown=True): + for name in files: + if depth and path.count(os.sep) - start_count >= depth: + del subdirs[:] + continue + file = os.path.join(path, name) + if not extension: + file_list.append(file) + else: + if file.lower().endswith(extension.lower()): + file_list.append(file) + + return sorted(file_list, key=lambda x: x.count(os.path.sep), reverse=True) + + +############################################################ +# MAIN +############################################################ + +# do checks +do_check() + +# retrieve required variables +directory = os.path.normpath(os.environ['NZBPP_DIRECTORY']) +nzb_name = os.environ['NZBPP_NZBFILENAME'] +if nzb_name is None: + print("[ERROR] Unable to retrieve NZBPP_NZBFILENAME") + sys.exit(NZBGET_POSTPROCESS_ERROR) +nzb_name = nzb_name.replace('.nzb', '') + +print("[INFO] Using \"%s\" for hashed filenames" % nzb_name) +print("[INFO] Scanning \"%s\" for hashed filenames" % directory) + +# scan for files +found_files = find_files(directory) +if not found_files: + print("[INFO] No files were found in \"%s\"" % directory) + sys.exit(NZBGET_POSTPROCESS_NONE) +else: + print("[INFO] Found %d files to check for hashed filenames" % len(found_files)) + # loop files checking for file hash + moved_files = 0 + for found_file_path in found_files: + # set variable + dir_name = os.path.dirname(found_file_path) + file_name, file_ext = get_file_name(found_file_path) + + # is this a file hash + if is_file_hash(file_name): + new_file_path = os.path.join(dir_name, "%s.%s" % (nzb_name, file_ext)) + print("[INFO] Moving \"%s\" to \"%s\"" % (found_file_path, new_file_path)) + try: + shutil.move(found_file_path, new_file_path) + moved_files += 1 + except Exception: + print("[ERROR] Failed moving \"%s\" to \"%s\"" % (found_file_path, new_file_path)) + + print("[INFO] Finished processing \"%s\", moved %d files" % (directory, moved_files)) + +sys.exit(NZBGET_POSTPROCESS_SUCCESS) diff --git a/apps/templates/nzbget/scripts/rarfile/__init__.py b/apps/templates/nzbget/scripts/rarfile/__init__.py new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/apps/templates/nzbget/scripts/rarfile/__init__.py @@ -0,0 +1 @@ + diff --git a/apps/templates/nzbget/scripts/rarfile/rarfile.py b/apps/templates/nzbget/scripts/rarfile/rarfile.py new file mode 100644 index 0000000..c6e0d44 --- /dev/null +++ b/apps/templates/nzbget/scripts/rarfile/rarfile.py @@ -0,0 +1,2932 @@ +# rarfile.py +# +# Copyright (c) 2005-2016 Marko Kreen