From d4263027dbee5e2f6647d09d20415c94c0955f60 Mon Sep 17 00:00:00 2001 From: Luctia Date: Fri, 2 May 2025 16:09:26 +0200 Subject: [PATCH] Add Homarr support --- README.md | 8 +++++--- container_configs.py | 17 +++++++++++++++++ docker-compose.yml.sample | 12 ++++++++++++ main.py | 4 +++- 4 files changed, 37 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 7b1506f..db414cb 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,7 @@ It's set up to follow the [TRaSH guidelines](https://trash-guides.info/Hardlinks the process within Prowlarr is the same as for the other containers (add app). You'll have to add an API key within Mylar3, yourself. - [Audiobookshelf](https://www.audiobookshelf.org/) is a self-hosted audiobook and podcast server. +- [Homarr](https://homarr.dev/) is _a sleek, modern dashboard that puts all of your apps and services at your fingertips._ - [Prowlarr](https://wiki.servarr.com/prowlarr) can keep track of indexers, which are services that keep track of Torrent or UseNet links. One can search an indexer for certain content and find a where to download this. **Note**: when adding an indexer, please do not set the "seed ratio" to @@ -42,8 +43,8 @@ It's set up to follow the [TRaSH guidelines](https://trash-guides.info/Hardlinks - [Jellyseerr](https://github.com/Fallenbagel/jellyseerr) is like Overseerr, but for Jellyfin. ## Requirements -Currently this script only works on Linux. There is a chance that the sample docker compose file will work on Windows, although untested. -The only requirements other than that are **Python 3** and **docker** with **docker-compose-v2**. +Currently, this script only works on Linux. There is a chance that the sample docker compose file will work on Windows, +although untested. The only requirements other than that are **Python 3** and **docker** with **docker-compose-v2**. While this script _may_ work on docker-compose-v1 it's made to be and highly recommended to be run using v2. The easiest way to install these dependencies on Ubuntu and other Debian-based distors is by running: ``` @@ -73,7 +74,8 @@ If you're coming from an older version or reinstalling with different IDs, run ` 6. Take a look at the `docker-compose.yml` file. If there are services you would like to ignore (for example, running PleX and Jellyfin at the same time is a bit unusual), you can comment them out by placing `#` in front of the lines. This ensures they are ignored by Docker compose. - Double check that your .env file is set up properly. + Double check that your .env file is set up properly. Also make sure to add a newly generated encryption key to the + Homarr section, if you want to use it. 7. Run `docker compose up -d` to start the containers. If it complains about permissions run the following commands to add your current user to the docker group and apply changes: ``` sudo groupadd docker diff --git a/container_configs.py b/container_configs.py index b175190..1d7f439 100644 --- a/container_configs.py +++ b/container_configs.py @@ -17,6 +17,7 @@ class ContainerConfig: 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') def plex(self): @@ -213,6 +214,22 @@ class ContainerConfig: ' restart: unless-stopped\n\n' ) + def homarr(self): + key = os.urandom(124).hex() + return ( + ' homarr:\n' + ' image: ghcr.io/homarr-labs/homarr:latest\n' + ' container_name: homarr\n' + ' environment:\n' + ' - SECRET_ENCRYPTION_KEY=' + key + '\n' + ' volumes:\n' + ' - ' + self.homarr_dir + ':/appdata\n' + ' - /var/run/docker.sock:/var/run/docker.sock\n' + ' ports:\n' + ' - "7575:7575"\n' + ' restart: unless-stopped\n\n' + ) + def qbittorrent(self): return ( ' qbittorrent:\n' diff --git a/docker-compose.yml.sample b/docker-compose.yml.sample index 9e4ae6d..8259b80 100644 --- a/docker-compose.yml.sample +++ b/docker-compose.yml.sample @@ -145,6 +145,18 @@ services: ports: - "9696:9696" restart: unless-stopped + + homarr: + container_name: homarr + image: ghcr.io/homarr-labs/homarr:latest + restart: unless-stopped + volumes: + - /var/run/docker.sock:/var/run/docker.sock # Optional, only if you want docker integration + - ./homarr/appdata:/appdata + environment: + - SECRET_ENCRYPTION_KEY= + ports: + - "7575:7575" jackett: image: lscr.io/linuxserver/jackett:latest diff --git a/main.py b/main.py index f5e036c..22b240d 100644 --- a/main.py +++ b/main.py @@ -59,6 +59,8 @@ print('Use Mylar3? [Y/n]', end=" ") take_input('mylar3', 'servarr') print('Use Audiobookshelf? [Y/n]', end=" ") take_input('audiobookshelf', 'servarr') +print('Use Homarr? [Y/n]', end=" ") +take_input('homarr', 'servarr') if len(services_classed['servarr']) == 0: print('Warning: no media management services selected.') if services_classed['servarr'].__contains__('sonarr') or services_classed['servarr'].__contains__('radarr'): @@ -122,7 +124,7 @@ print('\n===CONFIGURATION===') print('Please enter your timezone (like "Europe/Amsterdam") or press enter to use your system\'s configured timezone:', end=' ') timezone = input() -if (timezone == ''): +if timezone == '': timezone = get_system_timezone() if len(timezone) == 0: # if user pressed enter and reading timezone from /etc/localtime failed then default to Amsterdam