Merge pull request #7 from Admin9705/v8.3

update to 8.3
This commit is contained in:
timekills
2019-02-04 04:17:42 +04:30
committed by GitHub
34 changed files with 1097 additions and 335 deletions

151
apps/_core.yml Normal file
View File

@@ -0,0 +1,151 @@
#!/bin/bash
#
# Title: PlexGuide (Reference Title File)
# Author(s): Admin9705
# URL: https://plexguide.com - http://github.plexguide.com
# GNU: General Public License v3.0
################################################################################
---
# RECALL KEY VARIABLES #########################################################
- name: 'Register TLD'
shell: 'cat /var/plexguide/tld.program'
register: toplevel
ignore_errors: True
- name: Register Domain
shell: 'cat /var/plexguide/server.domain'
register: domain
ignore_errors: True
- name: Register IP
shell: 'cat /var/plexguide/server.ip'
register: ipaddress
ignore_errors: True
- name: Register Ports
shell: 'cat /var/plexguide/server.ports'
register: ports
ignore_errors: True
- name: Register HD Path
shell: 'cat /var/plexguide/server.hd.path'
register: path
ignore_errors: True
- name: Register incomplete Path
shell: 'cat /var/plexguide/server.incomplete.path'
register: incomplete
ignore_errors: True
- name: Register Auth Path
shell: 'cat /var/plexguide/server.ht'
register: auth
ignore_errors: True
- name: Remove {{pgrole}} Container
docker_container:
name: '{{pgrole}}'
state: absent
ignore_errors: True
- name: Storing Role Name
shell: "echo '{{pgrole}}' > /tmp/program_var"
ignore_errors: True
# APPDATA
- name: 'Creating appdata folder if it does not exist.'
shell: 'mkdir -p /opt/appdata/{{pgrole}}'
- name: 'Setting ownership on appdata'
shell: 'chown 1000:1000 /opt/appdata/{{pgrole}}'
when: '"plex" in pgrole'
- name: 'Setting permissions on appdata'
shell: 'chmod 775 /opt/appdata/{{pgrole}}'
when: '"plex" in pgrole'
- name: 'Setting ownership on appdata recursivley (this can take a while!)'
shell: 'chown -R 1000:1000 /opt/appdata/{{pgrole}}'
when: '"plex" not in pgrole'
- name: 'Setting permissions on appdata recursivley (this can take a while!)'
shell: 'chmod -R 775 /opt/appdata/{{pgrole}}'
when: '"plex" not in pgrole'
# OVERWRITE IMAGES #############################################################
- name: Check if Image Variable Exists
stat:
path: '/var/plexguide/image/{{pgrole}}'
register: imagecheck
- name: 'Transfer Image Variable'
shell: 'cat /var/plexguide/image/{{pgrole}}'
register: imagetemp
when: imagecheck.stat.exists
- name: 'If Fact Does Not Match - Disable TLD'
set_fact:
image: '{{imagetemp.stdout}}'
when: imagecheck.stat.exists
# TOP LEVEL DOMAIN INFO SET ####################################################
- debug: msg="Stored TLD - {{pgrole}} must match {{toplevel.stdout}} for TLD"
- name: 'If Fact Matches - Enable TLD'
set_fact:
tldset: '{{domain.stdout}}'
when: 'toplevel.stdout == pgrole'
- debug: msg="TLDSET is now for {{toplevel.stdout}}"
when: 'toplevel.stdout == pgrole'
- name: 'If Fact Does Not Match - Disable TLD'
set_fact:
tldset: ''
when: 'not toplevel.stdout == pgrole'
- debug: msg="TLD does not apply"
when: 'not toplevel.stdout == pgrole'
# EXTERNAL PORT FOR END BANNER
- name: Export Internal Port
shell: 'echo {{extport}} > /tmp/program_port'
ignore_errors: True
# FOR AUTHENTICATION
- name: 'Script Execute Part I'
shell: 'bash /opt/plexguide/menu/pgshield/drop.sh'
- name: 'Script Execute Part II'
shell: 'cat /var/plexguide/auth.var'
register: oauth
- name: 'OAuth Exe'
block:
- name: Check if Anti Auth Variable Exists
stat:
path: '/var/plexguide/auth/{{pgrole}}'
register: authcheck
- name: 'Auth Check 1'
set_fact:
gauth: 'http://oauth:4181'
when: not authcheck.stat.exists
- name: 'Auth Check 2'
set_fact:
gauth: ''
when: authcheck.stat.exists
when: oauth.stdout == 'good'
- name: 'OAuth Exe'
set_fact:
gauth: ''
when: not oauth.stdout == 'good'
- debug: msg="OAuth - {{oauth.stdout}}"

32
apps/_downloaders.yml Normal file
View File

@@ -0,0 +1,32 @@
- name: Creating download paths
file: 'path={{item}} state=directory mode=0775 owner=1000 group=1000'
with_items:
- '{{path.stdout}}/downloads/{{pgrole}}'
- '{{path.stdout}}/downloads/{{pgrole}}/tv'
- '{{path.stdout}}/downloads/{{pgrole}}/movies'
- '{{path.stdout}}/downloads/{{pgrole}}/music'
- '{{path.stdout}}/downloads/{{pgrole}}/ebooks'
- '{{path.stdout}}/downloads/{{pgrole}}/abooks'
- name: Creating incomplete paths
file: 'path={{item}} state=directory mode=0775 owner=1000 group=1000'
with_items:
- '{{path.stdout}}/incomplete/{{pgrole}}'
- '{{path.stdout}}/incomplete/{{pgrole}}/tv'
- '{{path.stdout}}/incomplete/{{pgrole}}/movies'
- '{{path.stdout}}/incomplete/{{pgrole}}/music'
- '{{path.stdout}}/incomplete/{{pgrole}}/ebooks'
- '{{path.stdout}}/incomplete/{{pgrole}}/abooks'
when: incomplete.stdout | length == 0
- name: Creating incomplete paths
file: 'path={{item}} state=directory mode=0775 owner=1000 group=1000'
with_items:
- '{{incomplete.stdout}}/{{pgrole}}'
- '{{incomplete.stdout}}/{{pgrole}}/tv'
- '{{incomplete.stdout}}/{{pgrole}}/movies'
- '{{incomplete.stdout}}/{{pgrole}}/music'
- '{{incomplete.stdout}}/{{pgrole}}/ebooks'
- '{{incomplete.stdout}}/{{pgrole}}/abooks'
when: incomplete.stdout | length > 0
ignore_errors: yes

