Hey everyone,
I am currently deploying my first SeaFile Instance with OnlyOffice integration using Podman / Docker Compose.
At first glance, everything seems to be working, I can create / upload office files and open them in OnlyOffice.
However, after restarting the server (podman compose down && podman compose up -d
), I can not open the files created before the restart anymore - I am getting a “Download Failed” error combined with the following log output:
e9f3a59022b6 [2024-08-16T11:37:42.290] [ERROR] [localhost] [60e0f7122dfd69f8f47d] [myemail@example.com] nodeJS - error downloadFile:url=https://seafile.karatek.net/seafhttp/files/02cfcdc8-9c90-4705-9879-5570e0bb14e0/example.xlsx;attempt=2;code:null;connect:null Error: Error response: statusCode:403; headers:{"date":"Fri, 16 Aug 2024 11:37:42 GMT","content-type":"text/plain","transfer-encoding":"chunked","connection":"keep-alive","content-encoding":"gzip","strict-transport-security":"max-age=63072000; preload","cf-cache-status":"BYPASS","report-to":"{\"endpoints\":[{\"url\":\"https:\\/\\/a.nel.cloudflare.com\\/report\\/v4?s=BedHFYDvzoDI0gTgx50%2BoIQtDw%2FKPECxl8jXJxeOxLyKoqxsmEmnSTNp1DcMVY%2BnbSh8Z9xYZ1vEUatXbLnntxdvcgeZ7LD1XMI6ODB6a67GmAmYq%2BhXTTWKIAo9EoVMTYEClGqW\"}],\"group\":\"cf-nel\",\"max_age\":604800}","nel":"{\"success_fraction\":0,\"report_to\":\"cf-nel\",\"max_age\":604800}","vary":"Accept-Encoding","server":"cloudflare","cf-ray":"8b41224709ef96e5-AMS","alt-svc":"h3=\":443\"; ma=86400"};
e9f3a59022b6 at Request.fResponse (/snapshot/server/Common/sources/utils.js)
e9f3a59022b6 at Request.emit (node:events:527:28)
e9f3a59022b6 at Request.onRequestResponse (/snapshot/server/Common/node_modules/request/request.js:1066:10)
e9f3a59022b6 at ClientRequest.emit (node:events:527:28)
e9f3a59022b6 at HTTPParser.parserOnIncomingClient [as onIncoming] (node:_http_client:631:27)
e9f3a59022b6 at HTTPParser.parserOnHeadersComplete (node:_http_common:128:17)
e9f3a59022b6 at TLSSocket.socketOnData (node:_http_client:494:22)
e9f3a59022b6 at TLSSocket.emit (node:events:527:28)
e9f3a59022b6 at addChunk (node:internal/streams/readable:315:12)
e9f3a59022b6 at readableAddChunk (node:internal/streams/readable:289:9)
e9f3a59022b6 at TLSSocket.Readable.push (node:internal/streams/readable:228:10)
e9f3a59022b6 at TLSWrap.onStreamRead (node:internal/stream_base_commons:190:23)
Newly created files can still be opened up until the next restart.
Below my docker-compose.yml file:
services:
db:
image: mariadb:10.11
container_name: seafile-mysql
environment:
- MYSQL_ROOT_PASSWORD=somepasswd # Required, set the root's password of MySQL service.
- MYSQL_LOG_CONSOLE=true
- MARIADB_AUTO_UPGRADE=1
volumes:
- /srv/seafile/db:/var/lib/mysql:Z # Required, specifies the path to MySQL data persistent store.
networks:
- seafile-net
memcached:
image: memcached:1.6.18
container_name: seafile-memcached
entrypoint: memcached -m 256
networks:
- seafile-net
seafile:
image: seafileltd/seafile-mc:11.0-latest
container_name: seafile
ports:
- "8081:80"
volumes:
- /srv/seafile/data:/shared:Z # Required, specifies the path to Seafile data persistent store.
environment:
- DB_HOST=db
- DB_ROOT_PASSWD=somepasswd # Required, the value should be root's password of MySQL service.
- TIME_ZONE=Europe/Berlin # Optional, default is UTC. Should be uncomment and set to your local time zone.
- SEAFILE_ADMIN_EMAIL=myemail@example.com # Specifies Seafile admin user, default is 'me@example.com'.
- SEAFILE_ADMIN_PASSWORD=asecret # Specifies Seafile admin password, default is 'asecret'.
- SEAFILE_SERVER_LETSENCRYPT=false # Whether to use https or not.
- SEAFILE_SERVER_HOSTNAME=seafile.karatek.net # Specifies your host name if https is enabled.
- FORCE_HTTPS_IN_CONF=true
depends_on:
- db
- memcached
networks:
- seafile-net
oods:
image: onlyoffice/documentserver:latest
container_name: seafile-oods
dns:
- 1.1.1.1
ports:
- "8082:80"
environment:
- JWT_ENABLED=true
- JWT_SECRET=somesecret
networks:
seafile-net:
Also, my seahub_settings.py:
# -*- coding: utf-8 -*-
SECRET_KEY = "b'somesecret'"
SERVICE_URL = "https://seafile.karatek.net"
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'seahub_db',
'USER': 'seafile',
'PASSWORD': 'secret',
'HOST': 'db',
'PORT': '3306',
'OPTIONS': {'charset': 'utf8mb4'},
}
}
CACHES = {
'default': {
'BACKEND': 'django_pylibmc.memcached.PyLibMCCache',
'LOCATION': 'memcached:11211',
},
'locmem': {
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
},
}
CSRF_TRUSTED_ORIGINS = ["https://seafile.karatek.net"]
COMPRESS_CACHE_BACKEND = 'locmem'
TIME_ZONE = 'Europe/Berlin'
FILE_SERVER_ROOT = "https://seafile.karatek.net/seafhttp"
ENABLE_ONLYOFFICE = True
VERIFY_ONLYOFFICE_CERTIFICATE = False
ONLYOFFICE_APIJS_URL = 'https://office.karatek.net/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')
# Enable force save to let user can save file when he/she press the save button on OnlyOffice file edit page.
ONLYOFFICE_FORCE_SAVE = True
# if JWT enabled
ONLYOFFICE_JWT_SECRET = 'somesecret'
Any help is greatly appreciated, I’ve been stuck with this for days. Thank you in advance!