From 7ffd92c581a97e609f1237ea99f4c4f2afcb650a Mon Sep 17 00:00:00 2001 From: vhsdream Date: Sun, 7 Dec 2025 10:59:58 -0500 Subject: [PATCH] OpenCloud --- ct/deferred/opencloud.sh | 62 -------------------- ct/opencloud.sh | 60 +++++++++++++++++++ frontend/public/json/opencloud.json | 64 +++++++++++++++++++++ install/{deferred => }/opencloud-install.sh | 39 ++++++------- 4 files changed, 140 insertions(+), 85 deletions(-) delete mode 100644 ct/deferred/opencloud.sh create mode 100644 ct/opencloud.sh create mode 100644 frontend/public/json/opencloud.json rename install/{deferred => }/opencloud-install.sh (82%) diff --git a/ct/deferred/opencloud.sh b/ct/deferred/opencloud.sh deleted file mode 100644 index 2c428f93c..000000000 --- a/ct/deferred/opencloud.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/env bash -source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func) -# Copyright (c) 2021-2025 community-scripts ORG -# Author: vhsdream -# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE -# Source: https://opencloud.eu - -APP="OpenCloud" -var_tags="${var_tags:-files;cloud}" -var_cpu="${var_cpu:-2}" -var_ram="${var_ram:-2048}" -var_disk="${var_disk:-6}" -var_os="${var_os:-debian}" -var_version="${var_version:-12}" -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 - - RELEASE=$(curl -fsSL https://api.github.com/repos/opencloud-eu/opencloud/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') - if [[ "${RELEASE}" != "$(cat /etc/opencloud/version)" ]] || [[ ! -f /etc/opencloud/version ]]; then - msg_info "Stopping $APP" - systemctl stop opencloud opencloud-wopi - msg_ok "Stopped $APP" - - msg_info "Updating $APP to v${RELEASE}" - curl -fsSL "https://github.com/opencloud-eu/opencloud/releases/download/v${RELEASE}/opencloud-${RELEASE}-linux-amd64" -o /usr/bin/opencloud - chmod +x /usr/bin/opencloud - msg_ok "Updated $APP to v${RELEASE}" - - msg_info "Starting $APP" - systemctl start opencloud opencloud-wopi - msg_ok "Started $APP" - - echo "${RELEASE}" >/etc/opencloud/version - msg_ok "Update Successful" - else - msg_ok "No update required. ${APP} is already at v${RELEASE}" - fi - exit -} - -start -build_container -description - -msg_ok "Completed Successfully!\n" -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}https://${CL}" diff --git a/ct/opencloud.sh b/ct/opencloud.sh new file mode 100644 index 000000000..1a47f5293 --- /dev/null +++ b/ct/opencloud.sh @@ -0,0 +1,60 @@ +#!/usr/bin/env bash +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func) +# Copyright (c) 2021-2025 community-scripts ORG +# Author: vhsdream +# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE +# Source: https://opencloud.eu + +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}" +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 + + RELEASE="v4.0.0" + if check_for_gh_release "opencloud" "opencloud-eu/opencloud" "${RELEASE}"; then + msg_info "Stopping services" + systemctl stop opencloud opencloud-wopi + msg_ok "Stopped services" + + msg_info "Updating packages" + $STD apt-get update + $STD apt-get dist-upgrade + msg_ok "Updated packages" + + CLEAN_INSTALL=1 fetch_and_deploy_gh_release "opencloud" "opencloud-eu/opencloud" "singlefile" "${RELEASE}" "/usr/bin" "opencloud-.*linux-amd64" + + 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}" +echo -e "${INFO}${YW} Access it using the following URL:${CL}" +echo -e "${TAB}${GATEWAY}${BGN}https://${CL}" diff --git a/frontend/public/json/opencloud.json b/frontend/public/json/opencloud.json new file mode 100644 index 000000000..6283aa6ef --- /dev/null +++ b/frontend/public/json/opencloud.json @@ -0,0 +1,64 @@ +{ + "name": "OpenCloud", + "slug": "opencloud", + "categories": [ + 2 + ], + "date_created": "2025-12-12", + "type": "ct", + "updateable": true, + "privileged": false, + "interface_port": 443, + "documentation": "https://docs.opencloud.eu", + "config_path": "/etc/opencloud/opencloud.env, /etc/opencloud/opencloud.yaml, /etc/opencloud/csp.yaml", + "website": "https://opencloud.eu", + "logo": "https://cdn.jsdelivr.net/gh/selfhst/icons/webp/opencloud.webp", + "description": "OpenCloud is the file sharing and collaboration solution of the Heinlein Group. Through intelligent file management and a strong open source community, files become valuable resources, effectively structured and usable in the long term. With flexible data rooms and intelligent access rights, teams can access and work together on data anytime, anywhere without barriers, but with a lot of productivity.", + "install_methods": [ + { + "type": "default", + "script": "ct/opencloud.sh", + "resources": { + "cpu": 2, + "ram": 2048, + "hdd": 20, + "os": "Debian", + "version": "13" + } + } + ], + "default_credentials": { + "username": "admin", + "password": "randomly generated during the installation process" + }, + "notes": [ + { + "text": "Valid TLS certificates and fully-qualified domain names behind a reverse proxy (Caddy) for 3 services - OpenCloud, Collabora, and WOPI are **REQUIRED**", + "type": "warning" + }, + { + "text": "Forgot your admin password? Check `admin_password` in the 'idm' section in `/etc/opencloud/opencloud.yaml`", + "type": "info" + }, + { + "text": "**Optional External Apps**: extract zip archives from App Store to `/etc/opencloud/assets/apps`", + "type": "info" + }, + { + "text": "**Optional CalDAV and CardDAV**: requires separate Radicale install. Edit and rename `/opt/opencloud/proxy.yaml.bak` and change your Radicale config to use `http_x_remote_user` as the auth method", + "type": "info" + }, + { + "text": "**Optional OpenID**: Authelia and PocketID supported. Uncomment relevant lines in `/opt/opencloud/opencloud.env` and consult OpenCloud GitHub discussions for configuration tips", + "type": "info" + }, + { + "text": "**Optional Full-text Search with Apache Tika**: requires your own Tika LXC. See `https://community-scripts.github.io/ProxmoxVE/scripts?id=apache-tika`", + "type": "info" + }, + { + "text": "**Relevant services**: `opencloud.service`, `opencloud-wopi.service`, `coolwsd.service`", + "type": "info" + } + ] +} diff --git a/install/deferred/opencloud-install.sh b/install/opencloud-install.sh similarity index 82% rename from install/deferred/opencloud-install.sh rename to install/opencloud-install.sh index f369eee85..cedb0492c 100644 --- a/install/deferred/opencloud-install.sh +++ b/install/opencloud-install.sh @@ -15,48 +15,45 @@ update_os read -r -p "Enter the hostname of your OpenCloud server (eg cloud.domain.tld): " oc_host if [[ "$oc_host" ]]; then - OC_HOST="$oc_host" + OC_HOST="$oc_host" fi read -r -p "Enter the hostname of your Collabora server (eg collabora.domain.tld): " collabora_host if [[ "$collabora_host" ]]; then - COLLABORA_HOST="$collabora_host" + COLLABORA_HOST="$collabora_host" fi read -r -p "Enter the hostname of your WOPI server (eg wopiserver.domain.tld): " wopi_host if [[ "$wopi_host" ]]; then - WOPI_HOST="$wopi_host" + WOPI_HOST="$wopi_host" fi +# Collabora online +setup_deb822_repo \ + "collaboraonline" \ + "https://collaboraoffice.com/downloads/gpg/collaboraonline-release-keyring.gpg" \ + "https://www.collaboraoffice.com/repos/CollaboraOnline/CODE-deb" \ + "all" + msg_info "Installing Collabora Online" -curl -fsSL https://collaboraoffice.com/downloads/gpg/collaboraonline-release-keyring.gpg -o /etc/apt/keyrings/collaboraonline-release-keyring.gpg - -cat </etc/apt/sources.list.d/collaboraonline.sources -Types: deb -URIs: https://www.collaboraoffice.com/repos/CollaboraOnline/CODE-deb -Suites: ./ -Signed-By: /etc/apt/keyrings/collaboraonline-release-keyring.gpg -EOF - -$STD apt-get update $STD apt-get install -y coolwsd code-brand systemctl stop coolwsd COOLPASS="$(openssl rand -base64 36)" $STD sudo -u cool coolconfig set-admin-password --user=admin --password="$COOLPASS" msg_ok "Installed Collabora Online" +# OpenCloud +fetch_and_deploy_gh_release "opencloud" "opencloud-eu/opencloud" "singlefile" "v4.0.0" "/usr/bin" "opencloud-.*linux-amd64" + msg_info "Installing ${APPLICATION}" -OPENCLOUD=$(curl -s https://api.github.com/repos/opencloud-eu/opencloud/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') DATA_DIR="/var/lib/opencloud/" CONFIG_DIR="/etc/opencloud" ENV_FILE="${CONFIG_DIR}/opencloud.env" -curl -fsSL "https://github.com/opencloud-eu/opencloud/releases/download/v${OPENCLOUD}/opencloud-${OPENCLOUD}-linux-amd64" -o /usr/bin/opencloud -chmod +x /usr/bin/opencloud mkdir -p "$DATA_DIR" "$CONFIG_DIR"/assets/apps echo "${OPENCLOUD}" >/etc/opencloud/version msg_ok "Installed ${APPLICATION}" msg_info "Configuring ${APPLICATION}" -curl -fsSL https://raw.githubusercontent.com/opencloud-eu/opencloud-compose/refs/heads/main/config/opencloud/csp.yaml -o "$CONFIG_DIR"/csp.yaml -curl -fsSL https://raw.githubusercontent.com/opencloud-eu/opencloud-compose/refs/heads/main/config/opencloud/proxy.yaml -o "$CONFIG_DIR"/proxy.yaml.bak +curl -fsSL https://raw.githubusercontent.com/opencloud-eu/opencloud/refs/heads/main/devtools/deployments/opencloud_full/config/opencloud/csp.yaml -o "$CONFIG_DIR"/csp.yaml +curl -fsSL https://raw.githubusercontent.com/opencloud-eu/opencloud/refs/heads/main/devtools/deployments/opencloud_full/config/opencloud/proxy.yaml -o "$CONFIG_DIR"/proxy.yaml.bak cat <"$ENV_FILE" OC_URL=https://${OC_HOST} @@ -181,8 +178,4 @@ msg_ok "Configured ${APPLICATION}" motd_ssh customize - -msg_info "Cleaning up" -$STD apt-get -y autoremove -$STD apt-get -y autoclean -msg_ok "Cleaned" +cleanup_lxc