21
apps/_plugins.yml Normal file
View File

@@ -0,0 +1,21 @@
- name: Creating scripts and plugins paths
file: 'path={{item}} state=directory mode=0775 owner=1000 group=1000'
with_items:
- '/opt/appdata/{{pgrole}}/scripts'
- '/opt/appdata/{{pgrole}}/plugins'
- name: 'Check if Templates Exist for {{pgrole}}'
stat:
path: './templates/{{pgrole}}'
register: copycheck
- name: 'Copying Scripts & Plugins'
copy:
src: ./templates/{{pgrole}}
dest: /opt/appdata
directory_mode: yes
force: yes
owner: 1000
group: 1000
mode: 0755
when: copycheck.stat.exists

63
apps/bazarr.yml Normal file
View File

@@ -0,0 +1,63 @@
#!/bin/bash
#
# Title: PlexGuide (Reference Title File)
# Author(s): Admin9705
# URL: https://plexguide.com - http://github.plexguide.com
# GNU: General Public License v3.0
################################################################################
---
- hosts: localhost
gather_facts: false
tasks:
# FACTS #######################################################################
- name: 'Set Known Facts'
set_fact:
pgrole: 'bazarr'
intport: '6767'
extport: '6767'
image: 'linuxserver/bazarr:latest'
# CORE (MANDATORY) ############################################################
- name: 'Including cron job'
include_tasks: '/opt/plexguide/containers/_core.yml'
# LABELS ######################################################################
- name: 'Adding Traefik'
set_fact:
pg_labels:
traefik.enable: 'true'
traefik.port: '{{intport}}'
traefik.frontend.auth.forward.address: '{{gauth}}'
traefik.frontend.rule: 'Host:{{pgrole}}.{{domain.stdout}},{{tldset}}'
- name: 'Setting PG Volumes'
set_fact:
pg_volumes:
- '/etc/localtime:/etc/localtime:ro'
- '/opt/appdata/{{pgrole}}:/config'
- '{{path.stdout}}:{{path.stdout}}'
- '/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}}'

View File

@@ -43,7 +43,8 @@
- '/opt/appdata/{{pgrole}}:/config'
- '/etc/localtime:/etc/localtime:ro'
- '{{path.stdout}}:{{path.stdout}}'
- '/mnt:/mnt'
- name: 'Setting PG ENV'
set_fact:
pg_env:

60
apps/bitwarden.yml Normal file
View File

@@ -0,0 +1,60 @@
#!/bin/bash
#
# Title: PlexGuide (Reference Title File)
# Author(s): Admin9705
# URL: https://plexguide.com - http://github.plexguide.com
# GNU: General Public License v3.0
################################################################################
---
- hosts: localhost
gather_facts: false
tasks:
# FACTS #######################################################################
- name: 'Set Known Facts'
set_fact:
pgrole: 'bitwarden'
intport: '80'
extport: '2489'
image: 'mprasil/bitwarden'
# CORE (MANDATORY) ############################################################
- name: 'Including cron job'
include_tasks: '/opt/plexguide/containers/_core.yml'
# LABELS ######################################################################
- name: 'Adding Traefik'
set_fact:
pg_labels:
traefik.enable: 'true'
traefik.backend: "{{pgrole}}"
traefik.port: '80'
traefik.frontend.auth.forward.address: '{{gauth}}'
traefik.frontend.rule: 'Host:bit.{{domain.stdout}},{{pgrole}}.{{domain.stdout}},{{tldset}}'
- name: 'Setting PG Volumes'
set_fact:
pg_volumes:
- '/opt/appdata/{{pgrole}}/data:/data'
- '/opt/appdata/{{pgrole}}/database:/database'
- name: 'Setting PG ENV'
set_fact:
pg_env:
PUID: 1000
PGID: 1000
# MAIN DEPLOYMENT #############################################################
- name: 'Deploying {{pgrole}}'
docker_container:
name: '{{pgrole}}'
image: '{{image}}'
pull: yes
volumes: '{{pg_volumes}}'
env: '{{pg_env}}'
restart_policy: unless-stopped
networks:
- name: plexguide
aliases:
- '{{pgrole}}'
state: started
labels: '{{pg_labels}}'

61
apps/cloudcmd.yml Normal file
View File

@@ -0,0 +1,61 @@
#!/bin/bash
#
# Title: PlexGuide (Reference Title File)
# Author(s): Admin9705
# URL: https://plexguide.com - http://github.plexguide.com
# GNU: General Public License v3.0
################################################################################
---
- hosts: localhost
gather_facts: false
tasks:
# FACTS #######################################################################
- name: 'Set Known Facts'
set_fact:
pgrole: 'cloudcmd'
intport: '8000'
extport: '7999'
image: 'coderaiser/cloudcmd'
# CORE (MANDATORY) ############################################################
- name: 'Including cron job'
include_tasks: '/opt/plexguide/containers/_core.yml'
# LABELS ######################################################################
- name: 'Adding Traefik'
set_fact:
pg_labels:
traefik.enable: 'true'
traefik.port: '{{intport}}'
traefik.frontend.auth.forward.address: '{{gauth}}'
traefik.frontend.rule: 'Host:{{pgrole}}.{{domain.stdout}},{{tldset}}'
- name: 'Setting PG Volumes'
set_fact:
pg_volumes:
- /:/SERVER
- /opt/appdata/{{pgrole}}:/root/
- name: 'Setting PG ENV'
set_fact:
pg_env:
PUID: 1000
PGID: 1000
# MAIN DEPLOYMENT #############################################################
- name: 'Deploying {{pgrole}}'
docker_container:
name: '{{pgrole}}'
image: '{{image}}'
pull: yes
published_ports:
- '{{ports.stdout}}{{extport}}:{{intport}}'
volumes: '{{pg_volumes}}'
env: '{{pg_env}}'
restart_policy: unless-stopped
networks:
- name: plexguide
aliases:
- '{{pgrole}}'
state: started
labels: '{{pg_labels}}'

