2026-02-05 14:16:36 +01:00
#!/usr/bin/env bash
2026-09-02 13:18:14 +02:00
_cs_boot = " ${ COMMUNITY_SCRIPTS_CORE_DIR :-$( dirname " ${ BASH_SOURCE [0] } " ) /../../core } /core/build.func"
source " $_cs_boot " 2>/dev/null || source <( curl -fsSL " ${ COMMUNITY_SCRIPTS_CORE_URL :- https ://raw.githubusercontent.com/community-scripts/core/main } /core/build.func" )
2026-02-05 14:16:36 +01:00
# Copyright (c) 2021-2026 community-scripts ORG
# Author: vhsdream
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
2026-02-24 15:11:53 +01:00
# Source: https://opencloud.eu | Github: https://github.com/opencloud-eu/opencloud
2026-02-05 14:16:36 +01:00
APP = "OpenCloud"
var_tags = " ${ var_tags :- files ;cloud } "
var_cpu = " ${ var_cpu :- 2 } "
var_ram = " ${ var_ram :- 2048 } "
var_disk = " ${ var_disk :- 20 } "
var_os = " ${ var_os :- debian } "
var_version = " ${ var_version :- 13 } "
2026-06-22 04:45:41 +10:00
var_arm64 = " ${ var_arm64 :- yes } "
2026-02-05 14:16:36 +01:00
var_unprivileged = " ${ var_unprivileged :- 1 } "
header_info " $APP "
variables
color
catch_errors
function update_script() {
header_info
check_container_storage
check_container_resources
if [[ ! -d /etc/opencloud ]] ; then
msg_error "No ${ APP } Installation Found!"
exit
fi
2026-08-04 10:54:31 -04:00
RELEASE = "v7.4.0"
2026-03-19 22:18:27 +01:00
if check_for_gh_release "OpenCloud" "opencloud-eu/opencloud" " ${ RELEASE } " "each release is tested individually before the version is updated. Please do not open issues for this" ; then
2026-02-05 14:16:36 +01:00
msg_info "Stopping services"
systemctl stop opencloud opencloud-wopi
msg_ok "Stopped services"
msg_info "Updating packages"
2026-09-24 08:06:49 +02:00
apt_update_safe
2026-10-01 08:14:33 +02:00
$STD apt dist-upgrade -y
2026-02-11 16:30:09 -05:00
ensure_dependencies "inotify-tools"
2026-02-05 14:16:36 +01:00
msg_ok "Updated packages"
2026-03-09 13:38:58 -04:00
rm -f /usr/bin/{ OpenCloud,opencloud}
2026-06-22 04:45:41 +10:00
CLEAN_INSTALL = 1 fetch_and_deploy_gh_release "OpenCloud" "opencloud-eu/opencloud" "singlefile" " ${ RELEASE } " "/usr/bin" "opencloud-*-linux- $( arch_resolve) "
2026-03-09 13:38:58 -04:00
mv /usr/bin/OpenCloud /usr/bin/opencloud
2026-02-11 16:30:09 -05:00
if ! grep -q 'POSIX_WATCH' /etc/opencloud/opencloud.env; then
sed -i '/^## External/i ## Uncomment below to enable PosixFS Collaborative Mode\
## Increase inotify watch/instance limits on your PVE host:\
### sysctl -w fs.inotify.max_user_watches=1048576\
### sysctl -w fs.inotify.max_user_instances=1024\
# STORAGE_USERS_POSIX_ENABLE_COLLABORATION=true\
# STORAGE_USERS_POSIX_WATCH_TYPE=inotifywait\
# STORAGE_USERS_POSIX_WATCH_FS=true\
# STORAGE_USERS_POSIX_WATCH_PATH=<path-to-storage-or-bind-mount>' /etc/opencloud/opencloud.env
fi
2026-02-05 14:16:36 +01:00
2026-05-22 09:10:20 -04:00
if ! sed -n '/^sharing:/,/^storage_users:/p' /etc/opencloud/opencloud.yaml | grep -q 'service_account' ; then
ACCOUNT_ID = " $( sed -n '/^activitylog:/,/*.$/p' /etc/opencloud/opencloud.yaml | awk -F'id:' '{print $2}' | tr -d '[:space:]' ) "
ACCOUNT_SECRET = " $( sed -n '/^activitylog:/,/*.$/p' /etc/opencloud/opencloud.yaml | awk -F'secret:' '{print $2}' | tr -d '[:space:]' ) "
sed -i "/^sharing:/a\\
service_account:\\
service_account_id: $ACCOUNT_ID \\
service_account_secret: $ACCOUNT_SECRET " /etc/opencloud/opencloud.yaml
fi
2026-02-05 14:16:36 +01:00
msg_info "Starting services"
systemctl start opencloud opencloud-wopi
msg_ok "Started services"
msg_ok "Updated successfully"
fi
exit
}
start
build_container
description
msg_ok "Completed successfully!\n"
echo -e " ${ CREATING }${ GN }${ APP } setup has been successfully initialized! ${ CL } "
2026-06-03 11:03:13 +02:00
echo -e " ${ INFO }${ YW } Access it using the following URL: ${ CL } "
echo -e " ${ GATEWAY }${ BGN } https://<your-OpenCloud-FQDN> ${ CL } "