From 080371c16dc50c0c90ffa19930375f7ed3fc4c37 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Tue, 17 Jun 2025 09:40:58 +0200 Subject: [PATCH] add onlyoffice --- ct/onlyoffice.sh | 42 +++++++++++++++++++++++++++++++++++ install/onlyoffice-install.sh | 36 +++++++++++++++++++++++++++++- 2 files changed, 77 insertions(+), 1 deletion(-) create mode 100644 ct/onlyoffice.sh diff --git a/ct/onlyoffice.sh b/ct/onlyoffice.sh new file mode 100644 index 00000000..7088bdf0 --- /dev/null +++ b/ct/onlyoffice.sh @@ -0,0 +1,42 @@ +#!/usr/bin/env bash +source <(curl -s https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/main/misc/build.func) +# Copyright (c) 2021-2025 community-scripts ORG +# Author: MickLesk (CanbiZ) +# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE +# Source: https://www.onlyoffice.com/ + +APP="OnlyOffice" +var_tags="${var_tags:-word;excel;powerpoint;pdf}" +var_cpu="${var_cpu:-2}" +var_ram="${var_ram:-2048}" +var_disk="${var_disk:-10}" +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 /var ]]; then + msg_error "No ${APP} Installation Found!" + exit + fi + msg_info "Updating $APP LXC" + $STD apt-get update + $STD apt-get -y upgrade + msg_ok "Updated $APP LXC" + exit +} + +start +build_container +description + +msg_ok "Completed Successfully!\n" +echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" diff --git a/install/onlyoffice-install.sh b/install/onlyoffice-install.sh index 20f2d81e..69bdc6f6 100644 --- a/install/onlyoffice-install.sh +++ b/install/onlyoffice-install.sh @@ -15,7 +15,9 @@ update_os msg_info "Installing Dependencies" $STD apt-get install -y \ nginx \ - rabbitmq-server + rabbitmq-server \ + ca-certificates \ + software-properties-common msg_ok "Installed Dependencies" PG_VERSION="16" setup_postgresql @@ -37,6 +39,38 @@ $STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET timezone TO 'UTC'" } >>~/onlyoffice.creds msg_ok "Set up Database" +msg_info "Adding ONLYOFFICE Repository and GPG Key" +mkdir -p -m 700 ~/.gnupg +curl -fsSL https://download.onlyoffice.com/GPG-KEY-ONLYOFFICE | gpg --no-default-keyring --keyring gnupg-ring:/tmp/onlyoffice.gpg --import +chmod 644 /tmp/onlyoffice.gpg +chown root:root /tmp/onlyoffice.gpg +mv /tmp/onlyoffice.gpg /usr/share/keyrings/onlyoffice.gpg +echo "deb [signed-by=/usr/share/keyrings/onlyoffice.gpg] https://download.onlyoffice.com/repo/debian squeeze main" | tee /etc/apt/sources.list.d/onlyoffice.list +$STD apt-get update +msg_ok "Repository Added" + +msg_info "Preconfiguring ONLYOFFICE Debconf Settings" +echo onlyoffice-documentserver onlyoffice/db-host string localhost | debconf-set-selections +echo onlyoffice-documentserver onlyoffice/db-user string $DB_USER | debconf-set-selections +echo onlyoffice-documentserver onlyoffice/db-pwd password $DB_PASS | debconf-set-selections +echo onlyoffice-documentserver onlyoffice/db-name string $DB_NAME | debconf-set-selections +echo onlyoffice-documentserver onlyoffice/rabbitmq-host string localhost | debconf-set-selections +echo onlyoffice-documentserver onlyoffice/rabbitmq-user string guest | debconf-set-selections +echo onlyoffice-documentserver onlyoffice/rabbitmq-pwd password guest | debconf-set-selections +echo onlyoffice-documentserver onlyoffice/jwt-enabled boolean true | debconf-set-selections +JWT_SECRET=$(openssl rand -hex 16) +echo onlyoffice-documentserver onlyoffice/jwt-secret password $JWT_SECRET | debconf-set-selections +msg_ok "Debconf Preconfiguration Done" + +msg_info "Installing ttf-mscorefonts-installer" +echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | debconf-set-selections +$STD apt-get install -y ttf-mscorefonts-installer +msg_ok "Installed Microsoft Core Fonts" + +msg_info "Installing ONLYOFFICE Docs" +$STD apt-get install -y onlyoffice-documentserver +msg_ok "ONLYOFFICE Docs Installed" + motd_ssh customize