From 80bcf668a55a2e0d445a9d660b55df48c2e8b227 Mon Sep 17 00:00:00 2001 From: Daniel Mendizabal Date: Fri, 1 Dec 2023 22:13:09 +1100 Subject: [PATCH 1/3] Create community-installation-guide --- docs/community-installation-guide | 1 + 1 file changed, 1 insertion(+) create mode 100644 docs/community-installation-guide diff --git a/docs/community-installation-guide b/docs/community-installation-guide new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/docs/community-installation-guide @@ -0,0 +1 @@ + From 975705f8aca1793af486945436cf2c4de9c25600 Mon Sep 17 00:00:00 2001 From: Daniel Mendizabal Date: Fri, 1 Dec 2023 22:26:26 +1100 Subject: [PATCH 2/3] Update and rename community-installation-guide to community-installation-guide.md --- docs/community-installation-guide | 1 - docs/community-installation-guide.md | 101 +++++++++++++++++++++++++++ 2 files changed, 101 insertions(+), 1 deletion(-) delete mode 100644 docs/community-installation-guide create mode 100644 docs/community-installation-guide.md diff --git a/docs/community-installation-guide b/docs/community-installation-guide deleted file mode 100644 index 8b137891..00000000 --- a/docs/community-installation-guide +++ /dev/null @@ -1 +0,0 @@ - diff --git a/docs/community-installation-guide.md b/docs/community-installation-guide.md new file mode 100644 index 00000000..adfea662 --- /dev/null +++ b/docs/community-installation-guide.md @@ -0,0 +1,101 @@ +# Community Installation Guide + +After installation take a look at the [Post-install steps](installation.md#post-install-configuration). + +## Podman (rootless container) + +Podman is usually pre-installed in Fedora, CentOS, RHEL and derivatives. But if this is not the case, the instruction below will install all necessary packages. + +RHEL based and RHEL-like systems +```bash +sudo dnf install podman +``` + +### Download the configuration files from Invidious' repository + +Note: Currently the repository has to be cloned, this is because the `init-invidious-db.sh` file and the `config/sql` directory have to be mounted to the postgres container (See the volumes section in the postgres' container). This "problem" will be solved in the future. +> `` Absolute path in your home directory where invidious will be downloaded (e.i. /home/johnsmith/.inv) + +```bash +cd +git clone https://github.com/iv-org/invidious.git +``` + +### Create Pod - videos + +```podman +podman pod create --name videos -p 3000:3000 +``` + +### Create Container - postgres + +```podman +podman create --rm \ +--pod videos \ +--name postgres \ +--label "io.containers.autoupdate=registry" \ +--health-cmd='pg_isready -U $POSTGRES_USER -d $POSTGRES_DB' \ +-v postgresdata:/var/lib/postgresql/data \ +-v /invidious/config/sql:/config/sql:z \ +-v /invidious/docker/init-invidious-db.sh:/docker-entrypoint-initdb.d/init-invidious-db.sh:z \ +-e POSTGRES_DB=invidious \ +-e POSTGRES_USER=kemal \ +-e POSTGRES_PASSWORD=kemal \ +docker.io/library/postgres:14 +``` + +### Create Container - invidious + +Copy `/invidious/config/config.example.yml` to `/config.yml` and update parameters as required. + +```podman +podman create --rm \ +--pod videos \ +--name invidious \ +--label "io.containers.autoupdate=registry" \ +--health-cmd="wget -nv --tries=1 --spider http://127.0.0.1:3000/api/v1/comments/jNQXAC9IVRw || exit 1" \ +--health-interval=30s \ +--health-timeout=5s \ +--health-retries=2 \ +-v /config.yml:/invidious/config/config.yml:z,U \ +quay.io/invidious/invidious:latest +``` + +### Create systemd services to manage the Pod + +Podman can generate systemd services to handle the life cycle of pods and containers. +The instructions below will create 3 service units, and they will be placed in the correct location ready to be used. + +```podman +cd ~ +cp $(podman generate systemd --new --files --name videos) .config/systemd/user +``` + +### Start Pod + +Despite the existance of 3 services, only the one related to the Pod must be used. The life cycle for the 2 containers implementing **postgres** and **invidious** will be handled by the pod. + +```systemd +systemctl --user daemon-reload +systemctl --user enable --now pod-videos.service +``` + +And similarly, the instruction below will re-start the service: + +```systemd +systemctl --user restart pod-videos.service +``` + +If this service runs on a server, it will stop as soon as you logout, because it is running in user space. +To ensure it is persistent and remains active after logging out, you will need to enable user lingering. + +```systemd +loginctl enable-linger +``` + +### Updating to the latest release + +```bash +podman auto-update +podman image prune -f +``` From 0b93e13bff31d465280c000eed087320969c7eb6 Mon Sep 17 00:00:00 2001 From: Daniel Mendizabal Date: Sat, 9 Dec 2023 00:11:26 +1100 Subject: [PATCH 3/3] Update community-installation-guide.md --- docs/community-installation-guide.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/community-installation-guide.md b/docs/community-installation-guide.md index adfea662..62d941e3 100644 --- a/docs/community-installation-guide.md +++ b/docs/community-installation-guide.md @@ -23,13 +23,13 @@ git clone https://github.com/iv-org/invidious.git ### Create Pod - videos -```podman +```bash podman pod create --name videos -p 3000:3000 ``` ### Create Container - postgres -```podman +```bash podman create --rm \ --pod videos \ --name postgres \ @@ -48,7 +48,7 @@ docker.io/library/postgres:14 Copy `/invidious/config/config.example.yml` to `/config.yml` and update parameters as required. -```podman +```bash podman create --rm \ --pod videos \ --name invidious \ @@ -66,7 +66,7 @@ quay.io/invidious/invidious:latest Podman can generate systemd services to handle the life cycle of pods and containers. The instructions below will create 3 service units, and they will be placed in the correct location ready to be used. -```podman +```bash cd ~ cp $(podman generate systemd --new --files --name videos) .config/systemd/user ``` @@ -75,21 +75,21 @@ cp $(podman generate systemd --new --files --name videos) .config/systemd/user Despite the existance of 3 services, only the one related to the Pod must be used. The life cycle for the 2 containers implementing **postgres** and **invidious** will be handled by the pod. -```systemd +```bash systemctl --user daemon-reload systemctl --user enable --now pod-videos.service ``` And similarly, the instruction below will re-start the service: -```systemd +```bash systemctl --user restart pod-videos.service ``` If this service runs on a server, it will stop as soon as you logout, because it is running in user space. To ensure it is persistent and remains active after logging out, you will need to enable user lingering. -```systemd +```bash loginctl enable-linger ```