From 61fb45a0b8181c83f9dc819d7fb3e51b49a9e2ff Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Fri, 1 Aug 2025 21:05:16 +0200 Subject: [PATCH] Re-Add: Suwayomi-Server (#6458) --- ct/suwayomiserver.sh | 20 ++---------- frontend/public/json/suwayomi-server.json | 40 +++++++++++++++++++++++ install/suwayomiserver-install.sh | 10 +----- 3 files changed, 44 insertions(+), 26 deletions(-) create mode 100644 frontend/public/json/suwayomi-server.json diff --git a/ct/suwayomiserver.sh b/ct/suwayomiserver.sh index ce64e1da8..733c71803 100644 --- a/ct/suwayomiserver.sh +++ b/ct/suwayomiserver.sh @@ -28,34 +28,20 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - if dpkg -l | grep -q "openjdk-17-jre"; then - $STD apt-get remove -y openjdk-17-jre - fi - JAVA_VERSION=21 setup_java RELEASE=$(curl -fsSL https://api.github.com/repos/Suwayomi/Suwayomi-Server/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') - if [[ "${RELEASE}" != "$(cat /opt/suwayomi-server_version.txt)" ]] || [[ ! -f /opt/suwayomi-server_version.txt ]]; then - msg_info "Updating $APP" + if [[ "${RELEASE}" != "$(cat ~/.suwayomi-server 2>/dev/null)" ]] || [[ ! -f ~/.suwayomi-server ]]; then + JAVA_VERSION=21 setup_java msg_info "Stopping $APP" systemctl stop suwayomi-server msg_ok "Stopped $APP" - msg_info "Updating $APP to v${RELEASE}" - temp_file=$(mktemp) - RELEASE=$(curl -fsSL https://api.github.com/repos/Suwayomi/Suwayomi-Server/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') - curl -fsSL "https://github.com/Suwayomi/Suwayomi-Server/releases/download/${RELEASE}/Suwayomi-Server-${RELEASE}-debian-all.deb" -o "$temp_file" - $STD dpkg -i "$temp_file" - msg_ok "Updated $APP to v${RELEASE}" + fetch_and_deploy_gh_release "suwayomi-server" "Suwayomi/Suwayomi-Server" "binary" msg_info "Starting $APP" systemctl start suwayomi-server msg_ok "Started $APP" - msg_info "Cleaning Up" - rm -f "$temp_file" - msg_ok "Cleanup Completed" - - echo "${RELEASE}" >/opt/suwayomi-server_version.txt.txt msg_ok "Update Successful" else msg_ok "No update required. ${APP} is already at v${RELEASE}" diff --git a/frontend/public/json/suwayomi-server.json b/frontend/public/json/suwayomi-server.json new file mode 100644 index 000000000..f84ef1f96 --- /dev/null +++ b/frontend/public/json/suwayomi-server.json @@ -0,0 +1,40 @@ +{ + "name": "Suwayomi-Server", + "slug": "suwayomi-server", + "categories": [ + 13 + ], + "date_created": "2025-02-07", + "type": "ct", + "updateable": true, + "privileged": false, + "interface_port": 4567, + "documentation": "https://github.com/Suwayomi/Suwayomi-Server/wiki", + "website": "https://github.com/Suwayomi/Suwayomi-Server", + "logo": "https://cdn.jsdelivr.net/gh/selfhst/icons/webp/suwayomi.webp", + "config_path": "", + "description": "A free and open source manga reader server that runs extensions built for Mihon (Tachiyomi).", + "install_methods": [ + { + "type": "default", + "script": "ct/suwayomiserver.sh", + "resources": { + "cpu": 1, + "ram": 1024, + "hdd": 4, + "os": "debian", + "version": "12" + } + } + ], + "default_credentials": { + "username": null, + "password": null + }, + "notes": [ + { + "text": "This application can be conflicting with Kaspersky products. You maybe need to disable Kaspersky in order to use this application.", + "type": "info" + } + ] +} diff --git a/install/suwayomiserver-install.sh b/install/suwayomiserver-install.sh index ffe7485c1..86d929d70 100644 --- a/install/suwayomiserver-install.sh +++ b/install/suwayomiserver-install.sh @@ -18,14 +18,7 @@ $STD apt-get install -y libc++-dev msg_ok "Installed Dependencies" JAVA_VERSION=21 setup_java - -msg_info "Settting up Suwayomi-Server" -temp_file=$(mktemp) -RELEASE=$(curl -fsSL https://api.github.com/repos/Suwayomi/Suwayomi-Server/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') -curl -fsSL "https://github.com/Suwayomi/Suwayomi-Server/releases/download/${RELEASE}/Suwayomi-Server-${RELEASE}-debian-all.deb" -o "$temp_file" -$STD dpkg -i "$temp_file" -echo "${RELEASE}" >/opt/suwayomi-server_version.txt -msg_ok "Done setting up Suwayomi-Server" +fetch_and_deploy_gh_release "suwayomi-server" "Suwayomi/Suwayomi-Server" "binary" msg_info "Creating Service" cat </etc/systemd/system/suwayomi-server.service @@ -47,7 +40,6 @@ motd_ssh customize msg_info "Cleaning up" -rm -f "$temp_file" $STD apt-get -y autoremove $STD apt-get -y autoclean msg_ok "Cleaned"