View File

@@ -36,7 +36,8 @@
- '/opt/appdata/{{pgrole}}:/config'
- '{{path.stdout}}:{{path.stdout}}'
- '/etc/localtime:/etc/localtime:ro'
- '/mnt:/mnt'
- name: 'Setting PG ENV'
set_fact:
pg_env:

276
apps/deluge.yml Normal file
View File

@@ -0,0 +1,276 @@
#!/bin/bash
#
# Title: PlexGuide (Reference Title File)
# Author(s): Admin9705
# URL: https://plexguide.com - http://github.plexguide.com
# GNU: General Public License v3.0
################################################################################
---
- hosts: localhost
gather_facts: false
tasks:
# FACTS #######################################################################
- name: 'Set Known Facts'
set_fact:
pgrole: 'deluge'
intport: '8112'
extport: '8112'
intport2: '58846'
extport2: '58846'
intport3: '58946'
extport3: '58946'
image: 'linuxserver/deluge'
# CORE (MANDATORY) ############################################################
- name: 'Including cron job'
include_tasks: '/opt/plexguide/containers/_core.yml'
- name: 'Including required folders'
include_tasks: '/opt/plexguide/containers/_downloaders.yml'
- name: 'Including plugins'
include_tasks: '/opt/plexguide/containers/_plugins.yml'
- name: 'Checking for existing app data'
stat:
path: /opt/appdata/{{pgrole}}/core.conf
register: confcheck
# LABELS ######################################################################
- name: 'Adding Traefik'
set_fact:
pg_labels:
traefik.frontend.auth.forward.address: '{{gauth}}'
traefik.enable: 'true'
traefik.port: '{{intport}}'
traefik.frontend.rule: 'Host:{{pgrole}}.{{domain.stdout}},{{tldset}}'
- name: 'Setting PG Volumes'
set_fact:
pg_volumes:
- '/opt/appdata/{{pgrole}}:/config'
- '{{path.stdout}}:{{path.stdout}}'
- '/etc/localtime:/etc/localtime:ro'
- '/mnt:/mnt'
- name: 'Setting PG ENV'
set_fact:
pg_env:
PUID: 1000
PGID: 1000
# MAIN DEPLOYMENT #############################################################
- name: 'Deploying {{pgrole}}'
docker_container:
name: '{{pgrole}}'
image: '{{image}}'
pull: yes
published_ports:
- '{{ports.stdout}}{{extport}}:{{intport}}'
- '{{ports.stdout}}{{extport2}}:{{intport2}}'
- '{{ports.stdout}}{{extport3}}:{{intport3}}'
volumes: '{{pg_volumes}}'
env: '{{pg_env}}'
restart_policy: unless-stopped
networks:
- name: plexguide
aliases:
- '{{pgrole}}'
state: started
labels: '{{pg_labels}}'
# CONFIGURATION ###########################################################
- name: 'Waiting for {{pgrole}} to initialize'
wait_for:
timeout: 10
- name: Stopping {{pgrole}}
docker_container:
name: '{{pgrole}}'
state: stopped
- name: 'Checking for appdata'
wait_for:
path: '/opt/appdata/{{pgrole}}/core.conf'
state: present
delay: 5
- name: Setting plugins directory
lineinfile:
path: '/opt/appdata/{{pgrole}}/core.conf'
regexp: '"plugins_location".*'
line: '"plugins_location": "/config/plugins",'
state: present
- name: Set move completed location
lineinfile:
path: '/opt/appdata/{{pgrole}}/core.conf'
regexp: '"move_completed_path".*'
line: '"move_completed_path": "{{path.stdout}}/downloads/{{pgrole}}",'
state: present
when: incomplete.stdout | length == 0
- name: Set download location
lineinfile:
path: '/opt/appdata/{{pgrole}}/core.conf'
regexp: '"download_location".*'
line: '"download_location": "{{path.stdout}}/incomplete/{{pgrole}}",'
state: present
when: incomplete.stdout | length == 0
- name: Set download location
lineinfile:
path: '/opt/appdata/{{pgrole}}/core.conf'
regexp: '"download_location".*'
line: '"download_location": "{{incomplete.stdout}}/{{pgrole}}",'
state: present
when: incomplete.stdout | length > 0
- name: Setting torrent file directory
lineinfile:
path: '/opt/appdata/{{pgrole}}/core.conf'
regexp: '"torrentfiles_location".*'
line: '"torrentfiles_location": "{{path.stdout}}/torrent",'
state: present
- name: Setting torrent watch directory
lineinfile:
path: '/opt/appdata/{{pgrole}}/core.conf'
regexp: '"autoadd_location".*'
line: '"autoadd_location": "{{path.stdout}}/torrent/watch",'
state: present
- name: Setting move_completed
lineinfile:
path: '/opt/appdata/{{pgrole}}/core.conf'
regexp: '"move_completed".*'
line: '"move_completed": true,'
state: present
- name: Setting extractor folder
lineinfile:
path: '/opt/appdata/{{pgrole}}/plugins/extractor.conf'
regexp: '"use_name_folder".*'
line: '"use_name_folder": true,'
state: present
- name: Setting extractor
lineinfile:
path: '/opt/appdata/{{pgrole}}/plugins/extractor.conf'
regexp: '"extract_path".*'
line: '"extract_path": "{{path.stdout}}/downloads/deluge"'
state: present
# FIRST TIME CONFIGURATION ####################################################
- name: 'Configuring {{pgrole}} for first time use'
block:
- name: set enabled_plugins
lineinfile:
path: '/opt/appdata/{{pgrole}}/core.conf'
regexp: '"enabled_plugins".*'
line: '"enabled_plugins": ["Extractor", "Label"],'
state: present
- name: set compact_allocation
lineinfile:
path: '/opt/appdata/{{pgrole}}/core.conf'
regexp: '"compact_allocation".*'
line: '"compact_allocation": true,'
state: present
- name: set stop_seed_ratio
lineinfile:
path: '/opt/appdata/{{pgrole}}/core.conf'
regexp: '"stop_seed_ratio"".*'
line: '"stop_seed_ratio": 1.0,'
state: present
- name: set share_ratio_limit
lineinfile:
path: '/opt/appdata/{{pgrole}}/core.conf'
regexp: '"share_ratio_limit".*'
line: '"share_ratio_limit": 1.0,'
state: present
- name: set remove_seed_at_ratio
lineinfile:
path: '/opt/appdata/{{pgrole}}/core.conf'
regexp: '"remove_seed_at_ratio".*'
line: '"remove_seed_at_ratio": true,'
state: present
- name: set enc_prefer_rc4
lineinfile:
path: '/opt/appdata/{{pgrole}}/core.conf'
regexp: '"enc_prefer_rc4".*'
line: '"enc_prefer_rc4": true,'
state: present
- name: set enc_level
lineinfile:
path: '/opt/appdata/{{pgrole}}/core.conf'
regexp: '"enc_level".*'
line: '"enc_level": 1,'
state: present
- name: set enc_in_policy
lineinfile:
path: '/opt/appdata/{{pgrole}}/core.conf'
regexp: '"enc_in_policy".*'
line: '"enc_in_policy": 1,'
state: present
- name: set enc_out_policy
lineinfile:
path: '/opt/appdata/{{pgrole}}/core.conf'
regexp: '"enc_out_policy".*'
line: '"enc_out_policy": 1,'
state: present
- name: set max_active_downloading
lineinfile:
path: '/opt/appdata/{{pgrole}}/core.conf'
regexp: '"max_active_downloading".*'
line: '"max_active_downloading": 4,'
state: present
- name: set dont_count_slow_torrents
lineinfile:
path: '/opt/appdata/{{pgrole}}/core.conf'
regexp: '"dont_count_slow_torrents".*'
line: '"dont_count_slow_torrents": true,'
state: present
- name: set max_active_seeding
lineinfile:
path: '/opt/appdata/{{pgrole}}/core.conf'
regexp: '"enabled_plugins".*'
line: '"max_active_seeding": 8,'
state: present
- name: set share_ratio_limit
lineinfile:
path: '/opt/appdata/{{pgrole}}/core.conf'
regexp: '"share_ratio_limit".*'
line: '"share_ratio_limit": 1,'
state: present
- name: set stop_seed_at_ratio
lineinfile:
path: '/opt/appdata/{{pgrole}}/core.conf'
regexp: '"stop_seed_at_ratio".*'
line: '"stop_seed_at_ratio": 1.0,'
state: present
- name: set seed_time_ratio_limit
lineinfile:
path: '/opt/appdata/{{pgrole}}/core.conf'
regexp: '"seed_time_ratio_limit".*'
line: '"seed_time_ratio_limit": 1.0,'
state: present
when: not confcheck.stat.exists
- name: Restart {{pgrole}}
docker_container:
name: '{{pgrole}}'
state: started

