From 73de2951b299cbd2a8f044de410c77dcd739843f Mon Sep 17 00:00:00 2001 From: juftin Date: Wed, 10 Apr 2024 18:02:31 -0600 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20apps=20+=20appdata?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 8 +- README.md | 83 +++++++++---------- {stacks => apps}/archive/nzbget.yaml | 2 +- {stacks/media => apps}/calibre-web.yaml | 4 +- {stacks/media => apps}/calibre.yaml | 2 +- .../chat-gpt-next-web.yaml | 0 .../chatgpt-in-slack.yaml | 0 {stacks/core => apps}/duckdns.yaml | 0 {stacks/media => apps}/heimdall.yaml | 2 +- .../homeassistant/configuration.yaml | 0 .../homeassistant/docker-compose.yaml | 4 +- .../miscellaneous => apps}/libreoffice.yaml | 2 +- {stacks/media => apps}/nzbhydra.yaml | 2 +- {stacks/core => apps}/oauth.yaml | 0 {stacks/media => apps}/ombi.yaml | 2 +- {stacks/utilities => apps}/pihole.yaml | 4 +- {stacks/media => apps}/plex.yaml | 3 +- {stacks/utilities => apps}/portainer.yaml | 3 +- {stacks/utilities => apps}/postgres.yaml | 2 +- {stacks/media => apps}/prowlarr.yaml | 2 +- {stacks/media => apps}/radarr.yaml | 3 +- {stacks/media => apps}/readarr.yaml | 4 +- {stacks/media => apps}/sabnzbd.yaml | 2 +- {stacks/utilities => apps}/sftpgo.yaml | 4 +- {stacks/core => apps}/socket-proxy.yaml | 0 {stacks/media => apps}/sonarr.yaml | 3 +- {stacks/media => apps}/tautulli.yaml | 5 +- .../core => apps}/traefik/docker-compose.yaml | 8 +- .../traefik/rules/middlewares-chains.yml | 0 .../traefik/rules/middlewares.yml | 0 .../core => apps}/traefik/rules/tls-opts.yml | 0 {stacks/media => apps}/transmission.yaml | 3 +- {stacks/miscellaneous => apps}/umami.yaml | 0 {stacks/utilities => apps}/watchtower.yaml | 0 docker-compose.yaml | 54 ++++++------ docs/applications/core.md | 2 +- docs/applications/media.md | 4 +- docs/applications/miscellaneous.md | 6 +- docs/applications/utilities.md | 2 +- docs/cli.md | 10 +-- docs/config.md | 6 +- docs/index.md | 83 +++++++++---------- docs/migrations.md | 28 +++++++ docs/traefik.md | 18 ++-- mkdocs.yaml | 8 +- 45 files changed, 194 insertions(+), 184 deletions(-) rename {stacks => apps}/archive/nzbget.yaml (94%) rename {stacks/media => apps}/calibre-web.yaml (90%) rename {stacks/media => apps}/calibre.yaml (94%) rename {stacks/miscellaneous => apps}/chat-gpt-next-web.yaml (100%) rename {stacks/miscellaneous => apps}/chatgpt-in-slack.yaml (100%) rename {stacks/core => apps}/duckdns.yaml (100%) rename {stacks/media => apps}/heimdall.yaml (93%) rename {stacks/miscellaneous => apps}/homeassistant/configuration.yaml (100%) rename {stacks/miscellaneous => apps}/homeassistant/docker-compose.yaml (82%) rename {stacks/miscellaneous => apps}/libreoffice.yaml (93%) rename {stacks/media => apps}/nzbhydra.yaml (94%) rename {stacks/core => apps}/oauth.yaml (100%) rename {stacks/media => apps}/ombi.yaml (93%) rename {stacks/utilities => apps}/pihole.yaml (87%) rename {stacks/media => apps}/plex.yaml (85%) rename {stacks/utilities => apps}/portainer.yaml (89%) rename {stacks/utilities => apps}/postgres.yaml (92%) rename {stacks/media => apps}/prowlarr.yaml (93%) rename {stacks/media => apps}/radarr.yaml (89%) rename {stacks/media => apps}/readarr.yaml (90%) rename {stacks/media => apps}/sabnzbd.yaml (94%) rename {stacks/utilities => apps}/sftpgo.yaml (87%) rename {stacks/core => apps}/socket-proxy.yaml (100%) rename {stacks/media => apps}/sonarr.yaml (89%) rename {stacks/media => apps}/tautulli.yaml (82%) rename {stacks/core => apps}/traefik/docker-compose.yaml (93%) rename {stacks/core => apps}/traefik/rules/middlewares-chains.yml (100%) rename {stacks/core => apps}/traefik/rules/middlewares.yml (100%) rename {stacks/core => apps}/traefik/rules/tls-opts.yml (100%) rename {stacks/media => apps}/transmission.yaml (92%) rename {stacks/miscellaneous => apps}/umami.yaml (100%) rename {stacks/utilities => apps}/watchtower.yaml (100%) diff --git a/Makefile b/Makefile index 3a24044..63336f3 100644 --- a/Makefile +++ b/Makefile @@ -75,10 +75,10 @@ media-logs: ## Show the logs for the media services (plex, sonarr, radarr, etc). .PHONY: config-acme config-acme: ## Initialize the acme.json file. - mkdir -p appdata/core/traefik/acme/ - rm -f appdata/core/traefik/acme/acme.json - touch appdata/core/traefik/acme/acme.json - chmod 600 appdata/core/traefik/acme/acme.json + mkdir -p appdata/traefik/acme/ + rm -f appdata/traefik/acme/acme.json + touch appdata/traefik/acme/acme.json + chmod 600 appdata/traefik/acme/acme.json ##@ Backup 🗂️ diff --git a/README.md b/README.md index 357218a..7aaed7f 100644 --- a/README.md +++ b/README.md @@ -16,20 +16,22 @@ ## What is homelab? **`homelab`** is a collection of services that can be deployed from your home server and accessed -securely from anywhere in the world. This project deploys multiple "stacks" of services: +securely from anywhere in the world. Ultimately everything is deployed into a single +docker compose application. Each service belongs to a [docker compose profile] - and the +`Makefile` contains everything you need to get started and manage your homelab. -- **`core`**: The `core` stack is the base of this project, it includes a [traefik] reverse proxy +- **`core`**: The `core` profile is the base of this project, it includes a [traefik] reverse proxy and [OAuth] service that allows you to access all of your services via a single domain name securely behind HTTPS and protected with Google OAuth. -- **`media`**: The `media` stack includes services like [Plex], [Sonarr], [Radarr], and - [Ombi] that allow you to request, download, organize, and stream media to your devices. This stack +- **`media`**: The `media` profile includes services like [Plex], [Sonarr], [Radarr], and + [Ombi] that allow you to request, download, organize, and stream media to your devices. This profile is perfect for those who want to have a media server in their homelab. -- **`utilities`**: The `utilities` stack includes services like [Watchtower] and [Portainer] that +- **`utilities`**: The `utilities` profile includes services like [Watchtower] and [Portainer] that are designed to help you manage your homelab, monitor your services, and keep your containers up-to-date. -- **`miscellaneous`**: The `miscellaneous` stack is disabled by default. +- **`miscellaneous`**: The `miscellaneous` profile is disabled by default. It includes services like [ChatGPT Next Web] and [LibreOffice Online] - that don't fit into the other stacks. These services are great for improving your + that don't fit into the other profiles. These services are great for improving your productivity and adding some fun to your homelab. ## How does it work? @@ -39,46 +41,38 @@ project that allows you to deploy a variety of services to your homelab. At the root of this repository is a `docker-compose.yaml` file that defines the entire homelab project - it uses the `include` directive to pull in -individual service docker compose files from the `stacks` directory. -Ultimately a single docker compose stack is created that deploys everything. +individual service docker compose files from the `apps` directory. ```text . -├── docker-compose.yaml # Main Docker Compose File -├── .env # Environment Variables and Configuration -├── Makefile # Makefile for common tasks and docker compose wrappers -├── secrets # Secret Files -│ ├── cloudflare_api_key.secret # Cloudflare API Key -│ └── google_oauth.secret # Google OAuth Credentials and Whitelist -├── stacks -│ ├── media -│ │ ├── plex.yaml # Each individual service has its own docker compose file -│ │ ├── radarr.yaml -│ | ├── ombi.yaml -│ │ └── sonarr.yaml -│ ├── core # Traefik Reverse Proxy and OAuth -│ │ ├── oauth # OAuth Service -│ │ └── traefik # Traefik Reverse Proxy -│ │ ├── docker-compose.yaml # Traefik Docker Compose File (Traefik Only) -│ │ └── rules # Traefik Middlewares and Rules -│ │ ├── middlewares-chains.yml -│ │ ├── middlewares.yml -│ │ └── tls-opts.yml -│ ├── miscellaneous # Non Media Center Services (pihole, chat-gpt-next-web, etc.) -│ │ └── chat-gpt-next-web.yaml -│ └── utilities # Utility Services -│ └── watchtower.yaml -└── appdata # Application Data Persistent Volumes - ├── media - │ ├── plex # Each individual service has its own subdirectory - │ └── sonarr - ├── core - │ ├── oauth - │ └── traefik - ├── miscellaneous - │ └── chat-gpt-next-web - └── utilities - └── watchtower +├── docker-compose.yaml # Main Docker Compose File +├── .env # Environment Variables and Configuration +├── Makefile # Makefile for common tasks and docker compose wrappers +├── secrets # Secret Files +│ ├── cloudflare_api_key.secret # Cloudflare API Key +│ └── google_oauth.secret # Google OAuth Credentials and Whitelist +├── apps # Individual Service Docker Compose Files +│ ├── plex.yaml +│ ├── radarr.yaml +│ ├── ombi.yaml +│ ├── sonarr.yaml +│ ├── oauth.yaml +│ ├── chat-gpt-next-web.yaml +│ ├── watchtower.yaml +│ └── traefik # Traefik Reverse Proxy +│ ├── docker-compose.yaml # Traefik Docker Compose File +│ └── rules # Traefik Middlewares and Rules +│ ├── middlewares-chains.yml +│ ├── middlewares.yml +│ └── tls-opts.yml +└── appdata # Application Data Persistent Volumes + ├── plex # Each individual service has its own subdirectory + ├── sonarr + ├── oauth + ├── traefik + ├── chat-gpt-next-web + ├── utilities + └── watchtower ``` ### Configuration @@ -105,3 +99,4 @@ getting started. [Watchtower]: https://github.com/containrrr/watchtower [LibreOffice Online]: https://www.libreoffice.org/ [Portainer]: https://github.com/portainer/portainer +[docker compose profile]: https://docs.docker.com/compose/profiles/ diff --git a/stacks/archive/nzbget.yaml b/apps/archive/nzbget.yaml similarity index 94% rename from stacks/archive/nzbget.yaml rename to apps/archive/nzbget.yaml index 95a9bf4..fc1edf9 100644 --- a/stacks/archive/nzbget.yaml +++ b/apps/archive/nzbget.yaml @@ -8,7 +8,7 @@ services: image: lscr.io/linuxserver/nzbget:latest profiles: ["media", "all"] volumes: - - ${DOCKER_DIRECTORY}/appdata/media/nzbget:/config + - ${DOCKER_DIRECTORY}/appdata/nzbget:/config - ${COMPLETED_DOWNLOADS}:/downloads/completed environment: PUID: ${PUID} diff --git a/stacks/media/calibre-web.yaml b/apps/calibre-web.yaml similarity index 90% rename from stacks/media/calibre-web.yaml rename to apps/calibre-web.yaml index d6a8aa9..5f701df 100644 --- a/stacks/media/calibre-web.yaml +++ b/apps/calibre-web.yaml @@ -9,9 +9,9 @@ services: image: lscr.io/linuxserver/calibre-web:latest profiles: ["media", "all"] volumes: - - ${DOCKER_DIRECTORY}/appdata/media/calibre-web:/config + - ${DOCKER_DIRECTORY}/appdata/calibre-web:/config - ${BOOKS_DIR}:/books - - ${DOCKER_DIRECTORY}/appdata/media/calibre:/calibre-config + - ${DOCKER_DIRECTORY}/appdata/calibre:/calibre-config environment: PUID: ${PUID} PGID: ${PGID} diff --git a/stacks/media/calibre.yaml b/apps/calibre.yaml similarity index 94% rename from stacks/media/calibre.yaml rename to apps/calibre.yaml index 5a49fdd..300eeef 100644 --- a/stacks/media/calibre.yaml +++ b/apps/calibre.yaml @@ -9,7 +9,7 @@ services: image: lscr.io/linuxserver/calibre:latest profiles: ["media", "all"] volumes: - - ${DOCKER_DIRECTORY}/appdata/media/calibre:/config + - ${DOCKER_DIRECTORY}/appdata/calibre:/config - ${BOOKS_DIR}:/books - ${COMPLETED_DOWNLOADS}:/downloads environment: diff --git a/stacks/miscellaneous/chat-gpt-next-web.yaml b/apps/chat-gpt-next-web.yaml similarity index 100% rename from stacks/miscellaneous/chat-gpt-next-web.yaml rename to apps/chat-gpt-next-web.yaml diff --git a/stacks/miscellaneous/chatgpt-in-slack.yaml b/apps/chatgpt-in-slack.yaml similarity index 100% rename from stacks/miscellaneous/chatgpt-in-slack.yaml rename to apps/chatgpt-in-slack.yaml diff --git a/stacks/core/duckdns.yaml b/apps/duckdns.yaml similarity index 100% rename from stacks/core/duckdns.yaml rename to apps/duckdns.yaml diff --git a/stacks/media/heimdall.yaml b/apps/heimdall.yaml similarity index 93% rename from stacks/media/heimdall.yaml rename to apps/heimdall.yaml index 7521ac6..b27f050 100644 --- a/stacks/media/heimdall.yaml +++ b/apps/heimdall.yaml @@ -8,7 +8,7 @@ services: image: lscr.io/linuxserver/heimdall:latest profiles: ["media", "all"] volumes: - - ${DOCKER_DIRECTORY}/appdata/media/heimdall:/config + - ${DOCKER_DIRECTORY}/appdata/heimdall:/config environment: PUID: ${PUID} PGID: ${PGID} diff --git a/stacks/miscellaneous/homeassistant/configuration.yaml b/apps/homeassistant/configuration.yaml similarity index 100% rename from stacks/miscellaneous/homeassistant/configuration.yaml rename to apps/homeassistant/configuration.yaml diff --git a/stacks/miscellaneous/homeassistant/docker-compose.yaml b/apps/homeassistant/docker-compose.yaml similarity index 82% rename from stacks/miscellaneous/homeassistant/docker-compose.yaml rename to apps/homeassistant/docker-compose.yaml index 76e124f..30b53ee 100644 --- a/stacks/miscellaneous/homeassistant/docker-compose.yaml +++ b/apps/homeassistant/docker-compose.yaml @@ -4,8 +4,8 @@ services: image: homeassistant/home-assistant:stable profiles: ["miscellaneous", "all"] volumes: - - ${DOCKER_DIRECTORY}/stacks/miscellaneous/homeassistant/configuration.yaml:/config/configuration.yaml - - ${DOCKER_DIRECTORY}/appdata/miscellaneous/homeassistant:/config + - ${DOCKER_DIRECTORY}/apps/homeassistant/configuration.yaml:/config/configuration.yaml + - ${DOCKER_DIRECTORY}/appdata/homeassistant:/config environment: PUID: ${PUID} PGID: ${PGID} diff --git a/stacks/miscellaneous/libreoffice.yaml b/apps/libreoffice.yaml similarity index 93% rename from stacks/miscellaneous/libreoffice.yaml rename to apps/libreoffice.yaml index 79a8393..f5d92ec 100644 --- a/stacks/miscellaneous/libreoffice.yaml +++ b/apps/libreoffice.yaml @@ -13,7 +13,7 @@ services: - PGID=${PGID} - TZ=${TZ} volumes: - - ${DOCKER_DIRECTORY}/appdata/miscellaneous/libreoffice:/config + - ${DOCKER_DIRECTORY}/appdata/libreoffice:/config security_opt: - no-new-privileges:true networks: diff --git a/stacks/media/nzbhydra.yaml b/apps/nzbhydra.yaml similarity index 94% rename from stacks/media/nzbhydra.yaml rename to apps/nzbhydra.yaml index 0456b4c..09fe089 100644 --- a/stacks/media/nzbhydra.yaml +++ b/apps/nzbhydra.yaml @@ -8,7 +8,7 @@ services: image: lscr.io/linuxserver/nzbhydra2:latest profiles: ["media", "all"] volumes: - - ${DOCKER_DIRECTORY}/appdata/media/nzbhydra:/config + - ${DOCKER_DIRECTORY}/appdata/nzbhydra:/config - ${COMPLETED_DOWNLOADS}:/downloads environment: PUID: ${PUID} diff --git a/stacks/core/oauth.yaml b/apps/oauth.yaml similarity index 100% rename from stacks/core/oauth.yaml rename to apps/oauth.yaml diff --git a/stacks/media/ombi.yaml b/apps/ombi.yaml similarity index 93% rename from stacks/media/ombi.yaml rename to apps/ombi.yaml index d580115..c6c4b59 100644 --- a/stacks/media/ombi.yaml +++ b/apps/ombi.yaml @@ -12,7 +12,7 @@ services: PGID: ${PGID} TZ: ${TZ} volumes: - - ${DOCKER_DIRECTORY}/appdata/media/ombi:/config + - ${DOCKER_DIRECTORY}/appdata/ombi:/config security_opt: - no-new-privileges:true restart: ${UNIVERSAL_RESTART_POLICY:-unless-stopped} diff --git a/stacks/utilities/pihole.yaml b/apps/pihole.yaml similarity index 87% rename from stacks/utilities/pihole.yaml rename to apps/pihole.yaml index ffbf95f..96914f9 100644 --- a/stacks/utilities/pihole.yaml +++ b/apps/pihole.yaml @@ -14,8 +14,8 @@ services: DNS2: 8.8.4.4 VIRTUAL_HOST: ${PIHOLE_SUBDOMAIN:-pihole}.${DOMAIN_NAME} volumes: - - ${DOCKER_DIRECTORY}/appdata/utilities/pihole/pihole/:/etc/pihole/ - - ${DOCKER_DIRECTORY}/appdata/utilities/pihole/dnsmasq.d/:/etc/dnsmasq.d/ + - ${DOCKER_DIRECTORY}/appdata/pihole/pihole/:/etc/pihole/ + - ${DOCKER_DIRECTORY}/appdata/pihole/dnsmasq.d/:/etc/dnsmasq.d/ networks: traefik: ports: diff --git a/stacks/media/plex.yaml b/apps/plex.yaml similarity index 85% rename from stacks/media/plex.yaml rename to apps/plex.yaml index 3926ed1..c70f8e3 100644 --- a/stacks/media/plex.yaml +++ b/apps/plex.yaml @@ -9,10 +9,9 @@ services: profiles: ["media", "all"] network_mode: host volumes: - - ${DOCKER_DIRECTORY}/appdata/media/plex:/config + - ${DOCKER_DIRECTORY}/appdata/plex:/config - ${TV_DIR}:/tv - ${MOVIE_DIR}:/movies - - ${DOCKER_DIRECTORY}/stacks/media/shared:/shared - ${PLEX_TRANSCODE_DIR:-/tmp}:/transcode - ${BOOKS_DIR}:/books devices: diff --git a/stacks/utilities/portainer.yaml b/apps/portainer.yaml similarity index 89% rename from stacks/utilities/portainer.yaml rename to apps/portainer.yaml index b4d353a..4c2b79d 100644 --- a/stacks/utilities/portainer.yaml +++ b/apps/portainer.yaml @@ -9,8 +9,7 @@ services: image: portainer/portainer-ce:latest profiles: ["utilities", "all"] volumes: - - ${DOCKER_DIRECTORY}/appdata/utilities/portainer:/data - - ${DOCKER_DIRECTORY}/stacks/utilities/shared:/shared + - ${DOCKER_DIRECTORY}/appdata/portainer:/data command: -H tcp://socket-proxy:2375 environment: TZ: ${TZ} diff --git a/stacks/utilities/postgres.yaml b/apps/postgres.yaml similarity index 92% rename from stacks/utilities/postgres.yaml rename to apps/postgres.yaml index 559c666..bd2b352 100644 --- a/stacks/utilities/postgres.yaml +++ b/apps/postgres.yaml @@ -18,7 +18,7 @@ services: networks: internal: volumes: - - ${DOCKER_DIRECTORY}/appdata/utilities/homelab-postgres:/var/lib/postgresql/data + - ${DOCKER_DIRECTORY}/appdata/homelab-postgres:/var/lib/postgresql/data - ${DOCKER_DIRECTORY}/scripts/create-databases.sh:/docker-entrypoint-initdb.d/create-databases.sh restart: always healthcheck: diff --git a/stacks/media/prowlarr.yaml b/apps/prowlarr.yaml similarity index 93% rename from stacks/media/prowlarr.yaml rename to apps/prowlarr.yaml index a8465f6..c970d9b 100644 --- a/stacks/media/prowlarr.yaml +++ b/apps/prowlarr.yaml @@ -8,7 +8,7 @@ services: image: lscr.io/linuxserver/prowlarr:develop profiles: ["media", "arrs", "all"] volumes: - - ${DOCKER_DIRECTORY}/appdata/media/prowlarr:/config + - ${DOCKER_DIRECTORY}/appdata/prowlarr:/config environment: PUID: ${PUID} PGID: ${PGID} diff --git a/stacks/media/radarr.yaml b/apps/radarr.yaml similarity index 89% rename from stacks/media/radarr.yaml rename to apps/radarr.yaml index f74b5d2..7bbb184 100644 --- a/stacks/media/radarr.yaml +++ b/apps/radarr.yaml @@ -8,10 +8,9 @@ services: image: lscr.io/linuxserver/radarr:latest profiles: ["media", "arrs", "all"] volumes: - - ${DOCKER_DIRECTORY}/appdata/media/radarr:/config + - ${DOCKER_DIRECTORY}/appdata/radarr:/config - ${COMPLETED_DOWNLOADS}:/downloads - ${MOVIE_DIR}:/movies - - ${DOCKER_DIRECTORY}/stacks/media/shared:/shared environment: PUID: ${PUID} PGID: ${PGID} diff --git a/stacks/media/readarr.yaml b/apps/readarr.yaml similarity index 90% rename from stacks/media/readarr.yaml rename to apps/readarr.yaml index 1b53dd8..faaba7b 100644 --- a/stacks/media/readarr.yaml +++ b/apps/readarr.yaml @@ -9,10 +9,10 @@ services: image: lscr.io/linuxserver/readarr:develop profiles: ["media", "arrs", "all"] volumes: - - ${DOCKER_DIRECTORY}/appdata/media/readarr:/config + - ${DOCKER_DIRECTORY}/appdata/readarr:/config - ${COMPLETED_DOWNLOADS}:/downloads - ${BOOKS_DIR}:/books - - ${DOCKER_DIRECTORY}/appdata/media/calibre:/calibre + - ${DOCKER_DIRECTORY}/appdata/calibre:/calibre environment: PUID: ${PUID} PGID: ${PGID} diff --git a/stacks/media/sabnzbd.yaml b/apps/sabnzbd.yaml similarity index 94% rename from stacks/media/sabnzbd.yaml rename to apps/sabnzbd.yaml index 64df741..bfc67d9 100644 --- a/stacks/media/sabnzbd.yaml +++ b/apps/sabnzbd.yaml @@ -8,7 +8,7 @@ services: image: lscr.io/linuxserver/sabnzbd:latest profiles: ["media", "all"] volumes: - - ${DOCKER_DIRECTORY}/appdata/media/sabnzbd:/config + - ${DOCKER_DIRECTORY}/appdata/sabnzbd:/config - ${COMPLETED_DOWNLOADS}:/downloads - ${INCOMPLETE_DOWNLOADS}:/incomplete-downloads environment: diff --git a/stacks/utilities/sftpgo.yaml b/apps/sftpgo.yaml similarity index 87% rename from stacks/utilities/sftpgo.yaml rename to apps/sftpgo.yaml index 0a4b8eb..4b7f377 100644 --- a/stacks/utilities/sftpgo.yaml +++ b/apps/sftpgo.yaml @@ -13,8 +13,8 @@ services: - ${MOVIE_DIR}:/srv/sftpgo/data/juftin/movies - ${TV_DIR}:/srv/sftpgo/data/juftin/tv - ${BOOKS_DIR}:/srv/sftpgo/data/juftin/books - - ${DOCKER_DIRECTORY}/appdata/utilities/sftpgo/data/:/srv/sftpgo/data/juftin/upload - - ${DOCKER_DIRECTORY}/appdata/utilities/sftpgo/config/:/var/lib/sftpgo/ + - ${DOCKER_DIRECTORY}/appdata/sftpgo/data/:/srv/sftpgo/data/juftin/upload + - ${DOCKER_DIRECTORY}/appdata/sftpgo/config/:/var/lib/sftpgo/ environment: PUID: ${PUID} PGID: ${PGID} diff --git a/stacks/core/socket-proxy.yaml b/apps/socket-proxy.yaml similarity index 100% rename from stacks/core/socket-proxy.yaml rename to apps/socket-proxy.yaml diff --git a/stacks/media/sonarr.yaml b/apps/sonarr.yaml similarity index 89% rename from stacks/media/sonarr.yaml rename to apps/sonarr.yaml index ff0dc48..6126d51 100644 --- a/stacks/media/sonarr.yaml +++ b/apps/sonarr.yaml @@ -8,10 +8,9 @@ services: image: lscr.io/linuxserver/sonarr:latest profiles: ["media", "arrs", "all"] volumes: - - ${DOCKER_DIRECTORY}/appdata/media/sonarr:/config + - ${DOCKER_DIRECTORY}/appdata/sonarr:/config - ${COMPLETED_DOWNLOADS}:/downloads - ${TV_DIR}:/tv - - ${DOCKER_DIRECTORY}/stacks/media/shared:/shared environment: PUID: ${PUID} PGID: ${PGID} diff --git a/stacks/media/tautulli.yaml b/apps/tautulli.yaml similarity index 82% rename from stacks/media/tautulli.yaml rename to apps/tautulli.yaml index d131ef7..14e1d73 100644 --- a/stacks/media/tautulli.yaml +++ b/apps/tautulli.yaml @@ -9,9 +9,8 @@ services: image: lscr.io/linuxserver/tautulli:latest profiles: ["media", "all"] volumes: - - ${DOCKER_DIRECTORY}/appdata/media/tautulli:/config - - ${DOCKER_DIRECTORY}/appdata/media/plex/Library/Application Support/Plex Media Server/Logs:/logs:ro - - ${DOCKER_DIRECTORY}/stacks/media/shared:/shared + - ${DOCKER_DIRECTORY}/appdata/tautulli:/config + - ${DOCKER_DIRECTORY}/appdata/plex/Library/Application Support/Plex Media Server/Logs:/logs:ro environment: PUID: ${PUID} PGID: ${PGID} diff --git a/stacks/core/traefik/docker-compose.yaml b/apps/traefik/docker-compose.yaml similarity index 93% rename from stacks/core/traefik/docker-compose.yaml rename to apps/traefik/docker-compose.yaml index 7923e03..fccb9c5 100644 --- a/stacks/core/traefik/docker-compose.yaml +++ b/apps/traefik/docker-compose.yaml @@ -27,10 +27,10 @@ services: - source: cloudflare_api_key target: /run/secrets/cloudflare_api_key volumes: - - ${DOCKER_DIRECTORY}/stacks/core/traefik/rules:/rules - - ${DOCKER_DIRECTORY}/appdata/core/traefik/logs:/logs - - ${DOCKER_DIRECTORY}/appdata/core/traefik/traefik:/etc/traefik - - ${DOCKER_DIRECTORY}/appdata/core/traefik/acme/acme.json:/acme.json + - ${DOCKER_DIRECTORY}/apps/traefik/rules:/rules + - ${DOCKER_DIRECTORY}/appdata/traefik/logs:/logs + - ${DOCKER_DIRECTORY}/appdata/traefik/traefik:/etc/traefik + - ${DOCKER_DIRECTORY}/appdata/traefik/acme/acme.json:/acme.json networks: traefik: docker: diff --git a/stacks/core/traefik/rules/middlewares-chains.yml b/apps/traefik/rules/middlewares-chains.yml similarity index 100% rename from stacks/core/traefik/rules/middlewares-chains.yml rename to apps/traefik/rules/middlewares-chains.yml diff --git a/stacks/core/traefik/rules/middlewares.yml b/apps/traefik/rules/middlewares.yml similarity index 100% rename from stacks/core/traefik/rules/middlewares.yml rename to apps/traefik/rules/middlewares.yml diff --git a/stacks/core/traefik/rules/tls-opts.yml b/apps/traefik/rules/tls-opts.yml similarity index 100% rename from stacks/core/traefik/rules/tls-opts.yml rename to apps/traefik/rules/tls-opts.yml diff --git a/stacks/media/transmission.yaml b/apps/transmission.yaml similarity index 92% rename from stacks/media/transmission.yaml rename to apps/transmission.yaml index 35f4ecb..296bdf6 100644 --- a/stacks/media/transmission.yaml +++ b/apps/transmission.yaml @@ -9,10 +9,9 @@ services: profiles: ["media", "all"] volumes: - /etc/localtime:/etc/localtime:ro - - ${DOCKER_DIRECTORY}/appdata/media/transmission:/config/transmission-home + - ${DOCKER_DIRECTORY}/appdata/transmission:/config/transmission-home - ${COMPLETED_DOWNLOADS}:/downloads - ${INCOMPLETE_DOWNLOADS}:/data/incomplete - - ${DOCKER_DIRECTORY}/stacks/media/shared:/shared environment: PUID: ${PUID} PGID: ${PGID} diff --git a/stacks/miscellaneous/umami.yaml b/apps/umami.yaml similarity index 100% rename from stacks/miscellaneous/umami.yaml rename to apps/umami.yaml diff --git a/stacks/utilities/watchtower.yaml b/apps/watchtower.yaml similarity index 100% rename from stacks/utilities/watchtower.yaml rename to apps/watchtower.yaml diff --git a/docker-compose.yaml b/docker-compose.yaml index f2ab5a7..f3a101d 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -7,38 +7,38 @@ include: # TRAEFIK (CORE) ############################################################################# - - stacks/core/traefik/docker-compose.yaml # Traefik (Reverse Proxy) - - stacks/core/duckdns.yaml # DuckDNS (Dynamic DNS) - - stacks/core/oauth.yaml # OAuth (Authentication) - - stacks/core/socket-proxy.yaml # Docker Socket Proxy (Security) + - apps/traefik/docker-compose.yaml # Traefik (Reverse Proxy) + - apps/duckdns.yaml # DuckDNS (Dynamic DNS) + - apps/oauth.yaml # OAuth (Authentication) + - apps/socket-proxy.yaml # Docker Socket Proxy (Security) ############################################################################# # MEDIA ############################################################################# - - stacks/media/heimdall.yaml # Heimdall (Landing Page) - - stacks/media/plex.yaml # Plex (Media Server) - - stacks/media/sonarr.yaml # Sonarr (TV Show Downloads) - - stacks/media/radarr.yaml # Radarr (Movie Downloads) - - stacks/media/prowlarr.yaml # Prowlarr (Indexer) - - stacks/media/ombi.yaml # Ombi (Download Requests) - - stacks/media/tautulli.yaml # Tautulli (Plex Analytics) - - stacks/media/transmission.yaml # Transmission (Torrents Behind VPN) - - stacks/media/sabnzbd.yaml # SABnzbd (Usenet Downloading) - - stacks/media/nzbhydra.yaml # NZBHydra2 (Usenet Browsing) - # - stacks/media/readarr.yaml # Readarr (Ebook Downloads) - # - stacks/media/calibre.yaml # Calibre (Books Management) - # - stacks/media/calibre-web.yaml # Calibre Web-UI + - apps/heimdall.yaml # Heimdall (Landing Page) + - apps/plex.yaml # Plex (Media Server) + - apps/sonarr.yaml # Sonarr (TV Show Downloads) + - apps/radarr.yaml # Radarr (Movie Downloads) + - apps/prowlarr.yaml # Prowlarr (Indexer) + - apps/ombi.yaml # Ombi (Download Requests) + - apps/tautulli.yaml # Tautulli (Plex Analytics) + - apps/transmission.yaml # Transmission (Torrents Behind VPN) + - apps/sabnzbd.yaml # SABnzbd (Usenet Downloading) + - apps/nzbhydra.yaml # NZBHydra2 (Usenet Browsing) + # - apps/readarr.yaml # Readarr (Ebook Downloads) + # - apps/calibre.yaml # Calibre (Books Management) + # - apps/calibre-web.yaml # Calibre Web-UI ############################################################################# # UTILITIES ############################################################################# - - stacks/utilities/watchtower.yaml # Watchtower (Container Updating) - # - stacks/utilities/postgres.yaml # PostgreSQL (Shared Database) - # - stacks/utilities/sftpgo.yaml # SFTPGo (File Management) - # - stacks/utilities/pihole.yaml # Pi-hole (DNS Ad-Blocking) - # - stacks/utilities/portainer.yaml # Portainer (Container Management) + - apps/watchtower.yaml # Watchtower (Container Updating) + # - apps/postgres.yaml # PostgreSQL (Shared Database) + # - apps/sftpgo.yaml # SFTPGo (File Management) + # - apps/pihole.yaml # Pi-hole (DNS Ad-Blocking) + # - apps/portainer.yaml # Portainer (Container Management) ############################################################################# # MISCELLANEOUS @@ -46,11 +46,11 @@ include: # * Note the existing services that are disabled by default. ############################################################################# - # - stacks/miscellaneous/chat-gpt-next-web.yaml # ChatGPT Next Web - # - stacks/miscellaneous/chatgpt-in-slack.yaml # ChatGPT Slack Bot - # - stacks/miscellaneous/libreoffice.yaml # LibreOffice (Office Suite) - # - stacks/miscellaneous/umami.yaml # Umami Analytics - # - stacks/miscellaneous/homeassistant/docker-compose.yaml # Home Assistant (Smart Home) + # - apps/chat-gpt-next-web.yaml # ChatGPT Next Web + # - apps/chatgpt-in-slack.yaml # ChatGPT Slack Bot + # - apps/libreoffice.yaml # LibreOffice (Office Suite) + # - apps/umami.yaml # Umami Analytics + # - apps/homeassistant/docker-compose.yaml # Home Assistant (Smart Home) ################################################################################ # NETWORK CONFIGURATION diff --git a/docs/applications/core.md b/docs/applications/core.md index 6b59400..d906a92 100644 --- a/docs/applications/core.md +++ b/docs/applications/core.md @@ -1,4 +1,4 @@ -# Core Stack +# Core Profile ## traefik diff --git a/docs/applications/media.md b/docs/applications/media.md index a11bb6c..3220248 100644 --- a/docs/applications/media.md +++ b/docs/applications/media.md @@ -1,4 +1,4 @@ -# Media Stack +# Media Profile ## Table of Contents @@ -173,7 +173,7 @@ source for tools like Sonarr, Radarr, Lidarr or CouchPotato. ### Configuration -The files at `appdata/media/sabnzbd/sabnzbd.ini` needs to be modified +The files at `appdata/sabnzbd/sabnzbd.ini` needs to be modified to allow access from the internet and internally. ```text diff --git a/docs/applications/miscellaneous.md b/docs/applications/miscellaneous.md index 9c73ea7..07d531c 100644 --- a/docs/applications/miscellaneous.md +++ b/docs/applications/miscellaneous.md @@ -1,4 +1,4 @@ -# Miscellaneous Stack +# Miscellaneous Profile ## chat-gtp-next-web @@ -51,7 +51,7 @@ Umami is a simple, fast, privacy-focused alternative to Google Analytics. > [!WARNING] Important > -> Umami needs a PostgreSQL database to work, the `stacks/utilities/postgres.yaml` service +> Umami needs a PostgreSQL database to work, the `apps/postgres.yaml` service > is a dependency of Umami. You must also add "umami" to the `POSTGRES_MULTIPLE_DATABASES` > variable in your `.env` file or manually create the database yourself before starting: > @@ -72,7 +72,7 @@ Umami is a simple, fast, privacy-focused alternative to Google Analytics. > The current setup of Umami uses a secondary domain for the ultimate > tracking URL. You can change this in the `umami.yaml` file. If you choose to use > the secondary domain, you must uncomment `SECONDARY_DOMAIN_NAME` settings in the -> `stacks/core/traefik/docker-compose.yaml` file and uncomment the `SECONDARY_DOMAIN_NAME` +> `apps/traefik/docker-compose.yaml` file and uncomment the `SECONDARY_DOMAIN_NAME` > variable in your `.env` file before regenerating HTTPS certificates. ## homeassistant diff --git a/docs/applications/utilities.md b/docs/applications/utilities.md index 2793092..5870230 100644 --- a/docs/applications/utilities.md +++ b/docs/applications/utilities.md @@ -1,4 +1,4 @@ -# Utilities Stack +# Utilities Profile ## watchtower diff --git a/docs/cli.md b/docs/cli.md index 55dfaeb..d10da4c 100644 --- a/docs/cli.md +++ b/docs/cli.md @@ -12,7 +12,7 @@ commands to manage your deployment. Add this to your `.bashrc` / `.zshrc` to use the **`homelab`** command: ```shell - alias homelab="make --directory /path/to/this/repo" + alias homelab="make --no-print-directory --directory /path/to/this/repo" ``` If you'd like to use the **`docker compose`** command from anywhere, you can @@ -515,10 +515,10 @@ Initialize the `acme.json` file for traefik. === "bash" ```shell - mkdir -p appdata/core/traefik/acme/ && \ - rm -f appdata/core/traefik/acme/acme.json && \ - touch appdata/core/traefik/acme/acme.json && \ - chmod 600 appdata/core/traefik/acme/acme.json + mkdir -p appdata/traefik/acme/ && \ + rm -f appdata/traefik/acme/acme.json && \ + touch appdata/traefik/acme/acme.json && \ + chmod 600 appdata/traefik/acme/acme.json ``` ### Backup 🗂️ diff --git a/docs/config.md b/docs/config.md index 05d8643..3947dfe 100644 --- a/docs/config.md +++ b/docs/config.md @@ -2,7 +2,7 @@ ## traefik -[Traefik] (pronounced traffic) is a modern HTTP reverse proxy and load balancer that +[Traefik](https://github.com/traefik/traefik) (pronounced traffic) is a modern HTTP reverse proxy and load balancer that makes deploying microservices easy. It is the core of the entire `homelab` stack as it routes all incoming traffic to the @@ -65,7 +65,7 @@ cp -r docs/example-secrets/ secrets/ ## App Deployment Which apps to deploy are defined in the `docker-compose.yaml` files. For example, -To disable specific apps in the `media` stack, you would comment out the `include` directive +To disable specific apps in the `media` profile, you would comment out the `include` directive in the root `docker-compose.yaml` file.
📄 docker-compose.yaml @@ -88,5 +88,3 @@ all share a common docker network. This means that when you're trying to connect to a service you can simply use a service name as the hostname. For example, if you're trying to connect to the sonarr service from the ombi service you can simply use http://sonarr:8989 as the hostname. - -[Traefik]: https://github.com/traefik/traefik diff --git a/docs/index.md b/docs/index.md index 6fdd643..cc60867 100644 --- a/docs/index.md +++ b/docs/index.md @@ -14,20 +14,22 @@ ## What is homelab? **`homelab`** is a collection of services that can be deployed from your home server and accessed -securely from anywhere in the world. This project deploys multiple "stacks" of services: +securely from anywhere in the world. Ultimately everything is deployed into a single +docker compose application. Each service belongs to a [docker compose profile] - and the +`Makefile` contains everything you need to get started and manage your homelab. -- **`core`**: The `core` stack is the base of this project, it includes a [traefik] reverse proxy +- **`core`**: The `core` profile is the base of this project, it includes a [traefik] reverse proxy and [OAuth] service that allows you to access all of your services via a single domain name securely behind HTTPS and protected with Google OAuth. -- **`media`**: The `media` stack includes services like [Plex], [Sonarr], [Radarr], and - [Ombi] that allow you to request, download, organize, and stream media to your devices. This stack +- **`media`**: The `media` profile includes services like [Plex], [Sonarr], [Radarr], and + [Ombi] that allow you to request, download, organize, and stream media to your devices. This profile is perfect for those who want to have a media server in their homelab. -- **`utilities`**: The `utilities` stack includes services like [Watchtower] and [Portainer] that +- **`utilities`**: The `utilities` profile includes services like [Watchtower] and [Portainer] that are designed to help you manage your homelab, monitor your services, and keep your containers up-to-date. -- **`miscellaneous`**: The `miscellaneous` stack is disabled by default. +- **`miscellaneous`**: The `miscellaneous` profile is disabled by default. It includes services like [ChatGPT Next Web] and [LibreOffice Online] - that don't fit into the other stacks. These services are great for improving your + that don't fit into the other profiles. These services are great for improving your productivity and adding some fun to your homelab. ## How does it work? @@ -37,46 +39,38 @@ project that allows you to deploy a variety of services to your homelab. At the root of this repository is a `docker-compose.yaml` file that defines the entire homelab project - it uses the `include` directive to pull in -individual service docker compose files from the `stacks` directory. -Ultimately a single docker compose stack is created that deploys everything. +individual service docker compose files from the `apps` directory. ```text . -├── docker-compose.yaml # Main Docker Compose File -├── .env # Environment Variables and Configuration -├── Makefile # Makefile for common tasks and docker compose wrappers -├── secrets # Secret Files -│ ├── cloudflare_api_key.secret # Cloudflare API Key -│ └── google_oauth.secret # Google OAuth Credentials and Whitelist -├── stacks -│ ├── media -│ │ ├── plex.yaml # Each individual service has its own docker compose file -│ │ ├── radarr.yaml -│ | ├── ombi.yaml -│ │ └── sonarr.yaml -│ ├── core # Traefik Reverse Proxy and OAuth -│ │ ├── oauth # OAuth Service -│ │ └── traefik # Traefik Reverse Proxy -│ │ ├── docker-compose.yaml # Traefik Docker Compose File (Traefik Only) -│ │ └── rules # Traefik Middlewares and Rules -│ │ ├── middlewares-chains.yml -│ │ ├── middlewares.yml -│ │ └── tls-opts.yml -│ ├── miscellaneous # Non Media Center Services (pihole, chat-gpt-next-web, etc.) -│ │ └── chat-gpt-next-web.yaml -│ └── utilities # Utility Services -│ └── watchtower.yaml -└── appdata # Application Data Persistent Volumes - ├── media - │ ├── plex # Each individual service has its own subdirectory - │ └── sonarr - ├── core - │ ├── oauth - │ └── traefik - ├── miscellaneous - │ └── chat-gpt-next-web - └── utilities - └── watchtower +├── docker-compose.yaml # Main Docker Compose File +├── .env # Environment Variables and Configuration +├── Makefile # Makefile for common tasks and docker compose wrappers +├── secrets # Secret Files +│ ├── cloudflare_api_key.secret # Cloudflare API Key +│ └── google_oauth.secret # Google OAuth Credentials and Whitelist +├── apps # Individual Service Docker Compose Files +│ ├── plex.yaml +│ ├── radarr.yaml +│ ├── ombi.yaml +│ ├── sonarr.yaml +│ ├── oauth.yaml +│ ├── chat-gpt-next-web.yaml +│ ├── watchtower.yaml +│ └── traefik # Traefik Reverse Proxy +│ ├── docker-compose.yaml # Traefik Docker Compose File +│ └── rules # Traefik Middlewares and Rules +│ ├── middlewares-chains.yml +│ ├── middlewares.yml +│ └── tls-opts.yml +└── appdata # Application Data Persistent Volumes + ├── plex # Each individual service has its own subdirectory + ├── sonarr + ├── oauth + ├── traefik + ├── chat-gpt-next-web + ├── utilities + └── watchtower ``` [traefik]: https://github.com/traefik/traefik @@ -89,3 +83,4 @@ Ultimately a single docker compose stack is created that deploys everything. [Watchtower]: https://github.com/containrrr/watchtower [LibreOffice Online]: https://www.libreoffice.org/ [Portainer]: https://github.com/portainer/portainer +[docker compose profile]: https://docs.docker.com/compose/profiles/ diff --git a/docs/migrations.md b/docs/migrations.md index 832f263..f8d21da 100644 --- a/docs/migrations.md +++ b/docs/migrations.md @@ -4,6 +4,34 @@ When larger changes are made this project there are occasionally migrations that need to be run. These are mostly for updating the directory structure and will be minimized as much as possible. +## 1.11.0 + +The 1.11.0 release moved everything under the `stacks` directory to the top level +of a new `apps` directory. It also moved everything under the `appdata` directory +to the top level. + +
1.10.0 to 1.11.0 Migration +

