Skip to content

Commit

Permalink
Merge pull request #197 from ONLYOFFICE/release/12.5
Browse files Browse the repository at this point in the history
Merge release/12.5 into master
  • Loading branch information
agolybev authored Jul 31, 2023
2 parents 703b202 + 3e7cc45 commit a7dd75e
Show file tree
Hide file tree
Showing 7 changed files with 156 additions and 105 deletions.
53 changes: 35 additions & 18 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
FROM ubuntu:18.04
FROM ubuntu:22.04

ARG RELEASE_DATE="2016-06-21"
ARG RELEASE_DATE_SIGN=""
ARG VERSION="8.9.0.190"
ARG SOURCE_REPO_URL="deb http://static.teamlab.com.s3.amazonaws.com/repo/debian squeeze main"
ARG SOURCE_REPO_URL="deb [signed-by=/usr/share/keyrings/onlyoffice.gpg] https://download.onlyoffice.com/repo/debian squeeze main"
ARG DEBIAN_FRONTEND=noninteractive
ARG PACKAGE_SYSNAME="onlyoffice"

ARG ELK_DIR=/usr/share/elasticsearch
ARG ELK_INDEX_DIR=/var/www/${PACKAGE_SYSNAME}/Data/Index
ARG ELK_LOG_DIR=/var/log/${PACKAGE_SYSNAME}/Index
ARG ELK_LIB_DIR=${ELK_DIR}/lib
ARG ELK_MODULE_DIR=${ELK_DIR}/modules

Expand Down Expand Up @@ -49,20 +51,24 @@ RUN apt-get -y update && \
locale-gen en_US.UTF-8 && \
echo "#!/bin/sh\nexit 0" > /usr/sbin/policy-rc.d && \
echo "${SOURCE_REPO_URL}" >> /etc/apt/sources.list && \
echo "deb https://download.mono-project.com/repo/ubuntu stable-bionic/snapshots/6.8.0.123 main" | tee /etc/apt/sources.list.d/mono-official.list && \
echo "deb https://d2nlctn12v279m.cloudfront.net/repo/mono/ubuntu bionic main" | tee /etc/apt/sources.list.d/mono-extra.list && \
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys CB2DE8E5 && \
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF && \
wget http://nginx.org/keys/nginx_signing.key && \
apt-key add nginx_signing.key && \
echo "deb http://nginx.org/packages/ubuntu/ bionic nginx" >> /etc/apt/sources.list.d/nginx.list && \
echo "deb [signed-by=/usr/share/keyrings/xamarin.gpg] https://download.mono-project.com/repo/ubuntu stable-focal/snapshots/6.8.0.123 main" | tee /etc/apt/sources.list.d/mono-official.list && \
echo "deb [signed-by=/usr/share/keyrings/mono-extra.gpg] https://d2nlctn12v279m.cloudfront.net/repo/mono/ubuntu focal main" | tee /etc/apt/sources.list.d/mono-extra.list && \
curl -fsSL https://download.onlyoffice.com/GPG-KEY-ONLYOFFICE | gpg --no-default-keyring --keyring gnupg-ring:/usr/share/keyrings/onlyoffice.gpg --import && \
chmod 644 /usr/share/keyrings/onlyoffice.gpg && \
curl -fsSL https://download.mono-project.com/repo/xamarin.gpg | gpg --no-default-keyring --keyring gnupg-ring:/usr/share/keyrings/xamarin.gpg --import && \
chmod 644 /usr/share/keyrings/xamarin.gpg && \
curl -fsSL https://d2nlctn12v279m.cloudfront.net/repo/mono/mono.key | gpg --no-default-keyring --keyring gnupg-ring:/usr/share/keyrings/mono-extra.gpg --import && \
chmod 644 /usr/share/keyrings/mono-extra.gpg && \
wget http://archive.ubuntu.com/ubuntu/pool/main/g/glibc/multiarch-support_2.27-3ubuntu1_amd64.deb && \
apt-get install ./multiarch-support_2.27-3ubuntu1_amd64.deb && \
rm -f ./multiarch-support_2.27-3ubuntu1_amd64.deb && \
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | apt-key add - && \
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 - && \
wget https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb && \
sudo dpkg -i packages-microsoft-prod.deb && \
rm packages-microsoft-prod.deb && \
printf "Package: * \nPin: origin \"packages.microsoft.com\"\nPin-Priority: 1001" > /etc/apt/preferences && \
curl -sL https://deb.nodesource.com/setup_18.x | sudo -E bash - && \
apt-get install -yq gnupg2 \
ca-certificates \
software-properties-common \
Expand All @@ -75,7 +81,7 @@ RUN apt-get -y update && \
gdb \
mono-complete \
ca-certificates-mono \
python-certbot-nginx \
python3-certbot-nginx \
htop \
nano \
dnsutils \
Expand All @@ -86,9 +92,20 @@ RUN apt-get -y update && \
ffmpeg \
jq \
apt-transport-https \
elasticsearch=${ELASTICSEARCH_VERSION} \
mono-webserver-hyperfastcgi=0.4-7 \
dotnet-sdk-6.0 \
elasticsearch=${ELASTICSEARCH_VERSION} && \
mkdir -p ${ELK_INDEX_DIR}/v${ELASTICSEARCH_VERSION} && \
mkdir -p ${ELK_LOG_DIR} && \
chmod -R u=rwx /var/www/${PACKAGE_SYSNAME} && \
chmod -R g=rx /var/www/${PACKAGE_SYSNAME} && \
chmod -R o=rx /var/www/${PACKAGE_SYSNAME} && \
chown -R elasticsearch:elasticsearch ${ELK_INDEX_DIR}/v${ELASTICSEARCH_VERSION} && \
chown -R elasticsearch:elasticsearch ${ELK_LOG_DIR} && \
chmod -R u=rwx ${ELK_INDEX_DIR}/v${ELASTICSEARCH_VERSION} && \
chmod -R g=rs ${ELK_INDEX_DIR}/v${ELASTICSEARCH_VERSION} && \
chmod -R o= ${ELK_INDEX_DIR}/v${ELASTICSEARCH_VERSION} && \
apt-get install -yq \
mono-webserver-hyperfastcgi=0.4-8 \
dotnet-sdk-7.0 \
${PACKAGE_SYSNAME}-communityserver \
${PACKAGE_SYSNAME}-xmppserver && \
apt-get clean && \
Expand Down
35 changes: 25 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -351,19 +351,29 @@ Then launch containers on it using the 'docker run --net onlyoffice' option:

Follow [these steps](#installing-mysql) to install MySQL server.

**STEP 3**: Install ONLYOFFICE Document Server.
**STEP 3**: Generate JWT Secret

JWT secret defines the secret key to validate the JSON Web Token in the request to the **ONLYOFFICE Document Server**. You can specify it yourself or easily get it using the command:
```
JWT_SECRET=$(cat /dev/urandom | tr -dc A-Za-z0-9 | head -c 32);
```

**STEP 4**: Install ONLYOFFICE Document Server.

```bash
sudo docker run --net onlyoffice -i -t -d --restart=always --name onlyoffice-document-server \
-v /app/onlyoffice/DocumentServer/logs:/var/log/onlyoffice \
-v /app/onlyoffice/DocumentServer/data:/var/www/onlyoffice/Data \
-v /app/onlyoffice/DocumentServer/fonts:/usr/share/fonts/truetype/custom \
-v /app/onlyoffice/DocumentServer/forgotten:/var/lib/onlyoffice/documentserver/App_Data/cache/files/forgotten \
onlyoffice/documentserver
-e JWT_ENABLED=true \
-e JWT_SECRET=${JWT_SECRET} \
-e JWT_HEADER=AuthorizationJwt \
-v /app/onlyoffice/DocumentServer/logs:/var/log/onlyoffice \
-v /app/onlyoffice/DocumentServer/data:/var/www/onlyoffice/Data \
-v /app/onlyoffice/DocumentServer/fonts:/usr/share/fonts/truetype/custom \
-v /app/onlyoffice/DocumentServer/forgotten:/var/lib/onlyoffice/documentserver/App_Data/cache/files/forgotten \
onlyoffice/documentserver
```
To learn more, refer to the [ONLYOFFICE Document Server documentation](https://github.com/ONLYOFFICE/Docker-DocumentServer "ONLYOFFICE Document Server documentation").

**STEP 4**: Install ONLYOFFICE Mail Server.
**STEP 5**: Install ONLYOFFICE Mail Server.

For the mail server correct work you need to specify its hostname 'yourdomain.com'.
To learn more, refer to the [ONLYOFFICE Mail Server documentation](https://github.com/ONLYOFFICE/Docker-MailServer "ONLYOFFICE Mail Server documentation").
Expand All @@ -384,7 +394,7 @@ sudo docker run --init --net onlyoffice --privileged -i -t -d --restart=always -

The additional parameters for mail server are available [here](https://github.com/ONLYOFFICE/Docker-CommunityServer/blob/master/docker-compose.yml#L75).

**STEP 5**: Install ONLYOFFICE Control Panel
**STEP 6**: Install ONLYOFFICE Control Panel

```bash
docker run --net onlyoffice -i -t -d --restart=always --name onlyoffice-control-panel \
Expand All @@ -394,7 +404,7 @@ docker run --net onlyoffice -i -t -d --restart=always --name onlyoffice-control-
-v /app/onlyoffice/ControlPanel/logs:/var/log/onlyoffice onlyoffice/controlpanel
```

**STEP 6**: Install ONLYOFFICE Community Server
**STEP 7**: 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 --cgroupns=host \
Expand All @@ -404,6 +414,9 @@ sudo docker run --net onlyoffice -i -t -d --privileged --restart=always --name o
-e MYSQL_SERVER_USER=onlyoffice_user \
-e MYSQL_SERVER_PASS=onlyoffice_pass \
-e DOCUMENT_SERVER_PORT_80_TCP_ADDR=onlyoffice-document-server \
-e DOCUMENT_SERVER_JWT_ENABLED=true \
-e DOCUMENT_SERVER_JWT_SECRET=${JWT_SECRET} \
-e DOCUMENT_SERVER_JWT_HEADER=AuthorizationJwt \
-e MAIL_SERVER_API_HOST=${MAIL_SERVER_IP} \
-e MAIL_SERVER_DB_HOST=onlyoffice-mysql-server \
-e MAIL_SERVER_DB_NAME=onlyoffice_mailserver \
Expand Down Expand Up @@ -436,7 +449,7 @@ wget https://download.onlyoffice.com/install/workspace-install.sh
workspace-install.sh -md yourdomain.com
```

Or use [docker-compose](https://docs.docker.com/compose/install "docker-compose"). `Temporarily does not work on Ubuntu 22.04 and Debian 11.`
Or use [docker-compose](https://docs.docker.com/compose/install "docker-compose").

First you need to clone this [GitHub repository](https://github.com/ONLYOFFICE/Docker-CommunityServer/):

Expand All @@ -456,6 +469,8 @@ For the mail server correct work, open one of the files depending on the product
* [docker-compose.yml](https://github.com/ONLYOFFICE/Docker-CommunityServer/blob/master/docker-compose.workspace.yml) for ONLYOFFICE Workspace Community Edition
* [docker-compose.yml](https://github.com/ONLYOFFICE/Docker-CommunityServer/blob/master/docker-compose.workspace_enterprise.yml) for ONLYOFFICE Workspace Enterprise Edition

For working on `Ubuntu 22.04` and `Debian 11` or later, you need to use docker-compose versions v2.16.0 or later and uncomment the cgroup line in the yml file

Then replace the `${MAIL_SERVER_HOSTNAME}` variable with your own hostname for the **Mail Server**. After that, assuming you have docker-compose installed, execute the following command:

```bash
Expand Down
4 changes: 2 additions & 2 deletions config/mysql/docker-entrypoint-initdb.d/onlyoffice-initdb.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ CREATE DATABASE IF NOT EXISTS onlyoffice_mailserver CHARACTER SET "utf8" COLLATE

ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'my-secret-pw';
CREATE USER IF NOT EXISTS 'onlyoffice_user'@'%' IDENTIFIED WITH mysql_native_password BY 'onlyoffice_pass';
CREATE USER IF NOT EXISTS 'onlyoffice_mailserver_user'@'%' IDENTIFIED WITH mysql_native_password BY 'onlyoffice_mailserver_user_pass';
CREATE USER IF NOT EXISTS 'mail_admin'@'%' IDENTIFIED WITH mysql_native_password BY 'Isadmin123';

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%';
GRANT ALL PRIVILEGES ON *.* TO 'onlyoffice_user'@'%';
GRANT ALL PRIVILEGES ON *.* TO 'onlyoffice_mailserver_user'@'%';
GRANT ALL PRIVILEGES ON *.* TO 'mail_admin'@'%';

FLUSH PRIVILEGES;
1 change: 1 addition & 0 deletions docker-compose.groups.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ services:
tty: true
restart: always
privileged: true
# cgroup: host
volumes:
- community_data:/var/www/onlyoffice/Data
- community_log:/var/log/onlyoffice
Expand Down
9 changes: 5 additions & 4 deletions docker-compose.workspace.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ services:
- MAIL_SERVER_DB_HOST=onlyoffice-mysql-server
- MAIL_SERVER_DB_PORT=3306
- MAIL_SERVER_DB_NAME=onlyoffice_mailserver
- MAIL_SERVER_DB_USER=onlyoffice_mailserver_user
- MAIL_SERVER_DB_PASS=onlyoffice_mailserver_user_pass
- MAIL_SERVER_DB_USER=mail_admin
- MAIL_SERVER_DB_PASS=Isadmin123
- ELASTICSEARCH_SERVER_HOST=onlyoffice-elasticsearch
- ELASTICSEARCH_SERVER_HTTPPORT=9200
networks:
Expand All @@ -54,6 +54,7 @@ services:
tty: true
restart: always
privileged: true
# cgroup: host
volumes:
- community_data:/var/www/onlyoffice/Data
- community_log:/var/log/onlyoffice
Expand Down Expand Up @@ -115,8 +116,8 @@ services:
environment:
- MYSQL_SERVER=onlyoffice-mysql-server
- MYSQL_SERVER_PORT=3306
- MYSQL_ROOT_USER=onlyoffice_mailserver_user
- MYSQL_ROOT_PASSWD=onlyoffice_mailserver_user_pass
- MYSQL_ROOT_USER=mail_admin
- MYSQL_ROOT_PASSWD=Isadmin123
- MYSQL_SERVER_DB_NAME=onlyoffice_mailserver
networks:
- onlyoffice
Expand Down
9 changes: 5 additions & 4 deletions docker-compose.workspace_enterprise.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ services:
- MAIL_SERVER_DB_HOST=onlyoffice-mysql-server
- MAIL_SERVER_DB_PORT=3306
- MAIL_SERVER_DB_NAME=onlyoffice_mailserver
- MAIL_SERVER_DB_USER=onlyoffice_mailserver_user
- MAIL_SERVER_DB_PASS=onlyoffice_mailserver_user_pass
- MAIL_SERVER_DB_USER=mail_admin
- MAIL_SERVER_DB_PASS=Isadmin123
- ELASTICSEARCH_SERVER_HOST=onlyoffice-elasticsearch
- ELASTICSEARCH_SERVER_HTTPPORT=9200
networks:
Expand All @@ -54,6 +54,7 @@ services:
tty: true
restart: always
privileged: true
# cgroup: host
volumes:
- community_data:/var/www/onlyoffice/Data
- community_log:/var/log/onlyoffice
Expand Down Expand Up @@ -115,8 +116,8 @@ services:
environment:
- MYSQL_SERVER=onlyoffice-mysql-server
- MYSQL_SERVER_PORT=3306
- MYSQL_ROOT_USER=onlyoffice_mailserver_user
- MYSQL_ROOT_PASSWD=onlyoffice_mailserver_user_pass
- MYSQL_ROOT_USER=mail_admin
- MYSQL_ROOT_PASSWD=Isadmin123
- MYSQL_SERVER_DB_NAME=onlyoffice_mailserver
networks:
- onlyoffice
Expand Down
Loading

0 comments on commit a7dd75e

Please sign in to comment.