View File

@@ -22,12 +22,6 @@
- name: 'Including cron job'
include_tasks: '/opt/plexguide/containers/_core.yml'
# MIGRATIONS (REMOVE SECTION ON MARCH 1st) #############################################################
- name: 'Check for old volumes'
stat:
path: '{{path.stdout}}/{{pgrole}}'
register: oldcheck
# LABELS ######################################################################
- name: 'Adding Traefik'
set_fact:
@@ -99,38 +93,3 @@
- '{{pgrole}}'
state: started
labels: '{{pg_labels}}'
- name: 'Wait 6 Seconds'
wait_for:
timeout: 6
- name: Stop Container
docker_container:
name: '{{pgrole}}'
state: stopped
# ENDING FOR HANDBRAKE ###########################################################
# - name: 'Waiting for {{pgrole}} to initialize'
# wait_for:
# path: '/opt/appdata/{{pgrole}}/core.conf'
# state: present
- name: 'Configuring {{pgrole}} for first time use'
block:
- name: 'Stopping {{pgrole}}'
docker_container:
name: '{{pgrole}}'
state: stopped
# - name: Setting plugins directory
# lineinfile:
# path: '/opt/appdata/{{pgrole}}/core.conf'
# regexp: '"plugins_location"'
# line: '"plugins_location": "/config/plugins",'
# state: present
- name: Restart Container
docker_container:
name: '{{pgrole}}'
state: started

View File

