add onlyoffice

This commit is contained in:
CanbiZ 2025-06-17 09:40:58 +02:00
parent c226f924ec
commit 080371c16d
2 changed files with 77 additions and 1 deletions

42
ct/onlyoffice.sh Normal file
View File

@ -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}"

View File

@ -15,7 +15,9 @@ update_os
msg_info "Installing Dependencies" msg_info "Installing Dependencies"
$STD apt-get install -y \ $STD apt-get install -y \
nginx \ nginx \
rabbitmq-server rabbitmq-server \
ca-certificates \
software-properties-common
msg_ok "Installed Dependencies" msg_ok "Installed Dependencies"
PG_VERSION="16" setup_postgresql 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 } >>~/onlyoffice.creds
msg_ok "Set up Database" 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 motd_ssh
customize customize