From 4c5809c4731618ad544fddd600c3f7169ce717f3 Mon Sep 17 00:00:00 2001 From: Rik Veenboer Date: Sat, 30 Nov 2024 21:00:23 +0100 Subject: [PATCH] official seafile container --- docker-compose.seafile.yml | 19 ++++++------ seafile-new/server/seafile/conf/ccnet.conf | 11 +++++++ .../server/seafile/conf/gunicorn.conf.py | 17 +++++++++++ seafile-new/server/seafile/conf/seafdav.conf | 5 ++++ seafile-new/server/seafile/conf/seafile.conf | 19 ++++++++++++ .../server/seafile/conf/seahub_settings.py | 29 +++++++++++++++++++ 6 files changed, 90 insertions(+), 10 deletions(-) create mode 100644 seafile-new/server/seafile/conf/ccnet.conf create mode 100644 seafile-new/server/seafile/conf/gunicorn.conf.py create mode 100644 seafile-new/server/seafile/conf/seafdav.conf create mode 100644 seafile-new/server/seafile/conf/seafile.conf create mode 100755 seafile-new/server/seafile/conf/seahub_settings.py diff --git a/docker-compose.seafile.yml b/docker-compose.seafile.yml index 62d05ea..d8160e9 100644 --- a/docker-compose.seafile.yml +++ b/docker-compose.seafile.yml @@ -16,7 +16,7 @@ services: - /opt/seafile:/seafile - /media/sync/seafile:/seafile/seafile-data - seafile-db: + seafile-mysql: image: mariadb:10.11 container_name: seafile-mysql environment: @@ -24,7 +24,8 @@ services: - MYSQL_LOG_CONSOLE=true - MARIADB_AUTO_UPGRADE=1 volumes: - - /opt/seafile-mysql/db:/var/lib/mysql # Required, specifies the path to MySQL data persistent store. + - /opt/seafile-new/db:/var/lib/mysql + - /opt/seafile-new/tmp:/host env_file: - /opt/seafile-new/.env @@ -39,18 +40,16 @@ services: ports: - "12380:80" volumes: + - /opt/seafile-new/tmp:/host + - /opt/seafile-new/tmp/setup-seafile-mysql.py:/scripts/setup-seafile-mysql.py - /opt/seafile-new/server:/shared - + - /media/sync/seafile:/shared/seafile/seafile-data environment: - - DB_HOST=seafile-db + - DB_HOST=seafile-mysql - DB_ROOT_PASSWD=${SEAFILE_MYSQL_DB_PASSWORD} - #- TIME_ZONE=Europe/Amsterdam # Optional, default is UTC. Should be uncomment and set to your local time zone. - #- SEAFILE_ADMIN_EMAIL=me@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=docs.seafile.com # Specifies your host name if https is enabled. + - TIME_ZONE=Europe/Amsterdam depends_on: - - seafile-db + - seafile-mysql - seafile-memcached env_file: - /opt/seafile-new/.env diff --git a/seafile-new/server/seafile/conf/ccnet.conf b/seafile-new/server/seafile/conf/ccnet.conf new file mode 100644 index 0000000..3c88891 --- /dev/null +++ b/seafile-new/server/seafile/conf/ccnet.conf @@ -0,0 +1,11 @@ +[General] + +[Database] +ENGINE = mysql +HOST = seafile-mysql +PORT = 3306 +USER = seafile +PASSWD = 26669b06-5358-4693-95f3-833da89c70cb +DB = ccnet_db +CONNECTION_CHARSET = utf8 + diff --git a/seafile-new/server/seafile/conf/gunicorn.conf.py b/seafile-new/server/seafile/conf/gunicorn.conf.py new file mode 100644 index 0000000..2a437dc --- /dev/null +++ b/seafile-new/server/seafile/conf/gunicorn.conf.py @@ -0,0 +1,17 @@ + +import os + +daemon = True +workers = 5 + +# default localhost:8000 +bind = "127.0.0.1:8000" + +# Pid +pids_dir = '/opt/seafile/pids' +pidfile = os.path.join(pids_dir, 'seahub.pid') + +# for file upload, we need a longer timeout value (default is only 30s, too short) +timeout = 1200 + +limit_request_line = 8190 diff --git a/seafile-new/server/seafile/conf/seafdav.conf b/seafile-new/server/seafile/conf/seafdav.conf new file mode 100644 index 0000000..eb0252b --- /dev/null +++ b/seafile-new/server/seafile/conf/seafdav.conf @@ -0,0 +1,5 @@ + +[WEBDAV] +enabled = false +port = 8080 +share_name = /seafdav diff --git a/seafile-new/server/seafile/conf/seafile.conf b/seafile-new/server/seafile/conf/seafile.conf new file mode 100644 index 0000000..a3a7aba --- /dev/null +++ b/seafile-new/server/seafile/conf/seafile.conf @@ -0,0 +1,19 @@ +[fileserver] +port = 8082 + +[database] +type = mysql +host = seafile-mysql +port = 3306 +user = seafile +password = 26669b06-5358-4693-95f3-833da89c70cb +db_name = seafile_db +connection_charset = utf8 + +[notification] +enabled = false +host = 127.0.0.1 +port = 8083 +log_level = info +jwt_private_key = -fl9r-9imc*dhtpgx4w9**bdk*8thq!wq6_0_mov*z!3chs(bu + diff --git a/seafile-new/server/seafile/conf/seahub_settings.py b/seafile-new/server/seafile/conf/seahub_settings.py new file mode 100755 index 0000000..92bdd26 --- /dev/null +++ b/seafile-new/server/seafile/conf/seahub_settings.py @@ -0,0 +1,29 @@ +# -*- coding: utf-8 -*- +SECRET_KEY = "b'x)npwu6*%19$_*-c+%yl(tudan3)uc9f#*hur3$18yw*6z33+&'" +SERVICE_URL = "http://seafile.example.com/" + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.mysql', + 'NAME': 'seahub_db', + 'USER': 'seafile', + 'PASSWORD': '26669b06-5358-4693-95f3-833da89c70cb', + 'HOST': 'seafile-mysql', + 'PORT': '3306', + 'OPTIONS': {'charset': 'utf8mb4'}, + } +} + + +CACHES = { + 'default': { + 'BACKEND': 'django_pylibmc.memcached.PyLibMCCache', + 'LOCATION': 'memcached:11211', + }, + 'locmem': { + 'BACKEND': 'django.core.cache.backends.locmem.LocMemCache', + }, +} +COMPRESS_CACHE_BACKEND = 'locmem' +TIME_ZONE = 'Europe/Amsterdam' +FILE_SERVER_ROOT = "http://seafile.example.com/seafhttp"