diff --git a/manual/config/env.md b/manual/config/env.md index 7a6bc328..b0a83781 100644 --- a/manual/config/env.md +++ b/manual/config/env.md @@ -84,7 +84,13 @@ This part of configurations is only valid in `CACHE_PROVIDER=memcached` - `INIT_S3_AWS_REGION`: Region of your buckets (AWS only), default is `us-east-1`. (Only valid when `INIT_S3_USE_V4_SIGNATURE` sets to `true`) - `INIT_S3_HOST`: Host of your buckets, default is `s3.us-east-1.amazonaws.com`. (Only valid when `INIT_S3_USE_V4_SIGNATURE` sets to `true`) - `INIT_S3_USE_HTTPS`: Use HTTPS connections to S3 if enabled, default is `true` +- `INIT_S3_PATH_STYLE_REQUEST`: This option asks Seafile to use URLs like `https://192.168.1.123:8080/bucketname/object` to access objects. In *Amazon S3*, the default URL format is in virtual host style, such as `https://bucketname.s3.amazonaws.com/object`. But this style relies on advanced DNS server setup. So most self-hosted storage systems only implement the path style format. Default `true`. +- `INIT_S3_SSE_C_KEY`: A string of 32 characters can be generated by openssl rand -base64 24. It can be any 32-character long random string. It's required to use V4 authentication protocol and https if you enable SSE-C. ## SeaSearch -For configurations about SeaSearch in `.env`, please refer [here](https://seasearch-manual.seafile.com/config/) for the details +For configurations about SeaSearch in `.env`, please refer [here](https://seasearch-manual.seafile.com/config/) for the details. + +## Metadata server + +For configurations about Metadata server in `.env`, please refer [here](../extension/metadata-server.md#list-of-environment-variables-of-metadata-server) for the details. diff --git a/manual/extension/metadata-server.md b/manual/extension/metadata-server.md index 43d0c381..1dae7d4a 100644 --- a/manual/extension/metadata-server.md +++ b/manual/extension/metadata-server.md @@ -7,6 +7,9 @@ Metadata server aims to provide metadata management for your libraries, so as to !!! note "Prerequisites" The startup of Metadata server requires using ***Redis*** as the cache server (it should be the default cache server in Seafile 13.0). So you must deploy *Redis* for Seafile, then modify [`seafile.conf`](../config/seafile-conf.md#cache-pro-edition-only), [`seahub_settings.py`](https://docs.djangoproject.com/en/4.2/topics/cache/#redis) and [`seafevents.conf`](../config/seafevents-conf.md) to enable it before deploying metadata server. +!!! warning + Please make sure your Seafile service has been deployed **before** deploying Metadata server. This is because Metadata server needs to read Seafile's configuration file `seafile.conf`. If you deploy Metadata server before or at the same time with Seafile, it may not be able to detect `seafile.conf` and fail to start. + ### Download docker-compose file Please download the file by following command: @@ -38,7 +41,51 @@ Metadata server read all configurations from environtment and **does not need a COMPOSE_FILE='...,md-server.yml' ``` -The following table is all the related environment variables with metadata-server: +To facilitate your deployment, we still provide two different configuration solutions for your reference: + +#### Example `.env` for Seafile data is stored locally + +In this case you don't need to add any additional configuration to your `.env`. You can also specify image version, maximum local cache size, etc., but you must make sure `MD_STORAGE_TYPE=file` + +``` +MD_IMAGE=seafileltd/seafile-md-server:latest +MD_MAX_CACHE_SIZE=1GB +MD_STORAGE_TYPE=file +``` + +#### Example `.env` for Seafile data is stored in the storage backend (e.g., S3) + +First you need to create a bucket for Metadata on your S3 storage backend provider. Then add or modify the following information to `.env`: + +!!! success "Easier to configure S3 for Seafile and its components" + Since Seafile Pro 13.0, in order to facilitate users to deploy Seafile's related extension components and other services in the future, a section will be provided in `.env` to store the **default S3 authorization information configuration**. You can locate it with the following title bar: + + ```sh + ########################################### + # Default S3 authorization Configurations # + ########################################### + ``` + + The S3 authorization configuration part (i.e., ***without buckets name***) in Seafile initialization and some extension components (such as *SeaSearch*, *Metadata server*) configuration will be read from this configuration by default. + + By the way, you can also manually modify the configurations for specific service (this is the situation when you have selected different S3 service providers for these components). + +```sh +MD_IMAGE=seafileltd/seafile-md-server:latest +MD_STORAGE_TYPE=s3 +MD_S3_BUCKET= +MD_S3_HOST= +MD_S3_AWS_REGION= # only needed for AWS +MD_S3_USE_HTTPS=true +MD_S3_PATH_STYLE_REQUEST=false +MD_S3_KEY_ID= +MD_S3_KEY= +MD_S3_USE_V4_SIGNATURE=true +MD_S3_SSE_C_KEY= +``` + +#### List of environment variables for Metadata server +The following table is all the related environment variables with Metadata server: | Variables | Description | Required | | --- | --- | --- | @@ -49,28 +96,19 @@ The following table is all the related environment variables with metadata-serve | `REDIS_PORT` | Your *Redis* service port. | Optional, default `6379` | | `REDIS_PASSWORD` | Your *Redis* access password. | Optional | -And here is other optional values according to your `MD_STORAGE_TYPE` setting: +And here is other optional values when your `MD_STORAGE_TYPE=s3: -- `MD_STORAGE_TYPE=file` (only for deploying the metadata server in the same machine with Seafile) - - | Variables | Description | Required | +| Variables | Description | Required | | --- | --- | --- | - | `SEAFILE_VOLUME` | Directory for Seafile data | Optional, default `/opt/seafile-data` | - - -- `MD_STORAGE_TYPE=s3` - - | Variables | Description | Required | - | --- | --- | --- | - | `MD_S3_HOST` | Host of s3 backend. | Optional | - | `MD_S3_AWS_REGION` | Region of *AWS* s3 backend. | Optional | - | `MD_S3_USE_HTTPS` | Use https connecting to S3 backend. | Optional, default `true` | - | `MD_S3_BUCKET` | Name of S3 bucket for storaging metadata. | **Required** | - | `MD_S3_PATH_STYLE_REQUEST` | S3 backend use path style request. | Optional, default `false` | - | `MD_S3_KEY_ID` | S3 backend authorization key ID. | **Required** | - | `MD_S3_KEY` | S3 backend authorization key secret. | **Required** | - | `MD_S3_USE_V4_SIGNATURE` | Use V4 signature to S3 storage backend. | Optional, default `true` | - | `MD_S3_SSE_C_KEY` | S3 SSE-C key. | Optional | +| `MD_S3_HOST` | Host of s3 backend. | Optional | +| `MD_S3_AWS_REGION` | Region of *AWS* s3 backend. | Optional | +| `MD_S3_USE_HTTPS` | Use https connecting to S3 backend. | Optional, default `true` | +| `MD_S3_BUCKET` | Name of S3 bucket for storaging metadata. | **Required** | +| `MD_S3_PATH_STYLE_REQUEST` | S3 backend use path style request. | Optional, default `false` | +| `MD_S3_KEY_ID` | S3 backend authorization key ID. | **Required** | +| `MD_S3_KEY` | S3 backend authorization key secret. | **Required** | +| `MD_S3_USE_V4_SIGNATURE` | Use V4 signature to S3 storage backend. | Optional, default `true` | +| `MD_S3_SSE_C_KEY` | S3 SSE-C key. | Optional | ### Modify `seahub_settings.py` @@ -79,13 +117,13 @@ To enable metadata server in Seafile, please add the following field in your `se === "Deploy in the same machine with Seafile" ```py ENABLE_METADATA_MANAGEMENT = True - METADATA_SERVER_SECRET_KEY = ' ' + METADATA_SERVER_SECRET_KEY = '' METADATA_SERVER_URL = 'http://seafile-md-server:8084' ``` === "Standalone" ```py ENABLE_METADATA_MANAGEMENT = True - METADATA_SERVER_SECRET_KEY = ' ' + METADATA_SERVER_SECRET_KEY = '' METADATA_SERVER_URL = 'http://:8084' ``` @@ -98,23 +136,33 @@ docker compose down docker compose up -d ``` -!!! success - If the container startups normally, the message you can get from the following logs - - - `docker logs -f seafile-md-server`: - ```log - [md-server] [2025-01-24 06:23:44] [INFO] Environment variable validity checked - [md-server] [2025-01-24 06:23:44] [INFO] Database initialization completed - [md-server] [2025-01-24 06:23:44] [INFO] Configuration file generated - ``` - - `$SEAFILE_VOLUME/seafile/logs/seafevents.log` - ```log - [2025-02-23 06:08:05] [INFO] seafevents.repo_metadata.index_worker:134 refresh_lock refresh_thread Starting refresh locks - [2025-02-23 06:08:05] [INFO] seafevents.repo_metadata.slow_task_handler:61 worker_handler slow_task_handler_thread_0 starting update metadata work - [2025-02-23 06:08:05] [INFO] seafevents.repo_metadata.slow_task_handler:61 worker_handler slow_task_handler_thread_1 starting update metadata work - [2025-02-23 06:08:05] [INFO] seafevents.repo_metadata.slow_task_handler:61 worker_handler slow_task_handler_thread_2 starting update metadata work - ``` -` +## Verify Metadata server and enable it in the Seafile + +1. Check container log for `seafile-md-server`, you can see the following message if it runs fine: + + ``` + $docker logs -f seafile-md-server + + [md-server] [2025-03-27 02:30:55] [INFO] Created data links + [md-server] [2025-03-27 02:30:55] [INFO] Database initialization completed + [md-server] [2025-03-27 02:30:55] [INFO] Starting Metadata server + ``` +2. Check the `seafevents.log` and `seahub.log`, as you can see the following information in `seafevents.log` and **no error log** is reported in `seahub.log`: + + ```log + [2025-02-23 06:08:05] [INFO] seafevents.repo_metadata.index_worker:134 refresh_lock refresh_thread Starting refresh locks + [2025-02-23 06:08:05] [INFO] seafevents.repo_metadata.slow_task_handler:61 worker_handler slow_task_handler_thread_0 starting update metadata work + [2025-02-23 06:08:05] [INFO] seafevents.repo_metadata.slow_task_handler:61 worker_handler slow_task_handler_thread_1 starting update metadata work + [2025-02-23 06:08:05] [INFO] seafevents.repo_metadata.slow_task_handler:61 worker_handler slow_task_handler_thread_2 starting update metadata work + ``` + +3. Switch ***Enable extended properties*** in button ***Settings*** + + ![md-server-des-1](../images/md-server-des-1.png) + +3. Finally, you can see the metadata of your library in ***views*** tab + + ![md-server-des-2](../images/md-server-des-2.png) ## Directory structure diff --git a/manual/images/md-server-des-1.png b/manual/images/md-server-des-1.png new file mode 100644 index 00000000..4f54115f Binary files /dev/null and b/manual/images/md-server-des-1.png differ diff --git a/manual/images/md-server-des-2.png b/manual/images/md-server-des-2.png new file mode 100644 index 00000000..37acf660 Binary files /dev/null and b/manual/images/md-server-des-2.png differ diff --git a/manual/repo/docker/ce/env b/manual/repo/docker/ce/env index 6a070b25..75046ad2 100644 --- a/manual/repo/docker/ce/env +++ b/manual/repo/docker/ce/env @@ -1,26 +1,47 @@ +################################# +# Docker compose configurations # +################################# COMPOSE_FILE='seafile-server.yml,caddy.yml,seadoc.yml' COMPOSE_PATH_SEPARATOR=',' -# Seafile & Basic services - -## Images +## Images ## SEAFILE_IMAGE=seafileltd/seafile-mc:13.0-latest SEAFILE_DB_IMAGE=mariadb:10.11 SEAFILE_REDIS_IMAGE=redis SEAFILE_CADDY_IMAGE=lucaslorentz/caddy-docker-proxy:2.9-alpine +SEADOC_IMAGE=seafileltd/sdoc-server:1.0-latest +NOTIFICATION_SERVER_IMAGE=seafileltd/notification-server:12.0-latest +MD_IMAGE=seafileltd/seafile-md-server:latest -## Persistent Storage -SEAFILE_VOLUME=/opt/seafile-data -SEAFILE_MYSQL_VOLUME=/opt/seafile-mysql/db -SEAFILE_CADDY_VOLUME=/opt/seafile-caddy +## Persistent Storage ## +BASIC_STORAGE_PATH=/opt +SEAFILE_VOLUME=$BASIC_STORAGE_PATH/seafile-data +SEAFILE_MYSQL_VOLUME=$BASIC_STORAGE_PATH/seafile-mysql/db +SEAFILE_CADDY_VOLUME=$BASIC_STORAGE_PATH/seafile-caddy +SEADOC_VOLUME=$BASIC_STORAGE_PATH/seadoc-data +NOTIFICATION_SERVER_VOLUME=$BASIC_STORAGE_PATH/notification-data -## Database +################################# +# Startup parameters # +################################# +SEAFILE_SERVER_HOSTNAME=seafile.example.com +SEAFILE_SERVER_PROTOCOL=http +TIME_ZONE=Etc/UTC +JWT_PRIVATE_KEY= + +##################################### +# Third-party service configuration # +##################################### + +## Database ## SEAFILE_MYSQL_DB_HOST=db -INIT_SEAFILE_MYSQL_ROOT_PASSWORD=ROOT_PASSWORD SEAFILE_MYSQL_DB_USER=seafile SEAFILE_MYSQL_DB_PASSWORD=PASSWORD +SEAFILE_MYSQL_DB_CCNET_DB_NAME=ccnet_db +SEAFILE_MYSQL_DB_SEAFILE_DB_NAME=seafile_db +SEAFILE_MYSQL_DB_SEAHUB_DB_NAME=seahub_db -## Cache +## Cache ## CACHE_PROVIDER=redis # or memcached ### Redis @@ -32,25 +53,22 @@ REDIS_PASSWORD= MEMCACHED_SERVER=memcached MEMCACHED_PORT=11211 -## Scheme -SEAFILE_SERVER_HOSTNAME=seafile.example.com -SEAFILE_SERVER_PROTOCOL=http +###################################### +# Initial variables # +# (Only valid in first-time startup) # +###################################### -## Startup parameters -TIME_ZONE=Etc/UTC -JWT_PRIVATE_KEY= +## Database root password ## +## Used to create Seafile users ## +INIT_SEAFILE_MYSQL_ROOT_PASSWORD=ROOT_PASSWORD - -## Initial variables (can be removed after firstime startup) +## Seafile admin user ## INIT_SEAFILE_ADMIN_EMAIL=me@example.com INIT_SEAFILE_ADMIN_PASSWORD=asecret -# Extension -## SeaDoc service -ENABLE_SEADOC=true -SEADOC_IMAGE=seafileltd/sdoc-server:1.0-latest -SEADOC_VOLUME=/opt/seadoc-data +############################################ +# Additional configurations for extensions # +############################################ -## Notification server -NOTIFICATION_SERVER_IMAGE=seafileltd/notification-server:12.0-latest -NOTIFICATION_SERVER_VOLUME=/opt/notification-data +## SeaDoc service ## +ENABLE_SEADOC=true diff --git a/manual/repo/docker/cluster/env b/manual/repo/docker/cluster/env index 3c2f5a0c..d16ccc91 100644 --- a/manual/repo/docker/cluster/env +++ b/manual/repo/docker/cluster/env @@ -1,41 +1,65 @@ +################################# +# Docker compose configurations # +################################# COMPOSE_FILE='seafile-server.yml' COMPOSE_PATH_SEPARATOR=',' SEAFILE_IMAGE=seafileltd/seafile-pro-mc:13.0-latest SEAFILE_VOLUME=/opt/seafile/shared + +################################# +# Startup parameters # +################################# SEAFILE_SERVER_HOSTNAME=seafile.example.com SEAFILE_SERVER_PROTOCOL=http - -# mysql -SEAFILE_MYSQL_DB_HOST= -INIT_SEAFILE_MYSQL_ROOT_PASSWORD= -SEAFILE_MYSQL_DB_USER=seafile -SEAFILE_MYSQL_DB_PASSWORD= - -# Cluster -CLUSTER_INIT_MODE=true # if you have the configurations file, please set to false -CLUSTER_INIT_MEMCACHED_HOST= # only valid in config init -CLUSTER_INIT_ES_HOST= # only valid in config init -CLUSTER_INIT_ES_PORT=9200 # only valid in config init - +TIME_ZONE=UTC +JWT_PRIVATE_KEY= CLUSTER_MODE=frontend # backend for backend node -# Seafile admin +##################################### +# Third-party service configuration # +##################################### + +# mysql +## Database ## +SEAFILE_MYSQL_DB_HOST=db +SEAFILE_MYSQL_DB_USER=seafile +SEAFILE_MYSQL_DB_PASSWORD=PASSWORD +SEAFILE_MYSQL_DB_CCNET_DB_NAME=ccnet_db +SEAFILE_MYSQL_DB_SEAFILE_DB_NAME=seafile_db +SEAFILE_MYSQL_DB_SEAHUB_DB_NAME=seahub_db + +###################################### +# Initial variables # +# (Only valid in first-time startup) # +###################################### + +## Cluster init ## +CLUSTER_INIT_MODE=true # set to false after finishing initial progress +CLUSTER_INIT_MEMCACHED_HOST= +CLUSTER_INIT_ES_HOST= +CLUSTER_INIT_ES_PORT=9200 + +## Database root password ## +## Used to create Seafile users ## +INIT_SEAFILE_MYSQL_ROOT_PASSWORD=ROOT_PASSWORD + +## Seafile admin user ## INIT_SEAFILE_ADMIN_EMAIL=me@example.com INIT_SEAFILE_ADMIN_PASSWORD=asecret -# Time zone -TIME_ZONE=UTC +## Init S3 configurations ## +INIT_S3_STORAGE_BACKEND_CONFIG=false -# S3 storage backend (the below configurations are only valid in configuration - files initial mode) -INIT_S3_STORAGE_BACKEND_CONFIG=false # if you use S3 as backend storage, please set to true -INIT_S3_COMMIT_BUCKET= -INIT_S3_FS_BUCKET= -INIT_S3_BLOCK_BUCKET= +################################# +# S3 Storage Backend (optional) # +################################# + +## S3 authorization ## INIT_S3_KEY_ID= INIT_S3_SECRET_KEY= INIT_S3_USE_V4_SIGNATURE=true +INIT_S3_PATH_STYLE_REQUEST=true # false for AWS INIT_S3_AWS_REGION=us-east-1 INIT_S3_HOST=s3.us-east-1.amazonaws.com INIT_S3_USE_HTTPS=true - -JWT_PRIVATE_KEY= \ No newline at end of file +INIT_S3_SSE_C_KEY= diff --git a/manual/repo/docker/cluster/seafile-server.yml b/manual/repo/docker/cluster/seafile-server.yml index a969ae32..857cb39b 100644 --- a/manual/repo/docker/cluster/seafile-server.yml +++ b/manual/repo/docker/cluster/seafile-server.yml @@ -36,6 +36,8 @@ services: - INIT_S3_AWS_REGION=${INIT_S3_AWS_REGION:-us-east-1} - INIT_S3_HOST=${INIT_S3_HOST:-s3.us-east-1.amazonaws.com} - INIT_S3_USE_HTTPS=${INIT_S3_USE_HTTPS:-true} + - INIT_S3_PATH_STYLE_REQUEST=${INIT_S3_PATH_STYLE_REQUEST:-false} + - INIT_S3_SSE_C_KEY=${INIT_S3_SSE_C_KEY:-} - JWT_PRIVATE_KEY=${JWT_PRIVATE_KEY:?Variable is not set or empty} - SEAFILE_LOG_TO_STDOUT=${SEAFILE_LOG_TO_STDOUT:-false} - SITE_ROOT=${SITE_ROOT:-/} diff --git a/manual/repo/docker/pro/env b/manual/repo/docker/pro/env index d538e0a4..12b12cac 100644 --- a/manual/repo/docker/pro/env +++ b/manual/repo/docker/pro/env @@ -1,28 +1,53 @@ +################################# +# Docker compose configurations # +################################# COMPOSE_FILE='seafile-server.yml,caddy.yml,seadoc.yml,elasticsearch.yml' COMPOSE_PATH_SEPARATOR=',' -# Seafile & Basic services - -## Images +## Images ## SEAFILE_IMAGE=seafileltd/seafile-pro-mc:13.0-latest SEAFILE_DB_IMAGE=mariadb:10.11 SEAFILE_REDIS_IMAGE=redis SEAFILE_ELASTICSEARCH_IMAGE=elasticsearch:8.15.0 SEAFILE_CADDY_IMAGE=lucaslorentz/caddy-docker-proxy:2.9-alpine +SEADOC_IMAGE=seafileltd/sdoc-server:1.0-latest +NOTIFICATION_SERVER_IMAGE=seafileltd/notification-server:12.0-latest +#SEASEARCH_IMAGE=seafileltd/seasearch-nomkl:latest # Apple's Chip for SeaSearch +SEASEARCH_IMAGE=seafileltd/seasearch:latest +MD_IMAGE=seafileltd/seafile-md-server:latest -## Persistent Storage -SEAFILE_VOLUME=/opt/seafile-data -SEAFILE_MYSQL_VOLUME=/opt/seafile-mysql/db -SEAFILE_ELASTICSEARCH_VOLUME=/opt/seafile-elasticsearch/data -SEAFILE_CADDY_VOLUME=/opt/seafile-caddy +## Persistent Storage ## +BASIC_STORAGE_PATH=/opt +SEAFILE_VOLUME=$BASIC_STORAGE_PATH/seafile-data +SEAFILE_MYSQL_VOLUME=$BASIC_STORAGE_PATH/seafile-mysql/db +SEAFILE_ELASTICSEARCH_VOLUME=$BASIC_STORAGE_PATH/seafile-elasticsearch/data +SEAFILE_CADDY_VOLUME=$BASIC_STORAGE_PATH/seafile-caddy +NOTIFICATION_SERVER_VOLUME=$BASIC_STORAGE_PATH/notification-data +SS_DATA_PATH=$BASIC_STORAGE_PATH/seasearch-data +SEADOC_VOLUME=$BASIC_STORAGE_PATH/seadoc-data -## Database +################################# +# Startup parameters # +################################# +SEAFILE_SERVER_HOSTNAME=seafile.example.com +SEAFILE_SERVER_PROTOCOL=http +TIME_ZONE=Etc/UTC +JWT_PRIVATE_KEY= + +##################################### +# Third-party service configuration # +##################################### + +## Database ## SEAFILE_MYSQL_DB_HOST=db SEAFILE_MYSQL_DB_USER=seafile SEAFILE_MYSQL_DB_PASSWORD=PASSWORD +SEAFILE_MYSQL_DB_CCNET_DB_NAME=ccnet_db +SEAFILE_MYSQL_DB_SEAFILE_DB_NAME=seafile_db +SEAFILE_MYSQL_DB_SEAHUB_DB_NAME=seahub_db -## Cache -CACHE_PROVIDER=redis # or memcached +## Cache ## +CACHE_PROVIDER=redis # options: redis (recommend), memcached ### Redis REDIS_SERVER=redis @@ -33,75 +58,92 @@ REDIS_PASSWORD= MEMCACHED_SERVER=memcached MEMCACHED_PORT=11211 -## Scheme -SEAFILE_SERVER_HOSTNAME=seafile.example.com -SEAFILE_SERVER_PROTOCOL=http +########################################### +# Default S3 authorization Configurations # +########################################### -## Startup parameters -TIME_ZONE=Etc/UTC -JWT_PRIVATE_KEY= +DEFAULT_S3_KEY_ID= +DEFAULT_S3_SECRET_KEY= +DEFAULT_S3_USE_V4_SIGNATURE=true +DEFAULT_S3_PATH_STYLE_REQUEST=true # false for AWS +DEFAULT_S3_AWS_REGION=us-east-1 +DEFAULT_S3_HOST=s3.us-east-1.amazonaws.com +DEFAULT_S3_USE_HTTPS=true +DEFAULT_S3_SSE_C_KEY= -## Initial variables (can be removed after firstime startup) +###################################### +# Initial variables # +# (Only valid in first-time startup) # +###################################### -### Database root password +## Database root password ## +## Used to create Seafile users ## INIT_SEAFILE_MYSQL_ROOT_PASSWORD=ROOT_PASSWORD -### Seafile admin user +## Seafile admin user ## INIT_SEAFILE_ADMIN_EMAIL=me@example.com INIT_SEAFILE_ADMIN_PASSWORD=asecret -### S3 +## SeaSearch admin user ## +## (valid in enabling SeaSearch and use Seafile admin by default) ## +INIT_SS_ADMIN_USER=$INIT_SEAFILE_ADMIN_EMAIL +INIT_SS_ADMIN_PASSWORD=$INIT_SEAFILE_ADMIN_PASSWORD + +## Init S3 configurations ## INIT_S3_STORAGE_BACKEND_CONFIG=false -INIT_S3_COMMIT_BUCKET= -INIT_S3_FS_BUCKET= -INIT_S3_BLOCK_BUCKET= -INIT_S3_KEY_ID= -INIT_S3_SECRET_KEY= -INIT_S3_USE_V4_SIGNATURE=true -INIT_S3_AWS_REGION=us-east-1 -INIT_S3_HOST=s3.us-east-1.amazonaws.com -INIT_S3_USE_HTTPS=true +INIT_S3_COMMIT_BUCKET= +INIT_S3_FS_BUCKET= +INIT_S3_BLOCK_BUCKET= +INIT_S3_KEY_ID=$DEFAULT_S3_KEY_ID +INIT_S3_SECRET_KEY=$DEFAULT_S3_SECRET_KEY +INIT_S3_USE_V4_SIGNATURE=$DEFAULT_S3_USE_V4_SIGNATURE +INIT_S3_PATH_STYLE_REQUEST=$DEFAULT_S3_PATH_STYLE_REQUEST # false for AWS +INIT_S3_AWS_REGION=$DEFAULT_S3_AWS_REGION +INIT_S3_HOST=$DEFAULT_S3_HOST +INIT_S3_USE_HTTPS=$DEFAULT_S3_USE_HTTPS +INIT_S3_SSE_C_KEY=$DEFAULT_S3_SSE_C_KEY +############################################ +# Additional configurations for extensions # +############################################ -# Extension -## SeaDoc service +## SeaDoc service ## ENABLE_SEADOC=true -SEADOC_IMAGE=seafileltd/sdoc-server:1.0-latest -SEADOC_VOLUME=/opt/seadoc-data -## Notification server -NOTIFICATION_SERVER_IMAGE=seafileltd/notification-server:12.0-latest -NOTIFICATION_SERVER_VOLUME=/opt/notification-data +## SeaSearch ## -## SeaSearch +### Storage type +SS_STORAGE_TYPE=disk # options: disk (local disk), s3 -### Image -#SEASEARCH_IMAGE=seafileltd/seasearch-nomkl:latest # Apple's Chip -SEASEARCH_IMAGE=seafileltd/seasearch:latest - -### Storage -SS_STORAGE_TYPE=disk # disk (local storage), s3, oss - -#### Local storage mode -SS_DATA_PATH=/opt/seasearch-data # Persistent storage path +### Local cache SS_MAX_OBJ_CACHE_SIZE=10GB -#### S3 mode -SS_S3_USE_V4_SIGNATURE=false -SS_S3_ACCESS_ID= -SS_S3_ACCESS_SECRET= -SS_S3_ENDPOINT=s3.us-east-1.amazonaws.com -SS_S3_BUCKET= -SS_S3_USE_HTTPS=true -SS_S3_PATH_STYLE_REQUEST=true -SS_S3_AWS_REGION=us-east-1 -SS_S3_SSE_C_KEY= +### S3 +SS_S3_BUCKET= +SS_S3_USE_V4_SIGNATURE=$DEFAULT_S3_USE_V4_SIGNATURE +SS_S3_ACCESS_ID=$DEFAULT_S3_KEY_ID +SS_S3_ACCESS_SECRET=$DEFAULT_S3_SECRET_KEY +SS_S3_ENDPOINT=$DEFAULT_S3_HOST +SS_S3_USE_HTTPS=$DEFAULT_S3_USE_HTTPS +SS_S3_PATH_STYLE_REQUEST=$DEFAULT_S3_PATH_STYLE_REQUEST +SS_S3_AWS_REGION=$DEFAULT_S3_AWS_REGION +SS_S3_SSE_C_KEY=$DEFAULT_S3_SSE_C_KEY ### Log SS_LOG_TO_STDOUT=false SS_LOG_OUTPUT=true SS_LOG_LEVEL=info -### Initial variables (can be removed after firstime startup SeaSearch service) -INIT_SS_ADMIN_USER= -INIT_SS_ADMIN_PASSWORD= +## Metadata server ## +MD_STORAGE_TYPE=file # options: file (local disk), s3, oss + +### S3 +MD_S3_BUCKET= +MD_S3_HOST=$DEFAULT_S3_HOST +MD_S3_AWS_REGION=$DEFAULT_S3_AWS_REGION +MD_S3_USE_HTTPS=$DEFAULT_S3_USE_HTTPS +MD_S3_PATH_STYLE_REQUEST=$DEFAULT_S3_PATH_STYLE_REQUEST +MD_S3_KEY_ID=$DEFAULT_S3_KEY_ID +MD_S3_KEY=$DEFAULT_S3_SECRET_KEY +MD_S3_USE_V4_SIGNATURE=$DEFAULT_S3_USE_V4_SIGNATURE +MD_S3_SSE_C_KEY=$DEFAULT_S3_SSE_C_KEY diff --git a/manual/repo/docker/pro/seafile-server.yml b/manual/repo/docker/pro/seafile-server.yml index 71eb279b..e270bebe 100644 --- a/manual/repo/docker/pro/seafile-server.yml +++ b/manual/repo/docker/pro/seafile-server.yml @@ -75,8 +75,10 @@ services: - INIT_S3_SECRET_KEY=${INIT_S3_SECRET_KEY:-} - INIT_S3_USE_V4_SIGNATURE=${INIT_S3_USE_V4_SIGNATURE:-true} - INIT_S3_AWS_REGION=${INIT_S3_AWS_REGION:-us-east-1} - - INIT_S3_HOST=${INIT_S3_HOST:-us-east-1} + - INIT_S3_HOST=${INIT_S3_HOST:-s3.us-east-1.amazonaws.com} - INIT_S3_USE_HTTPS=${INIT_S3_USE_HTTPS:-true} + - INIT_S3_PATH_STYLE_REQUEST=${INIT_S3_PATH_STYLE_REQUEST:-false} + - INIT_S3_SSE_C_KEY=${INIT_S3_SSE_C_KEY:-} labels: caddy: ${SEAFILE_SERVER_PROTOCOL:-http}://${SEAFILE_SERVER_HOSTNAME:?Variable is not set or empty} caddy.reverse_proxy: "{{upstreams 80}}" diff --git a/manual/setup/setup_ce_by_docker.md b/manual/setup/setup_ce_by_docker.md index d408409d..dd97cd9f 100644 --- a/manual/setup/setup_ce_by_docker.md +++ b/manual/setup/setup_ce_by_docker.md @@ -66,6 +66,9 @@ Start Seafile server with the following command docker compose up -d ``` +!!! warning "ERROR: Named volume "xxx" is used in service "xxx" but no declaration was found in the volumes section" + You may encounter this problem when your Docker (or docker-compose) version is out of date. You can upgrade or reinstall the Docker service to solve this problem according to the `Docker official documentation` + !!! note You must run the above command in the directory with the `.env`. If `.env` file is elsewhere, please run diff --git a/manual/setup/setup_pro_by_docker.md b/manual/setup/setup_pro_by_docker.md index db27a998..18def51c 100644 --- a/manual/setup/setup_pro_by_docker.md +++ b/manual/setup/setup_pro_by_docker.md @@ -74,15 +74,30 @@ The following fields merit particular attention: | `INIT_SEAFILE_ADMIN_EMAIL` | Synchronously set admin username during initialization | me@example.com | | `INIT_SEAFILE_ADMIN_PASSWORD` | Synchronously set admin password during initialization | asecret | | `INIT_S3_STORAGE_BACKEND_CONFIG` | Whether to configure S3 storage backend synchronously during initialization (i.e., the following variables with prefix `INIT_S3_*`, for more details, please refer to [AWS S3](./setup_with_s3.md)) | false | -| `INIT_S3_COMMIT_BUCKET` | S3 storage backend commit objects bucket (only valid when `INIT_S3_STORAGE_BACKEND_CONFIG` sets to `true`) | (required when `INIT_S3_STORAGE_BACKEND_CONFIG` sets to `true`) | -| `INIT_S3_FS_BUCKET` | S3 storage backend fs objects bucket (only valid when `INIT_S3_STORAGE_BACKEND_CONFIG` sets to `true`) | (required when `INIT_S3_STORAGE_BACKEND_CONFIG` sets to `true`) | -| `INIT_S3_BLOCK_BUCKET` | S3 storage backend block objects bucket (only valid when `INIT_S3_STORAGE_BACKEND_CONFIG` sets to `true`) | (required when `INIT_S3_STORAGE_BACKEND_CONFIG` sets to `true`) | -| `INIT_S3_KEY_ID` | S3 storage backend key ID (only valid when `INIT_S3_STORAGE_BACKEND_CONFIG` sets to `true`) | (required when `INIT_S3_STORAGE_BACKEND_CONFIG` sets to `true`) | -| `INIT_S3_SECRET_KEY` | S3 storage backend secret key (only valid when `INIT_S3_STORAGE_BACKEND_CONFIG` sets to `true`) | (required when `INIT_S3_STORAGE_BACKEND_CONFIG` sets to `true`) | +| `INIT_S3_COMMIT_BUCKET` | S3 storage backend commit objects bucket | (required when `INIT_S3_STORAGE_BACKEND_CONFIG` sets to `true`) | +| `INIT_S3_FS_BUCKET` | S3 storage backend fs objects bucket | (required when `INIT_S3_STORAGE_BACKEND_CONFIG` sets to `true`) | +| `INIT_S3_BLOCK_BUCKET` | S3 storage backend block objects bucket | (required when `INIT_S3_STORAGE_BACKEND_CONFIG` sets to `true`) | +| `INIT_S3_KEY_ID` | S3 storage backend key ID | (required when `INIT_S3_STORAGE_BACKEND_CONFIG` sets to `true`) | +| `INIT_S3_SECRET_KEY` | S3 storage backend secret key | (required when `INIT_S3_STORAGE_BACKEND_CONFIG` sets to `true`) | | `INIT_S3_USE_V4_SIGNATURE` | Use the v4 protocol of S3 if enabled (only valid when `INIT_S3_STORAGE_BACKEND_CONFIG` sets to `true`) | `true` | -| `INIT_S3_AWS_REGION` | Region of your buckets (only valid when `INIT_S3_STORAGE_BACKEND_CONFIG` and `INIT_S3_USE_V4_SIGNATURE` sets to `true`) | `us-east-1` | -| `INIT_S3_HOST` | Host of your buckets (only valid when `INIT_S3_STORAGE_BACKEND_CONFIG` and `INIT_S3_USE_V4_SIGNATURE` sets to `true`) | `s3.us-east-1.amazonaws.com` | +| `INIT_S3_AWS_REGION` | Region of your buckets (only valid when you use the AWS' S3) | `us-east-1` | +| `INIT_S3_HOST` | Host of your buckets (only valid when `INIT_S3_USE_V4_SIGNATURE` sets to `true`) | `s3.us-east-1.amazonaws.com` | | `INIT_S3_USE_HTTPS` | Use HTTPS connections to S3 if enabled (only valid when `INIT_S3_STORAGE_BACKEND_CONFIG` sets to `true`) | `true` | +| `INIT_S3_PATH_STYLE_REQUEST` | This option asks Seafile to use URLs like `https://192.168.1.123:8080/bucketname/object` to access objects. In *Amazon S3*, the default URL format is in virtual host style, such as `https://bucketname.s3.amazonaws.com/object`. But this style relies on advanced DNS server setup. So most self-hosted storage systems only implement the path style format. | `false` | +| `INIT_S3_SSE_C_KEY` | A string of 32 characters can be generated by openssl rand -base64 24. It can be any 32-character long random string. It's required to use V4 authentication protocol and https if you enable SSE-C. | (none) | + +!!! success "Easier to configure S3 for Seafile and its components" + Since Seafile Pro 13.0, in order to facilitate users to deploy Seafile's related extension components and other services in the future, a section will be provided in `.env` to store the **default S3 authorization information configuration**. You can locate it with the following title bar: + + ```sh + ########################################### + # Default S3 authorization Configurations # + ########################################### + ``` + + The S3 authorization configuration part (i.e., ***without buckets name***) in Seafile initialization and some extension components (such as *SeaSearch*, *Metadata server*) configuration will be read from this configuration by default. + + By the way, you can also manually modify the S3 configurations for specific service (this is the situation when you have selected different S3 service providers for these components). To conclude, set the directory permissions of the Elasticsearch volumne: @@ -99,6 +114,10 @@ Run docker compose in detached mode: docker compose up -d ``` +!!! warning "ERROR: Named volume "xxx" is used in service "xxx" but no declaration was found in the volumes section" + You may encounter this problem when your Docker (or docker-compose) version is out of date. You can upgrade or reinstall the Docker service to solve this problem according to the `Docker official documentation` + + !!! note You must run the above command in the directory with the `.env`. If `.env` file is elsewhere, please run diff --git a/manual/setup/use_seasearch.md b/manual/setup/use_seasearch.md index 425ac9be..63628712 100644 --- a/manual/setup/use_seasearch.md +++ b/manual/setup/use_seasearch.md @@ -20,7 +20,7 @@ wget https://manual.seafile.com/13.0/repo/docker/pro/seasearch.yml ## Modify `.env` -We have configured the relevant variables in .env. Here you must pay special attention to the following variable information, which will affect the SeaSearch initialization process. For variables in `.env` of SeaSearch service, please refer [here](https://seasearch-manual.seafile.com/config/) for the details. We use `/opt/seasearch-data` as the persistent directory of SeaSearch: +We have configured the relevant variables in .env. Here you must pay special attention to the following variable information, which will affect the SeaSearch initialization process. For variables in `.env` of SeaSearch service, please refer [here](https://seasearch-manual.seafile.com/config/) for the details. We use `/opt/seasearch-data` as the persistent directory of SeaSearch (the information of administrator are same as Seafile's admin by default from Seafile 13): !!! warning "For Apple's Chips" Since Apple's chips (such as M2) do not support [MKL](https://www.intel.com/content/www/us/en/developer/tools/oneapi/onemkl.html), you need to set the relevant image to `xxx-nomkl:latest`, e.g.: diff --git a/manual/upgrade/upgrade_docker.md b/manual/upgrade/upgrade_docker.md index b2f2ba94..7551699f 100644 --- a/manual/upgrade/upgrade_docker.md +++ b/manual/upgrade/upgrade_docker.md @@ -34,19 +34,45 @@ From Seafile Docker 13.0, the `elasticsearch.yml` has separated from `seafile-se wget https://manual.seafile.com/13.0/repo/docker/pro/seafile-server.yml ``` -4. From Seafile Docker 13.0 (**Pro**), the *ElasticSearch* service will be controlled by a separate resource file (i.e., `elasticsearch.yml`). If you are using Seafile Pro and still plan to use *ElasticSearch*, please download the `elasticsearch.yml` and update the `COMPOSE_FILE` list in `.env`: +4. From Seafile Docker 13.0 (**Pro**), the *ElasticSearch* service will be controlled by a separate resource file (i.e., `elasticsearch.yml`). If you are using Seafile Pro and still plan to use *ElasticSearch*, please download the `elasticsearch.yml` - - Download the `elasticsearch.yml`: + ```sh + wget https://manual.seafile.com/13.0/repo/docker/pro/elasticsearch.yml + ``` + +5. Modify `.env`, update image version and : + + !!! tip "About `.env`" + Normally you don't need to download the latest `.env` file during the upgrade process from Seafile 12 to 13, but we recommend that you download the latest version of the `.env` file, which is usually more concise and convenient for your subsequent configuration work. You can upgrade your `.env` file by following commands, but you must ensure that the configuration is exactly the same as the old `.env`: + + === "Seafile Pro" + + ```sh + mv .env .env.bak + wget -O .env https://manual.seafile.com/13.0/repo/docker/pro/env + ``` + + === "Seafile CE" + + ```sh + mv .env .env.bak + wget -O .env https://manual.seafile.com/13.0/repo/docker/ce/env + ``` + + + === "Seafile Pro" ```sh - wget https://manual.seafile.com/13.0/repo/docker/pro/elasticsearch.yml + COMPOSE_FILE='...,elasticsearch.yml' # add `elasticsearch.yml` if you are still using ElasticSearch + SEAFILE_IMAGE=seafileltd/seafile-pro-mc:13.0-latest ``` - - Modify `.env` to add `elasticsearch.yml` in `COMPOSE_FILE` list: + === "Seafile CE" + ```sh + SEAFILE_IMAGE=seafileltd/seafile-mc:13.0-latest ``` - COMPOSE_FILE='...,elasticsearch.yml' - ``` + 5. Since Seafile 13, Redis will be recommended as the primary cache server for supporting some new features (please refer the ***upgradte notes***, you can also refer to more details about Redis in Seafile Docker [here](../setup/setup_pro_by_docker.md#about-redis)) and can be configured directly from environment variables. So you should modify `.env`, add or modify the following fields: