diff --git a/ct/jackett.sh b/ct/jackett.sh index 1aea55e5a3f..4cebe010ab4 100644 --- a/ct/jackett.sh +++ b/ct/jackett.sh @@ -27,17 +27,18 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - RELEASE=$(curl -fsSL https://github.com/Jackett/Jackett/releases/latest | grep "title>Release" | cut -d " " -f 4) - if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then - msg_info "Updating ${APP}" - curl -fsSL "https://github.com/Jackett/Jackett/releases/download/$RELEASE/Jackett.Binaries.LinuxAMDx64.tar.gz" -o $(basename "https://github.com/Jackett/Jackett/releases/download/$RELEASE/Jackett.Binaries.LinuxAMDx64.tar.gz") - systemctl stop jackett + + if [ ! -f /opt/.env ]; then + sed -i 's|^Environment="DisableRootWarning=true"$|EnvironmentFile="/opt/.env"|' /etc/systemd/system/jackett.service + cat </opt/.env +DisableRootWarning=true +EOF + fi + + RELEASE=$(curl -s https://api.github.com/repos/Jackett/Jackett/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') + if [[ "${RELEASE}" != "$(cat ~/.jackett 2>/dev/null)" ]] || [[ ! -f ~/.jackett ]]; then rm -rf /opt/Jackett - tar -xzf Jackett.Binaries.LinuxAMDx64.tar.gz -C /opt - rm -rf Jackett.Binaries.LinuxAMDx64.tar.gz - systemctl start jackett - echo "${RELEASE}" >/opt/${APP}_version.txt - msg_ok "Updated ${APP} to ${RELEASE}" + fetch_and_deploy_gh_release "jackett" "Jackett/Jackett" "prebuild" "latest" "/opt/Jackett" "Jackett.Binaries.LinuxAMDx64.tar.gz" else msg_ok "No update required. ${APP} is already at ${RELEASE}" fi diff --git a/frontend/public/json/jackett.json b/frontend/public/json/jackett.json index fe681dce89d..6ee1016c159 100644 --- a/frontend/public/json/jackett.json +++ b/frontend/public/json/jackett.json @@ -6,13 +6,13 @@ ], "date_created": "2024-05-02", "type": "ct", - "updateable": false, + "updateable": true, "privileged": false, "interface_port": 9117, "documentation": "https://github.com/Jackett/Jackett/wiki", "website": "https://github.com/Jackett/Jackett", "logo": "https://cdn.jsdelivr.net/gh/selfhst/icons/webp/jackett.webp", - "config_path": "", + "config_path": "/opt/.env", "description": "Jackett supports a wide range of trackers, including popular ones like The Pirate Bay, RARBG, and Torrentz2, as well as many private trackers. It can be integrated with several BitTorrent clients, including qBittorrent, Deluge, and uTorrent, among others.", "install_methods": [ { diff --git a/install/jackett-install.sh b/install/jackett-install.sh index 196a39d7822..7ef45bcc954 100644 --- a/install/jackett-install.sh +++ b/install/jackett-install.sh @@ -13,20 +13,14 @@ setting_up_container network_check update_os -msg_info "Installing Jackett" -RELEASE=$(curl -fsSL https://github.com/Jackett/Jackett/releases/latest | grep "title>Release" | cut -d " " -f 4) -cd /opt -curl -fsSL "https://github.com/Jackett/Jackett/releases/download/$RELEASE/Jackett.Binaries.LinuxAMDx64.tar.gz" -o "Jackett.Binaries.LinuxAMDx64.tar.gz" -tar -xzf Jackett.Binaries.LinuxAMDx64.tar.gz -C /opt -rm -rf Jackett.Binaries.LinuxAMDx64.tar.gz -echo "${RELEASE}" >/opt/${APPLICATION}_version.txt -msg_ok "Installed Jackett" +fetch_and_deploy_gh_release "jackett" "Jackett/Jackett" "prebuild" "latest" "/opt/Jackett" "Jackett.Binaries.LinuxAMDx64.tar.gz" msg_info "Creating Service" cat </etc/systemd/system/jackett.service [Unit] Description=Jackett Daemon After=network.target + [Service] SyslogIdentifier=jackett Restart=always @@ -35,7 +29,8 @@ Type=simple WorkingDirectory=/opt/Jackett ExecStart=/bin/sh /opt/Jackett/jackett_launcher.sh TimeoutStopSec=30 -Environment="DisableRootWarning=true" +EnvironmentFile="/opt/.env" + [Install] WantedBy=multi-user.target EOF