@@ -21,13 +21,7 @@
# CORE (MANDATORY) ############################################################
- name: 'Including cron job'
include_tasks: '/opt/plexguide/containers/_core.yml'
# MIGRATIONS (REMOVE SECTION ON MARCH 1st) #############################################################
- name: 'Check for old volumes'
stat:
path: '{{path.stdout}}/{{pgrole}}'
register: oldcheck
# LABELS ######################################################################
- name: 'Adding Traefik'
set_fact:
@@ -43,7 +37,7 @@
- '/opt/appdata/{{pgrole}}/config:/config:rw'
- '/:/storage:ro'
- '{{path.stdout}}:{{path.stdout}}'
- '/mnt/unionfs:/mnt/unionfs'
- '/mnt:/mnt'
- '{{path.stdout}}/{{pgrole}}/watch/Very_Fast_1080p30:/watch:rw'
- '{{path.stdout}}/{{pgrole}}/watch/HQ_1080p30_Surround:/watch2:rw'
- '{{path.stdout}}/{{pgrole}}/watch/1080mkv:/watch3:rw'
@@ -98,39 +92,4 @@
aliases:
- '{{pgrole}}'
state: started
labels: '{{pg_labels}}'
- name: 'Wait 6 Seconds'
wait_for:
timeout: 6
- name: Stop Container
docker_container:
name: '{{pgrole}}'
state: stopped
# ENDING FOR HANDBRAKE ###########################################################
# - name: 'Waiting for {{pgrole}} to initialize'
# wait_for:
# path: '/opt/appdata/{{pgrole}}/core.conf'
# state: present
- name: 'Configuring {{pgrole}} for first time use'
block:
- name: 'Stopping {{pgrole}}'
docker_container:
name: '{{pgrole}}'
state: stopped
# - name: Setting plugins directory
# lineinfile:
# path: '/opt/appdata/{{pgrole}}/core.conf'
# regexp: '"plugins_location"'
# line: '"plugins_location": "/config/plugins",'
# state: present
- name: Restart Container
docker_container:
name: '{{pgrole}}'
state: started
labels: '{{pg_labels}}'

65
apps/heimdall.yml Normal file
View File

@@ -0,0 +1,65 @@
#!/bin/bash
#
# Title: PlexGuide (Reference Title File)
# Author(s): Admin9705
# URL: https://plexguide.com - http://github.plexguide.com
# GNU: General Public License v3.0
################################################################################
---
- hosts: localhost
gather_facts: false
tasks:
# FACTS #######################################################################
- name: 'Set Known Facts'
set_fact:
pgrole: 'heimdall'
intport: '443'
extport: '1111'
image: 'linuxserver/heimdall'
# CORE (MANDATORY) ############################################################
- name: 'Including cron job'
include_tasks: '/opt/plexguide/containers/_core.yml'
# LABELS ######################################################################
- name: 'Adding Traefik'
set_fact:
pg_labels:
traefik.frontend.auth.forward.address: '{{gauth}}'
traefik.protocol: 'https'
traefik.enable: 'true'
traefik.https.port: '443'
traefik.https.frontend.entryPoints: 'https'
traefik.https.frontend.rule: 'Host:{{pgrole}}.{{domain.stdout}},{{tldset}}'
- name: 'Setting PG Volumes'
set_fact:
pg_volumes:
- '/opt/appdata/heimdall:/config'
- '/etc/localtime:/etc/localtime:ro'
- name: 'Setting PG ENV'
set_fact:
pg_env:
PUID: 1000
PGID: 1000
# MAIN DEPLOYMENT #############################################################
- name: 'Deploying {{pgrole}}'
docker_container:
name: '{{pgrole}}'
image: '{{image}}'
pull: yes
published_ports:
- '127.0.0.0.1:1112:443'
- '{{ports.stdout}}1111:80'
volumes: '{{pg_volumes}}'
env: '{{pg_env}}'
restart_policy: unless-stopped
networks:
- name: plexguide
aliases:
- '{{pgrole}}'
state: started
labels: '{{pg_labels}}'

View File

@@ -26,22 +26,11 @@
- name: 'Including cron job'
include_tasks: '/opt/plexguide/containers/_core.yml'
# MIGRATIONS (REMOVE SECTION ON MARCH 1st) #############################################################
- name: 'Check for old volumes'
stat:
path: '{{path.stdout}}/{{pgrole}}'
register: oldcheck
- name: 'Including plugins'
include_tasks: '/opt/plexguide/containers/_plugins.yml'
- name: 'Migrations'
block:
- name: 'Creating new downloads location'
command: 'mkdir -p {{path.stdout}}/downloads/{{pgrole}}'
- name: 'Chown download folder'
shell: 'chown -R 1000:1000 {{path.stdout}}/downloads/{{pgrole}}/'
- name: 'Chmod download folder'
shell: 'chmod -R 775 {{path.stdout}}/downloads/{{pgrole}}/'
- name: 'Including folders'
include_tasks: '/opt/plexguide/containers/_downloaders.yml'
- name: 'Ini Check'
stat:
@@ -63,6 +52,7 @@
- '/opt/appdata/{{pgrole}}:/config'
- '{{path.stdout}}:{{path.stdout}}'
- '/mnt/unionfs:/unionfs'
- '/mnt:/mnt'
- '{{path.stdout}}/downloads/{{pgrole}}/:/output:rw'
- '/etc/localtime:/etc/localtime:ro'
@@ -73,22 +63,6 @@
GID: 1000
# MAIN DEPLOYMENT #############################################################
- name: 'Create scripts directory for {{pgrole}}'
file:
path: /opt/appdata/{{pgrole}}/scripts
state: directory
owner: 1000
group: 1000
mode: 0755
# - name: 'Create plugins directory for {{pgrole}}'
# file:
# path: /opt/appdata/{{pgrole}}/plugins
# state: directory
# owner: 1000
# group: 1000
# mode: 0755
- name: 'Deploying {{pgrole}}'
docker_container:
name: '{{pgrole}}'
@@ -104,41 +78,4 @@
aliases:
- '{{pgrole}}'
state: started
labels: '{{pg_labels}}'
- name: 'Wait 6 Seconds'
wait_for:
timeout: 6
- name: Stop Container
docker_container:
name: '{{pgrole}}'
state: stopped
# ENDING FOR JDOWNLOADER2 ###########################################################
# - name: 'Waiting for {{pgrole}} to initialize'
# wait_for:
# path: '/opt/appdata/{{pgrole}}/core.conf'
# state: present
- name: 'Configuring {{pgrole}} for first time use'
block:
- name: 'Stopping {{pgrole}}'
docker_container:
name: '{{pgrole}}'
state: stopped
# - name: Setting plugins directory
# lineinfile:
# path: '/opt/appdata/{{pgrole}}/core.conf'
# regexp: '"plugins_location"'
# line: '"plugins_location": "/config/plugins",'
# state: present
- name: Restart Container
docker_container:
name: '{{pgrole}}'
state: started
when: not inicheck.stat.exists
labels: '{{pg_labels}}'

