Skip to content

Commit c75af3a

Browse files
push-app-to-main[bot]tremor021MickLesk
authored
ONLYOFFICE Docs (#5420)
* 'Add new script' * Update install/onlyoffice-install.sh * Update onlyoffice-install.sh * add info for credentials * Update onlyoffice.sh * curl * naming --------- Co-authored-by: push-app-to-main[bot] <203845782+push-app-to-main[bot]@users.noreply.github.com> Co-authored-by: Slaviša Arežina <[email protected]> Co-authored-by: CanbiZ <[email protected]>
1 parent 5c768b5 commit c75af3a

File tree

4 files changed

+201
-0
lines changed

4 files changed

+201
-0
lines changed

ct/headers/onlyoffice

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
____ __ ____ _________
2+
/ __ \____ / /_ __/ __ \/ __/ __(_)_______
3+
/ / / / __ \/ / / / / / / / /_/ /_/ / ___/ _ \
4+
/ /_/ / / / / / /_/ / /_/ / __/ __/ / /__/ __/
5+
\____/_/ /_/_/\__, /\____/_/ /_/ /_/\___/\___/
6+
/____/

ct/onlyoffice.sh

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#!/usr/bin/env bash
2+
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
3+
# Copyright (c) 2021-2025 community-scripts ORG
4+
# Author: MickLesk (CanbiZ)
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
# Source: https://www.onlyoffice.com/
7+
8+
APP="ONLYOFFICE Docs"
9+
var_tags="${var_tags:-word;excel;powerpoint;pdf}"
10+
var_cpu="${var_cpu:-2}"
11+
var_ram="${var_ram:-2048}"
12+
var_disk="${var_disk:-10}"
13+
var_os="${var_os:-debian}"
14+
var_version="${var_version:-12}"
15+
var_unprivileged="${var_unprivileged:-1}"
16+
17+
header_info "$APP"
18+
variables
19+
color
20+
catch_errors
21+
22+
function update_script() {
23+
header_info
24+
check_container_storage
25+
check_container_resources
26+
27+
if [[ ! -d /var/www/onlyoffice ]]; then
28+
msg_error "No valid ${APP} installation found!"
29+
exit 1
30+
fi
31+
32+
msg_info "Updating $APP"
33+
$STD apt-get update
34+
$STD apt-get -y --only-upgrade install onlyoffice-documentserver
35+
msg_ok "Updated $APP"
36+
37+
if systemctl is-enabled --quiet onlyoffice-documentserver; then
38+
msg_info "Restarting $APP"
39+
$STD systemctl restart onlyoffice-documentserver
40+
msg_ok "$APP restarted"
41+
fi
42+
exit
43+
}
44+
45+
start
46+
build_container
47+
description
48+
49+
msg_ok "Completed Successfully!\n"
50+
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
51+
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
52+
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}${CL}"

frontend/public/json/onlyoffice.json

Lines changed: 40 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

