From 5e9c269d8686611acc33997856ca521fd8094711 Mon Sep 17 00:00:00 2001 From: Evgeniy Antonyuk Date: Wed, 13 Mar 2024 20:00:05 +0700 Subject: [PATCH 01/13] fix Bug 62253 - self-signed SSL issue (#714) --- README.md | 1 + run-document-server.sh | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/README.md b/README.md index 9e37913..f55ae07 100644 --- a/README.md +++ b/README.md @@ -178,6 +178,7 @@ Below is the complete list of parameters that can be set using environment varia - **SSL_KEY_PATH**: The path to the SSL certificate's private key. Defaults to `/var/www/onlyoffice/Data/certs/tls.key`. - **SSL_DHPARAM_PATH**: The path to the Diffie-Hellman parameter. Defaults to `/var/www/onlyoffice/Data/certs/dhparam.pem`. - **SSL_VERIFY_CLIENT**: Enable verification of client certificates using the `CA_CERTIFICATES_PATH` file. Defaults to `false` +- **NODE_EXTRA_CA_CERTS**: The [NODE_EXTRA_CA_CERTS](https://nodejs.org/api/cli.html#node_extra_ca_certsfile "Node.js documentation") to extend CAs with the extra certificates for Node.js. Defaults to `/var/www/onlyoffice/Data/certs/extra-ca-certs.pem`. - **DB_TYPE**: The database type. Supported values are `postgres`, `mariadb` or `mysql`. Defaults to `postgres`. - **DB_HOST**: The IP address or the name of the host where the database server is running. - **DB_PORT**: The database server port number. diff --git a/run-document-server.sh b/run-document-server.sh index 99b580c..404ff30 100644 --- a/run-document-server.sh +++ b/run-document-server.sh @@ -60,6 +60,25 @@ if [[ -z $SSL_KEY_PATH ]] && [[ -f ${SSL_CERTIFICATES_DIR}/${COMPANY_NAME}.key ] else SSL_KEY_PATH=${SSL_KEY_PATH:-${SSL_CERTIFICATES_DIR}/tls.key} fi + +#When set, the well known "root" CAs will be extended with the extra certificates in file +NODE_EXTRA_CA_CERTS=${NODE_EXTRA_CA_CERTS:-${SSL_CERTIFICATES_DIR}/extra-ca-certs.pem} +if [[ -f ${NODE_EXTRA_CA_CERTS} ]]; then + NODE_EXTRA_ENVIRONMENT="${NODE_EXTRA_CA_CERTS}" +elif [[ -f ${SSL_CERTIFICATE_PATH} ]]; then + SSL_CERTIFICATE_SUBJECT=$(openssl x509 -subject -noout -in "${SSL_CERTIFICATE_PATH}" | sed 's/subject=//') + SSL_CERTIFICATE_ISSUER=$(openssl x509 -issuer -noout -in "${SSL_CERTIFICATE_PATH}" | sed 's/issuer=//') + + #Add self-signed certificate to trusted list for validating Docs requests to the test example + if [[ -n $SSL_CERTIFICATE_SUBJECT && $SSL_CERTIFICATE_SUBJECT == $SSL_CERTIFICATE_ISSUER ]]; then + NODE_EXTRA_ENVIRONMENT="${SSL_CERTIFICATE_PATH}" + fi +fi + +if [[ -n $NODE_EXTRA_ENVIRONMENT ]]; then + sed -i "s|^environment=.*$|&${NODE_EXTRA_ENVIRONMENT}|" /etc/supervisor/conf.d/*.conf +fi + CA_CERTIFICATES_PATH=${CA_CERTIFICATES_PATH:-${SSL_CERTIFICATES_DIR}/ca-certificates.pem} SSL_DHPARAM_PATH=${SSL_DHPARAM_PATH:-${SSL_CERTIFICATES_DIR}/dhparam.pem} SSL_VERIFY_CLIENT=${SSL_VERIFY_CLIENT:-off} From eb1706e3b7215988bbb49c44855422a5e25f96e7 Mon Sep 17 00:00:00 2001 From: Evgeniy Antonyuk Date: Tue, 19 Mar 2024 19:37:55 +0700 Subject: [PATCH 02/13] fix Bug 62253 - NODE_EXTRA_CA_CERTS substitution error (#721) --- run-document-server.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run-document-server.sh b/run-document-server.sh index 404ff30..51a7039 100644 --- a/run-document-server.sh +++ b/run-document-server.sh @@ -76,7 +76,7 @@ elif [[ -f ${SSL_CERTIFICATE_PATH} ]]; then fi if [[ -n $NODE_EXTRA_ENVIRONMENT ]]; then - sed -i "s|^environment=.*$|&${NODE_EXTRA_ENVIRONMENT}|" /etc/supervisor/conf.d/*.conf + sed -i "s|^environment=.*$|&,NODE_EXTRA_CA_CERTS=${NODE_EXTRA_ENVIRONMENT}|" /etc/supervisor/conf.d/*.conf fi CA_CERTIFICATES_PATH=${CA_CERTIFICATES_PATH:-${SSL_CERTIFICATES_DIR}/ca-certificates.pem} From 3fe861b1a47d51f2f3933c489e617df29b22e303 Mon Sep 17 00:00:00 2001 From: Danil Titarenko <77471369+danilapog@users.noreply.github.com> Date: Mon, 25 Mar 2024 17:13:26 +0300 Subject: [PATCH 03/13] Add damengdb stand (#712) * Add dameng stand * Rename compose file * Move damengdb files in tests folder * Remove copy bin disql command * Refactoring damengdb stand * Update readme instructions * Refactor: update readme * Refactor: add note * Update run command for disql copy * Remove scripts and add volumes in compose file Stand was updated. Main changes that scripts for prepare environment was removed.Now damengdb image can be pulled from hub.docker, also disql will be mounted from damengdb container in documentserver container. * Update damengdb image version * Actualized damengdb compose file Use damengdb image from onlyoffice repo. Also do not use develop documentserver build anymore * Don't mount entrypoint script anymore After release it will be inside the image with the necessary edits * Add the ability to build an image before compose is started * Dameng: Execute schema on build stage Now if you want use damengdb, you nedd build own image, schema for Documentserver will be create on build stage. Add dockerfile for the build dameng image. Also disql bin file don't share between containers * Actualize readme for damengdb stand * Editing typos * Remove useless lines * Small cosmetic change * Remove useless volume from compose file * Use default password for check connection * Remove `image` filed from compose --- run-document-server.sh | 3 ++ tests/damengdb/.env | 1 + tests/damengdb/README.md | 19 +++++++++ tests/damengdb/damengdb.Dockerfile | 46 ++++++++++++++++++++ tests/damengdb/docker-compose.yml | 67 ++++++++++++++++++++++++++++++ 5 files changed, 136 insertions(+) create mode 100644 tests/damengdb/.env create mode 100644 tests/damengdb/README.md create mode 100644 tests/damengdb/damengdb.Dockerfile create mode 100644 tests/damengdb/docker-compose.yml diff --git a/run-document-server.sh b/run-document-server.sh index 51a7039..b161b40 100644 --- a/run-document-server.sh +++ b/run-document-server.sh @@ -173,6 +173,9 @@ read_setting(){ "mariadb"|"mysql") DB_PORT=${DB_PORT:-"3306"} ;; + "dameng") + DB_PORT=${DB_PORT:-"5236"} + ;; "") DB_PORT=${DB_PORT:-${POSTGRESQL_SERVER_PORT:-$(${JSON} services.CoAuthoring.sql.dbPort)}} ;; diff --git a/tests/damengdb/.env b/tests/damengdb/.env new file mode 100644 index 0000000..0fd2523 --- /dev/null +++ b/tests/damengdb/.env @@ -0,0 +1 @@ +VERSION=latest diff --git a/tests/damengdb/README.md b/tests/damengdb/README.md new file mode 100644 index 0000000..c7f9c97 --- /dev/null +++ b/tests/damengdb/README.md @@ -0,0 +1,19 @@ +## Stand Documentserver with damengdb + +### How it works + +For deploy stand, you need: + +**STEP 1**: Build you own images, do it with command: + +```bash +docker compose build +``` + +**STEP 2**: Wait build and when it finish deploy with command: + +```bash +docker compose up -d +``` + +Thats all. diff --git a/tests/damengdb/damengdb.Dockerfile b/tests/damengdb/damengdb.Dockerfile new file mode 100644 index 0000000..a0a708c --- /dev/null +++ b/tests/damengdb/damengdb.Dockerfile @@ -0,0 +1,46 @@ +FROM onlyoffice/damengdb:8.1.2 as damengdb + +ARG DM8_USER="SYSDBA" +ARG DM8_PASS="SYSDBA001" +ARG DB_HOST="localhost" +ARG DB_PORT="5236" +ARG DISQL_BIN="/opt/dmdbms/bin" + +SHELL ["/bin/bash", "-c"] + +COPY <<"EOF" /wait_dm_ready.sh +#!/usr/bin/env bash + +function wait_dm_ready() { + cd /opt/dmdbms/bin + for i in `seq 1 10`; do + echo `./disql /nolog < /dev/null 2>&1 + if [ $? -eq 0 ]; then + echo "DM Database is not OK, please wait..." + sleep 10 + else + echo "DM Database is OK" + break + fi + done +} + +wait_dm_ready + +EOF + + +RUN bash /opt/startup.sh > /dev/null 2>&1 \ + & mkdir -p /schema/damengdb \ + && apt update -y ; apt install wget -y \ + && wget https://raw.githubusercontent.com/ONLYOFFICE/server/master/schema/dameng/createdb.sql -P /schema/dameng/ \ + && bash ./wait_dm_ready.sh \ + && cd ${DISQL_BIN} \ + && ./disql $DM8_USER/$DM8_PASS@$DB_HOST:$DB_PORT -e \ + "create user "onlyoffice" identified by "onlyoffice" password_policy 0;" \ + && echo "EXIT" | tee -a /schema/dameng/createdb.sql \ + && ./disql $DM8_USER/$DM8_PASS@$DB_HOST:$DB_PORT \`/schema/dameng/createdb.sql \ + && sleep 10 diff --git a/tests/damengdb/docker-compose.yml b/tests/damengdb/docker-compose.yml new file mode 100644 index 0000000..c28dfb6 --- /dev/null +++ b/tests/damengdb/docker-compose.yml @@ -0,0 +1,67 @@ +version: '2' +services: + onlyoffice-documentserver: + build: + context: ../../. + dockerfile: Dockerfile + target: documentserver + container_name: onlyoffice-documentserver + depends_on: + - onlyoffice-dameng + - onlyoffice-rabbitmq + environment: + - DB_TYPE=dameng + - DB_HOST=onlyoffice-dameng + - DB_PORT=5236 + - DB_NAME=onlyoffice + - DB_USER=onlyoffice + - AMQP_URI=amqp://guest:guest@onlyoffice-rabbitmq + # Costomize the JSON Web Token validation parameters if needed. + #- JWT_ENABLED=false + #- JWT_SECRET=secret + #- JWT_HEADER=Authorization + #- JWT_IN_BODY=true + ports: + - '80:80' + - '443:443' + stdin_open: true + restart: always + stop_grace_period: 60s + volumes: + - /var/www/onlyoffice/Data + - /var/log/onlyoffice + - /var/lib/onlyoffice/documentserver/App_Data/cache/files + - /var/www/onlyoffice/documentserver-example/public/files + - /usr/share/fonts + + onlyoffice-rabbitmq: + container_name: onlyoffice-rabbitmq + image: rabbitmq + restart: always + expose: + - '5672' + + onlyoffice-dameng: + container_name: onlyoffice-dameng + build: + context: . + dockerfile: damengdb.Dockerfile + target: damengdb + args: + DM8_USER: SYSDBA + DM8_PASS: SYSDBA001 + DB_HOST: localhost + DB_PORT: 5236 + environment: + - PAGE_SIZE=16 + - LD_LIBRARY_PATH=/opt/dmdbms/bin + - INSTANCE_NAME=dm8_01 + restart: always + expose: + - '5236' + volumes: + - dameng_data:/opt/dmdbms/data + +volumes: + dameng_data: + From 12eb20a61b008efc3b7834f5f628df2fa95c7276 Mon Sep 17 00:00:00 2001 From: Evgeniy Antonyuk Date: Wed, 10 Apr 2024 14:49:31 +0700 Subject: [PATCH 04/13] fix Bug 65410 - Disable ds:metrics service when METRICS_ENABLED=false (#726) --- config/supervisor/ds/ds-metrics.conf | 4 ++-- run-document-server.sh | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/config/supervisor/ds/ds-metrics.conf b/config/supervisor/ds/ds-metrics.conf index 1eb858a..d9c7576 100644 --- a/config/supervisor/ds/ds-metrics.conf +++ b/config/supervisor/ds/ds-metrics.conf @@ -9,5 +9,5 @@ stdout_logfile_maxbytes=0 stderr_logfile=/var/log/COMPANY_NAME/documentserver/metrics/err.log stderr_logfile_backups=0 stderr_logfile_maxbytes=0 -autostart=true -autorestart=true +autostart=false +autorestart=false diff --git a/run-document-server.sh b/run-document-server.sh index b161b40..5733619 100644 --- a/run-document-server.sh +++ b/run-document-server.sh @@ -23,6 +23,7 @@ DS_LOG_DIR="${LOG_DIR}/documentserver" LIB_DIR="/var/lib/${COMPANY_NAME}" DS_LIB_DIR="${LIB_DIR}/documentserver" CONF_DIR="/etc/${COMPANY_NAME}/documentserver" +SUPERVISOR_CONF_DIR="/etc/supervisor/conf.d" IS_UPGRADE="false" ONLYOFFICE_DATA_CONTAINER=${ONLYOFFICE_DATA_CONTAINER:-false} @@ -275,6 +276,7 @@ update_statsd_settings(){ ${JSON} -I -e "this.statsd.host = '${METRICS_HOST}'" ${JSON} -I -e "this.statsd.port = '${METRICS_PORT}'" ${JSON} -I -e "this.statsd.prefix = '${METRICS_PREFIX}'" + sed -i -E "s/(autostart|autorestart)=.*$/\1=${METRICS_ENABLED}/g" ${SUPERVISOR_CONF_DIR}/ds-metrics.conf } update_db_settings(){ From a571bd0d1a02093f77f1f127d324d032ea39f574 Mon Sep 17 00:00:00 2001 From: Roman Demidov Date: Tue, 23 Apr 2024 13:04:49 +0300 Subject: [PATCH 05/13] Add MSSQL support (#728) --- Dockerfile | 10 ++++++++- README.md | 2 +- run-document-server.sh | 32 ++++++++++++++++++++++++++++ tests/mssql/README.md | 17 +++++++++++++++ tests/mssql/create_db_user.sh | 32 ++++++++++++++++++++++++++++ tests/mssql/docker-compose.yml | 38 ++++++++++++++++++++++++++++++++++ tests/mssql/mssql.Dockerfile | 9 ++++++++ 7 files changed, 138 insertions(+), 2 deletions(-) create mode 100644 tests/mssql/README.md create mode 100755 tests/mssql/create_db_user.sh create mode 100644 tests/mssql/docker-compose.yml create mode 100644 tests/mssql/mssql.Dockerfile diff --git a/Dockerfile b/Dockerfile index 499e72d..0b4720d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,9 +12,12 @@ ARG ONLYOFFICE_VALUE=onlyoffice RUN echo "#!/bin/sh\nexit 0" > /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/22.04/prod.list && \ + wget -q -O - https://packages.microsoft.com/keys/microsoft.asc | apt-key add - && \ + apt-get -y update && \ locale-gen en_US.UTF-8 && \ echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | debconf-set-selections && \ - apt-get -yq install \ + ACCEPT_EULA=Y apt-get -yq install \ adduser \ apt-utils \ bomstrip \ @@ -22,6 +25,7 @@ RUN echo "#!/bin/sh\nexit 0" > /usr/sbin/policy-rc.d && \ cron \ curl \ htop \ + libaio1 \ libasound2 \ libboost-regex-dev \ libcairo2 \ @@ -34,6 +38,7 @@ RUN echo "#!/bin/sh\nexit 0" > /usr/sbin/policy-rc.d && \ libxml2 \ libxss1 \ libxtst6 \ + mssql-tools18 \ mysql-client \ nano \ net-tools \ @@ -48,6 +53,7 @@ RUN echo "#!/bin/sh\nexit 0" > /usr/sbin/policy-rc.d && \ sudo \ supervisor \ ttf-mscorefonts-installer \ + unixodbc-dev \ xvfb \ zlib1g && \ if [ $(ls -l /usr/share/fonts/truetype/msttcorefonts | wc -l) -ne 61 ]; \ @@ -94,6 +100,8 @@ RUN PACKAGE_FILE="${COMPANY_NAME}-${PRODUCT_NAME}${PRODUCT_EDITION}${PACKAGE_VER 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/onlyoffice/documentserver/server/schema/mssql/createdb.sql && \ + printf "\nGO" >> /var/www/onlyoffice/documentserver/server/schema/mssql/removetbl.sql && \ rm -f /tmp/$PACKAGE_FILE && \ rm -rf /var/log/$COMPANY_NAME && \ rm -rf /var/lib/apt/lists/* diff --git a/README.md b/README.md index f55ae07..07addf2 100644 --- a/README.md +++ b/README.md @@ -179,7 +179,7 @@ Below is the complete list of parameters that can be set using environment varia - **SSL_DHPARAM_PATH**: The path to the Diffie-Hellman parameter. Defaults to `/var/www/onlyoffice/Data/certs/dhparam.pem`. - **SSL_VERIFY_CLIENT**: Enable verification of client certificates using the `CA_CERTIFICATES_PATH` file. Defaults to `false` - **NODE_EXTRA_CA_CERTS**: The [NODE_EXTRA_CA_CERTS](https://nodejs.org/api/cli.html#node_extra_ca_certsfile "Node.js documentation") to extend CAs with the extra certificates for Node.js. Defaults to `/var/www/onlyoffice/Data/certs/extra-ca-certs.pem`. -- **DB_TYPE**: The database type. Supported values are `postgres`, `mariadb` or `mysql`. Defaults to `postgres`. +- **DB_TYPE**: The database type. Supported values are `postgres`, `mariadb`, `mysql` or `mssql`. Defaults to `postgres`. - **DB_HOST**: The IP address or the name of the host where the database server is running. - **DB_PORT**: The database server port number. - **DB_NAME**: The name of a database to use. Should be existing on container startup. diff --git a/run-document-server.sh b/run-document-server.sh index 5733619..feb7e95 100644 --- a/run-document-server.sh +++ b/run-document-server.sh @@ -177,6 +177,9 @@ read_setting(){ "dameng") DB_PORT=${DB_PORT:-"5236"} ;; + "mssql") + DB_PORT=${DB_PORT:-"1433"} + ;; "") DB_PORT=${DB_PORT:-${POSTGRESQL_SERVER_PORT:-$(${JSON} services.CoAuthoring.sql.dbPort)}} ;; @@ -397,6 +400,12 @@ create_postgresql_db(){ sudo -u postgres psql -c "CREATE DATABASE $DB_NAME OWNER $DB_USER;" } +create_mssql_db(){ + MSSQL="/opt/mssql-tools18/bin/sqlcmd -S $DB_HOST,$DB_PORT" + + $MSSQL -U $DB_USER -P "$DB_PWD" -C -Q "IF NOT EXISTS (SELECT * FROM sys.databases WHERE name = '$DB_NAME') BEGIN CREATE DATABASE $DB_NAME; END" +} + create_db_tbl() { case $DB_TYPE in "postgres") @@ -405,6 +414,9 @@ create_db_tbl() { "mariadb"|"mysql") create_mysql_tbl ;; + "mssql") + create_mssql_tbl + ;; esac } @@ -416,6 +428,9 @@ upgrade_db_tbl() { "mariadb"|"mysql") upgrade_mysql_tbl ;; + "mssql") + upgrade_mssql_tbl + ;; esac } @@ -438,6 +453,14 @@ upgrade_mysql_tbl() { $MYSQL $DB_NAME < "$APP_DIR/server/schema/mysql/createdb.sql" >/dev/null 2>&1 } +upgrade_mssql_tbl() { + CONN_PARAMS="-U $DB_USER -P "$DB_PWD" -C" + MSSQL="/opt/mssql-tools18/bin/sqlcmd -S $DB_HOST,$DB_PORT $CONN_PARAMS" + + $MSSQL < "$APP_DIR/server/schema/mssql/removetbl.sql" >/dev/null 2>&1 + $MSSQL < "$APP_DIR/server/schema/mssql/createdb.sql" >/dev/null 2>&1 +} + create_postgresql_tbl() { if [ -n "$DB_PWD" ]; then export PGPASSWORD=$DB_PWD @@ -457,6 +480,15 @@ create_mysql_tbl() { $MYSQL $DB_NAME < "$APP_DIR/server/schema/mysql/createdb.sql" >/dev/null 2>&1 } +create_mssql_tbl() { + create_mssql_db + + CONN_PARAMS="-U $DB_USER -P "$DB_PWD" -C" + MSSQL="/opt/mssql-tools18/bin/sqlcmd -S $DB_HOST,$DB_PORT $CONN_PARAMS" + + $MSSQL < "$APP_DIR/server/schema/mssql/createdb.sql" >/dev/null 2>&1 +} + update_welcome_page() { WELCOME_PAGE="${APP_DIR}-example/welcome/docker.html" if [[ -e $WELCOME_PAGE ]]; then diff --git a/tests/mssql/README.md b/tests/mssql/README.md new file mode 100644 index 0000000..3db562f --- /dev/null +++ b/tests/mssql/README.md @@ -0,0 +1,17 @@ +## Stand Documentserver with mssql + +### How it works + +For deploy stand: + +**STEP 1**: Build you own images: + +```bash +sudo docker-compose build +``` + +**STEP 2**: Wait build complete and when: + +```bash +sudo docker-compose up -d +``` diff --git a/tests/mssql/create_db_user.sh b/tests/mssql/create_db_user.sh new file mode 100755 index 0000000..cbe4c4e --- /dev/null +++ b/tests/mssql/create_db_user.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +#generate SA password +SYMBOLS='!#$%&*+,-.:;=?@^_~' +for (( i=1; i <= 20; i++ )); do + PASS=$(tr -dc "A-Za-z0-9$SYMBOLS" /dev/null | grep "affected" | wc -l) + if [ "$RES" -eq "1" ]; then + echo "Database is ready" + break + fi + sleep 10 +done + +#create new db user +$CONNECTION_STR "IF NOT EXISTS (SELECT * FROM sys.sql_logins WHERE name = '$MSSQL_USER') BEGIN CREATE LOGIN $MSSQL_USER WITH PASSWORD = '$MSSQL_PASSWORD' , CHECK_POLICY = OFF; ALTER SERVER ROLE [dbcreator] ADD MEMBER [$MSSQL_USER]; END" diff --git a/tests/mssql/docker-compose.yml b/tests/mssql/docker-compose.yml new file mode 100644 index 0000000..036bbe5 --- /dev/null +++ b/tests/mssql/docker-compose.yml @@ -0,0 +1,38 @@ +version: '2.1' +services: + onlyoffice-documentserver: + container_name: onlyoffice-documentserver + build: + context: ../../. + dockerfile: Dockerfile + depends_on: + - onlyoffice-mssql + environment: + - DB_TYPE=${DB_TYPE:-mssql} + - DB_HOST=${DB_HOST:-onlyoffice-mssql} + - DB_PORT=${DB_PORT:-1433} + - DB_NAME=${DB_NAME:-onlyoffice} + - DB_USER=${DB_USER:-onlyoffice} + - DB_PWD=${DB_PWD:-onlyoffice} + stdin_open: true + restart: always + ports: + - '80:80' + + onlyoffice-mssql: + container_name: onlyoffice-mssql + build: + context: . + dockerfile: mssql.Dockerfile + args: + - MSSQL_DATABASE=${DB_NAME:-onlyoffice} + - MSSQL_USER=${DB_USER:-onlyoffice} + - MSSQL_PASSWORD=${DB_PWD:-onlyoffice} + restart: always + volumes: + - mssql_data:/var/opt/mssql + expose: + - '1433' + +volumes: + mssql_data: diff --git a/tests/mssql/mssql.Dockerfile b/tests/mssql/mssql.Dockerfile new file mode 100644 index 0000000..f6dddc6 --- /dev/null +++ b/tests/mssql/mssql.Dockerfile @@ -0,0 +1,9 @@ +FROM mcr.microsoft.com/mssql/server:2022-latest as onlyoffice-mssql + +ENV ACCEPT_EULA=Y + +SHELL ["/bin/bash", "-c"] + +COPY create_db_user.sh /tmp/create_db_user.sh + +RUN bash /tmp/create_db_user.sh From b665c004dafb45ea20d863086b68a1c9986d34ce Mon Sep 17 00:00:00 2001 From: Roman Demidov Date: Fri, 3 May 2024 11:23:12 +0300 Subject: [PATCH 06/13] Use mssql-tools version from BASE_IMAGE (#731) * Use mssql-tools version from BASE_IMAGE * Small changes * Small changes * Small changes * Small changes * Small changes --- .github/workflows/stable-build.yml | 2 +- Dockerfile | 9 ++++++--- docker-bake.hcl | 4 ++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/stable-build.yml b/.github/workflows/stable-build.yml index fd493f3..ab5813c 100644 --- a/.github/workflows/stable-build.yml +++ b/.github/workflows/stable-build.yml @@ -129,7 +129,7 @@ jobs: export PRODUCT_EDITION=${{ matrix.edition }} export PACKAGE_BASEURL=${{ secrets.REPO_BASEURL }} export DOCKERFILE=Dockerfile - export BASE_IMAGE=ubuntu:20.04 + export BASE_VERSION=20.04 export PG_VERSION=12 export TAG=${VERSION%.*}.${RELEASE_NUMBER} export PACKAGE_VERSION=$( echo ${VERSION} | sed -E 's/(.*)\./\1-/') diff --git a/Dockerfile b/Dockerfile index 0b4720d..a826476 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,18 +1,21 @@ -ARG BASE_IMAGE=ubuntu:22.04 +ARG BASE_VERSION=22.04 + +ARG BASE_IMAGE=ubuntu:$BASE_VERSION FROM ${BASE_IMAGE} as documentserver LABEL maintainer Ascensio System SIA +ARG BASE_VERSION ARG PG_VERSION=14 -ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8 DEBIAN_FRONTEND=noninteractive PG_VERSION=${PG_VERSION} +ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8 DEBIAN_FRONTEND=noninteractive PG_VERSION=${PG_VERSION} BASE_VERSION=${BASE_VERSION} ARG ONLYOFFICE_VALUE=onlyoffice RUN echo "#!/bin/sh\nexit 0" > /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/22.04/prod.list && \ + wget -q -O /etc/apt/sources.list.d/mssql-release.list https://packages.microsoft.com/config/ubuntu/$BASE_VERSION/prod.list && \ wget -q -O - https://packages.microsoft.com/keys/microsoft.asc | apt-key add - && \ apt-get -y update && \ locale-gen en_US.UTF-8 && \ diff --git a/docker-bake.hcl b/docker-bake.hcl index 54de0b6..793d568 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -64,7 +64,7 @@ variable "LATEST" { ### ↓ Variables for UCS build ↓ -variable "BASE_IMAGE" { +variable "BASE_VERSION" { default = "" } @@ -130,7 +130,7 @@ target "documentserver-ucs" { "COMPANY_NAME": "${COMPANY_NAME}" "PACKAGE_VERSION": "${PACKAGE_VERSION}" "PACKAGE_BASEURL": "${PACKAGE_BASEURL}" - "BASE_IMAGE": "${BASE_IMAGE}" + "BASE_VERSION": "${BASE_VERSION}" "PG_VERSION": "${PG_VERSION}" } } From b4e29f96954efcc472d8b44f6251a589e71de46d Mon Sep 17 00:00:00 2001 From: Evgeniy Antonyuk Date: Tue, 21 May 2024 14:13:54 +0300 Subject: [PATCH 07/13] Add configuration of WOPI parameters (#735) --- run-document-server.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/run-document-server.sh b/run-document-server.sh index feb7e95..fcefc64 100644 --- a/run-document-server.sh +++ b/run-document-server.sh @@ -373,8 +373,18 @@ update_ds_settings(){ fi if [ "${WOPI_ENABLED}" == "true" ]; then + WOPI_PRIVATE_KEY="${DATA_DIR}/wopi_private.key" + WOPI_PUBLIC_KEY="${DATA_DIR}/wopi_public.key" + + [ ! -f "${WOPI_PRIVATE_KEY}" ] && echo -n "Generating WOPI private key..." && openssl genpkey -algorithm RSA -outform PEM -out "${WOPI_PRIVATE_KEY}" && echo "Done" + [ ! -f "${WOPI_PUBLIC_KEY}" ] && echo -n "Generating WOPI public key..." && openssl rsa -pubout -in "${WOPI_PRIVATE_KEY}" -outform PEM -out "${WOPI_PUBLIC_KEY}" && echo "Done" + WOPI_MODULUS=$(openssl rsa -pubin -inform PEM -modulus -noout -in "${WOPI_PUBLIC_KEY}" | sed 's/Modulus=//') + ${JSON} -I -e "if(this.wopi===undefined)this.wopi={}" ${JSON} -I -e "this.wopi.enable = true" + ${JSON} -I -e "this.wopi.privateKey = '$(base64 -w0 ${WOPI_PRIVATE_KEY})'" + ${JSON} -I -e "this.wopi.publicKey = '$(base64 -w0 ${WOPI_PUBLIC_KEY})'" + ${JSON} -I -e "this.wopi.modulus = '${WOPI_MODULUS}'" fi if [ "${ALLOW_META_IP_ADDRESS}" = "true" ] || [ "${ALLOW_PRIVATE_IP_ADDRESS}" = "true" ]; then From bbfc86a1e0eb68c38f7b652f2504f3cea8d1c0b5 Mon Sep 17 00:00:00 2001 From: Roman Demidov Date: Mon, 27 May 2024 13:57:11 +0300 Subject: [PATCH 08/13] Add ORACLE support (#734) --- Dockerfile | 19 +++++++++++++ README.md | 2 +- oracle/sqlplus | 6 +++++ run-document-server.sh | 47 +++++++++++++++++++++++++++++++++ tests/oracle/README.md | 17 ++++++++++++ tests/oracle/create_db_user.sh | 28 ++++++++++++++++++++ tests/oracle/docker-compose.yml | 38 ++++++++++++++++++++++++++ tests/oracle/oracle.Dockerfile | 15 +++++++++++ 8 files changed, 171 insertions(+), 1 deletion(-) create mode 100755 oracle/sqlplus create mode 100644 tests/oracle/README.md create mode 100755 tests/oracle/create_db_user.sh create mode 100644 tests/oracle/docker-compose.yml create mode 100644 tests/oracle/oracle.Dockerfile diff --git a/Dockerfile b/Dockerfile index a826476..7af0962 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,6 +8,16 @@ LABEL maintainer Ascensio System SIA ARG BASE_VERSION ARG PG_VERSION=14 +ENV OC_RELEASE_NUM=21 +ENV OC_RU_VER=12 +ENV OC_RU_REVISION_VER=0 +ENV OC_RESERVED_NUM=0 +ENV OC_RU_DATE=0 +ENV OC_PATH=${OC_RELEASE_NUM}${OC_RU_VER}000 +ENV OC_FILE_SUFFIX=${OC_RELEASE_NUM}.${OC_RU_VER}.${OC_RU_REVISION_VER}.${OC_RESERVED_NUM}.${OC_RU_DATE}${OC_FILE_SUFFIX}dbru +ENV OC_VER_DIR=${OC_RELEASE_NUM}_${OC_RU_VER} +ENV OC_DOWNLOAD_URL=https://download.oracle.com/otn_software/linux/instantclient/${OC_PATH} + ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8 DEBIAN_FRONTEND=noninteractive PG_VERSION=${PG_VERSION} BASE_VERSION=${BASE_VERSION} ARG ONLYOFFICE_VALUE=onlyoffice @@ -57,6 +67,7 @@ RUN echo "#!/bin/sh\nexit 0" > /usr/sbin/policy-rc.d && \ supervisor \ ttf-mscorefonts-installer \ unixodbc-dev \ + unzip \ xvfb \ zlib1g && \ if [ $(ls -l /usr/share/fonts/truetype/msttcorefonts | wc -l) -ne 61 ]; \ @@ -68,6 +79,11 @@ RUN echo "#!/bin/sh\nexit 0" > /usr/sbin/policy-rc.d && \ 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.x64-${OC_FILE_SUFFIX}.zip && \ + wget -O sqlplus.zip ${OC_DOWNLOAD_URL}/instantclient-sqlplus-linux.x64-${OC_FILE_SUFFIX}.zip && \ + unzip -d /usr/share basic.zip && \ + unzip -d /usr/share sqlplus.zip && \ + mv /usr/share/instantclient_${OC_VER_DIR} /usr/share/instantclient && \ service postgresql stop && \ service redis-server stop && \ service rabbitmq-server stop && \ @@ -78,6 +94,7 @@ RUN echo "#!/bin/sh\nexit 0" > /usr/sbin/policy-rc.d && \ 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 @@ -105,6 +122,8 @@ RUN PACKAGE_FILE="${COMPANY_NAME}-${PRODUCT_NAME}${PRODUCT_EDITION}${PACKAGE_VER chmod 755 /app/ds/*.sh && \ printf "\nGO" >> /var/www/onlyoffice/documentserver/server/schema/mssql/createdb.sql && \ printf "\nGO" >> /var/www/onlyoffice/documentserver/server/schema/mssql/removetbl.sql && \ + printf "\nexit" >> /var/www/onlyoffice/documentserver/server/schema/oracle/createdb.sql && \ + printf "\nexit" >> /var/www/onlyoffice/documentserver/server/schema/oracle/removetbl.sql && \ rm -f /tmp/$PACKAGE_FILE && \ rm -rf /var/log/$COMPANY_NAME && \ rm -rf /var/lib/apt/lists/* diff --git a/README.md b/README.md index 07addf2..dc2d4e8 100644 --- a/README.md +++ b/README.md @@ -179,7 +179,7 @@ Below is the complete list of parameters that can be set using environment varia - **SSL_DHPARAM_PATH**: The path to the Diffie-Hellman parameter. Defaults to `/var/www/onlyoffice/Data/certs/dhparam.pem`. - **SSL_VERIFY_CLIENT**: Enable verification of client certificates using the `CA_CERTIFICATES_PATH` file. Defaults to `false` - **NODE_EXTRA_CA_CERTS**: The [NODE_EXTRA_CA_CERTS](https://nodejs.org/api/cli.html#node_extra_ca_certsfile "Node.js documentation") to extend CAs with the extra certificates for Node.js. Defaults to `/var/www/onlyoffice/Data/certs/extra-ca-certs.pem`. -- **DB_TYPE**: The database type. Supported values are `postgres`, `mariadb`, `mysql` or `mssql`. Defaults to `postgres`. +- **DB_TYPE**: The database type. Supported values are `postgres`, `mariadb`, `mysql`, `mssql` or `oracle`. Defaults to `postgres`. - **DB_HOST**: The IP address or the name of the host where the database server is running. - **DB_PORT**: The database server port number. - **DB_NAME**: The name of a database to use. Should be existing on container startup. diff --git a/oracle/sqlplus b/oracle/sqlplus new file mode 100755 index 0000000..3bd1bd5 --- /dev/null +++ b/oracle/sqlplus @@ -0,0 +1,6 @@ +#!/bin/sh + +CLIENTDIR=/usr/share/instantclient +export LD_LIBRARY_PATH=$CLIENTDIR +$CLIENTDIR/sqlplus $@ + diff --git a/run-document-server.sh b/run-document-server.sh index fcefc64..98ffddd 100644 --- a/run-document-server.sh +++ b/run-document-server.sh @@ -180,6 +180,9 @@ read_setting(){ "mssql") DB_PORT=${DB_PORT:-"1433"} ;; + "oracle") + DB_PORT=${DB_PORT:-"1521"} + ;; "") DB_PORT=${DB_PORT:-${POSTGRESQL_SERVER_PORT:-$(${JSON} services.CoAuthoring.sql.dbPort)}} ;; @@ -258,8 +261,31 @@ waiting_for_connection(){ done } +waiting_for_db_ready(){ + case $DB_TYPE in + "oracle") + PDB="XEPDB1" + ORACLE_SQL="sqlplus $DB_USER/$DB_PWD@//$DB_HOST:$DB_PORT/$PDB" + DB_TEST="echo \"SELECT version FROM V\$INSTANCE;\" | $ORACLE_SQL 2>/dev/null | grep \"Connected\" | wc -l" + ;; + *) + return + ;; + esac + + for (( i=1; i <= 10; i++ )); do + RES=$(eval $DB_TEST) + if [ "$RES" -ne "0" ]; then + echo "Database is ready" + break + fi + sleep 5 + done +} + waiting_for_db(){ waiting_for_connection $DB_HOST $DB_PORT + waiting_for_db_ready } waiting_for_amqp(){ @@ -427,6 +453,9 @@ create_db_tbl() { "mssql") create_mssql_tbl ;; + "oracle") + create_oracle_tbl + ;; esac } @@ -441,6 +470,9 @@ upgrade_db_tbl() { "mssql") upgrade_mssql_tbl ;; + "oracle") + upgrade_oracle_tbl + ;; esac } @@ -471,6 +503,14 @@ upgrade_mssql_tbl() { $MSSQL < "$APP_DIR/server/schema/mssql/createdb.sql" >/dev/null 2>&1 } +upgrade_oracle_tbl() { + PDB="XEPDB1" + ORACLE_SQL="sqlplus $DB_USER/$DB_PWD@//$DB_HOST:$DB_PORT/$PDB" + + $ORACLE_SQL @$APP_DIR/server/schema/oracle/removetbl.sql >/dev/null 2>&1 + $ORACLE_SQL @$APP_DIR/server/schema/oracle/createdb.sql >/dev/null 2>&1 +} + create_postgresql_tbl() { if [ -n "$DB_PWD" ]; then export PGPASSWORD=$DB_PWD @@ -499,6 +539,13 @@ create_mssql_tbl() { $MSSQL < "$APP_DIR/server/schema/mssql/createdb.sql" >/dev/null 2>&1 } +create_oracle_tbl() { + PDB="XEPDB1" + ORACLE_SQL="sqlplus $DB_USER/$DB_PWD@//$DB_HOST:$DB_PORT/$PDB" + + $ORACLE_SQL @$APP_DIR/server/schema/oracle/createdb.sql >/dev/null 2>&1 +} + update_welcome_page() { WELCOME_PAGE="${APP_DIR}-example/welcome/docker.html" if [[ -e $WELCOME_PAGE ]]; then diff --git a/tests/oracle/README.md b/tests/oracle/README.md new file mode 100644 index 0000000..f548805 --- /dev/null +++ b/tests/oracle/README.md @@ -0,0 +1,17 @@ +## Stand Documentserver with oracle + +### How it works + +For deploy stand: + +**STEP 1**: Build you own images: + +```bash +sudo docker-compose build +``` + +**STEP 2**: Wait build complete and when: + +```bash +sudo docker-compose up -d +``` diff --git a/tests/oracle/create_db_user.sh b/tests/oracle/create_db_user.sh new file mode 100755 index 0000000..831df42 --- /dev/null +++ b/tests/oracle/create_db_user.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +CONNECTION_STR="sqlplus sys/$ORACLE_PASSWORD@//localhost:1521/$ORACLE_DATABASE as sysdba" + +export ORACLE_PWD=$ORACLE_PASSWORD + +#start db +/opt/oracle/runOracle.sh & + +#wait for db up +for (( i=1; i <= 20; i++ )); do + RES=$(echo "SELECT version FROM V\$INSTANCE;" | $CONNECTION_STR 2>/dev/null | grep "Connected" | wc -l) + if [ "$RES" -ne "0" ]; then + echo "Database is ready" + break + fi + sleep 10 +done + +sleep 1 + +#create new db user +$CONNECTION_STR < Date: Wed, 29 May 2024 16:05:22 +0300 Subject: [PATCH 09/13] fix Bug 66601 - Add additional parameters for WOPI configuration (#738) --- run-document-server.sh | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/run-document-server.sh b/run-document-server.sh index 98ffddd..ada8394 100644 --- a/run-document-server.sh +++ b/run-document-server.sh @@ -398,20 +398,24 @@ update_ds_settings(){ ${JSON} -I -e "if(this.services.CoAuthoring.requestDefaults.rejectUnauthorized===undefined)this.services.CoAuthoring.requestDefaults.rejectUnauthorized=false" fi - if [ "${WOPI_ENABLED}" == "true" ]; then - WOPI_PRIVATE_KEY="${DATA_DIR}/wopi_private.key" - WOPI_PUBLIC_KEY="${DATA_DIR}/wopi_public.key" + WOPI_PRIVATE_KEY="${DATA_DIR}/wopi_private.key" + WOPI_PUBLIC_KEY="${DATA_DIR}/wopi_public.key" - [ ! -f "${WOPI_PRIVATE_KEY}" ] && echo -n "Generating WOPI private key..." && openssl genpkey -algorithm RSA -outform PEM -out "${WOPI_PRIVATE_KEY}" && echo "Done" - [ ! -f "${WOPI_PUBLIC_KEY}" ] && echo -n "Generating WOPI public key..." && openssl rsa -pubout -in "${WOPI_PRIVATE_KEY}" -outform PEM -out "${WOPI_PUBLIC_KEY}" && echo "Done" - WOPI_MODULUS=$(openssl rsa -pubin -inform PEM -modulus -noout -in "${WOPI_PUBLIC_KEY}" | sed 's/Modulus=//') - - ${JSON} -I -e "if(this.wopi===undefined)this.wopi={}" - ${JSON} -I -e "this.wopi.enable = true" - ${JSON} -I -e "this.wopi.privateKey = '$(base64 -w0 ${WOPI_PRIVATE_KEY})'" - ${JSON} -I -e "this.wopi.publicKey = '$(base64 -w0 ${WOPI_PUBLIC_KEY})'" - ${JSON} -I -e "this.wopi.modulus = '${WOPI_MODULUS}'" - fi + [ ! -f "${WOPI_PRIVATE_KEY}" ] && echo -n "Generating WOPI private key..." && openssl genpkey -algorithm RSA -outform PEM -out "${WOPI_PRIVATE_KEY}" >/dev/null 2>&1 && echo "Done" + [ ! -f "${WOPI_PUBLIC_KEY}" ] && echo -n "Generating WOPI public key..." && openssl rsa -RSAPublicKey_out -in "${WOPI_PRIVATE_KEY}" -outform "MS PUBLICKEYBLOB" -out "${WOPI_PUBLIC_KEY}" >/dev/null 2>&1 && echo "Done" + WOPI_MODULUS=$(openssl rsa -pubin -inform "MS PUBLICKEYBLOB" -modulus -noout -in "${WOPI_PUBLIC_KEY}" | sed 's/Modulus=//') + WOPI_EXPONENT=$(openssl rsa -pubin -inform "MS PUBLICKEYBLOB" -text -noout -in "${WOPI_PUBLIC_KEY}" | grep -oP '(?<=Exponent: )\d+') + + ${JSON} -e "if(this.wopi===undefined)this.wopi={};" + ${JSON} -e "this.wopi.enable = ${WOPI_ENABLED}" + ${JSON} -e "this.wopi.privateKey = '$(openssl base64 -in ${WOPI_PRIVATE_KEY} -A)'" + ${JSON} -e "this.wopi.privateKeyOld = '$(openssl base64 -in ${WOPI_PRIVATE_KEY} -A)'" + ${JSON} -e "this.wopi.publicKey = '$(openssl base64 -in ${WOPI_PUBLIC_KEY} -A)'" + ${JSON} -e "this.wopi.publicKeyOld = '$(openssl base64 -in ${WOPI_PUBLIC_KEY} -A)'" + ${JSON} -e "this.wopi.modulus = '${WOPI_MODULUS}'" + ${JSON} -e "this.wopi.modulusOld = '${WOPI_MODULUS}'" + ${JSON} -e "this.wopi.exponent = '${WOPI_EXPONENT}'" + ${JSON} -e "this.wopi.exponentOld = '${WOPI_EXPONENT}'" if [ "${ALLOW_META_IP_ADDRESS}" = "true" ] || [ "${ALLOW_PRIVATE_IP_ADDRESS}" = "true" ]; then ${JSON} -I -e "if(this.services.CoAuthoring['request-filtering-agent']===undefined)this.services.CoAuthoring['request-filtering-agent']={}" From cf29c757a2bd0b534654e97693ee78f68c7667b3 Mon Sep 17 00:00:00 2001 From: Evgeniy Antonyuk Date: Mon, 3 Jun 2024 17:33:07 +0300 Subject: [PATCH 10/13] fix Bug 68320 - Fix output during WOPI configuration (#741) --- run-document-server.sh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/run-document-server.sh b/run-document-server.sh index ada8394..4abe42a 100644 --- a/run-document-server.sh +++ b/run-document-server.sh @@ -406,16 +406,16 @@ update_ds_settings(){ WOPI_MODULUS=$(openssl rsa -pubin -inform "MS PUBLICKEYBLOB" -modulus -noout -in "${WOPI_PUBLIC_KEY}" | sed 's/Modulus=//') WOPI_EXPONENT=$(openssl rsa -pubin -inform "MS PUBLICKEYBLOB" -text -noout -in "${WOPI_PUBLIC_KEY}" | grep -oP '(?<=Exponent: )\d+') - ${JSON} -e "if(this.wopi===undefined)this.wopi={};" - ${JSON} -e "this.wopi.enable = ${WOPI_ENABLED}" - ${JSON} -e "this.wopi.privateKey = '$(openssl base64 -in ${WOPI_PRIVATE_KEY} -A)'" - ${JSON} -e "this.wopi.privateKeyOld = '$(openssl base64 -in ${WOPI_PRIVATE_KEY} -A)'" - ${JSON} -e "this.wopi.publicKey = '$(openssl base64 -in ${WOPI_PUBLIC_KEY} -A)'" - ${JSON} -e "this.wopi.publicKeyOld = '$(openssl base64 -in ${WOPI_PUBLIC_KEY} -A)'" - ${JSON} -e "this.wopi.modulus = '${WOPI_MODULUS}'" - ${JSON} -e "this.wopi.modulusOld = '${WOPI_MODULUS}'" - ${JSON} -e "this.wopi.exponent = '${WOPI_EXPONENT}'" - ${JSON} -e "this.wopi.exponentOld = '${WOPI_EXPONENT}'" + ${JSON} -I -e "if(this.wopi===undefined)this.wopi={};" + ${JSON} -I -e "this.wopi.enable = ${WOPI_ENABLED}" + ${JSON} -I -e "this.wopi.privateKey = '$(openssl base64 -in ${WOPI_PRIVATE_KEY} -A)'" + ${JSON} -I -e "this.wopi.privateKeyOld = '$(openssl base64 -in ${WOPI_PRIVATE_KEY} -A)'" + ${JSON} -I -e "this.wopi.publicKey = '$(openssl base64 -in ${WOPI_PUBLIC_KEY} -A)'" + ${JSON} -I -e "this.wopi.publicKeyOld = '$(openssl base64 -in ${WOPI_PUBLIC_KEY} -A)'" + ${JSON} -I -e "this.wopi.modulus = '${WOPI_MODULUS}'" + ${JSON} -I -e "this.wopi.modulusOld = '${WOPI_MODULUS}'" + ${JSON} -I -e "this.wopi.exponent = '${WOPI_EXPONENT}'" + ${JSON} -I -e "this.wopi.exponentOld = '${WOPI_EXPONENT}'" if [ "${ALLOW_META_IP_ADDRESS}" = "true" ] || [ "${ALLOW_PRIVATE_IP_ADDRESS}" = "true" ]; then ${JSON} -I -e "if(this.services.CoAuthoring['request-filtering-agent']===undefined)this.services.CoAuthoring['request-filtering-agent']={}" From 275719d078ecbe0e61cfb8560a1f720a97567a19 Mon Sep 17 00:00:00 2001 From: Evgeniy Antonyuk Date: Mon, 3 Jun 2024 17:35:29 +0300 Subject: [PATCH 11/13] Add fixes to WOPI configuration (#742) --- run-document-server.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/run-document-server.sh b/run-document-server.sh index 4abe42a..9fcbd1a 100644 --- a/run-document-server.sh +++ b/run-document-server.sh @@ -408,14 +408,14 @@ update_ds_settings(){ ${JSON} -I -e "if(this.wopi===undefined)this.wopi={};" ${JSON} -I -e "this.wopi.enable = ${WOPI_ENABLED}" - ${JSON} -I -e "this.wopi.privateKey = '$(openssl base64 -in ${WOPI_PRIVATE_KEY} -A)'" - ${JSON} -I -e "this.wopi.privateKeyOld = '$(openssl base64 -in ${WOPI_PRIVATE_KEY} -A)'" + ${JSON} -I -e "this.wopi.privateKey = '$(awk '{printf "%s\\n", $0}' ${WOPI_PRIVATE_KEY})'" + ${JSON} -I -e "this.wopi.privateKeyOld = '$(awk '{printf "%s\\n", $0}' ${WOPI_PRIVATE_KEY})'" ${JSON} -I -e "this.wopi.publicKey = '$(openssl base64 -in ${WOPI_PUBLIC_KEY} -A)'" ${JSON} -I -e "this.wopi.publicKeyOld = '$(openssl base64 -in ${WOPI_PUBLIC_KEY} -A)'" ${JSON} -I -e "this.wopi.modulus = '${WOPI_MODULUS}'" ${JSON} -I -e "this.wopi.modulusOld = '${WOPI_MODULUS}'" - ${JSON} -I -e "this.wopi.exponent = '${WOPI_EXPONENT}'" - ${JSON} -I -e "this.wopi.exponentOld = '${WOPI_EXPONENT}'" + ${JSON} -I -e "this.wopi.exponent = ${WOPI_EXPONENT}" + ${JSON} -I -e "this.wopi.exponentOld = ${WOPI_EXPONENT}" if [ "${ALLOW_META_IP_ADDRESS}" = "true" ] || [ "${ALLOW_PRIVATE_IP_ADDRESS}" = "true" ]; then ${JSON} -I -e "if(this.services.CoAuthoring['request-filtering-agent']===undefined)this.services.CoAuthoring['request-filtering-agent']={}" From 3b60bc3c6e7a68f6115ac078f4c664e3fd5c59d8 Mon Sep 17 00:00:00 2001 From: Evgeniy Antonyuk Date: Mon, 10 Jun 2024 17:28:48 +0300 Subject: [PATCH 12/13] Fix changing permissions for log directories (#744) --- run-document-server.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run-document-server.sh b/run-document-server.sh index 9fcbd1a..ddce1bd 100644 --- a/run-document-server.sh +++ b/run-document-server.sh @@ -645,7 +645,7 @@ for i in ${DS_LIB_DIR}/App_Data/cache/files ${DS_LIB_DIR}/App_Data/docbuilder ${ done # change folder rights -for i in ${LOG_DIR} ${LIB_DIR}; do +for i in ${DS_LOG_DIR} ${DS_LOG_DIR}-example ${LIB_DIR}; do chown -R ds:ds "$i" chmod -R 755 "$i" done From b2c9221d4884caea210f7c4c061d3636bf5aa883 Mon Sep 17 00:00:00 2001 From: Semyon Bezrukov Date: Tue, 11 Jun 2024 11:16:38 +0300 Subject: [PATCH 13/13] Fix branding paths (#745) --- Dockerfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7af0962..732bde9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -120,10 +120,10 @@ RUN PACKAGE_FILE="${COMPANY_NAME}-${PRODUCT_NAME}${PRODUCT_EDITION}${PACKAGE_VER 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/onlyoffice/documentserver/server/schema/mssql/createdb.sql && \ - printf "\nGO" >> /var/www/onlyoffice/documentserver/server/schema/mssql/removetbl.sql && \ - printf "\nexit" >> /var/www/onlyoffice/documentserver/server/schema/oracle/createdb.sql && \ - printf "\nexit" >> /var/www/onlyoffice/documentserver/server/schema/oracle/removetbl.sql && \ + 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/*