View File

@@ -24,28 +24,6 @@
- name: 'Including cron job'
include_tasks: '/opt/plexguide/containers/_core.yml'
# MIGRATIONS (REMOVE SECTION ON MARCH 1st) #############################################################
- name: 'Check for old volumes'
stat:
path: '{{path.stdout}}/{{pgrole}}'
register: oldcheck
- name: 'Migrations'
block:
- name: 'Creating new downloads location'
command: 'mkdir -p {{path.stdout}}/downloads/{{pgrole}}'
- name: 'Chown download folder'
shell: 'chown -R 1000:1000 {{path.stdout}}/downloads/{{pgrole}}/'
- name: 'Chmod download folder'
shell: 'chmod -R 775 {{path.stdout}}/downloads/{{pgrole}}/'
- name: 'Ini Check'
stat:
path: /opt/appdata/{{pgrole}}/core.conf
register: inicheck
# LABELS ######################################################################
- name: 'Adding Traefik'
set_fact:
@@ -92,34 +70,4 @@
aliases:
- '{{pgrole}}'
state: started
labels: '{{pg_labels}}'
- name: 'Wait 7 Seconds'
wait_for:
timeout: 7
- name: Stop Container
docker_container:
name: '{{pgrole}}'
state: stopped
# ENDING FOR JDOWNLOADER2 ###########################################################
# - name: 'Waiting for {{pgrole}} to initialize'
# wait_for:
# path: '/opt/appdata/{{pgrole}}/core.conf'
# state: present
- name: 'Configuring {{pgrole}} for first time use'
block:
- name: 'Stopping {{pgrole}}'
docker_container:
name: '{{pgrole}}'
state: stopped
- name: Restart Container
docker_container:
name: '{{pgrole}}'
state: started
when: not inicheck.stat.exists
labels: '{{pg_labels}}'

View File

@@ -28,7 +28,6 @@
traefik.frontend.auth.forward.address: '{{gauth}}'
traefik.enable: 'true'
traefik.port: '{{intport}}'
traefik.frontend.rule: 'Host:{{pgrole}}.{{domain.stdout}},{{tldset}}'
- name: 'Setting PG Volumes'

View File

@@ -28,7 +28,6 @@
traefik.frontend.auth.forward.address: '{{gauth}}'
traefik.enable: 'true'
traefik.port: '{{intport}}'
traefik.frontend.rule: 'Host:{{pgrole}}.{{domain.stdout}},{{tldset}}'
- name: 'Setting PG Volumes'

View File

@@ -28,7 +28,6 @@
traefik.frontend.auth.forward.address: '{{gauth}}'
traefik.enable: 'true'
traefik.port: '{{intport}}'
traefik.frontend.rule: 'Host:{{pgrole}}.{{domain.stdout}},{{tldset}}'
- name: 'Setting PG Volumes'

View File

@@ -21,15 +21,6 @@
- name: 'Including cron job'
include_tasks: '/opt/plexguide/containers/_core.yml'
# EXTRA #######################################################################
- name: Create required directories
file: 'path={{item}} state=directory mode=0775 owner=1000 group=1000'
with_items:
- /opt/appdata/nextcloud
- /opt/appdata/nextcloud/conf
- /opt/appdata/nextcloud/data
- /mnt/unionfs/nextcloud
# LABELS ######################################################################
- name: 'Adding Traefik'
set_fact:

61
apps/nowshowing.yml Normal file
View File

@@ -0,0 +1,61 @@
#!/bin/bash
#
# Title: PlexGuide (Reference Title File)
# Author(s): Admin9705
# URL: https://plexguide.com - http://github.plexguide.com
# GNU: General Public License v3.0
################################################################################
---
- hosts: localhost
gather_facts: false
tasks:
# FACTS #######################################################################
- name: 'Set Known Facts'
set_fact:
pgrole: 'nowshowing'
intport: '6878'
extport: '6878'
image: 'ninthwalker/nowshowing:v2'
# CORE (MANDATORY) ############################################################
- name: 'Including cron job'
include_tasks: '/opt/plexguide/containers/_core.yml'
# LABELS ######################################################################
- name: 'Adding Traefik'
set_fact:
pg_labels:
traefik.frontend.auth.forward.address: '{{gauth}}'
traefik.enable: 'true'
traefik.port: '{{intport}}'
traefik.frontend.rule: 'Host:{{pgrole}}.{{domain.stdout}},{{tldset}}'
- name: 'Setting PG Volumes'
set_fact:
pg_volumes:
- '/opt/appdata/{{pgrole}}:/config'
- '/etc/localtime:/etc/localtime:ro'
- name: 'Setting PG ENV'
set_fact:
pg_env:
PUID: 1000
PGID: 1000
# MAIN DEPLOYMENT #############################################################
- name: 'Deploying {{pgrole}}'
docker_container:
name: '{{pgrole}}'
image: '{{image}}'
pull: yes
published_ports:
- '{{ports.stdout}}{{extport}}:{{intport}}'
volumes: '{{pg_volumes}}'
env: '{{pg_env}}'
restart_policy: unless-stopped
networks:
- name: plexguide
aliases:
- '{{pgrole}}'
state: started
labels: '{{pg_labels}}'

View File

@@ -21,34 +21,6 @@
- name: 'Including cron job'
include_tasks: '/opt/plexguide/containers/_core.yml'
# EXTRA FUNCTIONS REQUIRED BY THE ROLE #####################################
- name: 'Create scripts directory for {{pgrole}}'
file:
path: /opt/appdata/{{pgrole}}/scripts
state: directory
owner: 1000
group: 1000
mode: 0755
- name: 'Create plugins directory for {{pgrole}}'
file:
path: /opt/appdata/{{pgrole}}/plugins
state: directory
owner: 1000
group: 1000
mode: 0755
- name: 'Copy scripts into directory for {{pgrole}}'
copy:
src: /opt/plexguide/containers/templates/radarr/scripts/cleanup-radarr.sh
dest: /opt/appdata/{{pgrole}}/scripts
directory_mode: yes
force: yes
owner: 1000
group: 1000
mode: 0755
# LABELS #### KEEPS BOTTOM CLEAN ###########################################
- name: 'Adding Traefik'
set_fact:

