Compare commits

...

22 Commits

Author SHA1 Message Date
f663fbd43b Update build 2022-01-06 12:18:40 +03:00
e3f8ab9a1d Update build 2022-01-06 12:13:22 +03:00
2fbbccccec add hooks 2022-01-06 11:46:31 +03:00
9c1975df7b Update Dockerfile.cl 2021-12-20 11:01:52 +03:00
f9499ba9ff Create Dockerfile.cl 2021-12-17 17:04:20 +03:00
ca39675055 Merge branch hotfix/v6.4.1 into master 2021-09-28 08:08:26 +00:00
a31a579d24 Add WOPI_ENABLED variable (#379)
* Add WOPI_ENABLED variable

* Add var description
2021-09-14 17:53:37 +03:00
32a8a24a0f Update README.md (#377) 2021-09-14 17:42:55 +03:00
a23477301e Merge branch release/v6.4.0 into master 2021-08-26 11:40:24 +00:00
d654094671 Merge branch hotfix/v6.3.1 into release/v6.4.0 2021-07-15 13:14:47 +00:00
5bf1ff715f Remove server version of spell checker (#365) 2021-06-22 09:59:50 +03:00
13a01e7c56 Merge branch release/v6.3.0 into develop 2021-05-20 12:08:20 +00:00
3b830417a2 Merge branch release/v6.3.0 into master 2021-05-20 12:08:15 +00:00
245659807a Merge branch hotfix/v6.2.2 into release/v6.3.0 2021-05-07 13:27:20 +00:00
2f26419ac7 Merge branch hotfix/v6.2.2 into develop 2021-05-07 13:25:56 +00:00
67df644858 Precise info about table existance (#355) 2021-04-29 12:14:31 +03:00
ca6b3a67a3 Merge branch hotfix/v6.2.2 into master 2021-04-19 12:18:58 +00:00
f2c708cff2 Reset database tables on update (#351)
* Reset database tables on update

* Add changes

* Add changes

* Add changes

* Add changes

* Add changes

* Add changes
2021-04-14 17:10:38 +03:00
2f26cea790 Fix #347 (#349) 2021-04-01 10:07:07 +03:00
30c5612cfb Merge branch hotfix/v6.2.1 into release/v6.3.0 2021-03-31 11:27:32 +00:00
1cfe84b8b8 Fix automatic port detection for database (#341) 2021-03-19 16:20:52 +03:00
30ca844513 Merge branch release/v6.2.0 into release/v6.3.0 2021-03-19 07:54:45 +00:00
6 changed files with 89 additions and 6 deletions

4
Dockerfile.cl Normal file
View File

@ -0,0 +1,4 @@
FROM onlyoffice/documentserver-ee:latest
RUN sed -i '/trap clean_exit SIGTERM/s/^/#/' /app/ds/run-document-server.sh

View File

@ -107,7 +107,7 @@ When using CA certified certificates (e.g [Let's encrypt](https://letsencrypt.or
#### Using the automatically generated Let's Encrypt SSL Certificates
sudo docker run -i -t -d -p 443:443 \
sudo docker run -i -t -d -p 80:80 -p 443:443 \
-e LETS_ENCRYPT_DOMAIN=your_domain -e LETS_ENCRYPT_MAIL=your_mail onlyoffice/documentserver
If you want to get and extend Let's Encrypt SSL Certificates automatically just set LETS_ENCRYPT_DOMAIN and LETS_ENCRYPT_MAIL variables.
@ -178,7 +178,7 @@ Below is the complete list of parameters that can be set using environment varia
- **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.
- **DB_NAME**: The name of a database to be created on the image startup.
- **DB_NAME**: The name of a database to use. Should be existing on container startup.
- **DB_USER**: The new user name with superuser permissions for the database account.
- **DB_PWD**: The password set for the database account.
- **AMQP_URI**: The [AMQP URI](https://www.rabbitmq.com/uri-spec.html "RabbitMQ URI Specification") to connect to message broker server.
@ -191,6 +191,7 @@ Below is the complete list of parameters that can be set using environment varia
- **JWT_SECRET**: Defines the secret key to validate the JSON Web Token in the request to the ONLYOFFICE Document Server. Defaults to `secret`.
- **JWT_HEADER**: Defines the http header that will be used to send the JSON Web Token. Defaults to `Authorization`.
- **JWT_IN_BODY**: Specifies the enabling the token validation in the request body to the ONLYOFFICE Document Server. Defaults to `false`.
- **WOPI_ENABLED**: Specifies the enabling the wopi handlers. Defaults to `false`.
- **USE_UNAUTHORIZED_STORAGE**: Set to `true`if using selfsigned certificates for your storage server e.g. Nextcloud. Defaults to `false`
- **GENERATE_FONTS**: When 'true' regenerates fonts list and the fonts thumbnails etc. at each start. Defaults to `true`
- **METRICS_ENABLED**: Specifies the enabling StatsD for ONLYOFFICE Document Server. Defaults to `false`.
@ -332,7 +333,7 @@ SaaS version: [https://www.onlyoffice.com/cloud-office.aspx](https://www.onlyoff
## User Feedback and Support
If you have any problems with or questions about this image, please visit our official forum to find answers to your questions: [dev.onlyoffice.org][1] or you can ask and answer ONLYOFFICE development questions on [Stack Overflow][2].
If you have any problems with or questions about this image, please visit our official forum to find answers to your questions: [forum.onlyoffice.com][1] or you can ask and answer ONLYOFFICE development questions on [Stack Overflow][2].
[1]: https://dev.onlyoffice.org
[1]: https://forum.onlyoffice.com
[2]: https://stackoverflow.com/questions/tagged/onlyoffice

5
hooks/build Normal file
View File

@ -0,0 +1,5 @@
#!/bin/bash
sed -i '/trap clean_exit SIGTERM/s/^/#/' run-document-server.sh
docker build -t $IMAGE_NAME .

7
hooks/post_push Normal file
View File

@ -0,0 +1,7 @@
#!/bin/bash
NEW_TAG=6.4.2
NEW_IMAGE_NAME=$DOCKER_REPO:$NEW_TAG
docker tag $IMAGE_NAME $NEW_IMAGE_NAME
docker push $NEW_IMAGE_NAME

3
hooks/push Normal file
View File

@ -0,0 +1,3 @@
#!/bin/bash
docker push $IMAGE_NAME

View File

@ -11,16 +11,32 @@ shopt -s globstar
APP_DIR="/var/www/${COMPANY_NAME}/documentserver"
DATA_DIR="/var/www/${COMPANY_NAME}/Data"
PRIVATE_DATA_DIR="${DATA_DIR}/.private"
DS_RELEASE_DATE="${PRIVATE_DATA_DIR}/ds_release_date"
LOG_DIR="/var/log/${COMPANY_NAME}"
DS_LOG_DIR="${LOG_DIR}/documentserver"
LIB_DIR="/var/lib/${COMPANY_NAME}"
DS_LIB_DIR="${LIB_DIR}/documentserver"
CONF_DIR="/etc/${COMPANY_NAME}/documentserver"
IS_UPGRADE="false"
ONLYOFFICE_DATA_CONTAINER=${ONLYOFFICE_DATA_CONTAINER:-false}
ONLYOFFICE_DATA_CONTAINER_HOST=${ONLYOFFICE_DATA_CONTAINER_HOST:-localhost}
ONLYOFFICE_DATA_CONTAINER_PORT=80
RELEASE_DATE="$(stat -c="%y" ${APP_DIR}/server/DocService/docservice | sed -r 's/=([0-9]+)-([0-9]+)-([0-9]+) ([0-9:.+ ]+)/\1-\2-\3/')";
if [ -f ${DS_RELEASE_DATE} ]; then
PREV_RELEASE_DATE=$(head -n 1 ${DS_RELEASE_DATE})
else
PREV_RELEASE_DATE="0"
fi
if [ "${RELEASE_DATE}" != "${PREV_RELEASE_DATE}" ]; then
if [ ${ONLYOFFICE_DATA_CONTAINER} != "true" ]; then
IS_UPGRADE="true";
fi
fi
SSL_CERTIFICATES_DIR="${DATA_DIR}/certs"
if [[ -z $SSL_CERTIFICATE_PATH ]] && [[ -f ${SSL_CERTIFICATES_DIR}/onlyoffice.crt ]]; then
SSL_CERTIFICATE_PATH=${SSL_CERTIFICATES_DIR}/onlyoffice.crt
@ -55,6 +71,8 @@ JWT_SECRET=${JWT_SECRET:-secret}
JWT_HEADER=${JWT_HEADER:-Authorization}
JWT_IN_BODY=${JWT_IN_BODY:-false}
WOPI_ENABLED=${WOPI_ENABLED:-false}
GENERATE_FONTS=${GENERATE_FONTS:-true}
if [[ ${PRODUCT_NAME} == "documentserver" ]]; then
@ -103,6 +121,7 @@ read_setting(){
METRICS_PREFIX="${METRICS_PREFIX:-.ds}"
DB_HOST=${DB_HOST:-${POSTGRESQL_SERVER_HOST:-$(${JSON} services.CoAuthoring.sql.dbHost)}}
DB_TYPE=${DB_TYPE:-$(${JSON} services.CoAuthoring.sql.type)}
case $DB_TYPE in
"postgres")
DB_PORT=${DB_PORT:-"5432"}
@ -121,7 +140,6 @@ read_setting(){
DB_NAME=${DB_NAME:-${POSTGRESQL_SERVER_DB_NAME:-$(${JSON} services.CoAuthoring.sql.dbName)}}
DB_USER=${DB_USER:-${POSTGRESQL_SERVER_USER:-$(${JSON} services.CoAuthoring.sql.dbUser)}}
DB_PWD=${DB_PWD:-${POSTGRESQL_SERVER_PASS:-$(${JSON} services.CoAuthoring.sql.dbPass)}}
DB_TYPE=${DB_TYPE:-$(${JSON} services.CoAuthoring.sql.type)}
RABBITMQ_SERVER_URL=${RABBITMQ_SERVER_URL:-$(${JSON} rabbitmq.url)}
AMQP_URI=${AMQP_URI:-${AMQP_SERVER_URL:-${RABBITMQ_SERVER_URL}}}
@ -297,6 +315,11 @@ update_ds_settings(){
${JSON} -I -e "if(this.services.CoAuthoring.requestDefaults===undefined)this.services.CoAuthoring.requestDefaults={}"
${JSON} -I -e "if(this.services.CoAuthoring.requestDefaults.rejectUnauthorized===undefined)this.services.CoAuthoring.requestDefaults.rejectUnauthorized=false"
fi
if [ "${WOPI_ENABLED}" == "true" ]; then
${JSON} -I -e "if(this.wopi===undefined)this.wopi={}"
${JSON} -I -e "this.wopi.enable = true"
fi
}
create_postgresql_cluster(){
@ -327,6 +350,36 @@ create_db_tbl() {
esac
}
upgrade_db_tbl() {
case $DB_TYPE in
"postgres")
upgrade_postgresql_tbl
;;
"mariadb"|"mysql")
upgrade_mysql_tbl
;;
esac
}
upgrade_postgresql_tbl() {
if [ -n "$DB_PWD" ]; then
export PGPASSWORD=$DB_PWD
fi
PSQL="psql -q -h$DB_HOST -p$DB_PORT -d$DB_NAME -U$DB_USER -w"
$PSQL -f "$APP_DIR/server/schema/postgresql/removetbl.sql"
$PSQL -f "$APP_DIR/server/schema/postgresql/createdb.sql"
}
upgrade_mysql_tbl() {
CONNECTION_PARAMS="-h$DB_HOST -P$DB_PORT -u$DB_USER -p$DB_PWD -w"
MYSQL="mysql -q $CONNECTION_PARAMS"
$MYSQL $DB_NAME < "$APP_DIR/server/schema/mysql/removetbl.sql" >/dev/null 2>&1
$MYSQL $DB_NAME < "$APP_DIR/server/schema/mysql/createdb.sql" >/dev/null 2>&1
}
create_postgresql_tbl() {
if [ -n "$DB_PWD" ]; then
export PGPASSWORD=$DB_PWD
@ -423,8 +476,13 @@ update_logrotate_settings(){
sed 's|\(^su\b\).*|\1 root root|' -i /etc/logrotate.conf
}
update_release_date(){
mkdir -p ${PRIVATE_DATA_DIR}
echo ${RELEASE_DATE} > ${DS_RELEASE_DATE}
}
# create base folders
for i in converter docservice spellchecker metrics; do
for i in converter docservice metrics; do
mkdir -p "${DS_LOG_DIR}/$i"
done
@ -527,6 +585,11 @@ if [ ${ONLYOFFICE_DATA_CONTAINER} != "true" ]; then
waiting_for_redis
fi
if [ "${IS_UPGRADE}" = "true" ]; then
upgrade_db_tbl
update_release_date
fi
update_nginx_settings
update_supervisor_settings