Merge branch 'main' of https://github.com/community-scripts/ProxmoxVED
This commit is contained in:
		
						commit
						a13b714208
					
				
							
								
								
									
										37
									
								
								ct/rclone.sh
									
									
									
									
									
								
							
							
						
						
									
										37
									
								
								ct/rclone.sh
									
									
									
									
									
								
							@ -1,9 +1,9 @@
 | 
				
			|||||||
#!/usr/bin/env bash
 | 
					#!/usr/bin/env bash
 | 
				
			||||||
source <(curl -s https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/main/misc/build.func)
 | 
					source <(curl -s https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/main/misc/build.func)
 | 
				
			||||||
# Copyright (c) 2021-2025 community-scripts ORG
 | 
					# Copyright (c) 2021-2025 community-scripts ORG
 | 
				
			||||||
# Author: MickLesk (CanbiZ)
 | 
					# Author: Slaviša Arežina (tremor021)
 | 
				
			||||||
# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE
 | 
					# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE
 | 
				
			||||||
# Source: https://rclone.org/
 | 
					# Source: https://github.com/rclone/rclone
 | 
				
			||||||
 | 
					
 | 
				
			||||||
APP="Rclone"
 | 
					APP="Rclone"
 | 
				
			||||||
var_tags="${var_tags:-os}"
 | 
					var_tags="${var_tags:-os}"
 | 
				
			||||||
