6 Commits

Author SHA1 Message Date
ee332f5edd chore: publish 2.5.0+7.3.3 release
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-05 17:48:38 +02:00
fce4120f09 update drone
Some checks reported errors
continuous-integration/drone/push Build was killed
2023-03-13 18:35:54 +01:00
cb08027aed chore: publish 2.4.1+7.3.0 release
Some checks reported errors
continuous-integration/drone/push Build was killed
2023-03-13 18:02:29 +01:00
364d87db5f update README 2023-03-13 17:57:39 +01:00
1ed3618203 fix: append to local.json instead of overwriting it
local.json is automatically generated and can change due to updates,
to prevent breaking changes, only append the necssary config
using a custom entrypoint.
2023-03-13 17:28:57 +01:00
0ee47375be chore: publish 2.4.0+7.3.0 release
All checks were successful
continuous-integration/drone/push Build is passing
2023-02-01 17:11:32 +01:00
7 changed files with 62 additions and 72 deletions

View File

@ -17,7 +17,7 @@ steps:
DOMAIN: onlyoffice.swarm-test.autonomic.zone
STACK_NAME: onlyoffice
LETS_ENCRYPT_ENV: production
LOCAL_JSON_VERSION: v1
ENTRYPOINT_VERSION: v1
SECRET_DB_PASSWORD_VERSION: v1
trigger:
branch:

View File

