From c32e71cae3a5efcf561d0bfa30d7a434b066135c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Slavi=C5=A1a=20Are=C5=BEina?= <58952836+tremor021@users.noreply.github.com> Date: Tue, 11 Feb 2025 10:55:27 +0100 Subject: [PATCH] New Script: Suwayomi-Server (#2139) * add suwayomi-server script * fix header * Update ct/suwayomiserver.sh Co-authored-by: Michel Roegl-Brunner <73236783+michelroegl-brunner@users.noreply.github.com> * Update ct/suwayomiserver.sh Co-authored-by: Michel Roegl-Brunner <73236783+michelroegl-brunner@users.noreply.github.com> * fixes * more fixes * fixes * Update json/suwayomi-server.json Co-authored-by: bvdberg01 <74251551+bvdberg01@users.noreply.github.com> --------- Co-authored-by: Michel Roegl-Brunner <73236783+michelroegl-brunner@users.noreply.github.com> Co-authored-by: CanbiZ <47820557+MickLesk@users.noreply.github.com> Co-authored-by: bvdberg01 <74251551+bvdberg01@users.noreply.github.com> --- ct/suwayomiserver.sh | 66 +++++++++++++++++++++++++++++++ install/suwayomiserver-install.sh | 53 +++++++++++++++++++++++++ json/suwayomi-server.json | 39 ++++++++++++++++++ 3 files changed, 158 insertions(+) create mode 100644 ct/suwayomiserver.sh create mode 100644 install/suwayomiserver-install.sh create mode 100644 json/suwayomi-server.json diff --git a/ct/suwayomiserver.sh b/ct/suwayomiserver.sh new file mode 100644 index 00000000..afbd192f --- /dev/null +++ b/ct/suwayomiserver.sh @@ -0,0 +1,66 @@ +#!/usr/bin/env bash +source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +# Copyright (c) 2021-2025 community-scripts ORG +# Author: tremor021 +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://github.com/Suwayomi/Suwayomi-Server + +APP="Suwayomi-Server" +TAGS="media;manga" +var_cpu="1" +var_ram="1024" +var_disk="4" +var_os="debian" +var_version="12" +var_unprivileged="1" + +header_info "$APP" +base_settings + +variables +color +catch_errors + +function update_script() { + header_info + check_container_storage + check_container_resources + + if [[ ! -f /usr/bin/suwayomi-server ]]; then + msg_error "No ${APP} Installation Found!" + exit + fi + RELEASE=$(curl -s 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" + msg_info "Stopping $APP" + systemctl stop suwayomi-server + msg_ok "Stopped $APP" + msg_info "Updating $APP to v${RELEASE}" + cd /tmp + URL=$(curl -s https://api.github.com/repos/Suwayomi/Suwayomi-Server/releases/latest | grep "browser_download_url" | awk '{print substr($2, 2, length($2)-2) }' | tail -n+2 | head -n 1) + wget -q $URL + $STD dpkg -i /tmp/*.deb + msg_ok "Updated $APP to v${RELEASE}" + msg_info "Starting $APP" + systemctl start suwayomi-server + msg_ok "Started $APP" + msg_info "Cleaning Up" + rm -f *.deb + 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}" + fi + exit +} + +start +build_container +description + +msg_ok "Completed Successfully!\n" +echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" +echo -e "${INFO}${YW} Access it using the following URL:${CL}" +echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:4567${CL}" diff --git a/install/suwayomiserver-install.sh b/install/suwayomiserver-install.sh new file mode 100644 index 00000000..3d0354a9 --- /dev/null +++ b/install/suwayomiserver-install.sh @@ -0,0 +1,53 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2025 community-scripts ORG +# Author: tremor021 +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://github.com/Suwayomi/Suwayomi-Server + +source /dev/stdin <<< "$FUNCTIONS_FILE_PATH" +color +verb_ip6 +catch_errors +setting_up_container +network_check +update_os + +msg_info "Installing Dependencies" +$STD apt-get install -y \ + curl \ + sudo \ + mc \ + openjdk-17-jre \ + libc++-dev +msg_ok "Installed Dependencies" + +msg_info "Settting up Suwayomi-Server" +URL=$(curl -s https://api.github.com/repos/Suwayomi/Suwayomi-Server/releases/latest | grep "browser_download_url" | awk '{print substr($2, 2, length($2)-2) }' | tail -n+2 | head -n 1) +RELEASE=$(curl -s https://api.github.com/repos/Suwayomi/Suwayomi-Server/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') +wget -q $URL +$STD dpkg -i *.deb +echo ${RELEASE} >/opt/suwayomi-server_version.txt +msg_ok "Done setting up Suwayomi-Server" +msg_info "Creating Service" +cat </etc/systemd/system/suwayomi-server.service +[Unit] +Description=Suwayomi-Server Service +After=network.target + +[Service] +ExecStart=/usr/bin/suwayomi-server +Restart=always + +[Install] +WantedBy=multi-user.target +EOF +systemctl enable -q --now suwayomi-server +msg_ok "Created Service" +motd_ssh +customize +msg_info "Cleaning up" +rm -f *.deb +$STD apt-get -y autoremove +$STD apt-get -y autoclean +msg_ok "Cleaned" diff --git a/json/suwayomi-server.json b/json/suwayomi-server.json new file mode 100644 index 00000000..b28a9913 --- /dev/null +++ b/json/suwayomi-server.json @@ -0,0 +1,39 @@ +{ + "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://github.com/Suwayomi/Suwayomi-Server/raw/master/server/src/main/resources/icon/faviconlogo.png", + "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 is conflicting with Kaspersky products. You need to disable Kaspersky in order to use this application.", + "type": "info" + } + ] +} \ No newline at end of file