mirror of
https://github.com/community-scripts/ProxmoxVE
synced 2025-02-11 02:09:17 +00:00
New script: cross-seed
This commit is contained in:
parent
f1eca8a4bf
commit
de3efb8760
56
ct/cross-seed.sh
Normal file
56
ct/cross-seed.sh
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
#!/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: Jakub Matraszek (jmatraszek)
|
||||||
|
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||||
|
# Source: https://www.cross-seed.org
|
||||||
|
|
||||||
|
# App Default Values
|
||||||
|
APP="cross-seed"
|
||||||
|
var_tags="arr"
|
||||||
|
var_cpu="1"
|
||||||
|
var_ram="1024"
|
||||||
|
var_disk="2"
|
||||||
|
var_os="debian"
|
||||||
|
var_version="12"
|
||||||
|
var_unprivileged="1"
|
||||||
|
|
||||||
|
# App Output & Base Settings
|
||||||
|
header_info "$APP"
|
||||||
|
base_settings
|
||||||
|
|
||||||
|
# Core
|
||||||
|
variables
|
||||||
|
color
|
||||||
|
catch_errors
|
||||||
|
|
||||||
|
function update_script() {
|
||||||
|
header_info
|
||||||
|
check_container_storage
|
||||||
|
check_container_resources
|
||||||
|
|
||||||
|
if command -v cross-seed &> /dev/null; then
|
||||||
|
current_version=$(cross-seed --version)
|
||||||
|
latest_version=$(npm show cross-seed version)
|
||||||
|
if [ "$current_version" != "$latest_version" ]; then
|
||||||
|
msg_info "Updating ${APP} from version v${current_version} to v${latest_version}"
|
||||||
|
npm install -g cross-seed@latest &> /dev/null
|
||||||
|
msg_ok "Updated Successfully"
|
||||||
|
else
|
||||||
|
msg_ok "${APP} is already at v${current_version}"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
msg_error "No ${APP} Installation Found!"
|
||||||
|
exit
|
||||||
|
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 cross-seed API using the following URL:${CL}"
|
||||||
|
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:2468${CL}"
|
66
install/cross-seed-install.sh
Normal file
66
install/cross-seed-install.sh
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# Copyright (c) 2021-2025 community-scripts ORG
|
||||||
|
# Author: Jakub Matraszek (jmatraszek)
|
||||||
|
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||||
|
# Source: https://www.cross-seed.org
|
||||||
|
|
||||||
|
# Import Functions und Setup
|
||||||
|
source /dev/stdin <<< "$FUNCTIONS_FILE_PATH"
|
||||||
|
color
|
||||||
|
verb_ip6
|
||||||
|
catch_errors
|
||||||
|
setting_up_container
|
||||||
|
network_check
|
||||||
|
update_os
|
||||||
|
|
||||||
|
# Installing Dependencies with the 3 core dependencies (curl;sudo;mc)
|
||||||
|
msg_info "Installing Dependencies"
|
||||||
|
$STD apt-get install -y \
|
||||||
|
curl \
|
||||||
|
sudo \
|
||||||
|
mc \
|
||||||
|
gnupg
|
||||||
|
msg_ok "Installed Dependencies"
|
||||||
|
|
||||||
|
msg_info "Setting up Node.js Repository"
|
||||||
|
mkdir -p /etc/apt/keyrings
|
||||||
|
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
|
||||||
|
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" >/etc/apt/sources.list.d/nodesource.list
|
||||||
|
msg_ok "Setup Node.js Repository"
|
||||||
|
|
||||||
|
msg_info "Setting up Node.js"
|
||||||
|
$STD apt-get update
|
||||||
|
$STD apt-get install -y nodejs
|
||||||
|
msg_ok "Setup Node.js"
|
||||||
|
|
||||||
|
msg_info "Setup ${APPLICATION}"
|
||||||
|
$STD npm install cross-seed@latest -g
|
||||||
|
$STD cross-seed gen-config
|
||||||
|
msg_ok "Setup ${APPLICATION}"
|
||||||
|
|
||||||
|
# Creating Service (if needed)
|
||||||
|
msg_info "Creating Service"
|
||||||
|
cat <<EOF >/etc/systemd/system/${APPLICATION}.service
|
||||||
|
[Unit]
|
||||||
|
Description=${APPLICATION} daemon Service
|
||||||
|
After=network.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
ExecStart=cross-seed daemon
|
||||||
|
Restart=always
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
EOF
|
||||||
|
systemctl enable -q --now ${APPLICATION}.service
|
||||||
|
msg_ok "Created Service"
|
||||||
|
|
||||||
|
motd_ssh
|
||||||
|
customize
|
||||||
|
|
||||||
|
# Cleanup
|
||||||
|
msg_info "Cleaning up"
|
||||||
|
$STD apt-get -y autoremove
|
||||||
|
$STD apt-get -y autoclean
|
||||||
|
msg_ok "Cleaned"
|
39
json/cross-seed.json
Normal file
39
json/cross-seed.json
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
{
|
||||||
|
"name": "cross-seed",
|
||||||
|
"slug": "cross-seed",
|
||||||
|
"categories": [
|
||||||
|
14
|
||||||
|
],
|
||||||
|
"date_created": "2025-02-07",
|
||||||
|
"type": "ct",
|
||||||
|
"updateable": true,
|
||||||
|
"privileged": false,
|
||||||
|
"interface_port": 2468,
|
||||||
|
"documentation": "https://www.cross-seed.org/docs/category/basics",
|
||||||
|
"website": "https://www.cross-seed.org/",
|
||||||
|
"logo": "https://www.cross-seed.org/img/cross-seed.svg",
|
||||||
|
"description": "cross-seed is an app designed to help you download torrents that you can cross seed based on your existing torrents. It is designed to match conservatively to minimize manual intervention.",
|
||||||
|
"install_methods": [
|
||||||
|
{
|
||||||
|
"type": "default",
|
||||||
|
"script": "ct/cross-seed.sh",
|
||||||
|
"resources": {
|
||||||
|
"cpu": 1,
|
||||||
|
"ram": 1024,
|
||||||
|
"hdd": 2,
|
||||||
|
"os": "debian",
|
||||||
|
"version": "12"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"default_credentials": {
|
||||||
|
"username": null,
|
||||||
|
"password": null
|
||||||
|
},
|
||||||
|
"notes": [
|
||||||
|
{
|
||||||
|
"text": "After the installation cross-seed will fail to start with an empty configuration. To fix this, edit `~/.cross-seed/config.js` to properly configure cross-seed, then restart by running `systemctl restart cross-seed`.",
|
||||||
|
"type": "info"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user