Skip to content

Commit 27ac263

Browse files
alpine-rclone (#4265)
* 'Add new script' * path --------- 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 1bff7fe commit 27ac263

File tree

3 files changed

+178
-0
lines changed

3 files changed

+178
-0
lines changed

ct/alpine-rclone.sh

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
#!/usr/bin/env bash
2+
source <(curl -fsSL 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="Alpine-rclone"
9+
var_tags="${var_tags:-alpine;backup}"
10+
var_cpu="${var_cpu:-1}"
11+
var_ram="${var_ram:-256}"
12+
var_disk="${var_disk:-1}"
13+
var_os="${var_os:-alpine}"
14+
var_version="${var_version:-3.21}"
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+
27+
if [ ! -d /opt/rclone ]; then
28+
msg_error "No ${APP} Installation Found!"
29+
exit 1
30+
fi
31+
32+
RELEASE=$(curl -s https://api.github.com/repos/rclone/rclone/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
33+
if [ "${RELEASE}" != "$(cat /opt/rclone_version.txt)" ] || [ ! -f /opt/rclone_version.txt ]; then
34+
msg_info "Updating ${APP} LXC"
35+
temp_file=$(mktemp)
36+
curl -fsSL "https://github.com/rclone/rclone/releases/download/v${RELEASE}/rclone-v${RELEASE}-linux-amd64.zip" -o "$temp_file"
37+
$STD unzip -o "$temp_file" '*/**' -d /opt/rclone
38+
rm -f "$temp_file"
39+
echo "${RELEASE}" >/opt/rclone_version.txt
40+
msg_ok "Updated Successfully"
41+
else
42+
msg_ok "No update required. ${APP} is already at ${RELEASE}"
43+
fi
44+
45+
exit 0
46+
}
47+
48+
start
49+
build_container
50+
description
51+
52+
msg_ok "Completed Successfully!\n"
53+
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
54+
echo -e "${INFO}${YW} Access it using the following IP:${CL}"
55+
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:3000${CL}"
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
{
2+
"name": "Alpine-rclone",
3+
"slug": "alpine-rclone",
4+
"categories": [
5+
11
6+
],
7+
"date_created": "2025-04-28",
8+
"type": "ct",
9+
"updateable": true,
10+
"privileged": false,
11+
"interface_port": 3000,
12+
"documentation": "https://rclone.org/docs/",
13+
"website": "https://rclone.org/",
14+
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons/svg/rclone.svg",
15+
"config_path": "~/.config/rclone/rclone.conf",
16+
"description": "Rclone is a command-line program to manage files on cloud storage. It is a feature-rich alternative to cloud vendors' web storage interfaces",
17+
"install_methods": [
18+
{
19+
"type": "default",
20+
"script": "ct/alpine-rclone.sh",
21+
"resources": {
22+
"cpu": 1,
23+
"ram": 256,
24+
"hdd": 1,
25+
"os": "alpine",
26+
"version": "3.21"
27+
}
28+
},
29+
{
30+
"type": "alpine",
31+
"script": "ct/alpine-rclone.sh",
32+
"resources": {
33+
"cpu": 1,
34+
"ram": 256,
35+
"hdd": 1,
36+
"os": "alpine",
37+
"version": "3.21"
38+
}
39+
}
40+
],
41+
"default_credentials": {
42+
"username": null,
43+
"password": null
44+
},
45+
"notes": [
46+
{
47+
"type": "info",
48+
"text": "`cat ~/rclone.creds` to view login credentials"
49+
},
50+
{
51+
"type": "info",
52+
"text": "`htpasswd -b -B /opt/rclone/login.pwd newuser newuserpassword` to add more users."
53+
}
54+
]
55+
}

install/alpine-rclone-install.sh

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
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 apk add --no-cache \
18+
unzip \
19+
apache2-utils
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=$(head -c 16 /dev/urandom | xxd -p -c 16)
30+
$STD htpasswd -cb -B 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+
rm -f "$temp_file"
38+
msg_ok "Installed rclone"
39+
40+
msg_info "Enabling rclone Service"
41+
cat <<EOF >/etc/init.d/rclone
42+
#!/sbin/openrc-run
43+
description="rclone Service"
44+
command="/opt/rclone/rclone"
45+
command_args="rcd --rc-web-gui --rc-web-gui-no-open-browser --rc-addr :3000 --rc-htpasswd /opt/rclone/login.pwd"
46+
command_background="true"
47+
command_user="root"
48+
pidfile="/var/run/rclone.pid"
49+
50+
depend() {
51+
use net
52+
}
53+
EOF
54+
chmod +x /etc/init.d/rclone
55+
$STD rc-update add rclone default
56+
msg_ok "Enabled rclone Service"
57+
58+
msg_info "Starting rclone"
59+
$STD service rclone start
60+
msg_ok "Started rclone"
61+
62+
motd_ssh
63+
customize
64+
65+
msg_info "Cleaning up"
66+
rm -rf "$temp_file"
67+
$STD apk cache clean
68+
msg_ok "Cleaned"

0 commit comments

Comments
 (0)