Skip to content

Commit

Permalink
fix audiobookshelf folder structure
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavlogal committed Apr 28, 2024
1 parent cb7778d commit 586d486
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 18 deletions.
6 changes: 3 additions & 3 deletions container_configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,9 @@ def audiobookshelf(self):
' - TZ=' + self.timezone + '\n'
' volumes:\n'
' - ' + self.config_dir + '/audiobookshelf:/config\n'
' - ' + self.root_dir + '/data/audiobooks:/audiobooks\n'
' - ' + self.root_dir + '/data/podcasts:/podcasts\n'
' - ' + self.root_dir + '/data/metadata:/metadata\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'
' ports:\n'
' - "13378:80"\n'
' restart: unless-stopped\n\n'
Expand Down
18 changes: 3 additions & 15 deletions users_groups_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,19 @@ class UserGroupSetup:
def __init__(self, root_dir='/'):
self.root_dir = root_dir
os.system('sudo groupadd mediacenter -g 13000')
os.system('sudo usermod -a -G mediacenter $USER')

def create_config_dir(self, service_name):
os.system(
f'sudo mkdir -p {self.root_dir}/config/{service_name}-config'
f' ; sudo chown -R {service_name}:mediacenter {self.root_dir}/config/{service_name}-config'
f' ; sudo chown $(id -u):mediacenter {self.root_dir}/config'
)

def sonarr(self):
os.system(
'/bin/bash -c "sudo useradd sonarr -u 13001'
' ; sudo mkdir -pv ' + self.root_dir + '/data/{media,usenet,torrents}/tv -m 775'
' ; sudo chown -R sonarr:mediacenter ' + self.root_dir + '/data/{media,usenet,torrents}/tv'
' ; sudo chown $(id -u):mediacenter ' + self.root_dir + '/data'
' ; sudo chown $(id -u):mediacenter ' + self.root_dir + '/data/{media,usenet,torrents}"'
)
self.create_config_dir('sonarr')
os.system('sudo usermod -a -G mediacenter sonarr')
Expand All @@ -29,8 +27,6 @@ def radarr(self):
'/bin/bash -c "sudo useradd radarr -u 13002'
' ; sudo mkdir -pv ' + self.root_dir + '/data/{media,usenet,torrents}/movies -m 775'
' ; sudo chown -R radarr:mediacenter ' + self.root_dir + '/data/{media,usenet,torrents}/movies'
' ; sudo chown $(id -u):mediacenter ' + self.root_dir + '/data'
' ; sudo chown $(id -u):mediacenter ' + self.root_dir + '/data/{media,usenet,torrents}"'
)
self.create_config_dir('radarr')
os.system('sudo usermod -a -G mediacenter radarr')
Expand All @@ -40,8 +36,6 @@ def lidarr(self):
'/bin/bash -c "sudo useradd lidarr -u 13003'
' ; sudo mkdir -pv ' + self.root_dir + '/data/{media,usenet,torrents}/music -m 775'
' ; sudo chown -R lidarr:mediacenter ' + self.root_dir + '/data/{media,usenet,torrents}/music'
' ; sudo chown $(id -u):mediacenter ' + self.root_dir + '/data'
' ; sudo chown $(id -u):mediacenter ' + self.root_dir + '/data/{media,usenet,torrents}"'
)
self.create_config_dir('lidarr')
os.system('sudo usermod -a -G mediacenter lidarr')
Expand All @@ -51,8 +45,6 @@ def readarr(self):
'/bin/bash -c "sudo useradd readarr -u 13004'
' ; sudo mkdir -pv ' + self.root_dir + '/data/{media,usenet,torrents}/books -m 775'
' ; sudo chown -R readarr:mediacenter ' + self.root_dir + '/data/{media,usenet,torrents}/books'
' ; sudo chown $(id -u):mediacenter ' + self.root_dir + '/data'
' ; sudo chown $(id -u):mediacenter ' + self.root_dir + '/data/{media,usenet,torrents}"'
)
self.create_config_dir('readarr')
os.system('sudo usermod -a -G mediacenter readarr')
Expand All @@ -62,19 +54,15 @@ def mylar3(self):
'/bin/bash -c "sudo useradd mylar -u 13005'
' ; sudo mkdir -pv ' + self.root_dir + '/data/{media,usenet,torrents}/comics -m 775'
' ; sudo chown -R mylar:mediacenter ' + self.root_dir + '/data/{media,usenet,torrents}/comics'
' ; sudo chown $(id -u):mediacenter ' + self.root_dir + '/data'
' ; sudo chown $(id -u):mediacenter ' + self.root_dir + '/data/{media,usenet,torrents}"'
)
self.create_config_dir('mylar')
os.system('sudo usermod -a -G mediacenter mylar')

def audiobookshelf(self):
os.system(
'/bin/bash -c "sudo useradd audiobookshelf -u 13006'
' ; sudo mkdir -pv ' + self.root_dir + '/data/{media,usenet,torrents}/audiobooks -m 775'
' ; sudo chown -R audiobookshelf:mediacenter ' + self.root_dir + '/data/{media,usenet,torrents}/audiobooks'
' ; sudo chown $(id -u):mediacenter ' + self.root_dir + '/data'
' ; sudo chown $(id -u):mediacenter ' + self.root_dir + '/data/{media,usenet,torrents}"'
' ; sudo mkdir -pv ' + self.root_dir + '/data/media/{audiobooks,podcasts,audiobookshelf-metadata} -m 775'
' ; sudo chown -R audiobookshelf:mediacenter ' + self.root_dir + '/data/media/{audiobooks,podcasts,audiobookshelf-metadata}'
)
self.create_config_dir('audiobookshelf')
os.system('sudo usermod -a -G mediacenter audiobookshelf')
Expand Down

0 comments on commit 586d486

Please sign in to comment.