mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-10-24 12:15:01 +00:00
Every interactive prompt takes a var_<app>_<name> override and treats a closed stdin like Enter (`|| true`), so an install keeps going after the console that started it is gone. Values the script cannot do without end with exit 64 and name the variable to set. Validation loops stop asking when nobody can answer instead of spinning on an empty read.
89 lines
2.8 KiB
Bash
89 lines
2.8 KiB
Bash
#!/usr/bin/env bash
|
|
|
|
# Copyright (c) 2021-2026 community-scripts ORG
|
|
# Author: Slaviša Arežina (tremor021)
|
|
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
|
# Source: https://github.com/Kometa-Team/Kometa
|
|
|
|
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
|
color
|
|
verb_ip6
|
|
catch_errors
|
|
setting_up_container
|
|
network_check
|
|
update_os
|
|
|
|
msg_info "Installing Dependencies"
|
|
$STD apt install -y git
|
|
msg_ok "Installed Dependencies"
|
|
|
|
PYTHON_VERSION="3.13" setup_uv
|
|
fetch_and_deploy_gh_release "kometa" "Kometa-Team/Kometa" "tarball"
|
|
|
|
msg_info "Setup Kometa"
|
|
cd /opt/kometa
|
|
$STD uv venv /opt/kometa/.venv
|
|
$STD uv pip install -r requirements.txt -p /opt/kometa/.venv/bin/python
|
|
mkdir -p config/assets
|
|
cp config/config.yml.template config/config.yml
|
|
msg_ok "Setup Kometa"
|
|
|
|
TMDBKEY="${var_kometa_tmdb_key:-}"
|
|
[[ -n "$TMDBKEY" ]] || read -r -p "${TAB3}Enter your TMDb API key: " TMDBKEY || true
|
|
[[ -n "$TMDBKEY" ]] || { msg_error "No TMDb API key given; set var_kometa_tmdb_key or answer the prompt"; exit 64; }
|
|
PLEXURL="${var_kometa_plex_url:-}"
|
|
[[ -n "$PLEXURL" ]] || read -r -p "${TAB3}Enter your Plex URL: " PLEXURL || true
|
|
[[ -n "$PLEXURL" ]] || { msg_error "No Plex URL given; set var_kometa_plex_url or answer the prompt"; exit 64; }
|
|
PLEXTOKEN="${var_kometa_plex_token:-}"
|
|
[[ -n "$PLEXTOKEN" ]] || read -r -p "${TAB3}Enter your Plex token: " PLEXTOKEN || true
|
|
[[ -n "$PLEXTOKEN" ]] || { msg_error "No Plex token given; set var_kometa_plex_token or answer the prompt"; exit 64; }
|
|
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
|
|
|
|
fetch_and_deploy_gh_release "kometa-quickstart" "Kometa-Team/Quickstart" "tarball"
|
|
|
|
msg_info "Installing Kometa Quickstart"
|
|
cd /opt/kometa-quickstart
|
|
$STD uv venv /opt/kometa-quickstart/.venv
|
|
$STD uv pip install -r requirements.txt -p /opt/kometa-quickstart/.venv/bin/python
|
|
msg_ok "Installed Kometa Quickstart"
|
|
|
|
msg_info "Creating Service"
|
|
cat <<EOF >/etc/systemd/system/kometa.service
|
|
[Unit]
|
|
Description=Kometa Service
|
|
After=network-online.target
|
|
|
|
[Service]
|
|
Type=simple
|
|
WorkingDirectory=/opt/kometa
|
|
ExecStart=/opt/kometa/.venv/bin/python kometa.py
|
|
Restart=always
|
|
RestartSec=30
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|
|
EOF
|
|
cat <<EOF >/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 kometa-quickstart
|
|
msg_ok "Created Service"
|
|
|
|
motd_ssh
|
|
customize
|
|
cleanup_lxc
|