View File

@@ -21,34 +21,6 @@
- name: 'Including cron job'
include_tasks: '/opt/plexguide/containers/_core.yml'
# EXTRA FUNCTIONS REQUIRED BY THE ROLE #####################################
- name: 'Create scripts directory for {{pgrole}}'
file:
path: /opt/appdata/{{pgrole}}/scripts
state: directory
owner: 1000
group: 1000
mode: 0755
- name: 'Create plugins directory for {{pgrole}}'
file:
path: /opt/appdata/{{pgrole}}/plugins
state: directory
owner: 1000
group: 1000
mode: 0755
- name: 'Copy scripts into directory for {{pgrole}}'
copy:
src: /opt/plexguide/containers/templates/radarr/scripts/cleanup-radarr.sh
dest: /opt/appdata/{{pgrole}}/scripts
directory_mode: yes
force: yes
owner: 1000
group: 1000
mode: 0755
# LABELS #### KEEPS BOTTOM CLEAN ###########################################
- name: 'Adding Traefik'
set_fact:

View File

@@ -22,34 +22,6 @@
- name: 'Including cron job'
include_tasks: '/opt/plexguide/containers/_core.yml'
# EXTRA FUNCTIONS REQUIRED BY THE ROLE #####################################
- name: 'Create scripts directory for {{pgrole}}'
file:
path: /opt/appdata/{{pgrole}}/scripts
state: directory
owner: 1000
group: 1000
mode: 0755
- name: 'Create plugins directory for {{pgrole}}'
file:
path: /opt/appdata/{{pgrole}}/plugins
state: directory
owner: 1000
group: 1000
mode: 0755
- name: 'Copy scripts into directory for {{pgrole}}'
copy:
src: /opt/plexguide/containers/templates/sonarr/scripts/cleanup-sonarr.sh
dest: /opt/appdata/{{pgrole}}/scripts
directory_mode: yes
force: yes
owner: 1000
group: 1000
mode: 0755
# LABELS #### KEEPS BOTTOM CLEAN ###########################################
- name: 'Adding Traefik'
set_fact:

View File

@@ -22,34 +22,6 @@
- name: 'Including cron job'
include_tasks: '/opt/plexguide/containers/_core.yml'
# EXTRA FUNCTIONS REQUIRED BY THE ROLE #####################################
- name: 'Create scripts directory for {{pgrole}}'
file:
path: /opt/appdata/{{pgrole}}/scripts
state: directory
owner: 1000
group: 1000
mode: 0755
- name: 'Create plugins directory for {{pgrole}}'
file:
path: /opt/appdata/{{pgrole}}/plugins
state: directory
owner: 1000
group: 1000
mode: 0755
- name: 'Copy scripts into directory for {{pgrole}}'
copy:
src: /opt/plexguide/containers/templates/sonarr/scripts/cleanup-sonarr.sh
dest: /opt/appdata/{{pgrole}}/scripts
directory_mode: yes
force: yes
owner: 1000
group: 1000
mode: 0755
# LABELS #### KEEPS BOTTOM CLEAN ###########################################
- name: 'Adding Traefik'
set_fact:

View File

@@ -48,7 +48,7 @@
- '/opt/appdata/{{pgrole}}/config:/config'
- '/opt/appdata/{{pgrole}}/sync:/sync'
- '/mnt:/mnt'
- '{{path.stdout}}:{{path.stdout}}'
- name: 'Setting PG ENV'
set_fact:

View File

@@ -0,0 +1,40 @@
---
# Path to your youtube-dl binary
youtubedl: vendor/rg3/youtube-dl/youtube_dl/__main__.py
# Path to your python binary
python: /usr/bin/python
# An array of parameters to pass to youtube-dl
params:
- --no-warnings
- --ignore-errors
- --flat-playlist
- --restrict-filenames
# True to enable audio conversion
convert: false
# True to enable advanced conversion mode
convertAdvanced: false
# List of formats available in advanced conversion mode
convertAdvancedFormats: [mp3, avi, flv, wav]
# Path to your avconv or ffmpeg binary
avconv: vendor/bin/ffmpeg
# avconv/ffmpeg logging level.
avconvVerbosity: error
# Path to the directory that contains the phantomjs binary.
phantomjsDir: vendor/bin/
# True to disable URL rewriting
uglyUrls: false
# True to stream videos through server
stream: false
# MP3 bitrate when converting (in kbit/s)
audioBitrate: 128

View File

@@ -0,0 +1,36 @@
{
"name": "",
"auth": true,
"username": "plex",
"password": "33449a17f325d04d86acfa00452b372c90742df5f9a10fee21673d9f384ab4bf536bce786034205b6496b559cece641f461c84df6a4eff220d1e66de09a29bde",
"algo": "sha512WithRSAEncryption",
"editor": "edward",
"packer": "tar",
"diff": true,
"zip": true,
"localStorage": true,
"buffer": true,
"dirStorage": false,
"online": true,
"open": false,
"cache": true,
"keysPanel": true,
"port": 8000,
"ip": null,
"root": "/SERVER",
"prefix": "",
"progress": true,
"htmlDialogs": true,
"contact": true,
"confirmCopy": true,
"confirmMove": true,
"configDialog": true,
"onePanelMode": false,
"console": true,
"syncConsolePath": false,
"terminal": "true",
"terminalPath": "gritty",
"showConfig": false,
"vim": false,
"columns": "name-size-date-owner-mode"
}

View File

