Skip to content

Commit 65f8495

Browse files
tremor021MickLesk
andauthored
New Script: Kometa (#2281)
* add kometa script * scale up LXC a bit * fixes * Update kometa.json --------- Co-authored-by: CanbiZ <[email protected]>
1 parent ab64e7e commit 65f8495

File tree

3 files changed

+193
-0
lines changed

3 files changed

+193
-0
lines changed

ct/kometa.sh

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
#!/usr/bin/env bash
2+
source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
3+
# Copyright (c) 2021-2025 community-scripts ORG
4+
# Author: Slaviša Arežina (tremor021)
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
# Source: https://github.com/Snawoot/kometa
7+
8+
# App Default Values
9+
APP="Kometa"
10+
TAGS="media;streaming"
11+
var_cpu="1"
12+
var_ram="1024"
13+
var_disk="4"
14+
var_os="debian"
15+
var_version="12"
16+
var_unprivileged="1"
17+
18+
header_info "$APP"
19+
base_settings
20+
21+
variables
22+
color
23+
catch_errors
24+
25+
function update_script() {
26+
header_info
27+
check_container_storage
28+
check_container_resources
29+
30+
if [[ ! -f "/opt/kometa/kometa.py" ]]; then
31+
msg_error "No ${APP} Installation Found!"
32+
exit
33+
fi
34+
RELEASE=$(curl -s https://api.github.com/repos/Kometa-Team/Kometa/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
35+
if [[ "${RELEASE}" != "$(cat /opt/kometa_version.txt)" ]] || [[ ! -f /opt/kometa_version.txt ]]; then
36+
msg_info "Updating $APP"
37+
msg_info "Stopping $APP"
38+
systemctl stop kometa
39+
msg_ok "Stopped $APP"
40+
41+
msg_info "Updating $APP to ${RELEASE}"
42+
cd /tmp
43+
temp_file=$(mktemp)
44+
RELEASE=$(curl -s https://api.github.com/repos/Kometa-Team/Kometa/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
45+
wget -q "https://github.com/Kometa-Team/Kometa/archive/refs/tags/v${RELEASE}.tar.gz" -O "$temp_file"
46+
tar -xzf "$temp_file"
47+
cp /opt/kometa/config/config.yml /opt
48+
rm -rf /opt/kometa
49+
mv Kometa-${RELEASE} /opt/kometa
50+
cd /opt/kometa
51+
rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED
52+
pip install -r requirements.txt --ignore-installed &> /dev/null
53+
mkdir -p config/assets
54+
cp /opt/config.yml config/config.yml
55+
echo "${RELEASE}" >/opt/kometa_version.txt
56+
msg_ok "Updated $APP to ${RELEASE}"
57+
58+
msg_info "Starting $APP"
59+
systemctl start kometa
60+
msg_ok "Started $APP"
61+
62+
msg_info "Cleaning Up"
63+
rm -f $temp_file
64+
msg_ok "Cleanup Completed"
65+
66+
msg_ok "Update Successful"
67+
else
68+
msg_ok "No update required. ${APP} is already at ${RELEASE}"
69+
fi
70+
exit
71+
}
72+
73+
start
74+
build_container
75+
description
76+
77+
msg_ok "Completed Successfully!\n"
78+
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
79+
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
80+
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}${CL}"

install/kometa-install.sh

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright (c) 2021-2025 community-scripts ORG
4+
# Author: Slaviša Arežina (tremor021)
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
# Source: https://github.com/Snawoot/kometa
7+
8+
source /dev/stdin <<< "$FUNCTIONS_FILE_PATH"
9+
color
10+
verb_ip6
11+
catch_errors
12+
setting_up_container
13+
network_check
14+
update_os
15+
16+
msg_info "Installing Dependencies"
17+
$STD apt-get install -y \
18+
curl \
19+
mc \
20+
sudo
21+
msg_ok "Installed Dependencies"
22+
23+
msg_info "Setup Python 3"
24+
$STD apt-get install python3-pip -y
25+
rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED
26+
msg_ok "Setup Python 3"
27+
28+
msg_info "Setup Kometa"
29+
temp_file=$(mktemp)
30+
RELEASE=$(curl -s https://api.github.com/repos/Kometa-Team/Kometa/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
31+
wget -q "https://github.com/Kometa-Team/Kometa/archive/refs/tags/v${RELEASE}.tar.gz" -O "$temp_file"
32+
tar -xzf "$temp_file"
33+
mv Kometa-${RELEASE} /opt/kometa
34+
cd /opt/kometa
35+
$STD pip install -r requirements.txt --ignore-installed
36+
mkdir -p config/assets
37+
cp config/config.yml.template config/config.yml
38+
echo "${RELEASE}" >/opt/kometa_version.txt
39+
msg_ok "Setup Kometa"
40+
41+
read -p "Enter your TMDb API key: " TMDBKEY
42+
read -p "Enter your Plex URL: " PLEXURL
43+
read -p "Enter your Plex token: " PLEXTOKEN
44+
sed -i -e "s#url: http://192.168.1.12:32400#url: $PLEXURL#g" /opt/kometa/config/config.yml
45+
sed -i -e "s/token: ####################/token: $PLEXTOKEN/g" /opt/kometa/config/config.yml
46+
sed -i -e "s/apikey: ################################/apikey: $TMDBKEY/g" /opt/kometa/config/config.yml
47+
48+
msg_info "Creating Service"
49+
cat <<EOF >/etc/systemd/system/kometa.service
50+
[Unit]
51+
Description=Kometa Service
52+
After=network-online.target
53+
54+
[Service]
55+
Type=simple
56+
WorkingDirectory=/opt/kometa
57+
ExecStart=/usr/bin/python3 kometa.py
58+
Restart=always
59+
RestartSec=30
60+
61+
[Install]
62+
WantedBy=multi-user.target
63+
EOF
64+
systemctl enable --now -q kometa
65+
msg_ok "Created Service"
66+
67+
motd_ssh
68+
customize
69+
70+
msg_info "Cleaning up"
71+
rm -f $temp_file
72+
$STD apt-get -y autoremove
73+
$STD apt-get -y autoclean
74+
msg_ok "Cleaned"

json/kometa.json

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"name": "Kometa",
3+
"slug": "kometa",
4+
"categories": [
5+
13
6+
],
7+
"date_created": "2025-02-12",
8+
"type": "ct",
9+
"updateable": true,
10+
"privileged": false,
11+
"interface_port": null,
12+
"documentation": "https://kometa.wiki/en/latest/",
13+
"website": "https://github.com/Snawoot/Kometa",
14+
"logo": "https://kometa.wiki/en/latest/assets/icon.png",
15+
"description": "Kometa (formerly known as Plex Meta Manager) is a powerful tool designed to give you complete control over your media libraries",
16+
"install_methods": [
17+
{
18+
"type": "default",
19+
"script": "ct/kometa.sh",
20+
"resources": {
21+
"cpu": 1,
22+
"ram": 1024,
23+
"hdd": 4,
24+
"os": "debian",
25+
"version": "12"
26+
}
27+
}
28+
],
29+
"default_credentials": {
30+
"username": null,
31+
"password": null
32+
},
33+
"notes": [
34+
{
35+
"text": "During installation you will be prompted to input your TMDb key, Plex URL and Plex token. Make sure you have them ready.",
36+
"type": "info"
37+
}
38+
]
39+
}

0 commit comments

Comments
 (0)