Skip to content

Commit

Permalink
Merge branch release/v8.2.0 into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
papacarlo committed Oct 21, 2024
2 parents ed00058 + 510128a commit 0b67063
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 16 deletions.
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ARG BASE_VERSION=22.04

ARG BASE_IMAGE=ubuntu:$BASE_VERSION

FROM ${BASE_IMAGE} as documentserver
FROM ${BASE_IMAGE} AS documentserver
LABEL maintainer Ascensio System SIA <[email protected]>

ARG BASE_VERSION
Expand Down Expand Up @@ -62,7 +62,6 @@ RUN echo "#!/bin/sh\nexit 0" > /usr/sbin/policy-rc.d && \
pwgen \
rabbitmq-server \
redis-server \
software-properties-common \
sudo \
supervisor \
ttf-mscorefonts-installer \
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ Below is the complete list of parameters that can be set using environment varia
- **METRICS_PREFIX**: Defines StatsD metrics prefix for backend services. Defaults to `ds.`.
- **LETS_ENCRYPT_DOMAIN**: Defines the domain for Let's Encrypt certificate.
- **LETS_ENCRYPT_MAIL**: Defines the domain administator mail address for Let's Encrypt certificate.
- **PLUGINS_ENABLED**: Defines whether to enable default plugins. Defaults to `false`.
- **PLUGINS_ENABLED**: Defines whether to enable default plugins. Defaults to `true`.

## Installing ONLYOFFICE Document Server integrated with Community and Mail Servers

Expand Down
2 changes: 1 addition & 1 deletion config/supervisor/ds/ds-converter.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
command=/var/www/COMPANY_NAME/documentserver/server/FileConverter/converter
directory=/var/www/COMPANY_NAME/documentserver/server/FileConverter
user=ds
environment=NODE_ENV=production-linux,NODE_CONFIG_DIR=/etc/COMPANY_NAME/documentserver,NODE_DISABLE_COLORS=1,APPLICATION_NAME=COMPANY_NAME
environment=NODE_ENV=production-linux,NODE_CONFIG_DIR=/etc/COMPANY_NAME/documentserver,NODE_DISABLE_COLORS=1,APPLICATION_NAME=COMPANY_NAME,LD_LIBRARY_PATH=/var/www/COMPANY_NAME/documentserver/server/FileConverter/bin
stdout_logfile=/var/log/COMPANY_NAME/documentserver/converter/out.log
stdout_logfile_backups=0
stdout_logfile_maxbytes=0
Expand Down
2 changes: 1 addition & 1 deletion config/supervisor/ds/ds-docservice.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
command=/var/www/COMPANY_NAME/documentserver/server/DocService/docservice
directory=/var/www/COMPANY_NAME/documentserver/server/DocService
user=ds
environment=NODE_ENV=production-linux,NODE_CONFIG_DIR=/etc/COMPANY_NAME/documentserver,NODE_DISABLE_COLORS=1
environment=NODE_ENV=production-linux,NODE_CONFIG_DIR=/etc/COMPANY_NAME/documentserver,NODE_DISABLE_COLORS=1,APPLICATION_NAME=COMPANY_NAME
stdout_logfile=/var/log/COMPANY_NAME/documentserver/docservice/out.log
stdout_logfile_backups=0
stdout_logfile_maxbytes=0
Expand Down
1 change: 0 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '2'
services:
onlyoffice-documentserver:
build:
Expand Down
33 changes: 23 additions & 10 deletions run-document-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,21 @@

umask 0022

start_process() {
"$@" &
CHILD=$!; wait "$CHILD"; CHILD="";
}

function clean_exit {
[[ -z "$CHILD" ]] || kill -s SIGTERM "$CHILD" 2>/dev/null
if [ ${ONLYOFFICE_DATA_CONTAINER} == "false" ] && \
[ ${ONLYOFFICE_DATA_CONTAINER_HOST} == "localhost" ]; then
/usr/bin/documentserver-prepare4shutdown.sh
fi
exit
}

trap clean_exit SIGTERM
trap clean_exit SIGTERM SIGQUIT SIGABRT SIGINT

# Define '**' behavior explicitly
shopt -s globstar
Expand All @@ -25,7 +32,7 @@ DS_LIB_DIR="${LIB_DIR}/documentserver"
CONF_DIR="/etc/${COMPANY_NAME}/documentserver"
SUPERVISOR_CONF_DIR="/etc/supervisor/conf.d"
IS_UPGRADE="false"
PLUGINS_ENABLED=${PLUGINS_ENABLED:-false}
PLUGINS_ENABLED=${PLUGINS_ENABLED:-true}

ONLYOFFICE_DATA_CONTAINER=${ONLYOFFICE_DATA_CONTAINER:-false}
ONLYOFFICE_DATA_CONTAINER_HOST=${ONLYOFFICE_DATA_CONTAINER_HOST:-localhost}
Expand Down Expand Up @@ -98,7 +105,9 @@ NGINX_ONLYOFFICE_EXAMPLE_CONF="${NGINX_ONLYOFFICE_EXAMPLE_PATH}/includes/ds-exam
NGINX_CONFIG_PATH="/etc/nginx/nginx.conf"
NGINX_WORKER_PROCESSES=${NGINX_WORKER_PROCESSES:-1}
# Limiting the maximum number of simultaneous connections due to possible memory shortage
[ $(ulimit -n) -gt 1048576 ] && NGINX_WORKER_CONNECTIONS=${NGINX_WORKER_CONNECTIONS:-1048576} || NGINX_WORKER_CONNECTIONS=${NGINX_WORKER_CONNECTIONS:-$(ulimit -n)}
LIMIT=$(ulimit -n); [ $LIMIT -gt 1048576 ] && LIMIT=1048576
NGINX_WORKER_CONNECTIONS=${NGINX_WORKER_CONNECTIONS:-$LIMIT}
RABBIT_CONNECTIONS=${RABBIT_CONNECTIONS:-$LIMIT}