install/onlyoffice-install.sh

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright (c) 2021-2025 community-scripts ORG
4+
# Author: MickLesk (CanbiZ)
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
7+
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
8+
color
9+
verb_ip6
10+
catch_errors
11+
setting_up_container
12+
network_check
13+
update_os
14+
15+
msg_info "Installing Dependencies"
16+
$STD apt-get install -y \
17+
nginx \
18+
rabbitmq-server \
19+
ca-certificates \
20+
software-properties-common
21+
msg_ok "Installed Dependencies"
22+
23+
PG_VERSION="16" setup_postgresql
24+
25+
msg_info "Setup Database"
26+
DB_NAME=onlyoffice
27+
DB_USER=onlyoffice_user
28+
DB_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | cut -c1-13)
29+
$STD sudo -u postgres psql -c "CREATE ROLE $DB_USER WITH LOGIN PASSWORD '$DB_PASS';"
30+
$STD sudo -u postgres psql -c "CREATE DATABASE $DB_NAME WITH OWNER $DB_USER ENCODING 'UTF8' TEMPLATE template0;"
31+
$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET client_encoding TO 'utf8';"
32+
$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET default_transaction_isolation TO 'read committed';"
33+
$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET timezone TO 'UTC'"
34+
{
35+
echo "ONLYOFFICE-Credentials"
36+
echo "ONLYOFFICE Database User: $DB_USER"
37+
echo "ONLYOFFICE Database Password: $DB_PASS"
38+
echo "ONLYOFFICE Database Name: $DB_NAME"
39+
} >>~/onlyoffice.creds
40+
msg_ok "Set up Database"
41+
42+
msg_info "Adding ONLYOFFICE GPG Key"
43+
GPG_TMP="/tmp/onlyoffice.gpg"
44+
KEY_URL="https://download.onlyoffice.com/GPG-KEY-ONLYOFFICE"
45+
TMP_KEY_CONTENT=$(mktemp)
46+
if curl -fsSL "$KEY_URL" -o "$TMP_KEY_CONTENT" && grep -q "BEGIN PGP PUBLIC KEY BLOCK" "$TMP_KEY_CONTENT"; then
47+
gpg --quiet --batch --yes --no-default-keyring --keyring "gnupg-ring:$GPG_TMP" --import "$TMP_KEY_CONTENT" >/dev/null 2>&1
48+
chmod 644 "$GPG_TMP"
49+
chown root:root "$GPG_TMP"
50+
mv "$GPG_TMP" /usr/share/keyrings/onlyoffice.gpg
51+
echo "deb [signed-by=/usr/share/keyrings/onlyoffice.gpg] https://download.onlyoffice.com/repo/debian squeeze main" >/etc/apt/sources.list.d/onlyoffice.list
52+
$STD apt-get update
53+
msg_ok "GPG Key Added"
54+
else
55+
msg_error "Failed to download or verify GPG key from $KEY_URL"
56+
[[ -f "$TMP_KEY_CONTENT" ]] && rm -f "$TMP_KEY_CONTENT"
57+
exit 1
58+
fi
59+
rm -f "$TMP_KEY_CONTENT"
60+
61+
msg_info "Preconfiguring ONLYOFFICE Debconf Settings"
62+
RMQ_USER=onlyoffice_rmq
63+
RMQ_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | cut -c1-13)
64+
JWT_SECRET=$(openssl rand -hex 16)
65+
66+
echo onlyoffice-documentserver onlyoffice/db-host string localhost | debconf-set-selections
67+
echo onlyoffice-documentserver onlyoffice/db-user string $DB_USER | debconf-set-selections
68+
echo onlyoffice-documentserver onlyoffice/db-pwd password $DB_PASS | debconf-set-selections
69+
echo onlyoffice-documentserver onlyoffice/db-name string $DB_NAME | debconf-set-selections
70+
echo onlyoffice-documentserver onlyoffice/rabbitmq-host string localhost | debconf-set-selections
71+
echo onlyoffice-documentserver onlyoffice/rabbitmq-user string $RMQ_USER | debconf-set-selections
72+
echo onlyoffice-documentserver onlyoffice/rabbitmq-pwd password $RMQ_PASS | debconf-set-selections
73+
echo onlyoffice-documentserver onlyoffice/jwt-enabled boolean true | debconf-set-selections
74+
echo onlyoffice-documentserver onlyoffice/jwt-secret password $JWT_SECRET | debconf-set-selections
75+
76+
echo "RabbitMQ User: $RMQ_USER" >>~/onlyoffice.creds
77+
echo "RabbitMQ Password: $RMQ_PASS" >>~/onlyoffice.creds
78+
echo "JWT Secret: $JWT_SECRET" >>~/onlyoffice.creds
79+
{
80+
echo ""
81+
echo "ONLYOFFICE RabbitMQ Credentials"
82+
echo "User: $RMQ_USER"
83+
echo "Password: $RMQ_PASS"
84+
echo "Secret: $JWT_SECRET"
85+
} >>~/onlyoffice.creds
86+
msg_ok "Debconf Preconfiguration Done"
87+
88+
msg_info "Installing ttf-mscorefonts-installer"
89+
echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | debconf-set-selections
90+
$STD apt-get install -y ttf-mscorefonts-installer
91+
msg_ok "Installed Microsoft Core Fonts"
92+
93+
msg_info "Installing ONLYOFFICE Docs"
94+
$STD apt-get install -y onlyoffice-documentserver
95+
msg_ok "ONLYOFFICE Docs Installed"
96+
97+
motd_ssh
98+
customize
99+
100+
msg_info "Cleaning up"
101+
$STD apt-get -y autoremove
102+
$STD apt-get -y autoclean
103+
msg_ok "Cleaned"

0 commit comments

Comments
 (0)