From 9aa594834ae461f718f4dc41d4e75454616cf615 Mon Sep 17 00:00:00 2001 From: rbm <73571278+redbeardymcgee@users.noreply.github.com> Date: Sun, 9 Nov 2025 13:03:35 -0600 Subject: [PATCH] Update podman quadlet docs to include companion (#677) * Update podman quadlet docs to include companion The prior documentation appears to predate the introduction of the companion container. This commit adapts the instructions to include the new companion and some improved formatting. * fix admonition * correct contributor name Some of lzap's original wording remains, but the guidance has been rewritten from scratch. Perhaps their username should remain for some time longer, but they noted that they no longer use Invidious #602 also. * comment out conflicting env var * set SELinux label for volumes `:Z` means the volume is not shared between containers. `:z` allows other containers to share the volume, implying read/write. Most volumes should be labeled `:Z` unless the volume must be shared between multiple containers. --- docs/community-installation-guide.md | 226 ++++++++++++++++++--------- 1 file changed, 149 insertions(+), 77 deletions(-) diff --git a/docs/community-installation-guide.md b/docs/community-installation-guide.md index 2b7d632..340eaca 100644 --- a/docs/community-installation-guide.md +++ b/docs/community-installation-guide.md @@ -113,114 +113,186 @@ podman image prune -f ## Podman via systemd -Guide contributor(s): [@lzap](https://github.com/lzap) +Guide contributor(s): [@redbeardymcgee](https://git.mcgee.red/redbeardymcgee) -This method is suitable for systems which come with Podman version 5.x or higher and systemd (e.g. Fedora, CentOS Stream 9 or clones). Instructions are written for root-less mode, do not run the commands as root since paths are different. Ensure that SELinux is in enforcing mode for maximum security. +This method employs rootless containers through podman whose lifecycles are managed by systemd and is suitable for systems which come with Podman version 5.x or higher. Ensure that SELinux is in enforcing mode for maximum security. Do not run any of the following commands or scripts as root. -Create a new volume for database: +### Define containers - podman volume create invidious-db +Add the quadlet definitions for Invidious, the database, and the companion containers to `$HOME/.config/containers/systemd/invidious`. -Start a temporary container: +```ini +# $HOME/.config/containers/systemd/invidious/invidious.container +[Unit] +Description=Invidious +Requires=invidious-db.service +After=invidious-db.service +Requires=invidious-companion.service +After=invidious-companion.service - podman run --rm -it --name invidious-init -v invidious-db:/var/lib/postgresql/data:Z -p 5432:5432 -e POSTGRES_DB=invidious -e POSTGRES_USER=kemal -e POSTGRES_PASSWORD=kemal docker.io/library/postgres:14 +[Service] +Restart=on-failure +TimeoutStartSec=900 -In another terminal, migrate the database: +[Install] +WantedBy=multi-user.target - export PGPASSWORD=kemal - for F in channels videos channel_videos users session_ids nonces annotations playlists playlist_videos; do - curl -s https://raw.githubusercontent.com/iv-org/invidious/refs/heads/master/config/sql/$F.sql | \ - psql -h localhost -p 5432 -U kemal invidious - done +[Container] +Image=quay.io/invidious/invidious:latest +ContainerName=invidious +AutoUpdate=registry -Shutdown the temporary container, it is no longer needed. Create a database volume unit: +Network=invidious.network +HostName=invidious - cat > ~/.config/containers/systemd/invidious-db.volume < ~/.config/containers/systemd/invidious-db.container < ~/.config/containers/systemd/invidious-sig-helper.container < ~/.config/containers/systemd/invidious.env < ~/.config/containers/systemd/invidious.container < ~/.config/containers/systemd/invidious.pod <