15 Commits

Author SHA1 Message Date
6c8b7dd2a7 chore: publish 2.11.0+9.0.2 release
All checks were successful
continuous-integration/drone/tag Build is passing
continuous-integration/drone/push Build is passing
2025-07-03 13:39:25 +02:00
04caca0798 chore: publish 2.10.0+8.3.0 release
All checks were successful
continuous-integration/drone/tag Build is passing
continuous-integration/drone/push Build is passing
2025-02-11 18:05:58 +01:00
45d1f09317 Update .drone.yml
All checks were successful
continuous-integration/drone/push Build is passing
2025-01-08 10:09:13 -08:00
b571899521 fix drone runner
All checks were successful
continuous-integration/drone/push Build is passing
2024-11-26 22:20:26 +01:00
c1fa536df2 chore: publish 2.9.0+8.2.1 release
Some checks failed
continuous-integration/drone/tag Build is passing
continuous-integration/drone/push Build is failing
2024-11-26 22:01:18 +01:00
807b095441 update pg_backup.sh
Some checks failed
continuous-integration/drone/push Build is failing
2024-10-22 21:33:47 +02:00
5f3dcb4256 update backupbot labels
Some checks failed
continuous-integration/drone/push Build is failing
2024-10-22 20:17:48 +02:00
3022729f66 chore: publish 2.8.0+8.1.1 release
All checks were successful
continuous-integration/drone/push Build is passing
2024-08-07 13:44:04 +02:00
450c1cdca0 add alakazam integration file alaconnect.yml
All checks were successful
continuous-integration/drone/push Build is passing
2024-05-13 17:33:01 +02:00
bb99499b91 chore: publish 2.7.0+8.0.1 release
All checks were successful
continuous-integration/drone/tag Build is passing
continuous-integration/drone/push Build is passing
2024-04-09 14:37:10 +02:00
b681d6ef44 chore: publish 2.6.2+7.4.0 release
All checks were successful
continuous-integration/drone/push Build is passing
2023-10-19 23:48:09 +02:00
928469f6eb add backup label 2023-10-19 23:47:50 +02:00
3072d4c33c chore: publish 2.6.1+7.4.0 release
All checks were successful
continuous-integration/drone/push Build is passing
2023-07-25 12:11:40 +02:00
c9ed2edd8f chore: publish 2.6.0+7.4.0 release 2023-07-25 12:10:03 +02:00
012b672e7a fix: postgres healthcheck, autoformat
All checks were successful
continuous-integration/drone/push Build is passing
2023-06-12 14:26:23 +02:00
6 changed files with 69 additions and 12 deletions

View File

@ -19,6 +19,7 @@ steps:
LETS_ENCRYPT_ENV: production
ENTRYPOINT_VERSION: v1
SECRET_DB_PASSWORD_VERSION: v1
PG_BACKUP_VERSION: v2
trigger:
branch:
- main
@ -34,7 +35,7 @@ steps:
from_secret: drone_abra-bot_token
fork: true
repositories:
- coop-cloud/auto-recipes-catalogue-json
- toolshed/auto-recipes-catalogue-json
trigger:
event: tag

View File

@ -2,6 +2,7 @@ TYPE=onlyoffice
TIMEOUT=300
ENABLE_AUTO_UPDATE=true
LETS_ENCRYPT_ENV=production
ENABLE_BACKUPS=true
DOMAIN=onlyoffice.example.com
SECRET_DB_PASSWORD_VERSION=v1

View File

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

6
alaconnect.yml Normal file
View File

@ -0,0 +1,6 @@
nextcloud:
uncomment:
- compose.jwt.yml
- SECRET_JWT_SECRET_VERSION
shared_secrets:
onlyoffice_jwt: jwt_secret

View File

@ -1,14 +1,14 @@
version: '3.8'
services:
app:
image: onlyoffice/documentserver:7.3.3
image: onlyoffice/documentserver:9.0.2
depends_on:
- db
- rabbitmq
stdin_open: true
networks:
- proxy
- internal
- internal
environment:
DB_TYPE: postgres
DB_HOST: db
@ -17,13 +17,13 @@ services:
DB_USER: onlyoffice
DB_PWD_FILE: /run/secrets/db_password
AMQP_URI: amqp://guest:guest@rabbitmq
AUTO_ASSEMBLY_ENABLED:
AUTO_ASSEMBLY_INTERVAL:
AUTO_ASSEMBLY_STEP:
AUTO_ASSEMBLY_ENABLED:
AUTO_ASSEMBLY_INTERVAL:
AUTO_ASSEMBLY_STEP:
secrets:
- db_password
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost/welcome"]
test: [ "CMD", "curl", "-f", "http://localhost/welcome" ]
interval: 30s
timeout: 10s
retries: 10
@ -47,10 +47,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.5.1+7.3.3"
- "coop-cloud.${STACK_NAME}.version=2.11.0+9.0.2"
rabbitmq:
image: rabbitmq:3.11.13
image: rabbitmq:4.1.1
networks:
- internal
healthcheck:
@ -59,9 +59,15 @@ services:
timeout: 10s
retries: 10
start_period: 1m
db:
image: postgres:9.5
deploy:
labels:
backupbot.backup: "${ENABLE_BACKUPS:-true}"
backupbot.backup.pre-hook: "/pg_backup.sh backup"
backupbot.backup.volumes.db.path: "backup.sql"
backupbot.restore.post-hook: '/pg_backup.sh restore'
environment:
POSTGRES_DB: onlyoffice
POSTGRES_USER: onlyoffice
@ -73,20 +79,26 @@ services:
networks:
- internal
healthcheck:
test: ["CMD", "pg_isready"]
test: [ "CMD", "pg_isready", "-U", "onlyoffice" ]
interval: 30s
timeout: 10s
retries: 10
start_period: 1m
configs:
- source: pg_backup
target: /pg_backup.sh
mode: 0555
volumes:
db:
networks:
proxy:
external: true
internal:
secrets:
db_password:
external: true
@ -97,4 +109,6 @@ configs:
name: ${STACK_NAME}_entrypoint_${ENTRYPOINT_VERSION}
file: entrypoint.sh.tmpl
template_driver: golang
pg_backup:
name: ${STACK_NAME}_pg_backup_${PG_BACKUP_VERSION}
file: pg_backup.sh

34
pg_backup.sh Normal file
View File

@ -0,0 +1,34 @@
#!/bin/bash
set -e
BACKUP_FILE='/var/lib/postgresql/data/backup.sql'
function backup {
export PGPASSWORD=$(cat /run/secrets/db_password)
pg_dump -U ${POSTGRES_USER} ${POSTGRES_DB} > $BACKUP_FILE
}
function restore {
cd /var/lib/postgresql/data/
restore_config(){
# Restore allowed connections
cat pg_hba.conf.bak > pg_hba.conf
su postgres -c 'pg_ctl reload'
}
# Don't allow any other connections than local
cp pg_hba.conf pg_hba.conf.bak
echo "local all all trust" > pg_hba.conf
su postgres -c 'pg_ctl reload'
trap restore_config EXIT INT TERM
# Recreate Database
psql -U ${POSTGRES_USER} -d postgres -c "DROP DATABASE ${POSTGRES_DB} WITH (FORCE);"
createdb -U ${POSTGRES_USER} ${POSTGRES_DB}
psql -U ${POSTGRES_USER} -d ${POSTGRES_DB} -1 -f $BACKUP_FILE
trap - EXIT INT TERM
restore_config
}
$@