+ +```shell +#!/usr/bin/env bash + +sudo mv appdata/media/* appdata/ +rm -r appdata/media + +sudo mv appdata/core/* appdata/ +rm -r appdata/core + +sudo mv appdata/utilities/* appdata/ +rm -r appdata/utilities + +sudo mv appdata/miscellaneous/* appdata/ +rm -r appdata/miscellaneous +``` + +

+
+ ## 1.9.0 The 1.9.0 release renames the `media-center`stack to `media`, diff --git a/docs/traefik.md b/docs/traefik.md index 042eecf..e0ba17d 100644 --- a/docs/traefik.md +++ b/docs/traefik.md @@ -21,7 +21,7 @@ anywhere in the world. > be patient on the first run. > > See the [Command Line](cli.md) documentation for more information on how to -> operate the stack +> operate the application. > [!INFO] Acknowledgements > This configuration was inspired by, and @@ -130,17 +130,17 @@ command on the traefik service in the `docker-compose` file while testing. - file permissions (chmod): `600` ```shell -mkdir -p appdata/core/traefik/acme/ && \ - rm -f appdata/core/traefik/acme/acme.json && \ - touch appdata/core/traefik/acme/acme.json && \ - chmod 600 appdata/core/traefik/acme/acme.json +mkdir -p appdata/traefik/acme/ && \ + rm -f appdata/traefik/acme/acme.json && \ + touch appdata/traefik/acme/acme.json && \ + chmod 600 appdata/traefik/acme/acme.json ``` > [!NOTE] > If you're comfortable with the `Makefile` at the root of the project, you can run > `make config-acme` to create the `acme.json` as described above. -## Containers in Core Stack +## Containers in Core Profile - [traefik](applications/core.md#traefik) - [oauth](applications/core.md#oauth) @@ -156,13 +156,13 @@ at `https://libreoffice.example.com`. If possible, I recommend using a [LinuxServer](https://github.com/linuxserver) image as they are well maintained and have a common configuration. Once the `libreoffice.yaml` file is created, you can reference it in the root `docker-compose.yaml` (by uncommenting -the reference to `stacks/miscellaneous/libreoffice.yaml` line) and then run +the reference to `apps/libreoffice.yaml` line) and then run `docker-compose up -d`. -=== "stacks/miscellaneous/libreoffice.yaml" +=== "apps/libreoffice.yaml" ```yaml - --8<-- "stacks/miscellaneous/libreoffice.yaml" + --8<-- "apps/libreoffice.yaml" ``` === "docker-compose.yaml" diff --git a/mkdocs.yaml b/mkdocs.yaml index e7a5a36..15cbc87 100644 --- a/mkdocs.yaml +++ b/mkdocs.yaml @@ -6,10 +6,10 @@ nav: - Configuration ⚙️: config.md - Traefik 🚦: traefik.md - Applications 📦: - - Core Stack 🧱: applications/core.md - - Media Stack 🎬: applications/media.md - - Utilities Stack 🔧: applications/utilities.md - - Miscellaneous Stack 🥞: applications/miscellaneous.md + - Core Profile 🧱: applications/core.md + - Media Profile 🎬: applications/media.md + - Utilities Profile 🔧: applications/utilities.md + - Miscellaneous Profile 🥞: applications/miscellaneous.md - Command Line Usage 🖥️: cli.md - Scripts 📜: scripts.md - Migrations 🚚: migrations.md