add suwayomi-server script

This commit is contained in:
tremor021 2025-02-07 15:52:24 +01:00
parent 7dcc717017
commit ebaad62c1d
3 changed files with 156 additions and 0 deletions

65
ct/suwayomiserver.sh Normal file
View File

@ -0,0 +1,65 @@
#!/usr/bin/env bash
source <(curl -s https://raw.githubusercontent.com/tremor021/ProxmoxVE/refs/heads/suwayomi/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
VERSION=$(curl -s https://api.github.com/repos/Suwayomi/Suwayomi-Server/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
if [[ "${VERSION}" != "$(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${VERSION}"
RELEASE=$(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 $RELEASE
$STD dpkg -i *.deb
msg_ok "Updated $APP to v${VERSION}"
msg_info "Starting $APP"
systemctl start suwayomi-server
msg_ok "Started $APP"
msg_info "Cleaning Up"
rm -f *.deb
msg_ok "Cleanup Completed"
echo "${VERSION}" >/opt/${APP}_version.txt
msg_ok "Update Successful"
else
msg_ok "No update required. ${APP} is already at v${VERSION}"
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}"

View File

@ -0,0 +1,52 @@
#!/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"
RELEASE=$(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)
VERSION=$(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 $RELEASE
$STD dpkg -i *.deb
rm -f *.deb
echo ${VERSION} >/opt/suwayomi-server_version.txt
msg_ok "Done setting up Suwayomi-Server"
msg_info "Creating Service"
cat <<EOF >/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"
$STD apt-get -y autoremove
$STD apt-get -y autoclean
msg_ok "Cleaned"

39
json/suwayomi-server.json Normal file
View File

@ -0,0 +1,39 @@
{
"name": "Suwayomi-Server",
"slug": "suwayomi-server",
"categories": [
0
],
"date_created": "2025-02-07",
"type": "ct",
"updateable": true,
"privileged": false,
"interface_port": 4567,
"documentation": "https://github.com/Suwayomi/Suwayomi-Servernull",
"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": 8,
"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"
}
]
}