Today, I'll show you how to integrate OnlyOffice
into your Seafile
instance. The advantages are enormous! With this add-on, you can easily edit Office formats directly on the server and collaborate on files at the same time.
you need to create a new docker compose with the following content:
services:
onlyoffice:
image: ${ONLYOFFICE_IMAGE:-onlyoffice/documentserver:8.1.0.1}
restart: unless-stopped
container_name: seafile-onlyoffice
environment:
#- DB_TYPE=${DB_TYPE:-mariadb}
#- DB_HOST=${SEAFILE_MYSQL_DB_HOST:-db}
#- DB_USER=${SEAFILE_MYSQL_DB_USER:-seafile}
#- DB_PWD=${SEAFILE_MYSQL_DB_PASSWORD:?Variable is not set or empty}
- JWT_ENABLED=true
- JWT_SECRET=${ONLYOFFICE_JWT_SECRET:?Variable is not set or empty}
volumes:
- ${ONLYOFFICE_VOLUME:-/opt/onlyoffice}/logs:/var/log/onlyoffice
- ${ONLYOFFICE_VOLUME:-/opt/onlyoffice}/data:/var/www/onlyoffice/Data
- ${ONLYOFFICE_VOLUME:-/opt/onlyoffice}/lib:/var/lib/onlyoffice
labels:
- "traefik.enable=true"
- "traefik.http.routers.ooffice.tls.certresolver=LEwillifixnet"
- "traefik.http.routers.ooffice.tls=true"
- "traefik.http.routers.ooffice.rule=Host(`${SEAFILE_SERVER_HOSTNAME}`) && PathPrefix(`/onlyofficeds`)"
- "traefik.http.routers.ooffice.entrypoints=websecure"
- "traefik.http.routers.ooffice.service=ooffice"
- "traefik.http.services.ooffice.loadbalancer.server.port=80"
- "traefik.http.middlewares.oo-strippath.stripprefix.prefixes=/onlyofficeds"
- "traefik.http.middlewares.ooffice-headers.headers.customrequestheaders.X-Forwarded-Proto=https"
- "traefik.http.middlewares.ooffice-headers.headers.customrequestheaders.X-Forwarded-Host=${SEAFILE_SERVER_HOSTNAME}/onlyofficeds"
- "traefik.http.middlewares.ooffice-rewrite.replacepathregex.regex=^/onlyofficeds/(.*)"
- "traefik.http.middlewares.ooffice-rewrite.replacepathregex.replacement=/$$1"
- "traefik.http.routers.ooffice.middlewares=oo-strippath,ooffice-headers,ooffice-rewrite"
networks:
- seafile-net
- public
networks:
seafile-net:
name: seafile-net
public:
external: true
name: public
in the existing seafile
.env add onlyoffice.yml to the COMPOSE-FILE Variable
COMPOSE-FILE='seafile-server.yml,seadoc.yml,onlyoffice.yml'
add also the following Variables to the .env:
ONLYOFFICE_IMAGE=onlyoffice/documentserver:8.1.0.1
ONLYOFFICE_VOLUME=/opt/onlyoffice
ONLYOFFICE_PORT=6233
ONLYOFFICE_JWT_SECRET=<my secret jwt>
last you must configure your seahub_settings.py (seafile-data/seafile/conf)
add the following
ENABLE_ONLYOFFICE = True
VERIFY_ONLYOFFICE_CERTIFICATE = True
ONLYOFFICE_APIJS_URL = 'https://seafile.willifix.net/onlyofficeds/web-apps/apps/api/documents/api.js'
ONLYOFFICE_FILE_EXTENSION = ('doc','docx','ppt','pptx','xls','xlsx','odt','fodt','odp','fodp','ods','fods')
ONLYOFFICE_EDIT_FILE_EXTENSION = ('docx','pptx','xlsx')
ONLYOFFICE_JWT_SECRET = '<my secret jwt>'
now restart your seafile
instance and see how nice a seafile
with OnlyOffice
is