Skip to content

Commit a386765

Browse files
rclone (#4579)
* 'Add new script' * remove alpine only file * Update rclone.json --------- Co-authored-by: push-app-to-main[bot] <203845782+push-app-to-main[bot]@users.noreply.github.com> Co-authored-by: CanbiZ <[email protected]>
1 parent d252e33 commit a386765

File tree

4 files changed

+143
-7
lines changed

4 files changed

+143
-7
lines changed

ct/headers/rclone

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
____ __
2+
/ __ \_____/ /___ ____ ___
3+
/ /_/ / ___/ / __ \/ __ \/ _ \
4+
/ _, _/ /__/ / /_/ / / / / __/
5+
/_/ |_|\___/_/\____/_/ /_/\___/
6+

ct/rclone.sh

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
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: Slaviša Arežina (tremor021)
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
# Source: https://github.com/rclone/rclone
7+
8+
APP="Rclone"
9+
var_tags="${var_tags:-os}"
10+
var_cpu="${var_cpu:-1}"
11+
var_ram="${var_ram:-512}"
12+
var_disk="${var_disk:-2}"
13+
var_os="${var_os:-debian}"
14+
var_version="${var_version:-12}"
15+
var_unprivileged="${var_unprivileged:-1}"
16+
17+
header_info "$APP"
18+
variables
19+
color
20+
catch_errors
21+
22+
function update_script() {
23+
header_info
24+
check_container_storage
25+
check_container_resources
26+
if [[ ! -d /opt/rclone ]]; then
27+
msg_error "No ${APP} Installation Found!"
28+
exit
29+
fi
30+
RELEASE=$(curl -s https://api.github.com/repos/rclone/rclone/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
31+
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
32+
msg_info "Stopping Service"
33+
systemctl stop rclone-web
34+
msg_ok "Stopped Service"
35+
36+
msg_info "Updating ${APP} to v${RELEASE}"
37+
temp_file=$(mktemp)
38+
rm -rf /opt/rclone/*
39+
curl -fsSL "https://github.com/rclone/rclone/releases/download/v${RELEASE}/rclone-v${RELEASE}-linux-amd64.zip" -o "$temp_file"
40+
$STD unzip -j "$temp_file" '*/**' -d /opt/rclone
41+
echo "${RELEASE}" >/opt/${APP}_version.txt
42+
msg_ok "Updated $APP to v${RELEASE}"
43+
44+
msg_info "Starting Service"
45+
systemctl start rclone-web
46+
msg_ok "Started Service"
47+
48+
msg_info "Cleaning up"
49+
rm -f "$temp_file"
50+
msg_ok "Cleaned"
51+
msg_ok "Updated Successfully"
52+
else
53+
msg_ok "No update required. ${APP} is already at v${RELEASE}"
54+
fi
55+
exit
56+
}
57+
58+
start
59+
build_container
60+
description
61+
62+
msg_ok "Completed Successfully!\n"
63+
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
64+
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
65+
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:3000${CL}"
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"name": "Alpine-rclone",
3-
"slug": "alpine-rclone",
2+
"name": "Rclone",
3+
"slug": "rclone",
44
"categories": [
55
11
66
],
7-
"date_created": "2025-05-06",
7+
"date_created": "2025-05-15",
88
"type": "ct",
99
"updateable": true,
1010
"privileged": false,
@@ -17,16 +17,16 @@
1717
"install_methods": [
1818
{
1919
"type": "default",
20-
"script": "ct/alpine-rclone.sh",
20+
"script": "ct/rclone.sh",
2121
"resources": {
2222
"cpu": 1,
2323
"ram": 256,
2424
"hdd": 1,
25-
"os": "alpine",
26-
"version": "3.21"
25+
"os": "debian",
26+
"version": "12"
2727
}
2828
},
29-
{
29+
{
3030
"type": "alpine",
3131
"script": "ct/alpine-rclone.sh",
3232
"resources": {

install/rclone-install.sh

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright (c) 2021-2025 community-scripts ORG
4+
# Author: Slaviša Arežina (tremor021)
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
# Source: https://github.com/rclone/rclone
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+
apache2-utils \
19+
unzip
20+
msg_ok "Installed Dependencies"
21+
22+
msg_info "Installing rclone"
23+
temp_file=$(mktemp)
24+
mkdir -p /opt/rclone
25+
RELEASE=$(curl -s https://api.github.com/repos/rclone/rclone/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
26+
curl -fsSL "https://github.com/rclone/rclone/releases/download/v${RELEASE}/rclone-v${RELEASE}-linux-amd64.zip" -o "$temp_file"
27+
$STD unzip -j "$temp_file" '*/**' -d /opt/rclone
28+
cd /opt/rclone
29+
RCLONE_PASSWORD=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13)
30+
$STD htpasswd -cb -B /opt/login.pwd admin "$RCLONE_PASSWORD"
31+
{
32+
echo "rclone-Credentials"
33+
echo "rclone User Name: admin"
34+
echo "rclone Password: $RCLONE_PASSWORD"
35+
} >>~/rclone.creds
36+
echo "${RELEASE}" >/opt/rclone_version.txt
37+
msg_ok "Installed rclone"
38+
39+
msg_info "Creating Service"
40+
cat <<EOF >/etc/systemd/system/rclone-web.service
41+
[Unit]
42+
Description=Rclone Web GUI
43+
After=network-online.target
44+
45+
[Service]
46+
Type=simple
47+
User=root
48+
WorkingDirectory=/opt/rclone
49+
ExecStart=/opt/rclone/rclone rcd --rc-web-gui --rc-web-gui-no-open-browser --rc-addr :3000 --rc-htpasswd /opt/login.pwd
50+
Restart=on-failure
51+
52+
[Install]
53+
WantedBy=multi-user.target
54+
EOF
55+
systemctl enable -q --now rclone-web
56+
msg_ok "Created Service"
57+
58+
motd_ssh
59+
customize
60+
61+
msg_info "Cleaning up"
62+
rm -f "$temp_file"
63+
$STD apt-get -y autoremove
64+
$STD apt-get -y autoclean
65+
msg_ok "Cleaned"

0 commit comments

Comments
 (0)