JWT_ENABLED=${JWT_ENABLED:-true}

Expand Down Expand Up @@ -617,7 +626,7 @@ update_nginx_settings(){
sed 's/linux/docker/' -i ${NGINX_ONLYOFFICE_EXAMPLE_CONF}
fi

documentserver-update-securelink.sh -s ${SECURE_LINK_SECRET:-$(pwgen -s 20)} -r false
start_process documentserver-update-securelink.sh -s ${SECURE_LINK_SECRET:-$(pwgen -s 20)} -r false
}

update_log_settings(){
Expand Down Expand Up @@ -693,6 +702,8 @@ if [ ${ONLYOFFICE_DATA_CONTAINER_HOST} = "localhost" ]; then
chmod 400 ${RABBITMQ_DATA}/.erlang.cookie
fi

echo "ulimit -n $RABBIT_CONNECTIONS" >> /etc/default/rabbitmq-server

LOCAL_SERVICES+=("rabbitmq-server")
# allow Rabbitmq startup after container kill
rm -rf /var/run/rabbitmq
Expand Down Expand Up @@ -753,30 +764,32 @@ if [ ${ONLYOFFICE_DATA_CONTAINER} != "true" ]; then
service cron start
fi

# Fix to resolve the `unknown "cache_tag" variable` error
start_process documentserver-flush-cache.sh -r false

# nginx used as a proxy, and as data container status service.
# it run in all cases.
service nginx start

if [ "${LETS_ENCRYPT_DOMAIN}" != "" -a "${LETS_ENCRYPT_MAIL}" != "" ]; then
if [ ! -f "${SSL_CERTIFICATE_PATH}" -a ! -f "${SSL_KEY_PATH}" ]; then
documentserver-letsencrypt.sh ${LETS_ENCRYPT_MAIL} ${LETS_ENCRYPT_DOMAIN}
start_process documentserver-letsencrypt.sh ${LETS_ENCRYPT_MAIL} ${LETS_ENCRYPT_DOMAIN}
fi
fi

# Regenerate the fonts list and the fonts thumbnails
if [ "${GENERATE_FONTS}" == "true" ]; then
documentserver-generate-allfonts.sh ${ONLYOFFICE_DATA_CONTAINER}
start_process documentserver-generate-allfonts.sh ${ONLYOFFICE_DATA_CONTAINER}
fi

if [ "${PLUGINS_ENABLED}" = "true" ]; then
echo -n Installing plugins, please wait...
documentserver-pluginsmanager.sh -r false --update=\"${APP_DIR}/sdkjs-plugins/plugin-list-default.json\" >/dev/null
start_process documentserver-pluginsmanager.sh -r false --update=\"${APP_DIR}/sdkjs-plugins/plugin-list-default.json\" >/dev/null
echo Done
fi

documentserver-static-gzip.sh ${ONLYOFFICE_DATA_CONTAINER}
start_process documentserver-static-gzip.sh ${ONLYOFFICE_DATA_CONTAINER}

echo "${JWT_MESSAGE}"

tail -f /var/log/${COMPANY_NAME}/**/*.log &
wait $!
start_process tail -f /var/log/${COMPANY_NAME}/**/*.log
11 changes: 11 additions & 0 deletions tests/damengdb/damengdb.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@ wait_dm_ready

EOF

COPY <<"EOF" /permissions.sql

CREATE SYNONYM onlyoffice.DOC_CHANGES FOR sysdba.DOC_CHANGES;
CREATE SYNONYM onlyoffice.TASK_RESULT FOR sysdba.TASK_RESULT;
GRANT ALL PRIVILEGES ON sysdba.DOC_CHANGES TO onlyoffice;
GRANT ALL PRIVILEGES ON sysdba.TASK_RESULT TO onlyoffice;

EOF

RUN bash /opt/startup.sh > /dev/null 2>&1 \
& mkdir -p /schema/damengdb \
Expand All @@ -41,6 +49,9 @@ RUN bash /opt/startup.sh > /dev/null 2>&1 \
&& cd ${DISQL_BIN} \
&& ./disql $DM8_USER/$DM8_PASS@$DB_HOST:$DB_PORT -e \
"create user "onlyoffice" identified by "onlyoffice" password_policy 0;" \
&& ./disql $DM8_USER/$DM8_PASS@$DB_HOST:$DB_PORT -e \
"GRANT SELECT ON DBA_TAB_COLUMNS TO onlyoffice;" \
&& echo "EXIT" | tee -a /schema/dameng/createdb.sql \
&& ./disql $DM8_USER/$DM8_PASS@$DB_HOST:$DB_PORT \`/schema/dameng/createdb.sql \
&& ./disql $DM8_USER/$DM8_PASS@$DB_HOST:$DB_PORT \`/permissions.sql \
&& sleep 10

0 comments on commit 0b67063

Please sign in to comment.