Skip to content

Commit 8181518

Browse files
authored
New script: cross-seed (#2186)
1 parent ba636ed commit 8181518

File tree

3 files changed

+156
-0
lines changed

3 files changed

+156
-0
lines changed

ct/cross-seed.sh

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
#!/usr/bin/env bash
2+
source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
3+
# Copyright (c) 2021-2025 community-scripts ORG
4+
# Author: Jakub Matraszek (jmatraszek)
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
# Source: https://www.cross-seed.org
7+
8+
APP="cross-seed"
9+
var_tags="arr"
10+
var_cpu="1"
11+
var_ram="1024"
12+
var_disk="2"
13+
var_os="debian"
14+
var_version="12"
15+
var_unprivileged="1"
16+
17+
header_info "$APP"
18+
base_settings
19+
20+
variables
21+
color
22+
catch_errors
23+
24+
function update_script() {
25+
header_info
26+
check_container_storage
27+
check_container_resources
28+
29+
if command -v cross-seed &> /dev/null; then
30+
current_version=$(cross-seed --version)
31+
latest_version=$(npm show cross-seed version)
32+
if [ "$current_version" != "$latest_version" ]; then
33+
msg_info "Updating ${APP} from version v${current_version} to v${latest_version}"
34+
npm install -g cross-seed@latest &> /dev/null
35+
systemctl restart cross-seed
36+
msg_ok "Updated Successfully"
37+
else
38+
msg_ok "${APP} is already at v${current_version}"
39+
fi
40+
else
41+
msg_error "No ${APP} Installation Found!"
42+
exit
43+
fi
44+
exit
45+
}
46+
47+
start
48+
build_container
49+
description
50+
51+
msg_ok "Completed Successfully!\n"
52+
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
53+
echo -e "${INFO}${YW} Access cross-seed API using the following URL:${CL}"
54+
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:2468${CL}"

install/cross-seed-install.sh

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright (c) 2021-2025 community-scripts ORG
4+
# Author: Jakub Matraszek (jmatraszek)
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
# Source: https://www.cross-seed.org
7+
8+
source /dev/stdin <<< "$FUNCTIONS_FILE_PATH"
9+
color
10+
verb_ip6
11+
catch_errors
12+
setting_up_container
13+
network_check
14+
update_os
15+
16+
msg_info "Installing Dependencies"
17+
$STD apt-get install -y \
18+
curl \
19+
sudo \
20+
mc \
21+
gnupg
22+
msg_ok "Installed Dependencies"
23+
24+
msg_info "Setting up Node.js Repository"
25+
mkdir -p /etc/apt/keyrings
26+
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
27+
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_23.x nodistro main" >/etc/apt/sources.list.d/nodesource.list
28+
msg_ok "Setup Node.js Repository"
29+
30+
msg_info "Setting up Node.js"
31+
$STD apt-get update
32+
$STD apt-get install -y nodejs
33+
msg_ok "Setup Node.js"
34+
35+
msg_info "Setup Cross-Seed"
36+
$STD npm install cross-seed@latest -g
37+
$STD cross-seed gen-config
38+
msg_ok "Setup Cross-Seed"
39+
40+
msg_info "Creating Service"
41+
cat <<EOF >/etc/systemd/system/cross-seed.service
42+
[Unit]
43+
Description=Cross-Seed daemon Service
44+
After=network.target
45+
46+
[Service]
47+
ExecStart=cross-seed daemon
48+
Restart=always
49+
User=root
50+
51+
[Install]
52+
WantedBy=multi-user.target
53+
EOF
54+
systemctl enable -q --now cross-seed
55+
msg_ok "Created Service"
56+
57+
motd_ssh
58+
customize
59+
60+
msg_info "Cleaning up"
61+
$STD apt-get -y autoremove
62+
$STD apt-get -y autoclean
63+
msg_ok "Cleaned"

json/cross-seed.json

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"name": "cross-seed",
3+
"slug": "cross-seed",
4+
"categories": [
5+
14
6+
],
7+
"date_created": "2025-02-07",
8+
"type": "ct",
9+
"updateable": true,
10+
"privileged": false,
11+
"interface_port": 2468,
12+
"documentation": "https://www.cross-seed.org/docs/category/basics",
13+
"website": "https://www.cross-seed.org/",
14+
"logo": "https://www.cross-seed.org/img/cross-seed.svg",
15+
"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.",
16+
"install_methods": [
17+
{
18+
"type": "default",
19+
"script": "ct/cross-seed.sh",
20+
"resources": {
21+
"cpu": 1,
22+
"ram": 1024,
23+
"hdd": 2,
24+
"os": "debian",
25+
"version": "12"
26+
}
27+
}
28+
],
29+
"default_credentials": {
30+
"username": null,
31+
"password": null
32+
},
33+
"notes": [
34+
{
35+
"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`.",
36+
"type": "info"
37+
}
38+
]
39+
}

0 commit comments

Comments
 (0)