@@ -0,0 +1,23 @@
{
"file": 1,
"format": 1
}{
"interval": 1.0,
"max_seeds": 0,
"sel_func": "or",
"trackers": [],
"remove_data": true,
"labels": [],
"enabled": true,
"count_exempt": false,
"remove": true,
"filter": "func_ratio",
"tracker_rules": {},
"min": 1.5,
"hdd_space": -1.0,
"filter2": "func_seed_time",
"rule_2_enabled": true,
"min2": 15.0,
"rule_1_enabled": true,
"label_rules": {}
}

View File

@@ -0,0 +1,104 @@
{
"file": 1,
"format": 1
}{
"info_sent": 0.0,
"lsd": false,
"send_info": false,
"move_completed_path": "{{ downloads }}/complete",
"enc_in_policy": 1,
"queue_new_to_top": true,
"ignore_limits_on_local_network": true,
"rate_limit_ip_overhead": false,
"daemon_port": 58846,
"natpmp": true,
"max_active_limit": "{{ max_active_limit }}",
"utpex": false,
"max_active_downloading": 5,
"max_active_seeding": 10,
"allow_remote": true,
"max_half_open_connections": 50,
"download_location": "{{ downloads }}/incomplete",
"compact_allocation": false,
"max_upload_speed": -1.0,
"cache_expiry": 60,
"prioritize_first_last_pieces": false,
"auto_managed": true,
"enc_level": 2,
"max_connections_per_second": 20,
"dont_count_slow_torrents": true,
"random_outgoing_ports": true,
"max_upload_slots_per_torrent": -1,
"new_release_check": false,
"enc_out_policy": 1,
"outgoing_ports": [
0,
0
],
"seed_time_limit": 180,
"cache_size": 512,
"share_ratio_limit": 2.0,
"max_download_speed": -1.0,
"geoip_db_location": "/usr/share/GeoIP/GeoIP.dat",
"torrentfiles_location": "/data/torrents",
"stop_seed_at_ratio": false,
"peer_tos": "0x00",
"listen_interface": "0.0.0.0",
"upnp": true,
"max_download_speed_per_torrent": -1,
"max_upload_slots_global": 4,
"enabled_plugins": [
"Label",
"Execute"
],
"random_port": false,
"autoadd_enable": false,
"max_connections_global": 200,
"enc_prefer_rc4": true,
"listen_ports": [
58946,
58946
],
"dht": false,
"stop_seed_ratio": 1.5,
"seed_time_ratio_limit": 7.0,
"max_upload_speed_per_torrent": -1,
"copy_torrent_file": false,
"del_copy_torrent_file": false,
"move_completed": true,
"proxies": {
"peer": {
"username": "",
"password": "",
"type": 0,
"hostname": "",
"port": 8080
},
"web_seed": {
"username": "",
"password": "",
"type": 0,
"hostname": "",
"port": 8080
},
"tracker": {
"username": "",
"password": "",
"type": 0,
"hostname": "",
"port": 8080
},
"dht": {
"username": "",
"password": "",
"type": 0,
"hostname": "",
"port": 8080
}
},
"add_paused": false,
"max_connections_per_torrent": -1,
"remove_seed_at_ratio": true,
"autoadd_location": "/data/watched",
"plugins_location": "/config/plugins"
}

View File

@@ -0,0 +1,12 @@
{
"file": 1,
"format": 1
}{
"commands": [
[
"0",
"complete",
"/config/scripts/extract.sh"
]
]
}

View File

@@ -0,0 +1,7 @@
{
"file": 1,
"format": 1
}{
"use_name_folder": true,
"extract_path": "/downloads/deluge/"
}

View File

@@ -0,0 +1,26 @@
{
"file": 1,
"format": 1
}{
"labels": {
"main": {
"max_download_speed": -1,
"stop_at_ratio": true,
"apply_move_completed": false,
"apply_queue": true,
"auto_add": false,
"max_upload_slots": -1,
"prioritize_first_last": false,
"move_completed": false,
"max_connections": -1,
"is_auto_managed": true,
"max_upload_speed": -1,
"auto_add_trackers": [],
"remove_at_ratio": false,
"stop_ratio": 0,
"move_completed_path": "",
"apply_max": false
}
},
"torrent_labels": {}
}

View File

@@ -0,0 +1,34 @@
#!/bin/bash
# Copied from https://github.com/Radarr/Radarr/wiki/Common-Problems on August 19, 2018
# the Radarr script was originally sourced from https://dev.deluge-torrent.org/wiki/Plugins/Execute
formats=(zip rar)
commands=([zip]="unzip -u" [rar]="unrar -r -o- e")
extraction_subdir='deluge_extracted'
torrentid=$1
torrentname=$2
torrentpath=$3
log()
{
logger -t deluge-extractarchives "$@"
}
log "Torrent complete: $@"
cd "${torrentpath}"
for format in "${formats[@]}"; do
while read file; do
log "Extracting \"$file\""
cd "$(dirname "$file")"
file=$(basename "$file")
# if extraction_subdir is not empty, extract to subdirectory
if [[ ! -z "$extraction_subdir" ]] ; then
mkdir "$extraction_subdir"
cd "$extraction_subdir"
file="../$file"
fi
${commands[$format]} "$file"
done < <(find "$torrentpath/$torrentname" -iname "*.${format}" )
done

View File

@@ -0,0 +1,10 @@
# If there is a dependent image it seems that the docker-gc can only identify them
# using the image id
# If you pull them specifically it will use the tag otherwise it uses the imageid
#
# The file consists of the name of the image followed by the image id (can be either the short version or the long version)
#
####################################################################################################
clockworksoul/docker-gc-cron:latest
e61267dbe31b

View File

@@ -28,7 +28,6 @@
traefik.frontend.auth.forward.address: '{{gauth}}'
traefik.enable: 'true'
traefik.port: '{{intport}}'
traefik.frontend.rule: 'Host:{{pgrole}}.{{domain.stdout}},{{tldset}}'
- name: 'Setting PG Volumes'