From 4cf700cc3b3426c3b834c75e341b6a45a0ddb2f8 Mon Sep 17 00:00:00 2001 From: MickLesk Date: Sun, 22 Mar 2026 20:42:38 +0100 Subject: [PATCH] fix(kometa): fix config.yml sed patterns, add Quickstart integration - Fix sed commands for plex token and tmdb apikey (empty values in template, not hash placeholders) - Use section-aware sed to avoid replacing wrong token/apikey fields - Add Kometa Quickstart web UI on port 7171 --- ct/kometa.sh | 4 ++-- install/kometa-install.sh | 35 +++++++++++++++++++++++++++++------ 2 files changed, 31 insertions(+), 8 deletions(-) diff --git a/ct/kometa.sh b/ct/kometa.sh index 2789e4ea1..72618bb82 100644 --- a/ct/kometa.sh +++ b/ct/kometa.sh @@ -61,5 +61,5 @@ description msg_ok "Completed successfully!\n" echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" -echo -e "${INFO}${YW} Access the LXC at following IP address:${CL}" -echo -e "${TAB}${GATEWAY}${BGN}${IP}${CL}" +echo -e "${INFO}${YW} Access Kometa Quickstart:${CL}" +echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:7171${CL}" diff --git a/install/kometa-install.sh b/install/kometa-install.sh index f944985a2..d85237a9f 100644 --- a/install/kometa-install.sh +++ b/install/kometa-install.sh @@ -23,12 +23,19 @@ mkdir -p config/assets cp config/config.yml.template config/config.yml msg_ok "Setup Kometa" -read -p "${TAB3}Enter your TMDb API key: " TMDBKEY -read -p "${TAB3}Enter your Plex URL: " PLEXURL -read -p "${TAB3}Enter your Plex token: " PLEXTOKEN -sed -i -e "s#url: http://192.168.1.12:32400#url: $PLEXURL #g" /opt/kometa/config/config.yml -sed -i -e "s/token: ####################/token: $PLEXTOKEN/g" /opt/kometa/config/config.yml -sed -i -e "s/apikey: ################################/apikey: $TMDBKEY/g" /opt/kometa/config/config.yml +read -r -p "${TAB3}Enter your TMDb API key: " TMDBKEY +read -r -p "${TAB3}Enter your Plex URL: " PLEXURL +read -r -p "${TAB3}Enter your Plex token: " PLEXTOKEN +sed -i '/^plex:/,/^[^ ]/{s| url:.*| url: '"$PLEXURL"'|}' /opt/kometa/config/config.yml +sed -i '/^plex:/,/^[^ ]/{s| token:.*| token: '"$PLEXTOKEN"'|}' /opt/kometa/config/config.yml +sed -i '/^tmdb:/,/^[^ ]/{s| apikey:.*| apikey: '"$TMDBKEY"'|}' /opt/kometa/config/config.yml + +msg_info "Installing Kometa Quickstart" +fetch_and_deploy_gh_release "kometa-quickstart" "Kometa-Team/Quickstart" +cd /opt/kometa-quickstart +$STD uv venv /opt/kometa-quickstart/.venv +$STD /opt/kometa-quickstart/.venv/bin/python -m pip install -r requirements.txt +msg_ok "Installed Kometa Quickstart" msg_info "Creating Service" cat </etc/systemd/system/kometa.service @@ -43,10 +50,26 @@ ExecStart=/usr/bin/python3 kometa.py Restart=always RestartSec=30 +[Install] +WantedBy=multi-user.target +EOF +cat </etc/systemd/system/kometa-quickstart.service +[Unit] +Description=Kometa Quickstart +After=network-online.target + +[Service] +Type=simple +WorkingDirectory=/opt/kometa-quickstart +ExecStart=/opt/kometa-quickstart/.venv/bin/python quickstart.py +Restart=always +RestartSec=10 + [Install] WantedBy=multi-user.target EOF systemctl enable -q --now kometa +systemctl enable -q --now kometa-quickstart msg_ok "Created Service" motd_ssh