mirror of
https://github.com/haiwen/seafile-admin-docs.git
synced 2025-12-25 18:22:48 +00:00
perf: Optimize the deployment process and improve user experience (#492)
* perf: Optimize the deployment process and improve user experience * revert: SEAFILE_S3_ -> INIT_S3_ * fix(seafile-server.yml): default value for INIT_S3_HOST * docs: add descriptions for new env * adjust deployment documentation
This commit is contained in:
parent
0c3c31c49c
commit
7a9cbd01a6
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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=<your md data bucket name>
|
||||
MD_S3_HOST=<your s3 host>
|
||||
MD_S3_AWS_REGION=<your aws region> # only needed for AWS
|
||||
MD_S3_USE_HTTPS=true
|
||||
MD_S3_PATH_STYLE_REQUEST=false
|
||||
MD_S3_KEY_ID=<your s3 key id>
|
||||
MD_S3_KEY=<your 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 = '<your JWT key> '
|
||||
METADATA_SERVER_SECRET_KEY = '<your JWT key>'
|
||||
METADATA_SERVER_URL = 'http://seafile-md-server:8084'
|
||||
```
|
||||
=== "Standalone"
|
||||
```py
|
||||
ENABLE_METADATA_MANAGEMENT = True
|
||||
METADATA_SERVER_SECRET_KEY = '<your JWT key> '
|
||||
METADATA_SERVER_SECRET_KEY = '<your JWT key>'
|
||||
METADATA_SERVER_URL = 'http://<your metadata-server host>: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***
|
||||
|
||||

|
||||
|
||||
3. Finally, you can see the metadata of your library in ***views*** tab
|
||||
|
||||

|
||||
|
||||
## Directory structure
|
||||
|
||||
|
|
|
|||
Binary file not shown.
|
After Width: | Height: | Size: 105 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 119 KiB |
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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=<your MySQL host>
|
||||
INIT_SEAFILE_MYSQL_ROOT_PASSWORD=<your MySQL root password>
|
||||
SEAFILE_MYSQL_DB_USER=seafile
|
||||
SEAFILE_MYSQL_DB_PASSWORD=<MySQL password for user seafile>
|
||||
|
||||
# Cluster
|
||||
CLUSTER_INIT_MODE=true # if you have the configurations file, please set to false
|
||||
CLUSTER_INIT_MEMCACHED_HOST=<your memcached host> # only valid in config init
|
||||
CLUSTER_INIT_ES_HOST=<your elasticsearch server HOST> # only valid in config init
|
||||
CLUSTER_INIT_ES_PORT=9200 # only valid in config init
|
||||
|
||||
TIME_ZONE=UTC
|
||||
JWT_PRIVATE_KEY=<your 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=<your memcached host>
|
||||
CLUSTER_INIT_ES_HOST=<your elasticsearch server 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=<your-commit-objects>
|
||||
INIT_S3_FS_BUCKET=<your-fs-objects>
|
||||
INIT_S3_BLOCK_BUCKET=<your-block-objects>
|
||||
#################################
|
||||
# S3 Storage Backend (optional) #
|
||||
#################################
|
||||
|
||||
## S3 authorization ##
|
||||
INIT_S3_KEY_ID=<your-key-id>
|
||||
INIT_S3_SECRET_KEY=<your-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=<your jwt private key>
|
||||
INIT_S3_SSE_C_KEY=
|
||||
|
|
|
|||
|
|
@ -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:-/}
|
||||
|
|
|
|||
|
|
@ -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=<your-key-id>
|
||||
DEFAULT_S3_SECRET_KEY=<your-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=<your-commit-objects>
|
||||
INIT_S3_FS_BUCKET=<your-fs-objects>
|
||||
INIT_S3_BLOCK_BUCKET=<your-block-objects>
|
||||
INIT_S3_KEY_ID=<your-key-id>
|
||||
INIT_S3_SECRET_KEY=<your-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=<your commit bucket name>
|
||||
INIT_S3_FS_BUCKET=<your fs bucket name>
|
||||
INIT_S3_BLOCK_BUCKET=<your block bucket name>
|
||||
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=<your access id>
|
||||
SS_S3_ACCESS_SECRET=<your access secret>
|
||||
SS_S3_ENDPOINT=s3.us-east-1.amazonaws.com
|
||||
SS_S3_BUCKET=<your bucket name>
|
||||
SS_S3_USE_HTTPS=true
|
||||
SS_S3_PATH_STYLE_REQUEST=true
|
||||
SS_S3_AWS_REGION=us-east-1
|
||||
SS_S3_SSE_C_KEY=<your SSE-C key>
|
||||
### S3
|
||||
SS_S3_BUCKET=<your seasearch bucket name>
|
||||
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=<admin-username>
|
||||
INIT_SS_ADMIN_PASSWORD=<admin-password>
|
||||
## Metadata server ##
|
||||
MD_STORAGE_TYPE=file # options: file (local disk), s3, oss
|
||||
|
||||
### S3
|
||||
MD_S3_BUCKET=<your metadata bucket name>
|
||||
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
|
||||
|
|
|
|||
|
|
@ -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}}"
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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.:
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue