Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/src/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

class App extends Application
{
const NAME = "Doil Version 20260712 - build 2026-07-12";
const NAME = "Doil Version 20260714 - build 2026-07-14";

public function __construct(Command ...$commands)
{
Expand Down
4 changes: 4 additions & 0 deletions app/src/Lib/Docker/DockerShell.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class DockerShell implements Docker
protected const KEYCLOAK = "/usr/local/lib/doil/server/keycloak";
protected const PROXY = "/usr/local/lib/doil/server/proxy";
protected const MAIL = "/usr/local/lib/doil/server/mail";
protected const OFFICE = "/usr/local/lib/doil/server/office";

public function __construct(LoggerFactory $logger, Posix $posix, Filesystem $filesystem)
{
Expand Down Expand Up @@ -582,6 +583,9 @@ protected function startDoilSystemsIfNeeded() : void
if ($this->filesystem->exists(self::KEYCLOAK . "/docker-compose.yml") && ! $this->isInstanceUp(self::KEYCLOAK)) {
$this->startContainerByDockerComposeWithForceRecreate(self::KEYCLOAK);
}
if ($this->filesystem->exists(self::OFFICE . "/docker-compose.yml") && ! $this->isInstanceUp(self::OFFICE)) {
$this->startContainerByDockerComposeWithForceRecreate(self::OFFICE);
}
if (! $this->isInstanceUp(self::PROXY)) {
$this->startContainerByDockerComposeWithForceRecreate(self::PROXY);
}
Expand Down
4 changes: 2 additions & 2 deletions setup/stack/states/disable-office/office/init.sls
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ set_wopi_url:
drop_wopi_app_table:
mysql_query.run:
- database: ilias
- query: "DROP TABLE IF EXISTS wopi_app;"
- query: "TRUNCATE wopi_app;"

truncate_wopi_action_table:
mysql_query.run:
- database: ilias
- query: "DELETE FROM wopi_action;"
- query: "TRUNCATE wopi_action;"
352 changes: 0 additions & 352 deletions setup/stack/states/enable-office/office/config/wopi.sql

This file was deleted.

351 changes: 351 additions & 0 deletions setup/stack/states/enable-office/office/config/wopi.sql.j2

Large diffs are not rendered by default.

9 changes: 6 additions & 3 deletions setup/stack/states/enable-office/office/init.sls
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{% set ilias_version = salt['grains.get']('ilias_version', '9') %}
{% set doil_domain = salt['grains.get']('doil_domain', 'http://doil/') %}

{% if ilias_version | int < 10 %}
failure:
Expand All @@ -12,16 +13,18 @@ enable_wopi:
- database: ilias
- query: "DELETE FROM settings WHERE keyword = 'wopi_activated';INSERT INTO settings (module, keyword, value) VALUES ('common', 'wopi_activated', 1);"


set_wopi_url:
mysql_query.run:
- database: ilias
- query: "DELETE FROM settings WHERE keyword = 'wopi_discovery_url';INSERT INTO settings (module, keyword, value) VALUES ('common', 'wopi_discovery_url', 'http://172.24.0.251/hosting/discovery');"
- query: "DELETE FROM settings WHERE keyword = 'wopi_discovery_url';INSERT INTO settings (module, keyword, value) VALUES ('common', 'wopi_discovery_url', '{{ doil_domain.split('/')[:-1] | join('/') }}/office/hosting/discovery');"

/root/wopi.sql:
file.managed:
- source: salt://office/config/wopi.sql
- source: salt://office/config/wopi.sql.j2
- mode: "0444"
- template: jinja
- context:
url: {{ doil_domain.split('/')[:-1] | join('/') }}

import_wopi_app_sql:
cmd.run:
Expand Down
97 changes: 50 additions & 47 deletions setup/templates/office/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ARG BASE_VERSION=24.04

ARG BASE_IMAGE=ubuntu:$BASE_VERSION

FROM ${BASE_IMAGE} AS documentserver
FROM ${BASE_IMAGE} AS documentserver-base
LABEL maintainer="Ascensio System SIA <support@onlyoffice.com>"

ARG BASE_VERSION
Expand All @@ -24,14 +24,9 @@ ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8 DEBIAN_FRONTEND=nonint
ARG ONLYOFFICE_VALUE=onlyoffice
COPY fonts/ /usr/share/fonts/truetype/

RUN echo "#!/bin/sh\nexit 0" > /usr/sbin/policy-rc.d && \
RUN echo "#!/bin/sh\nexit 101" > /usr/sbin/policy-rc.d && \
apt-get -y update && \
apt-get -yq install wget apt-transport-https gnupg locales lsb-release && \
wget -q -O /etc/apt/sources.list.d/mssql-release.list "https://packages.microsoft.com/config/ubuntu/$BASE_VERSION/prod.list" && \
wget -q -O /tmp/microsoft.asc https://packages.microsoft.com/keys/microsoft.asc && \
apt-key add /tmp/microsoft.asc && \
gpg --dearmor -o /usr/share/keyrings/microsoft-prod.gpg < /tmp/microsoft.asc && \
apt-get -y update && \
locale-gen en_US.UTF-8 && \
echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | debconf-set-selections && \
ACCEPT_EULA=Y apt-get -yq install \
Expand All @@ -42,9 +37,7 @@ RUN echo "#!/bin/sh\nexit 0" > /usr/sbin/policy-rc.d && \
cron \
curl \
htop \
libaio1${PACKAGE_SUFFIX} \
libasound2${PACKAGE_SUFFIX} \
libboost-regex-dev \
libcairo2 \
libcurl3-gnutls \
libcurl4 \
Expand All @@ -55,52 +48,25 @@ RUN echo "#!/bin/sh\nexit 0" > /usr/sbin/policy-rc.d && \
libxml2 \
libxss1 \
libxtst6 \
mssql-tools18 \
mysql-client \
nano \
net-tools \
netcat-openbsd \
nginx-extras \
postgresql \
postgresql-client \
pwgen \
rabbitmq-server \
redis-server \
sudo \
supervisor \
ttf-mscorefonts-installer \
unixodbc-dev \
unzip \
xvfb \
xxd \
zlib1g || dpkg --configure -a && \
# Added dpkg --configure -a to handle installation issues with rabbitmq-server on arm64 architecture
zlib1g && \
if [ $(find /usr/share/fonts/truetype/msttcorefonts -maxdepth 1 -type f -iname '*.ttf' | wc -l) -lt 30 ]; \
then echo 'msttcorefonts failed to download'; exit 1; fi && \
echo "SERVER_ADDITIONAL_ERL_ARGS=\"+S 1:1\"" | tee -a /etc/rabbitmq/rabbitmq-env.conf && \
sed -i "s/bind .*/bind 127.0.0.1/g" /etc/redis/redis.conf && \
sed 's|\(application\/zip.*\)|\1\n application\/wasm wasm;|' -i /etc/nginx/mime.types && \
pg_conftool $PG_VERSION main set listen_addresses 'localhost' && \
service postgresql restart && \
sudo -u postgres psql -c "CREATE USER $ONLYOFFICE_VALUE WITH password '$ONLYOFFICE_VALUE';" && \
sudo -u postgres psql -c "CREATE DATABASE $ONLYOFFICE_VALUE OWNER $ONLYOFFICE_VALUE;" && \
wget -O basic.zip ${OC_DOWNLOAD_URL}/instantclient-basic-linux.$(dpkg --print-architecture | sed 's/amd64/x64/')-${OC_FILE_SUFFIX}.zip && \
wget -O sqlplus.zip ${OC_DOWNLOAD_URL}/instantclient-sqlplus-linux.$(dpkg --print-architecture | sed 's/amd64/x64/')-${OC_FILE_SUFFIX}.zip && \
unzip -o basic.zip -d /usr/share && \
unzip -o sqlplus.zip -d /usr/share && \
mv /usr/share/instantclient_${OC_VER_DIR} /usr/share/instantclient && \
find /usr/lib /lib -name "libaio.so.1$PACKAGE_SUFFIX" -exec bash -c 'ln -sf "$0" "$(dirname "$0")/libaio.so.1"' {} \; && \
service postgresql stop && \
service redis-server stop && \
service rabbitmq-server stop && \
service supervisor stop && \
service nginx stop && \
rm -rf /var/lib/apt/lists/*

COPY config/supervisor/supervisor /etc/init.d/
COPY config/supervisor/ds/*.conf /etc/supervisor/conf.d/
COPY run-document-server.sh /app/ds/run-document-server.sh
COPY oracle/sqlplus /usr/bin/sqlplus

EXPOSE 80 443

Expand All @@ -117,27 +83,64 @@ ENV COMPANY_NAME=$COMPANY_NAME \
DS_PLUGIN_INSTALLATION=false \
DS_DOCKER_INSTALLATION=true

RUN if [ -n "${PRODUCT_EDITION}" ]; then \
wget -q -O /etc/apt/sources.list.d/mssql-release.list "https://packages.microsoft.com/config/ubuntu/$BASE_VERSION/prod.list" && \
wget -q -O /tmp/microsoft.asc https://packages.microsoft.com/keys/microsoft.asc && \
apt-key add /tmp/microsoft.asc && \
gpg --dearmor -o /usr/share/keyrings/microsoft-prod.gpg < /tmp/microsoft.asc && \
apt-get -y update && \
ACCEPT_EULA=Y apt-get -yq install \
libaio1${PACKAGE_SUFFIX} \
libboost-regex-dev \
mssql-tools18 \
mysql-client \
unixodbc-dev \
redis-server \
postgresql postgresql-client \
rabbitmq-server && \
dpkg --configure -a && \
wget -O basic.zip ${OC_DOWNLOAD_URL}/instantclient-basic-linux.$(dpkg --print-architecture | sed 's/amd64/x64/')-${OC_FILE_SUFFIX}.zip && \
wget -O sqlplus.zip ${OC_DOWNLOAD_URL}/instantclient-sqlplus-linux.$(dpkg --print-architecture | sed 's/amd64/x64/')-${OC_FILE_SUFFIX}.zip && \
unzip -o basic.zip -d /usr/share && \
unzip -o sqlplus.zip -d /usr/share && \
rm -f basic.zip sqlplus.zip && \
mv /usr/share/instantclient_${OC_VER_DIR} /usr/share/instantclient && \
find /usr/lib /lib -name "libaio.so.1$PACKAGE_SUFFIX" -exec bash -c 'ln -sf "$0" "$(dirname "$0")/libaio.so.1"' {} \; && \
sed -i "s/bind .*/bind 127.0.0.1/g" /etc/redis/redis.conf && \
echo "SERVER_ADDITIONAL_ERL_ARGS=\"+S 1:1\"" | tee -a /etc/rabbitmq/rabbitmq-env.conf && \
pg_conftool $PG_VERSION main set listen_addresses 'localhost' && \
service postgresql start && \
sudo -u postgres psql -c "CREATE USER $ONLYOFFICE_VALUE WITH password '$ONLYOFFICE_VALUE';" && \
sudo -u postgres psql -c "CREATE DATABASE $ONLYOFFICE_VALUE OWNER $ONLYOFFICE_VALUE;" && \
service postgresql stop && \
rm -rf /var/lib/apt/lists/*; fi

RUN PACKAGE_FILE="${COMPANY_NAME}-${PRODUCT_NAME}${PRODUCT_EDITION}${PACKAGE_VERSION:+_$PACKAGE_VERSION}_${TARGETARCH:-$(dpkg --print-architecture)}.deb" && \
wget -q -P /tmp "$PACKAGE_BASEURL/$PACKAGE_FILE" && \
apt-get -y update && \
service postgresql start && \
[ -n "${PRODUCT_EDITION}" ] && service postgresql start || true && \
apt-get -yq install /tmp/$PACKAGE_FILE && \
if [ "${PRODUCT_EDITION}" != "-ee" ] && [ "${PRODUCT_EDITION}" != "-de" ]; then rm -f /etc/supervisor/conf.d/ds-adminpanel.conf && sed -i 's/,adminpanel//' /etc/supervisor/conf.d/ds.conf; fi && \
PGPASSWORD=$ONLYOFFICE_VALUE dropdb -h localhost -p 5432 -U $ONLYOFFICE_VALUE $ONLYOFFICE_VALUE && \
sudo -u postgres psql -c "DROP ROLE onlyoffice;" && \
service postgresql stop && \
if [ -n "${PRODUCT_EDITION}" ]; then \
PGPASSWORD=$ONLYOFFICE_VALUE dropdb -h localhost -p 5432 -U $ONLYOFFICE_VALUE $ONLYOFFICE_VALUE && \
sudo -u postgres psql -c "DROP ROLE onlyoffice;" && \
service postgresql stop; \
else \
rm -f /etc/supervisor/conf.d/ds-adminpanel.conf && \
sed -i 's/,adminpanel//' /etc/supervisor/conf.d/ds.conf; \
fi && \
chmod 755 /etc/init.d/supervisor && \
sed "s/COMPANY_NAME/${COMPANY_NAME}/g" -i /etc/supervisor/conf.d/*.conf && \
service supervisor stop && \
chmod 755 /app/ds/*.sh && \
printf "\nGO" >> "/var/www/$COMPANY_NAME/documentserver/server/schema/mssql/createdb.sql" && \
printf "\nGO" >> "/var/www/$COMPANY_NAME/documentserver/server/schema/mssql/removetbl.sql" && \
printf "\nexit" >> "/var/www/$COMPANY_NAME/documentserver/server/schema/oracle/createdb.sql" && \
printf "\nexit" >> "/var/www/$COMPANY_NAME/documentserver/server/schema/oracle/removetbl.sql" && \
rm -f /tmp/$PACKAGE_FILE && \
rm -rf /var/log/$COMPANY_NAME && \
rm -rf /var/lib/apt/lists/*

VOLUME /var/log/$COMPANY_NAME /var/lib/$COMPANY_NAME /var/www/$COMPANY_NAME/Data /var/lib/postgresql /var/lib/rabbitmq /var/lib/redis /usr/share/fonts/truetype/custom
FROM documentserver-base AS documentserver-community
VOLUME /var/log/$COMPANY_NAME /var/lib/$COMPANY_NAME /var/www/$COMPANY_NAME/Data /usr/share/fonts/truetype/custom
ENTRYPOINT ["/app/ds/run-document-server.sh"]

FROM documentserver-base AS documentserver-enterprise
COPY oracle/sqlplus /usr/bin/sqlplus
VOLUME /var/log/$COMPANY_NAME /var/lib/$COMPANY_NAME /var/www/$COMPANY_NAME/Data /var/lib/postgresql /var/lib/rabbitmq /var/lib/redis /usr/share/fonts/truetype/custom
ENTRYPOINT ["/app/ds/run-document-server.sh"]
74 changes: 4 additions & 70 deletions setup/templates/office/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,21 @@ services:
doil_office:
build:
context: .
image: onlyoffice/documentserver:9.4
target: documentserver-community
image: onlyoffice/documentserver
container_name: doil_office
depends_on:
- doil_postgresql
- doil_rabbitmq
hostname: office
labels:
doil.compose.doilinstance: "true"
environment:
- WOPI_ENABLED=true
- DB_TYPE=postgres
- DB_HOST=doil_postgresql
- DB_PORT=5432
- DB_NAME=onlyoffice
- DB_USER=onlyoffice
- AMQP_URI=amqp://guest:guest@doil_rabbitmq
# Uncomment strings below to enable the JSON Web Token validation.
#- JWT_ENABLED=true
#- JWT_SECRET=secret
#- JWT_HEADER=Authorization
#- JWT_IN_BODY=true
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/info/info.json"]
interval: 30s
retries: 5
start_period: 60s
timeout: 10s
stdin_open: true
restart: always
stop_grace_period: 60s
volumes:
- /var/www/onlyoffice/Data
Expand All @@ -40,60 +27,7 @@ services:
networks:
doil_proxy:
ipv4_address: 172.24.0.251
salt_saltnet:
doil_office:

doil_rabbitmq:
container_name: doil_rabbitmq
image: rabbitmq:3
restart: always
labels:
doil.compose.doilinstance: "true"
expose:
- '5672'
healthcheck:
test: ["CMD", "rabbitmq-diagnostics", "status"]
interval: 10s
retries: 3
start_period: 10s
timeout: 10s
networks:
doil_office:

doil_postgresql:
container_name: doil_postgresql
image: postgres:15
labels:
doil.compose.doilinstance: "true"
environment:
- POSTGRES_DB=onlyoffice
- POSTGRES_USER=onlyoffice
- POSTGRES_HOST_AUTH_METHOD=trust
restart: always
expose:
- '5432'
volumes:
- postgresql_data:/var/lib/postgresql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U onlyoffice"]
interval: 10s
retries: 3
start_period: 10s
timeout: 10s
networks:
doil_office:

volumes:
postgresql_data:

networks:
doil_proxy:
external: true
salt_saltnet:
external: true
doil_office:
name: doil_office
ipam:
driver: default
config:
- subnet: 172.26.0.0/16
external: true
12 changes: 6 additions & 6 deletions setup/templates/proxy/conf/nginx/local.conf
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@ server {

location /office/ {
proxy_pass http://172.24.0.251/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_pass_request_headers on;
proxy_set_header X-Forwarded-Proto https;

rewrite ^/office/(.*) /office/$1 break;
# Standard-Proxy-Header zur Identifikation des Clients
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $host/office;
proxy_set_header X-Forwarded-Proto $scheme;
}

access_log /var/log/nginx/access.log;
Expand Down
Loading
Loading