@ -7,17 +7,21 @@
* **Category**: Apps
* **Status**: 3, stable
* **Image**: [`onlyoffice`](https://hub.docker.com/r/onlyoffice/documentserver/), 4, upstream
* **Healthcheck**: No
* **Healthcheck**: Yes
* **Backups**: No
* **Email**: 3
* **Email**: N/A
* **Tests**: 2
* **SSO**: No
<!-- endmetadata -->
## Basic usage
1. Set up Docker Swarm and [`abra`](https://git.autonomic.zone/coop-cloud/abra)
1. Deploy [`coop-cloud/traefik`](https://git.autonomic.zone/coop-cloud/traefik)
1. `abra app config YOURAPPDOMAIN` - be sure to change `$DOMAIN` to something that resolves to
your Docker swarm box
1. `abra app deploy YOURAPPDOMAIN`
* `abra app new onlyoffice`
* `abra app config <app-name>`
- uncomment `COMPOSE_FILE` and `SECRET_JWT_SECRET_VERSION` to enable JWT Secret
* `abra app secret generate -a <app-name>`
* `abra app deploy <app-name>`
For more, see [`docs.coopcloud.tech`](https://docs.coopcloud.tech) and [`ONLYOFFICE/Docker-DocumentServer`](https://github.com/ONLYOFFICE/Docker-DocumentServer).
[Official Onlyoffice docker compose](https://github.com/ONLYOFFICE/Docker-DocumentServer/blob/master/docker-compose.yml)

View File

@ -1,4 +1,4 @@
export LOCAL_JSON_VERSION=v1
export ENTRYPOINT_VERSION=v1
prepare_shutdown () {
documentserver-prepare4shutdown.sh

View File

@ -5,6 +5,7 @@ services:
- JWT_ENABLED=true
- JWT_HEADER=Authorization
- JWT_IN_BODY=true
- JWT_SECRET_FILE=/run/secrets/jwt_secret
secrets:
- jwt_secret

View File

@ -1,7 +1,7 @@
version: '3.8'
services:
app:
image: onlyoffice/documentserver:7.2.2
image: onlyoffice/documentserver:7.3.3
depends_on:
- db
- rabbitmq
@ -15,6 +15,7 @@ services:
DB_PORT: 5432
DB_NAME: onlyoffice
DB_USER: onlyoffice
DB_PWD_FILE: /run/secrets/db_password
AMQP_URI: amqp://guest:guest@rabbitmq
AUTO_ASSEMBLY_ENABLED:
AUTO_ASSEMBLY_INTERVAL:
@ -28,8 +29,10 @@ services:
retries: 10
start_period: 1m
configs:
- source: local_json
target: /etc/onlyoffice/documentserver/local.json
- source: entrypoint
target: /custom-entrypoint.sh
mode: 555
entrypoint: /custom-entrypoint.sh
deploy:
update_config:
failure_action: rollback
@ -43,10 +46,10 @@ services:
- "traefik.http.routers.${STACK_NAME}.tls.certresolver=${LETS_ENCRYPT_ENV}"
- "traefik.http.routers.${STACK_NAME}.middlewares=${STACK_NAME}-fwdproto"
- "traefik.http.middlewares.${STACK_NAME}-fwdproto.headers.customRequestHeaders.X-Forwarded-Proto=https"
- "coop-cloud.${STACK_NAME}.version=2.3.0+7.2.2"
- "coop-cloud.${STACK_NAME}.version=2.5.0+7.3.3"
rabbitmq:
image: rabbitmq:3.11.7
image: rabbitmq:3.11.13
networks:
- internal
healthcheck:
@ -89,8 +92,8 @@ secrets:
name: ${STACK_NAME}_db_password_${SECRET_DB_PASSWORD_VERSION}
configs:
local_json:
name: ${STACK_NAME}_local_json_${LOCAL_JSON_VERSION}
file: local.json.tmpl
entrypoint:
name: ${STACK_NAME}_entrypoint_${ENTRYPOINT_VERSION}
file: entrypoint.sh.tmpl
template_driver: golang

37
entrypoint.sh.tmpl Normal file
View File

@ -0,0 +1,37 @@
#!/bin/bash
set -eu
file_env() {
local var="$1"
local fileVar="${var}_FILE"
local def="${2:-}"
if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then
echo >&2 "error: both $var and $fileVar are set (but are exclusive)"
exit 1
fi
local val="$def"
if [ "${!var:-}" ]; then
val="${!var}"
elif [ "${!fileVar:-}" ]; then
val="$(< "${!fileVar}")"
fi
export "$var"="$val"
unset "$fileVar"
}
file_env "DB_PWD"
file_env "JWT_SECRET"
CONFIG=/etc/onlyoffice/documentserver/local.json
JSON_BIN=/var/www/onlyoffice/documentserver/npm/json
JSON="${JSON_BIN} -q -f ${CONFIG}"
${JSON} -I -e "if(this.services.CoAuthoring.autoAssembly===undefined)this.services.CoAuthoring.autoAssembly={};"
${JSON} -I -e "this.services.CoAuthoring.autoAssembly.enable = ${AUTO_ASSEMBLY_ENABLED}"
${JSON} -I -e "this.services.CoAuthoring.autoAssembly.interval = '${AUTO_ASSEMBLY_INTERVAL}'"
${JSON} -I -e "this.services.CoAuthoring.autoAssembly.step = '${AUTO_ASSEMBLY_STEP}'"
/app/ds/run-document-server.sh

View File

@ -1,55 +0,0 @@
{
"services": {
"CoAuthoring": {
"sql": {
"type": "{{ env "DB_TYPE" }}",
"dbHost": "{{ env "DB_HOST" }}",
"dbPort": "{{ env "DB_PORT" }}",
"dbName": "{{ env "DB_NAME" }}",
"dbUser": "{{ env "DB_USER" }}",
"dbPass": "{{ secret "db_password" }}"
},
{{ if eq (env "JWT_ENABLED") "true" }}
"token": {
"enable": {
"request": {
"inbox": true,
"outbox": true
},
"browser": true
},
"inbox": {
"header": "Authorization",
"inBody": true
},
"outbox": {
"header": "Authorization",
"inBody": true
}
},
"secret": {
"inbox": {
"string": "{{ secret "jwt_secret" }}"
},
"outbox": {
"string": "{{ secret "jwt_secret" }}"
},
"session": {
"string": "{{ secret "jwt_secret" }}"
}
},
{{ end }}
"autoAssembly" : {
"enable": {{ env "AUTO_ASSEMBLY_ENABLED" }},
"interval": "{{ env "AUTO_ASSEMBLY_INTERVAL" }}",
"step": "{{ env "AUTO_ASSEMBLY_STEP" }}"
}
}
},
"rabbitmq": {
"url": "amqp://guest:guest@rabbitmq"
},
"queue": {
"type": "rabbitmq"
}
}