mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-08-28 07:11:00 +02:00
Breaking Change: Migrate all "Alpine" Scripts to Normal CT's (#16587)
This commit is contained in:
committed by
GitHub
parent
f0b236ec77
commit
92e72e4137
+67
-14
@@ -13,25 +13,26 @@ setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
|
||||
msg_info "Installing Dependencies"
|
||||
$STD apt install -y apache2-utils fuse3
|
||||
msg_ok "Installed Dependencies"
|
||||
setup_deb_based() {
|
||||
msg_info "Installing Dependencies"
|
||||
$STD apt install -y apache2-utils fuse3
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
fetch_and_deploy_gh_release "rclone" "rclone/rclone" "prebuild" "latest" "/opt/rclone" "rclone*linux-$(arch_resolve).zip"
|
||||
fetch_and_deploy_gh_release "rclone" "rclone/rclone" "prebuild" "latest" "/opt/rclone" "rclone*linux-$(arch_resolve).zip"
|
||||
|
||||
msg_info "Installing rclone"
|
||||
cd /opt/rclone
|
||||
RCLONE_PASSWORD=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13)
|
||||
$STD htpasswd -cb -B /opt/login.pwd admin "$RCLONE_PASSWORD"
|
||||
cat <<EOF >~/rclone.creds
|
||||
msg_info "Installing rclone"
|
||||
cd /opt/rclone
|
||||
RCLONE_PASSWORD=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13)
|
||||
$STD htpasswd -cb -B /opt/login.pwd admin "$RCLONE_PASSWORD"
|
||||
cat <<EOF >~/rclone.creds
|
||||
rclone-Credentials
|
||||
rclone User Name: admin
|
||||
rclone Password: $RCLONE_PASSWORD
|
||||
EOF
|
||||
msg_ok "Installed rclone"
|
||||
msg_ok "Installed rclone"
|
||||
|
||||
msg_info "Creating Service"
|
||||
cat <<EOF >/etc/systemd/system/rclone-web.service
|
||||
msg_info "Creating Service"
|
||||
cat <<EOF >/etc/systemd/system/rclone-web.service
|
||||
[Unit]
|
||||
Description=Rclone Web GUI
|
||||
After=network-online.target
|
||||
@@ -46,8 +47,60 @@ Restart=on-failure
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl enable -q --now rclone-web
|
||||
msg_ok "Created Service"
|
||||
systemctl enable -q --now rclone-web
|
||||
msg_ok "Created Service"
|
||||
}
|
||||
|
||||
setup_alpine() {
|
||||
msg_info "Installing dependencies"
|
||||
$STD apk add --no-cache \
|
||||
apache2-utils fuse3
|
||||
msg_ok "Installed dependencies"
|
||||
|
||||
msg_info "Installing rclone"
|
||||
temp_file=$(mktemp)
|
||||
mkdir -p /opt/rclone
|
||||
RELEASE=$(curl -s https://api.github.com/repos/rclone/rclone/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
|
||||
curl -fsSL "https://github.com/rclone/rclone/releases/download/v${RELEASE}/rclone-v${RELEASE}-linux-$(arch_resolve).zip" -o "$temp_file"
|
||||
$STD unzip -j "$temp_file" '*/**' -d /opt/rclone
|
||||
cd /opt/rclone
|
||||
RCLONE_PASSWORD=$(head -c 16 /dev/urandom | xxd -p -c 16)
|
||||
$STD htpasswd -cb -B /opt/login.pwd admin "$RCLONE_PASSWORD"
|
||||
cat <<EOF >~/rclone.creds
|
||||
rclone-Credentials
|
||||
rclone User Name: admin
|
||||
rclone Password: $RCLONE_PASSWORD
|
||||
EOF
|
||||
echo "${RELEASE}" >/opt/rclone_version.txt
|
||||
rm -f "$temp_file"
|
||||
msg_ok "Installed rclone"
|
||||
|
||||
msg_info "Enabling rclone Service"
|
||||
cat <<EOF >/etc/init.d/rclone
|
||||
#!/sbin/openrc-run
|
||||
description="rclone Service"
|
||||
command="/opt/rclone/rclone"
|
||||
command_args="rcd --rc-web-gui --rc-web-gui-no-open-browser --rc-addr :3000 --rc-htpasswd /opt/login.pwd"
|
||||
command_background="true"
|
||||
command_user="root"
|
||||
pidfile="/var/run/rclone.pid"
|
||||
|
||||
depend() {
|
||||
use net
|
||||
}
|
||||
EOF
|
||||
chmod +x /etc/init.d/rclone
|
||||
$STD rc-update add rclone default
|
||||
msg_ok "Enabled rclone Service"
|
||||
|
||||
msg_info "Starting rclone"
|
||||
$STD service rclone start
|
||||
msg_ok "Started rclone"
|
||||
|
||||
rm -rf "$temp_file"
|
||||
}
|
||||
|
||||
run_os_setup
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
|
||||
Reference in New Issue
Block a user