Jellyfin: Init

This commit is contained in:
Benoit 2025-02-19 21:47:32 +09:00
parent 785e0f83c8
commit 3a0eadbe8b
Signed by: Benoit
SSH key fingerprint: SHA256:kFsX94Kq6z/6CY0dX+7/FpAeJC0QlMhJVY+B7NYrOmA

51
cfg/jobs/jellyfin.run Executable file
View file

@ -0,0 +1,51 @@
#!/bin/env bash
# Upstream doc: https://adguard-dns.io/kb/adguard-home/getting-started/
set -euxo pipefail
IMAGE="ubuntu/24.04"
DIST="${IMAGE%%/*}"
VER="${IMAGE#*/}"
VER="${VER%/*}"
VER="${VER//./-}"
UPSTREAM_VER="10.10.6"
UPSTREAM_VER_DASH="${UPSTREAM_VER//./-}"
UPSTREAM_NAME="jellyfin"
SERIAL="1benoitjpnet"
CNAME="$UPSTREAM_NAME-$UPSTREAM_VER_DASH-$SERIAL-$DIST-$VER"
ALIAS="$UPSTREAM_NAME-$UPSTREAM_VER-$SERIAL"
cd "$WORKSPACE"
incus launch images:$IMAGE "$CNAME" --quiet
wait_network "$CNAME"
incus config set "$CNAME" environment.DEBIAN_FRONTEND=noninteractive
incus config set "$CNAME" environment.DEBCONF_NONINTERACTIVE_SEEN=true
incus config set "$CNAME" environment.LC_ALL=C
incus exec "$CNAME" -- apt-get update
incus exec "$CNAME" -- apt-get upgrade -y
incus exec "$CNAME" -- apt-get install -y --no-install-recommends wget curl gnupg software-properties-common
incus exec "$CNAME" -- add-apt-repository universe
incus exec "$CNAME" -- mkdir -p /etc/apt/keyrings
incus exec "$CNAME" -- bash -c 'curl -fsSL https://repo.jellyfin.org/jellyfin_team.gpg.key | gpg --dearmor -o /etc/apt/keyrings/jellyfin.gpg'
incus exec "$CNAME" -- bash -c 'export DPKG_ARCHITECTURE="$( dpkg --print-architecture )"'
incus exec "$CNAME" -- bash -c 'cat <<EOF > /etc/apt/sources.list.d/jellyfin.sources
Types: deb
URIs: https://repo.jellyfin.org/ubuntu
Suites: noble
Components: main
Architectures: amd64
Signed-By: /etc/apt/keyrings/jellyfin.gpg
EOF'
incus exec "$CNAME" -- apt-get update
incus exec "$CNAME" -- apt-get install -y jellyfin=${UPSTREAM_VER}
incus exec "$CNAME" -- systemctl enable jellyfin
laminarc run incus_publish \
CNAME="$CNAME" \
UPSTREAM_NAME=$UPSTREAM_NAME \
UPSTREAM_VER=$UPSTREAM_VER \
IMAGE=$IMAGE \
SERIAL=$SERIAL \
ALIAS=$ALIAS