Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
120 changes: 61 additions & 59 deletions container_configs.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import getpass
import os
import pwd

class ContainerConfig:
def __init__(self,
Expand All @@ -8,17 +10,17 @@ def __init__(self,
):
self.root_dir = root_dir
self.timezone = timezone
self.config_dir = root_dir + '/config'
self.config_dir = f'{root_dir}/config'
self.plex_claim = plex_claim
self.movie_dir = root_dir + '/media/movies'
self.tv_dir = root_dir + '/media/tv'
self.music_dir = root_dir + '/media/music'
self.book_dir = root_dir + '/media/books'
self.comic_dir = root_dir + '/media/comics'
self.torrent_dir = root_dir + '/data/torrents'
self.usenet_dir = root_dir + '/data/usenet'
self.homarr_dir = root_dir + '/data/homarr/appdata'
self.UID = os.popen('id -u').read().rstrip('\n')
self.movie_dir = f'{root_dir}/media/movies'
self.tv_dir = f'{root_dir}/media/tv'
self.music_dir = f'{root_dir}/media/music'
self.book_dir = f'{root_dir}/media/books'
self.comic_dir = f'{root_dir}/media/comics'
self.torrent_dir = f'{root_dir}/data/torrents'
self.usenet_dir = f'{root_dir}/data/usenet'
self.homarr_dir = f'{root_dir}/data/homarr/appdata'
self.UID = pwd.getpwnam(getpass.getuser()).pw_uid

def plex(self):
return (
Expand All @@ -30,10 +32,10 @@ def plex(self):
' - PUID=13010\n'
' - PGID=13000\n'
' - VERSION=docker\n'
' - PLEX_CLAIM=' + self.plex_claim + '\n'
f' - PLEX_CLAIM={self.plex_claim}\n'
' volumes:\n'
' - ' + self.config_dir + '/plex-config:/config\n'
' - ' + self.root_dir + '/data/media:/media\n'
f' - {self.config_dir}/plex-config:/config\n'
f' - {self.root_dir}/data/media:/media\n'
' restart: unless-stopped\n\n'
)

Expand All @@ -45,11 +47,11 @@ def tautulli(self):
' depends_on:\n'
' - plex\n'
' environment:\n'
' - PUID='+ self.UID + '\n'
f' - PUID={self.UID}\n'
' - PGID=13000\n'
' - TZ=' + self.timezone + '\n'
f' - TZ={self.timezone}\n'
' volumes:\n'
' - ' + self.config_dir + '/tautulli-config:/config\n'
f' - {self.config_dir}/tautulli-config:/config\n'
' ports:\n'
' - "8181:8181"\n'
' restart: unless-stopped\n\n'
Expand All @@ -61,13 +63,13 @@ def jellyfin(self):
' image: lscr.io/linuxserver/jellyfin:latest\n'
' container_name: jellyfin\n'
' environment:\n'
' - PUID='+ self.UID + '\n'
f' - PUID={self.UID}\n'
' - PGID=13000\n'
' - UMASK=002\n'
' - TZ=' + self.timezone + '\n'
f' - TZ={self.timezone}\n'
' volumes:\n'
' - ' + self.config_dir + '/jellyfin-config:/config\n'
' - ' + self.root_dir + '/data/media:/data\n'
f' - {self.config_dir}/jellyfin-config:/config\n'
f' - {self.root_dir}/data/media:/data\n'
' ports:\n'
' - "8096:8096"\n'
' restart: unless-stopped\n\n'
Expand All @@ -82,10 +84,10 @@ def sonarr(self):
' - PUID=13001\n'
' - PGID=13000\n'
' - UMASK=002\n'
' - TZ=' + self.timezone + '\n'
f' - TZ={self.timezone}\n'
' volumes:\n'
' - ' + self.config_dir + '/sonarr-config:/config\n'
' - ' + self.root_dir + '/data:/data\n'
f' - {self.config_dir}/sonarr-config:/config\n'
f' - {self.root_dir}/data:/data\n'
' ports:\n'
' - "8989:8989"\n'
' restart: unless-stopped\n\n'
Expand All @@ -100,10 +102,10 @@ def radarr(self):
' - PUID=13002\n'
' - PGID=13000\n'
' - UMASK=002\n'
' - TZ=' + self.timezone + '\n'
f' - TZ={self.timezone}\n'
' volumes:\n'
' - ' + self.config_dir + '/radarr-config:/config\n'
' - ' + self.root_dir + '/data:/data\n'
f' - {self.config_dir}/radarr-config:/config\n'
f' - {self.root_dir}/data:/data\n'
' ports:\n'
' - "7878:7878"\n'
' restart: unless-stopped\n\n'
Expand All @@ -117,10 +119,10 @@ def bazarr(self):
' environment:\n'
' - PUID=13013\n'
' - PGID=13000\n'
' - TZ=' + self.timezone + '\n'
f' - TZ={self.timezone}\n'
' volumes:\n'
' - ' + self.config_dir + '/bazarr-config:/config\n'
' - ' + self.root_dir + '/data/media:/media\n'
f' - {self.config_dir}/bazarr-config:/config\n'
f' - {self.root_dir}/data/media:/media\n'
' ports:\n'
' - "6767:6767"\n'
' restart: unless-stopped\n\n'
Expand All @@ -135,10 +137,10 @@ def lidarr(self):
' - PUID=13003\n'
' - PGID=13000\n'
' - UMASK=002\n'
' - TZ=' + self.timezone + '\n'
f' - TZ={self.timezone}\n'
' volumes:\n'
' - ' + self.config_dir + '/lidarr-config:/config\n'
' - ' + self.root_dir + '/data:/data\n'
f' - {self.config_dir}/lidarr-config:/config\n'
f' - {self.root_dir}/data:/data\n'
' ports:\n'
' - "8686:8686"\n'
' restart: unless-stopped\n\n'
Expand All @@ -153,10 +155,10 @@ def readarr(self):
' - PUID=13004\n'
' - PGID=13000\n'
' - UMASK=002\n'
' - TZ=' + self.timezone + '\n'
f' - TZ={self.timezone}\n'
' volumes:\n'
' - ' + self.config_dir + '/readarr-config:/config\n'
' - ' + self.root_dir + '/data:/data\n'
f' - {self.config_dir}/readarr-config:/config\n'
f' - {self.root_dir}/data:/data\n'
' ports:\n'
' - "8787:8787"\n'
' restart: unless-stopped\n\n'
Expand All @@ -172,8 +174,8 @@ def mylar3(self):
' - PGID=13000\n'
' - UMASK=002\n'
' volumes:\n'
' - ' + self.config_dir + '/mylar-config:/config\n'
' - ' + self.root_dir + '/data:/data\n'
f' - {self.config_dir}/mylar-config:/config\n'
f' - {self.root_dir}/data:/data\n'
' ports:\n'
' - "8090:8090"\n'
' restart: unless-stopped\n\n'
Expand All @@ -186,12 +188,12 @@ def audiobookshelf(self):
' container_name: audiobookshelf\n'
' environment:\n'
' - user=13014:13000\n'
' - TZ=' + self.timezone + '\n'
f' - TZ={self.timezone}\n'
' volumes:\n'
' - ' + self.config_dir + '/audiobookshelf:/config\n'
' - ' + self.root_dir + '/data/media/audiobooks:/audiobooks\n'
' - ' + self.root_dir + '/data/media/podcasts:/podcasts\n'
' - ' + self.root_dir + '/data/media/audiobookshelf-metadata:/metadata\n'
f' - {self.config_dir}/audiobookshelf:/config\n'
f' - {self.root_dir}/data/media/audiobooks:/audiobooks\n'
f' - {self.root_dir}/data/media/podcasts:/podcasts\n'
f' - {self.root_dir}/data/media/audiobookshelf-metadata:/metadata\n'
' ports:\n'
' - "13378:80"\n'
' restart: unless-stopped\n\n'
Expand All @@ -206,9 +208,9 @@ def prowlarr(self):
' - PUID=13006\n'
' - PGID=13000\n'
' - UMASK=002\n'
' - TZ=' + self.timezone + '\n'
f' - TZ={self.timezone}\n'
' volumes:\n'
' - ' + self.config_dir + '/prowlarr-config:/config\n'
f' - {self.config_dir}/prowlarr-config:/config\n'
' ports:\n'
' - "9696:9696"\n'
' restart: unless-stopped\n\n'
Expand All @@ -221,9 +223,9 @@ def homarr(self):
' image: ghcr.io/homarr-labs/homarr:latest\n'
' container_name: homarr\n'
' environment:\n'
' - SECRET_ENCRYPTION_KEY=' + key + '\n'
f' - SECRET_ENCRYPTION_KEY={key}\n'
' volumes:\n'
' - ' + self.homarr_dir + ':/appdata\n'
f' - {self.homarr_dir}:/appdata\n'
' - /var/run/docker.sock:/var/run/docker.sock\n'
' ports:\n'
' - "7575:7575"\n'
Expand All @@ -239,11 +241,11 @@ def qbittorrent(self):
' - PUID=13007\n'
' - PGID=13000\n'
' - UMASK=002\n'
' - TZ=' + self.timezone + '\n'
f' - TZ={self.timezone}\n'
' - WEBUI_PORT=8080\n'
' volumes:\n'
' - ' + self.config_dir + '/qbittorrent-config:/config\n'
' - ' + self.torrent_dir + ':/data/torrents\n'
f' - {self.config_dir}/qbittorrent-config:/config\n'
f' - {self.torrent_dir}:/data/torrents\n'
' ports:\n'
' - "8080:8080"\n'
' - "6881:6881"\n'
Expand All @@ -260,9 +262,9 @@ def overseerr(self):
' - PUID=13009\n'
' - PGID=13000\n'
' - UMASK=002\n'
' - TZ=' + self.timezone + '\n'
f' - TZ={self.timezone}\n'
' volumes:\n'
' - ' + self.config_dir + '/overseerr-config:/app/config\n'
f' - {self.config_dir}/overseerr-config:/app/config\n'
' ports:\n'
' - "5055:5055"\n'
' restart: unless-stopped\n\n'
Expand All @@ -277,9 +279,9 @@ def jellyseerr(self):
' - PUID=13012\n'
' - PGID=13000\n'
' - UMASK=002\n'
' - TZ=' + self.timezone + '\n'
f' - TZ={self.timezone}\n'
' volumes:\n'
' - ' + self.config_dir + '/jellyseerr-config:/app/config\n'
f' - {self.config_dir}/jellyseerr-config:/app/config\n'
' ports:\n'
' - "5056:5055"\n'
' restart: unless-stopped\n\n'
Expand All @@ -294,10 +296,10 @@ def sabnzbd(self):
' - PUID=13011\n'
' - PGID=13000\n'
' - UMASK=002\n'
' - TZ=' + self.timezone + '\n'
f' - TZ={self.timezone}\n'
' volumes:\n'
' - ' + self.config_dir + '/sabnzbd-config:/config\n'
' - ' + self.usenet_dir + ':/data/usenet\n'
f' - {self.config_dir}/sabnzbd-config:/config\n'
f' - {self.usenet_dir}:/data/usenet\n'
' ports:\n'
' - "8081:8080"\n'
' restart: unless-stopped\n\n'
Expand All @@ -312,9 +314,9 @@ def jackett(self):
' - PUID=13008\n'
' - PGID=13000\n'
' - UMASK=002\n'
' - TZ=' + self.timezone + '\n'
f' - TZ={self.timezone}\n'
' volumes:\n'
' - ' + self.config_dir + '/jackett-config:/config\n'
f' - {self.config_dir}/jackett-config:/config\n'
' ports:\n'
' - 9117:9117\n'
' restart: unless-stopped\n\n'
Expand All @@ -329,7 +331,7 @@ def flaresolverr(self):
' - LOG_LEVEL=${LOG_LEVEL:-info}\n'
' - LOG_HTML=${LOG_HTML:-false}\n'
' - CAPTCHA_SOLVER=${CAPTCHA_SOLVER:-none}\n'
' - TZ=' + self.timezone + '\n'
f' - TZ={self.timezone}\n'
' ports:\n'
' - "8191:8191"\n'
' restart: unless-stopped\n\n'
Expand Down
Loading
Loading