@ -23,14 +23,35 @@ function update_script() {
 | 
				
			|||||||
  header_info
 | 
					  header_info
 | 
				
			||||||
  check_container_storage
 | 
					  check_container_storage
 | 
				
			||||||
  check_container_resources
 | 
					  check_container_resources
 | 
				
			||||||
  if [[ ! -d /var ]]; then
 | 
					  if [[ ! -d /opt/rclone ]]; then
 | 
				
			||||||
    msg_error "No ${APP} Installation Found!"
 | 
					    msg_error "No ${APP} Installation Found!"
 | 
				
			||||||
    exit
 | 
					    exit
 | 
				
			||||||
  fi
 | 
					  fi
 | 
				
			||||||
  msg_info "Updating $APP LXC"
 | 
					  RELEASE=$(curl -s https://api.github.com/repos/rclone/rclone/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
 | 
				
			||||||
  $STD apt-get update
 | 
					  if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
 | 
				
			||||||
  $STD apt-get -y upgrade
 | 
					    msg_info "Stopping Service"
 | 
				
			||||||
  msg_ok "Updated $APP LXC"
 | 
					    systemctl stop rclone-web
 | 
				
			||||||
 | 
					    msg_ok "Stopped Service"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    msg_info "Updating ${APP} to v${RELEASE}"
 | 
				
			||||||
 | 
					    temp_file=$(mktemp)
 | 
				
			||||||
 | 
					    rm -rf /opt/rclone/*
 | 
				
			||||||
 | 
					    curl -fsSL "https://github.com/rclone/rclone/releases/download/v${RELEASE}/rclone-v${RELEASE}-linux-amd64.zip" -o "$temp_file"
 | 
				
			||||||
 | 
					    $STD unzip -j "$temp_file" '*/**' -d /opt/rclone
 | 
				
			||||||
 | 
					    echo "${RELEASE}" >/opt/${APP}_version.txt
 | 
				
			||||||
 | 
					    msg_ok "Updated $APP to v${RELEASE}"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    msg_info "Starting Service"
 | 
				
			||||||
 | 
					    systemctl start rclone-web
 | 
				
			||||||
 | 
					    msg_ok "Started Service"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    msg_info "Cleaning up"
 | 
				
			||||||
 | 
					    rm -f "$temp_file"
 | 
				
			||||||
 | 
					    msg_ok "Cleaned"
 | 
				
			||||||
 | 
					    msg_ok "Updated Successfully"
 | 
				
			||||||
 | 
					  else
 | 
				
			||||||
 | 
					    msg_ok "No update required. ${APP} is already at v${RELEASE}"
 | 
				
			||||||
 | 
					  fi
 | 
				
			||||||
  exit
 | 
					  exit
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -40,3 +61,5 @@ description
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
msg_ok "Completed Successfully!\n"
 | 
					msg_ok "Completed Successfully!\n"
 | 
				
			||||||
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
 | 
					echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
 | 
				
			||||||
 | 
					echo -e "${INFO}${YW} Access it using the following URL:${CL}"
 | 
				
			||||||
 | 
					echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:3000${CL}"
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										55
									
								
								frontend/public/json/rclone.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										55
									
								
								frontend/public/json/rclone.json
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,55 @@
 | 
				
			|||||||
 | 
					{
 | 
				
			||||||
 | 
					  "name": "Rclone",
 | 
				
			||||||
 | 
					  "slug": "rclone",
 | 
				
			||||||
 | 
					  "categories": [
 | 
				
			||||||
 | 
					    11
 | 
				
			||||||
 | 
					  ],
 | 
				
			||||||
 | 
					  "date_created": "2025-05-06",
 | 
				
			||||||
 | 
					  "type": "ct",
 | 
				
			||||||
 | 
					  "updateable": true,
 | 
				
			||||||
 | 
					  "privileged": false,
 | 
				
			||||||
 | 
					  "interface_port": 3000,
 | 
				
			||||||
 | 
					  "documentation": "https://rclone.org/docs/",
 | 
				
			||||||
 | 
					  "website": "https://rclone.org/",
 | 
				
			||||||
 | 
					  "logo": "https://cdn.jsdelivr.net/gh/selfhst/icons/svg/rclone.svg",
 | 
				
			||||||
 | 
					  "config_path": "~/.config/rclone/rclone.conf",
 | 
				
			||||||
 | 
					  "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",
 | 
				
			||||||
 | 
					  "install_methods": [
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					      "type": "default",
 | 
				
			||||||
 | 
					      "script": "ct/rclone.sh",
 | 
				
			||||||
 | 
					      "resources": {
 | 
				
			||||||
 | 
					        "cpu": 1,
 | 
				
			||||||
 | 
					        "ram": 256,
 | 
				
			||||||
 | 
					        "hdd": 1,
 | 
				
			||||||
 | 
					        "os": "debian",
 | 
				
			||||||
 | 
					        "version": "12"
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					      "type": "alpine",
 | 
				
			||||||
 | 
					      "script": "ct/alpine-rclone.sh",
 | 
				
			||||||
 | 
					      "resources": {
 | 
				
			||||||
 | 
					        "cpu": 1,
 | 
				
			||||||
 | 
					        "ram": 256,
 | 
				
			||||||
 | 
					        "hdd": 1,
 | 
				
			||||||
 | 
					        "os": "alpine",
 | 
				
			||||||
 | 
					        "version": "3.21"
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  ],
 | 
				
			||||||
 | 
					  "default_credentials": {
 | 
				
			||||||
 | 
					    "username": null,
 | 
				
			||||||
 | 
					    "password": null
 | 
				
			||||||
 | 
					  },
 | 
				
			||||||
 | 
					  "notes": [
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					      "type": "info",
 | 
				
			||||||
 | 
					      "text": "`cat ~/rclone.creds` to view login credentials"
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					      "type": "info",
 | 
				
			||||||
 | 
					      "text": "`htpasswd -b -B /opt/login.pwd newuser newuserpassword` to add more users."
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  ]
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -1,9 +1,9 @@
 | 
				
			|||||||
#!/usr/bin/env bash
 | 
					#!/usr/bin/env bash
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Copyright (c) 2021-2025 tteck
 | 
					# Copyright (c) 2021-2025 community-scripts ORG
 | 
				
			||||||
# Author: tteck (tteckster)
 | 
					# Author: Slaviša Arežina (tremor021)
 | 
				
			||||||
# License: MIT
 | 
					# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
 | 
				
			||||||
# https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE
 | 
					# Source: https://github.com/rclone/rclone
 | 
				
			||||||
 | 
					
 | 
				
			||||||
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
 | 
					source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
 | 
				
			||||||
color
 | 
					color
 | 
				
			||||||
@ -14,14 +14,29 @@ network_check
 | 
				
			|||||||
update_os
 | 
					update_os
 | 
				
			||||||
 | 
					
 | 
				
			||||||
msg_info "Installing Dependencies"
 | 
					msg_info "Installing Dependencies"
 | 
				
			||||||
$STD apt-get install -y gnupg2
 | 
					$STD apt-get install -y \
 | 
				
			||||||
 | 
					  apache2-utils \
 | 
				
			||||||
 | 
					  unzip
 | 
				
			||||||
msg_ok "Installed Dependencies"
 | 
					msg_ok "Installed Dependencies"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
msg_info "Installing rclone"
 | 
					msg_info "Installing rclone"
 | 
				
			||||||
$STD fetch_and_deploy_gh_release rclone/rclone
 | 
					temp_file=$(mktemp)
 | 
				
			||||||
dpkg -i rclone-v1.69.1-linux-amd64.deb
 | 
					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-amd64.zip" -o "$temp_file"
 | 
				
			||||||
 | 
					$STD unzip -j "$temp_file" '*/**' -d /opt/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"
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					  echo "rclone-Credentials"
 | 
				
			||||||
 | 
					  echo "rclone User Name: admin"
 | 
				
			||||||
 | 
					  echo "rclone Password: $RCLONE_PASSWORD"
 | 
				
			||||||
 | 
					} >>~/rclone.creds
 | 
				
			||||||
 | 
					echo "${RELEASE}" >/opt/rclone_version.txt
 | 
				
			||||||
msg_ok "Installed rclone"
 | 
					msg_ok "Installed rclone"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					msg_info "Creating Service"
 | 
				
			||||||
cat <<EOF >/etc/systemd/system/rclone-web.service
 | 
					cat <<EOF >/etc/systemd/system/rclone-web.service
 | 
				
			||||||
[Unit]
 | 
					[Unit]
 | 
				
			||||||
Description=Rclone Web GUI
 | 
					Description=Rclone Web GUI
 | 
				
			||||||
@ -30,19 +45,21 @@ After=network-online.target
 | 
				
			|||||||
[Service]
 | 
					[Service]
 | 
				
			||||||
Type=simple
 | 
					Type=simple
 | 
				
			||||||
User=root
 | 
					User=root
 | 
				
			||||||
ExecStart=/usr/bin/rclone rcd --rc-web-gui --rc-web-gui-no-open-browser --rc-addr :3000 --rc-user admin --rc-pass 12345
 | 
					WorkingDirectory=/opt/rclone
 | 
				
			||||||
 | 
					ExecStart=/opt/rclone/rclone rcd --rc-web-gui --rc-web-gui-no-open-browser --rc-addr :3000 --rc-htpasswd /opt/login.pwd
 | 
				
			||||||
Restart=on-failure
 | 
					Restart=on-failure
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[Install]
 | 
					[Install]
 | 
				
			||||||
WantedBy=multi-user.target
 | 
					WantedBy=multi-user.target
 | 
				
			||||||
EOF
 | 
					EOF
 | 
				
			||||||
 | 
					 | 
				
			||||||
systemctl enable -q --now rclone-web
 | 
					systemctl enable -q --now rclone-web
 | 
				
			||||||
 | 
					msg_ok "Created Service"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
motd_ssh
 | 
					motd_ssh
 | 
				
			||||||
customize
 | 
					customize
 | 
				
			||||||
 | 
					
 | 
				
			||||||
msg_info "Cleaning up"
 | 
					msg_info "Cleaning up"
 | 
				
			||||||
 | 
					rm -f "$temp_file"
 | 
				
			||||||
$STD apt-get -y autoremove
 | 
					$STD apt-get -y autoremove
 | 
				
			||||||
$STD apt-get -y autoclean
 | 
					$STD apt-get -y autoclean
 | 
				
			||||||
msg_ok "Cleaned"
 | 
					msg_ok "Cleaned"
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user