diff --git a/Dockerfile b/Dockerfile index 44b2fc0..facff20 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,6 +7,15 @@ ARG SOURCE_REPO_URL="deb http://static.teamlab.com.s3.amazonaws.com/repo/debian ARG DEBIAN_FRONTEND=noninteractive ARG PACKAGE_SYSNAME="onlyoffice" +ARG LOG4J_VER=2.17.2 +ARG LOG4J_BIN=apache-log4j-${LOG4J_VER}-bin +ARG LOG4J_ARCH=${LOG4J_BIN}.tar.gz +ARG LOG4J_DIR=./log4j + +ARG ELK_DIR=/usr/share/elasticsearch +ARG ELK_LIB_DIR=${ELK_DIR}/lib +ARG ELK_MODULE_DIR=${ELK_DIR}/modules + LABEL ${PACKAGE_SYSNAME}.community.release-date="${RELEASE_DATE}" \ ${PACKAGE_SYSNAME}.community.version="${VERSION}" \ description="Community Server is a free open-source collaborative system developed to manage documents, projects, customer relationship and emails, all in one place." \ @@ -15,7 +24,8 @@ LABEL ${PACKAGE_SYSNAME}.community.release-date="${RELEASE_DATE}" \ ENV LANG=en_US.UTF-8 \ LANGUAGE=en_US:en \ - LC_ALL=en_US.UTF-8 + LC_ALL=en_US.UTF-8 \ + ELASTICSEARCH_VERSION=7.10.0 RUN apt-get -y update && \ apt-get -y upgrade && \ @@ -55,6 +65,8 @@ RUN apt-get -y update && \ echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" | tee -a /etc/apt/sources.list.d/elastic-7.x.list && \ add-apt-repository -y ppa:certbot/certbot && \ add-apt-repository -y ppa:chris-lea/redis-server && \ + curl -sSL https://packages.microsoft.com/keys/microsoft.asc | apt-key add - && \ + echo "deb [arch=amd64] https://packages.microsoft.com/ubuntu/18.04/prod bionic main" >> /etc/apt/sources.list.d/microsoft-prod.list && \ curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash - && \ apt-get install -yq gnupg2 \ ca-certificates \ @@ -78,12 +90,23 @@ RUN apt-get -y update && \ iproute2 \ ffmpeg \ jq \ - openjdk-8-jre-headless \ apt-transport-https \ - elasticsearch=7.9.0 \ + elasticsearch=${ELASTICSEARCH_VERSION} \ mono-webserver-hyperfastcgi=0.4-7 \ + dotnet-sdk-6.0 \ ${PACKAGE_SYSNAME}-communityserver \ ${PACKAGE_SYSNAME}-xmppserver && \ + rm -v ${ELK_LIB_DIR}/log4j-*.jar ${ELK_MODULE_DIR}/*/log4j-*.jar && \ + wget https://dlcdn.apache.org/logging/log4j/${LOG4J_VER}/${LOG4J_ARCH}&& \ + mkdir ${LOG4J_DIR} && \ + tar -xf ${LOG4J_ARCH} -C ${LOG4J_DIR} && \ + cp -v ${LOG4J_DIR}/${LOG4J_BIN}/log4j-api-${LOG4J_VER}.jar ${ELK_LIB_DIR} && \ + cp -v ${LOG4J_DIR}/${LOG4J_BIN}/log4j-core-${LOG4J_VER}.jar ${ELK_LIB_DIR} && \ + cp -v ${LOG4J_DIR}/${LOG4J_BIN}/log4j-1.2-api-${LOG4J_VER}.jar ${ELK_MODULE_DIR}/x-pack-core && \ + cp -v ${LOG4J_DIR}/${LOG4J_BIN}/log4j-slf4j-impl-${LOG4J_VER}.jar ${ELK_MODULE_DIR}/x-pack-identity-provider && \ + cp -v ${LOG4J_DIR}/${LOG4J_BIN}/log4j-slf4j-impl-${LOG4J_VER}.jar ${ELK_MODULE_DIR}/x-pack-security && \ + rm -vr ${LOG4J_ARCH} ${LOG4J_DIR} && \ + zip -q -d ${ELK_LIB_DIR}/log4j-core-*.jar org/apache/logging/log4j/core/lookup/JndiLookup.class && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* diff --git a/Dockerfile.ami b/Dockerfile.ami index bddbd26..65e5aa9 100644 --- a/Dockerfile.ami +++ b/Dockerfile.ami @@ -2,26 +2,6 @@ FROM onlyoffice/communityserver:latest AS communityserver-ami ARG APPSETTING_CONFIG=/var/www/onlyoffice/WebStudio/web.appsettings.config ARG RESOURCE_SQL=/var/www/onlyoffice/Sql/onlyoffice.resources.sql -ARG LOG4J_VER=2.17.1 -ARG LOG4J_BIN=apache-log4j-${LOG4J_VER}-bin -ARG LOG4J_ARCH=${LOG4J_BIN}.tar.gz -ARG LOG4J_DIR=./log4j - -ARG ELK_DIR=/usr/share/elasticsearch -ARG ELK_LIB_DIR=${ELK_DIR}/lib -ARG ELK_MODULE_DIR=${ELK_DIR}/modules - -RUN rm -v ${ELK_LIB_DIR}/log4j-*.jar ${ELK_MODULE_DIR}/*/log4j-*.jar && \ - wget https://dlcdn.apache.org/logging/log4j/${LOG4J_VER}/${LOG4J_ARCH}&& \ - mkdir ${LOG4J_DIR} && \ - tar -xf ${LOG4J_ARCH} -C ${LOG4J_DIR} && \ - cp -v ${LOG4J_DIR}/${LOG4J_BIN}/log4j-api-${LOG4J_VER}.jar ${ELK_LIB_DIR} && \ - cp -v ${LOG4J_DIR}/${LOG4J_BIN}/log4j-core-${LOG4J_VER}.jar ${ELK_LIB_DIR} && \ - cp -v ${LOG4J_DIR}/${LOG4J_BIN}/log4j-1.2-api-${LOG4J_VER}.jar ${ELK_MODULE_DIR}/x-pack-core && \ - cp -v ${LOG4J_DIR}/${LOG4J_BIN}/log4j-slf4j-impl-${LOG4J_VER}.jar ${ELK_MODULE_DIR}/x-pack-identity-provider && \ - cp -v ${LOG4J_DIR}/${LOG4J_BIN}/log4j-slf4j-impl-${LOG4J_VER}.jar ${ELK_MODULE_DIR}/x-pack-security && \ - rm -vr ${LOG4J_ARCH} ${LOG4J_DIR} - RUN apt-get -y update && \ apt-get install -yq xmlstarlet diff --git a/README.md b/README.md index 5d88518..3d79beb 100644 --- a/README.md +++ b/README.md @@ -162,7 +162,7 @@ sudo docker run --net onlyoffice -i -t -d --restart=always --name onlyoffice-mys Use this command to install **ONLYOFFICE Community Server**: ``` -sudo docker run --net onlyoffice -i -t -d --privileged --restart=always --name onlyoffice-community-server -p 80:80 -p 443:443 -p 5222:5222 \ +sudo docker run --net onlyoffice -i -t -d --privileged --restart=always --name onlyoffice-community-server -p 80:80 -p 443:443 -p 5222:5222 --cgroupns=host \ -e MYSQL_SERVER_ROOT_PASSWORD=my-secret-pw \ -e MYSQL_SERVER_DB_NAME=onlyoffice \ -e MYSQL_SERVER_HOST=onlyoffice-mysql-server \ @@ -171,7 +171,7 @@ sudo docker run --net onlyoffice -i -t -d --privileged --restart=always --name o -v /app/onlyoffice/CommunityServer/data:/var/www/onlyoffice/Data \ -v /app/onlyoffice/CommunityServer/logs:/var/log/onlyoffice \ -v /app/onlyoffice/CommunityServer/letsencrypt:/etc/letsencrypt \ - -v /sys/fs/cgroup:/sys/fs/cgroup:ro \ + -v /sys/fs/cgroup:/sys/fs/cgroup:rw \ onlyoffice/communityserver ``` @@ -186,11 +186,11 @@ All the data are stored in the specially-designated directories, **data volumes* To get access to your data from outside the container, you need to mount the volumes. It can be done by specifying the '-v' option in the docker run command. - sudo docker run -i -t -d -p 80:80 \ + sudo docker run -i -t -d -p 80:80 --cgroupns=host \ -v /app/onlyoffice/CommunityServer/logs:/var/log/onlyoffice \ -v /app/onlyoffice/CommunityServer/data:/var/www/onlyoffice/Data \ -v /app/onlyoffice/CommunityServer/letsencrypt:/etc/letsencrypt \ - -v /sys/fs/cgroup:/sys/fs/cgroup:ro onlyoffice/communityserver + -v /sys/fs/cgroup:/sys/fs/cgroup:rw onlyoffice/communityserver Storing the data on the host machine allows you to easily update ONLYOFFICE once the new version is released without losing your data. @@ -198,11 +198,11 @@ Storing the data on the host machine allows you to easily update ONLYOFFICE once To change the port, use the -p command. E.g.: to make your portal accessible via port 8080 execute the following command: - sudo docker run -i -t -d --privileged -p 8080:80 \ + sudo docker run -i -t -d --privileged -p 8080:80 --cgroupns=host \ -v /app/onlyoffice/CommunityServer/logs:/var/log/onlyoffice \ -v /app/onlyoffice/CommunityServer/data:/var/www/onlyoffice/Data \ -v /app/onlyoffice/CommunityServer/letsencrypt:/etc/letsencrypt \ - -v /sys/fs/cgroup:/sys/fs/cgroup:ro onlyoffice/communityserver + -v /sys/fs/cgroup:/sys/fs/cgroup:rw onlyoffice/communityserver ### Exposing Additional Ports @@ -214,11 +214,11 @@ The container ports to be exposed for **incoming connections** are the folloing: You can expose ports by specifying the '-p' option in the docker run command. - sudo docker run -i -t -d --privileged -p 80:80 -p 443:443 -p 5222:5222 \ + sudo docker run -i -t -d --privileged -p 80:80 -p 443:443 -p 5222:5222 --cgroupns=host \ -v /app/onlyoffice/CommunityServer/logs:/var/log/onlyoffice \ -v /app/onlyoffice/CommunityServer/data:/var/www/onlyoffice/Data \ -v /app/onlyoffice/CommunityServer/letsencrypt:/etc/letsencrypt \ - -v /sys/fs/cgroup:/sys/fs/cgroup:ro onlyoffice/communityserver + -v /sys/fs/cgroup:/sys/fs/cgroup:rw onlyoffice/communityserver For **outgoing connections** you need to expose the following ports: @@ -397,7 +397,7 @@ docker run --net onlyoffice -i -t -d --restart=always --name onlyoffice-control- **STEP 6**: Install ONLYOFFICE Community Server ```bash -sudo docker run --net onlyoffice -i -t -d --privileged --restart=always --name onlyoffice-community-server -p 80:80 -p 443:443 -p 5222:5222 \ +sudo docker run --net onlyoffice -i -t -d --privileged --restart=always --name onlyoffice-community-server -p 80:80 -p 443:443 -p 5222:5222 --cgroupns=host \ -e MYSQL_SERVER_ROOT_PASSWORD=my-secret-pw \ -e MYSQL_SERVER_DB_NAME=onlyoffice \ -e MYSQL_SERVER_HOST=onlyoffice-mysql-server \ @@ -415,7 +415,7 @@ sudo docker run --net onlyoffice -i -t -d --privileged --restart=always --name o -v /app/onlyoffice/CommunityServer/data:/var/www/onlyoffice/Data \ -v /app/onlyoffice/CommunityServer/logs:/var/log/onlyoffice \ -v /app/onlyoffice/CommunityServer/letsencrypt:/etc/letsencrypt \ - -v /sys/fs/cgroup:/sys/fs/cgroup:ro \ + -v /sys/fs/cgroup:/sys/fs/cgroup:rw \ onlyoffice/communityserver ``` Where `${MAIL_SERVER_IP}` is the IP address for **ONLYOFFICE Mail Server**. You can easily get it using the command: @@ -480,7 +480,7 @@ where **STEP 4** Run the new image with the same map paths - sudo docker run -i -t -d --privileged -p 80:80 \ + sudo docker run -i -t -d --privileged -p 80:80 --cgroupns=host \ -e MYSQL_SERVER_ROOT_PASSWORD=my-secret-pw \ -e MYSQL_SERVER_DB_NAME=onlyoffice \ -e MYSQL_SERVER_HOST=onlyoffice-mysql-server \ @@ -489,7 +489,7 @@ where -v /app/onlyoffice/CommunityServer/logs:/var/log/onlyoffice \ -v /app/onlyoffice/CommunityServer/data:/var/www/onlyoffice/Data \ -v /app/onlyoffice/CommunityServer/letsencrypt:/etc/letsencrypt \ - -v /sys/fs/cgroup:/sys/fs/cgroup:ro onlyoffice/communityserver + -v /sys/fs/cgroup:/sys/fs/cgroup:rw onlyoffice/communityserver *This will update **Community Server** container only and will not connect **Document Server** and **Mail Server** to it. You will need to use the additional parameters (like those used during installation) to connect them.* diff --git a/docker-compose.groups.yml b/docker-compose.groups.yml index b19c2a5..c9acde9 100644 --- a/docker-compose.groups.yml +++ b/docker-compose.groups.yml @@ -16,9 +16,10 @@ services: - mysql_data:/var/lib/mysql onlyoffice-community-server: container_name: onlyoffice-community-server - image: onlyoffice/communityserver:11.0.0.1458 + image: onlyoffice/communityserver:11.5.4.1582 depends_on: - onlyoffice-mysql-server + - onlyoffice-elasticsearch environment: - ONLYOFFICE_CORE_MACHINEKEY=core_secret - CONTROL_PANEL_PORT_80_TCP=80 @@ -28,6 +29,8 @@ services: - MYSQL_SERVER_HOST=onlyoffice-mysql-server - MYSQL_SERVER_USER=onlyoffice_user - MYSQL_SERVER_PASS=onlyoffice_pass + - ELASTICSEARCH_SERVER_HOST=onlyoffice-elasticsearch + - ELASTICSEARCH_SERVER_HTTPPORT=9200 networks: - onlyoffice ports: @@ -44,11 +47,35 @@ services: - community_letsencrypt:/etc/letsencrypt - /sys/fs/cgroup:/sys/fs/cgroup:ro - ./certs:/var/www/onlyoffice/Data/certs + onlyoffice-elasticsearch: + image: onlyoffice/elasticsearch:7.10.0 + container_name: onlyoffice-elasticsearch + restart: always + environment: + - discovery.type=single-node + - bootstrap.memory_lock=true + - "ES_JAVA_OPTS=-Xms512m -Xmx512m -Dlog4j2.formatMsgNoLookups=true" + - "indices.fielddata.cache.size=30%" + - "indices.memory.index_buffer_size=30%" + networks: + - onlyoffice + ulimits: + memlock: + soft: -1 + hard: -1 + nofile: + soft: 65535 + hard: 65535 + volumes: + - es_data:/usr/share/elasticsearch/data + expose: + - "9200" + - "9300" onlyoffice-control-panel: container_name: onlyoffice-control-panel depends_on: - onlyoffice-community-server - image: onlyoffice/controlpanel:2.9.0.351 + image: onlyoffice/controlpanel:3.0.2.395 environment: - ONLYOFFICE_CORE_MACHINEKEY=core_secret expose: @@ -74,3 +101,4 @@ volumes: controlpanel_data: controlpanel_log: mysql_data: + es_data: diff --git a/docker-compose.workspace.yml b/docker-compose.workspace.yml index c491798..d7a0125 100644 --- a/docker-compose.workspace.yml +++ b/docker-compose.workspace.yml @@ -16,11 +16,12 @@ services: - mysql_data:/var/lib/mysql onlyoffice-community-server: container_name: onlyoffice-community-server - image: onlyoffice/communityserver:11.0.0.1458 + image: onlyoffice/communityserver:11.5.4.1582 depends_on: - onlyoffice-mysql-server - onlyoffice-document-server - onlyoffice-mail-server + - onlyoffice-elasticsearch environment: - ONLYOFFICE_CORE_MACHINEKEY=core_secret - CONTROL_PANEL_PORT_80_TCP=80 @@ -41,6 +42,8 @@ services: - MAIL_SERVER_DB_NAME=onlyoffice_mailserver - MAIL_SERVER_DB_USER=onlyoffice_mailserver_user - MAIL_SERVER_DB_PASS=onlyoffice_mailserver_user_pass + - ELASTICSEARCH_SERVER_HOST=onlyoffice-elasticsearch + - ELASTICSEARCH_SERVER_HTTPPORT=9200 networks: - onlyoffice ports: @@ -58,9 +61,33 @@ services: - document_data:/var/www/onlyoffice/DocumentServerData - /sys/fs/cgroup:/sys/fs/cgroup:ro - ./certs:/var/www/onlyoffice/Data/certs + onlyoffice-elasticsearch: + image: onlyoffice/elasticsearch:7.10.0 + container_name: onlyoffice-elasticsearch + restart: always + environment: + - discovery.type=single-node + - bootstrap.memory_lock=true + - "ES_JAVA_OPTS=-Xms512m -Xmx512m -Dlog4j2.formatMsgNoLookups=true" + - "indices.fielddata.cache.size=30%" + - "indices.memory.index_buffer_size=30%" + networks: + - onlyoffice + ulimits: + memlock: + soft: -1 + hard: -1 + nofile: + soft: 65535 + hard: 65535 + volumes: + - es_data:/usr/share/elasticsearch/data + expose: + - "9200" + - "9300" onlyoffice-document-server: container_name: onlyoffice-document-server - image: onlyoffice/documentserver:6.0.2 + image: onlyoffice/documentserver:6.4.2.6 stdin_open: true tty: true restart: always @@ -110,7 +137,7 @@ services: - onlyoffice-document-server - onlyoffice-mail-server - onlyoffice-community-server - image: onlyoffice/controlpanel:2.9.0.351 + image: onlyoffice/controlpanel:3.0.2.395 environment: - ONLYOFFICE_CORE_MACHINEKEY=core_secret expose: @@ -143,3 +170,4 @@ volumes: controlpanel_data: controlpanel_log: mysql_data: + es_data: diff --git a/docker-compose.workspace_enterprise.yml b/docker-compose.workspace_enterprise.yml index f875c74..20bac08 100644 --- a/docker-compose.workspace_enterprise.yml +++ b/docker-compose.workspace_enterprise.yml @@ -16,11 +16,12 @@ services: - mysql_data:/var/lib/mysql onlyoffice-community-server: container_name: onlyoffice-community-server - image: onlyoffice/communityserver:11.0.0.1458 + image: onlyoffice/communityserver:11.5.4.1582 depends_on: - onlyoffice-mysql-server - onlyoffice-document-server - onlyoffice-mail-server + - onlyoffice-elasticsearch environment: - ONLYOFFICE_CORE_MACHINEKEY=core_secret - CONTROL_PANEL_PORT_80_TCP=80 @@ -41,6 +42,8 @@ services: - MAIL_SERVER_DB_NAME=onlyoffice_mailserver - MAIL_SERVER_DB_USER=onlyoffice_mailserver_user - MAIL_SERVER_DB_PASS=onlyoffice_mailserver_user_pass + - ELASTICSEARCH_SERVER_HOST=onlyoffice-elasticsearch + - ELASTICSEARCH_SERVER_HTTPPORT=9200 networks: - onlyoffice ports: @@ -58,9 +61,33 @@ services: - document_data:/var/www/onlyoffice/DocumentServerData - /sys/fs/cgroup:/sys/fs/cgroup:ro - ./certs:/var/www/onlyoffice/Data/certs + onlyoffice-elasticsearch: + image: onlyoffice/elasticsearch:7.10.0 + container_name: onlyoffice-elasticsearch + restart: always + environment: + - discovery.type=single-node + - bootstrap.memory_lock=true + - "ES_JAVA_OPTS=-Xms512m -Xmx512m -Dlog4j2.formatMsgNoLookups=true" + - "indices.fielddata.cache.size=30%" + - "indices.memory.index_buffer_size=30%" + networks: + - onlyoffice + ulimits: + memlock: + soft: -1 + hard: -1 + nofile: + soft: 65535 + hard: 65535 + volumes: + - es_data:/usr/share/elasticsearch/data + expose: + - "9200" + - "9300" onlyoffice-document-server: container_name: onlyoffice-document-server - image: onlyoffice/documentserver-ee:6.0.2 + image: onlyoffice/documentserver-ee:6.4.2.6 stdin_open: true tty: true restart: always @@ -110,7 +137,7 @@ services: - onlyoffice-document-server - onlyoffice-mail-server - onlyoffice-community-server - image: onlyoffice/controlpanel:2.9.0.351 + image: onlyoffice/controlpanel:3.0.2.395 environment: - ONLYOFFICE_CORE_MACHINEKEY=core_secret expose: @@ -143,3 +170,4 @@ volumes: controlpanel_data: controlpanel_log: mysql_data: + es_data: diff --git a/run-community-server.sh b/run-community-server.sh index 5d3631b..f020c1f 100644 --- a/run-community-server.sh +++ b/run-community-server.sh @@ -10,9 +10,10 @@ echo "##########################################################" SERVER_HOST=${SERVER_HOST:-""}; APP_DIR="/var/www/onlyoffice" APP_DATA_DIR="${APP_DIR}/Data" -APP_INDEX_DIR="${APP_DATA_DIR}/Index/v7.9.0" +APP_INDEX_DIR="${APP_DATA_DIR}/Index/v${ELASTICSEARCH_VERSION}" APP_PRIVATE_DATA_DIR="${APP_DATA_DIR}/.private" APP_SERVICES_DIR="${APP_DIR}/Services" +APP_CONFIG_DIR="/etc/onlyoffice/communityserver" APP_SQL_DIR="${APP_DIR}/Sql" APP_ROOT_DIR="${APP_DIR}/WebStudio" APP_APISYSTEM_DIR="/var/www/onlyoffice/ApiSystem" @@ -430,6 +431,9 @@ if [ ${MAIL_SERVER_DB_HOST} ]; then fi fi +MAIL_IMAPSYNC_START_DATE=${MAIL_IMAPSYNC_START_DATE:-$(date +"%Y-%m-%dT%H:%M:%S")}; +sed 's_\(\"ImapSyncStartDate":\).*,_\1 "'${MAIL_IMAPSYNC_START_DATE}'",_' -i ${APP_CONFIG_DIR}/mail.production.json +sed "/mail\.imap-sync-start-date/s/value=\"\S*\"/value=\"${MAIL_IMAPSYNC_START_DATE}\"/g" -i ${APP_ROOT_DIR}/web.appsettings.config if [ ${MAIL_SERVER_API_HOST} ]; then if [ ! bash ${SYSCONF_TOOLS_DIR}/wait-for-it.sh ${MAIL_SERVER_API_HOST}:25 --timeout=300 --quiet -s -- echo "MailServer is up" ]; then @@ -482,8 +486,6 @@ else sed -i 's/
/
/' ${APP_ROOT_DIR}/Web.config sed -i '/
/a
' ${APP_SERVICES_DIR}/TeamLabSvc/TeamLabSvc.exe.config sed -i 's/
/
/' ${APP_SERVICES_DIR}/TeamLabSvc/TeamLabSvc.exe.config - sed -i '/
/a
' ${APP_SERVICES_DIR}/MailAggregator/ASC.Mail.Aggregator.CollectionService.exe.config - sed -i 's/
/
/' ${APP_SERVICES_DIR}/MailAggregator/ASC.Mail.Aggregator.CollectionService.exe.config if [ ${ELASTICSEARCH_SERVER_HTTPPORT} ]; then sed -i '/<\/configSections>/a ' ${APP_ROOT_DIR}/Web.config @@ -492,8 +494,8 @@ else sed -i '/<\/configSections>/a ' ${APP_SERVICES_DIR}/TeamLabSvc/TeamLabSvc.exe.config sed -i 's// /' ${APP_SERVICES_DIR}/TeamLabSvc/TeamLabSvc.exe.config - sed -i '/' ${APP_SERVICES_DIR}/MailAggregator/ASC.Mail.Aggregator.CollectionService.exe.config - sed -i 's// /' ${APP_SERVICES_DIR}/MailAggregator/ASC.Mail.Aggregator.CollectionService.exe.config + sed -i "s/\"Host\": \"127.0.0.1\"/\"Host\": \"${ELASTICSEARCH_SERVER_HOST}\"/g" ${APP_CONFIG_DIR}/elastic.production.json + sed -i "s/\"Port\": \"9200\"/\"Port\": \"${ELASTICSEARCH_SERVER_HTTPPORT}\"/g" ${APP_CONFIG_DIR}/elastic.production.json fi fi fi @@ -631,10 +633,6 @@ change_connections "default" "${APP_ROOT_DIR}/web.connections.config"; change_connections "teamlabsite" "${APP_ROOT_DIR}/web.connections.config"; change_connections "default" "${APP_SERVICES_DIR}/TeamLabSvc/TeamLabSvc.exe.config"; change_connections "default" "${APP_SERVICES_DIR}/Jabber/ASC.Xmpp.Server.Launcher.exe.config"; -change_connections "default" "${APP_SERVICES_DIR}/MailAggregator/ASC.Mail.Aggregator.CollectionService.exe.config"; -change_connections "default" "${APP_SERVICES_DIR}/MailAggregator/ASC.Mail.EmlDownloader.exe.config"; -change_connections "default" "${APP_SERVICES_DIR}/MailWatchdog/ASC.Mail.Watchdog.Service.exe.config"; -change_connections "default" "${APP_SERVICES_DIR}/MailCleaner/ASC.Mail.StorageCleaner.exe.config"; change_connections "default" "${APP_APISYSTEM_DIR}/Web.config"; sed "s!\"host\":.*,!\"host\":\"${MYSQL_SERVER_HOST}\",!" -i ${APP_SERVICES_DIR}/ASC.UrlShortener/config/config.json @@ -642,6 +640,8 @@ sed "s!\"user\":.*,!\"user\":\"${MYSQL_SERVER_USER}\",!" -i ${APP_SERVICES_DIR}/ sed "s!\"password\":.*,!\"password\":\"${MYSQL_SERVER_PASS}\",!" -i ${APP_SERVICES_DIR}/ASC.UrlShortener/config/config.json sed "s!\"database\":.*!\"database\":\"${MYSQL_SERVER_DB_NAME}\"!" -i ${APP_SERVICES_DIR}/ASC.UrlShortener/config/config.json +sed -i "s/Server=.*/Server=${MYSQL_SERVER_HOST};Port=${MYSQL_SERVER_PORT};Database=${MYSQL_SERVER_DB_NAME};User ID=${MYSQL_SERVER_USER};Password=${MYSQL_SERVER_PASS};Pooling=true;Character Set=utf8;AutoEnlist=false;SSL Mode=none;AllowPublicKeyRetrieval=true;Connection Timeout=30;Maximum Pool Size=300;\",/g" ${APP_CONFIG_DIR}/appsettings.production.json + if [ "${DB_TABLES_COUNT}" -eq "0" ]; then mysql_batch_exec ${APP_SQL_DIR}/onlyoffice.sql mysql_batch_exec ${APP_SQL_DIR}/onlyoffice.data.sql @@ -704,7 +704,7 @@ if [ -f "${SSL_CERTIFICATE_PATH}" -a -f "${SSL_KEY_PATH}" ]; then sed '/certificatePassword/s/\(value\s*=\s*\"\).*\"/\1'${SSL_CERTIFICATE_PATH_PFX_PWD}'\"/' -i ${APP_SERVICES_DIR}/TeamLabSvc/TeamLabSvc.exe.config sed '/startTls/s/\(value\s*=\s*\"\).*\"/\1optional\"/' -i ${APP_SERVICES_DIR}/TeamLabSvc/TeamLabSvc.exe.config; - sed '/mail\.default-api-scheme/s/\(value\s*=\s*\"\).*\"/\1https\"/' -i ${APP_SERVICES_DIR}/MailAggregator/ASC.Mail.Aggregator.CollectionService.exe.config; + sed "s/\"DefaultApiSchema\": \"http\"/\"DefaultApiSchema\": \"https\"/g" -i ${APP_CONFIG_DIR}/mail.production.json else cp ${NGINX_ROOT_DIR}/includes/onlyoffice-communityserver-common.conf.template ${SYSCONF_TEMPLATES_DIR}/nginx/prepare-onlyoffice; @@ -805,6 +805,9 @@ if [ "${MAIL_SERVER_ENABLED}" == "true" ]; then if check_ip_is_internal $DOCKER_APP_SUBNET $MAIL_SERVER_API_HOST; then SENDER_IP=$(hostname -i); + if [[ -n ${MAIL_DOMAIN_NAME} ]]; then + echo "$(dig +short myip.opendns.com @resolver1.opendns.com) ${MAIL_DOMAIN_NAME}" >> /etc/hosts + fi elif [[ "$(dig +short myip.opendns.com @resolver1.opendns.com)" =~ $VALID_IP_ADDRESS_REGEX ]]; then SENDER_IP=$(dig +short myip.opendns.com @resolver1.opendns.com); log_debug "External ip $SENDER_IP is valid"; @@ -911,9 +914,7 @@ do sed "/core\.machinekey/s!\"core\.machinekey\".*!\"core\.machinekey\":\"${APP_CORE_MACHINEKEY}\",!" -i ${APP_SERVICES_DIR}/ASC.Socket.IO/config/config.json sed "s!machine_key\s*=.*!machine_key = ${APP_CORE_MACHINEKEY}!g" -i ${APP_SERVICES_DIR}/TeamLabSvc/radicale.config sed "s!\"core\.machinekey\":.*,!\"core\.machinekey\":\"${APP_CORE_MACHINEKEY}\",!g" -i ${APP_SERVICES_DIR}/ASC.UrlShortener/config/config.json - sed "/core.machinekey/s!value=\".*\"!value=\"${APP_CORE_MACHINEKEY}\"!g" -i ${APP_SERVICES_DIR}/MailAggregator/ASC.Mail.EmlDownloader.exe.config - sed "/core.machinekey/s!value=\".*\"!value=\"${APP_CORE_MACHINEKEY}\"!g" -i ${APP_SERVICES_DIR}/MailAggregator/ASC.Mail.Aggregator.CollectionService.exe.config - sed "/core.machinekey/s!value=\".*\"!value=\"${APP_CORE_MACHINEKEY}\"!g" -i ${APP_SERVICES_DIR}/MailCleaner/ASC.Mail.StorageCleaner.exe.config + sed "s!\"machinekey\":.*!\"machinekey\":\"${APP_CORE_MACHINEKEY}\",!" -i ${APP_CONFIG_DIR}/appsettings.production.json continue; fi @@ -1091,12 +1092,14 @@ systemctl stop onlyofficeJabber systemctl stop onlyofficeMailAggregator systemctl stop onlyofficeMailWatchdog systemctl stop onlyofficeMailCleaner +systemctl stop onlyofficeMailImap systemctl stop onlyofficeNotify systemctl stop onlyofficeBackup systemctl stop onlyofficeStorageMigrate systemctl stop onlyofficeStorageEncryption systemctl stop onlyofficeUrlShortener systemctl stop onlyofficeThumbnailBuilder +systemctl stop onlyofficeAutoCleanUp systemctl stop god systemctl enable god @@ -1136,12 +1139,14 @@ if [ "${APP_SERVICES_EXTERNAL}" == "true" ]; then systemctl disable onlyofficeMailAggregator.service systemctl disable onlyofficeMailWatchdog.service systemctl disable onlyofficeMailCleaner.service + systemctl disable onlyofficeMailImap.service systemctl disable onlyofficeNotify.service systemctl disable onlyofficeBackup.service systemctl disable onlyofficeStorageMigrate.service systemctl disable onlyofficeStorageEncryption.service systemctl disable onlyofficeUrlShortener.service systemctl disable onlyofficeThumbnailBuilder.service + systemctl disable onlyofficeAutoCleanUp.service rm -f /lib/systemd/system/onlyofficeRadicale.service rm -f /lib/systemd/system/onlyofficeTelegram.service @@ -1153,12 +1158,14 @@ if [ "${APP_SERVICES_EXTERNAL}" == "true" ]; then rm -f /lib/systemd/system/onlyofficeMailAggregator.service rm -f /lib/systemd/system/onlyofficeMailWatchdog.service rm -f /lib/systemd/system/onlyofficeMailCleaner.service + rm -f /lib/systemd/system/onlyofficeMailImap.service rm -f /lib/systemd/system/onlyofficeNotify.service rm -f /lib/systemd/system/onlyofficeBackup.service rm -f /lib/systemd/system/onlyofficeStorageMigrate.sevice rm -f /lib/systemd/system/onlyofficeStorageEncryption.sevice rm -f /lib/systemd/system/onlyofficeUrlShortener.service rm -f /lib/systemd/system/onlyofficeThumbnailBuilder.service + rm -f /lib/systemd/system/onlyofficeAutoCleanUp.service sed '/onlyoffice/d' -i ${APP_CRON_PATH} else @@ -1172,12 +1179,14 @@ else systemctl enable onlyofficeMailAggregator.service systemctl enable onlyofficeMailWatchdog.service systemctl enable onlyofficeMailCleaner.service + systemctl enable onlyofficeMailImap.service systemctl enable onlyofficeNotify.service systemctl enable onlyofficeBackup.service systemctl enable onlyofficeStorageMigrate.service systemctl enable onlyofficeStorageEncryption.service systemctl enable onlyofficeUrlShortener.service systemctl enable onlyofficeThumbnailBuilder.service + systemctl enable onlyofficeAutoCleanUp.service fi if [ "${APP_MODE}" == "SERVER" ]; then