diff --git a/manual/config/env.md b/manual/config/env.md index 5f7ccea2..c9c3a3ec 100644 --- a/manual/config/env.md +++ b/manual/config/env.md @@ -129,3 +129,7 @@ NOTIFICATION_SERVER_VOLUME=/opt/notification-data - `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` + +## SeaSearch + +For configurations about SeaSearch in `.env`, please refer [here](https://haiwen.github.io/seasearch-docs/config/) for the details diff --git a/manual/config/seafevents-conf.md b/manual/config/seafevents-conf.md index 7c666e81..30354536 100644 --- a/manual/config/seafevents-conf.md +++ b/manual/config/seafevents-conf.md @@ -104,5 +104,11 @@ password = q!1w@#123 enabled = true # Default is false, when enabled, users can use file auto deletion feature interval = 86400 # The unit is second(s), the default frequency is one day, that is, it runs once a day +[SEASEARCH] +enabled = true # Default is false, when enabled, seafile can use SeaSearch as the search engine +seasearch_url = http://seasearch:4080 # If your SeaSearch server deploy on another machine, replace it to the truth address +seasearch_token = # base64 code consist of `username:password` +interval = 10m # The interval the search index is updated. Can be s(seconds), m(minutes), h(hours), d(days) + ``` diff --git a/manual/docker/pro/env b/manual/docker/pro/env index 965b6a6f..083fe3cb 100644 --- a/manual/docker/pro/env +++ b/manual/docker/pro/env @@ -1,32 +1,44 @@ COMPOSE_FILE='seafile-server.yml,caddy.yml' COMPOSE_PATH_SEPARATOR=',' +# Seafile & Basic services +## Images SEAFILE_IMAGE=seafileltd/seafile-pro-mc:12.0-latest SEAFILE_DB_IMAGE=mariadb:10.11 SEAFILE_MEMCACHED_IMAGE=memcached:1.6.29 SEAFILE_ELASTICSEARCH_IMAGE=elasticsearch:8.15.0 SEAFILE_CADDY_IMAGE=lucaslorentz/caddy-docker-proxy:2.9 +## 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 +## Database SEAFILE_MYSQL_DB_HOST=db -INIT_SEAFILE_MYSQL_ROOT_PASSWORD=ROOT_PASSWORD SEAFILE_MYSQL_DB_USER=seafile SEAFILE_MYSQL_DB_PASSWORD=PASSWORD -TIME_ZONE=Etc/UTC - -JWT_PRIVATE_KEY= - +## Scheme SEAFILE_SERVER_HOSTNAME=seafile.example.com SEAFILE_SERVER_PROTOCOL=http +## Startup parameters +TIME_ZONE=Etc/UTC +JWT_PRIVATE_KEY= + +## Initial variables (can be removed after firstime startup) + +### Database root password +INIT_SEAFILE_MYSQL_ROOT_PASSWORD=ROOT_PASSWORD + +### Seafile admin user INIT_SEAFILE_ADMIN_EMAIL=me@example.com INIT_SEAFILE_ADMIN_PASSWORD=asecret + +### S3 INIT_S3_STORAGE_BACKEND_CONFIG=false INIT_S3_COMMIT_BUCKET= INIT_S3_FS_BUCKET= @@ -38,13 +50,45 @@ INIT_S3_AWS_REGION=us-east-1 INIT_S3_HOST=s3.us-east-1.amazonaws.com INIT_S3_USE_HTTPS=true - +# SeaDoc service +ENABLE_SEADOC=false SEADOC_IMAGE=seafileltd/sdoc-server:1.0-latest SEADOC_VOLUME=/opt/seadoc-data - -ENABLE_SEADOC=false SEADOC_SERVER_URL=http://seafile.example.com/sdoc-server - +# Notification server NOTIFICATION_SERVER_IMAGE=seafileltd/notification-server:12.0-latest NOTIFICATION_SERVER_VOLUME=/opt/notification-data + +# SeaSearch + +## 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=./data # Persistent storage path +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= + +## Log +SeaSearch_LOG_TO_STDOUT=false +SS_LOG_OUTPUT=true +SS_LOG_LEVEL=debug + +## Initial variables (can be removed after firstime startup SeaSearch service) +INIT_SS_ADMIN_USER= +INIT_SS_ADMIN_PASSWORD= diff --git a/manual/docker/pro/seasearch.yml b/manual/docker/pro/seasearch.yml new file mode 100644 index 00000000..d3dc55ab --- /dev/null +++ b/manual/docker/pro/seasearch.yml @@ -0,0 +1,53 @@ +services: + seasearch: + image: ${SEASEARCH_IMAGE:-seafileltd/seasearch:latest} + container_name: seafile-seasearch + volumes: + - ${SS_DATA_PATH:-/opt/seasearch-data}:/opt/seasearch/data + environment: + - ZINC_FIRST_ADMIN_USER=${INIT_SS_ADMIN_USER:-} + - ZINC_FIRST_ADMIN_PASSWORD=${INIT_SS_ADMIN_PASSWORD:-} + - GIN_MODE=${GIN_MODE:-release} + - ZINC_WAL_ENABLE=${SS_WAL_ENABLE:-true} + - ZINC_STORAGE_TYPE=${SS_STORAGE_TYPE:-} + - ZINC_SHARD_NUM=${SS_SHARD_NUM:-} + - ZINC_MAX_OBJ_CACHE_SIZE=${SS_MAX_OBJ_CACHE_SIZE:-10GB} + - ZINC_S3_ACCESS_ID=${SS_S3_ACCESS_ID:-} + - ZINC_S3_USE_V4_SIGNATURE=${SS_S3_USE_V4_SIGNATURE:-false} + - ZINC_S3_ACCESS_SECRET=${SS_S3_ACCESS_SECRET:-} + - ZINC_S3_ENDPOINT=${SS_S3_ENDPOINT:-s3.us-east-1.amazonaws.com`} + - ZINC_S3_BUCKET=${SS_S3_BUCKET:-} + - ZINC_S3_USE_HTTPS=${SS_S3_USE_HTTPS:-true} + - ZINC_S3_PATH_STYLE_REQUEST=${SS_S3_PATH_STYLE_REQUEST:-true} + - ZINC_S3_AWS_REGION=${SS_S3_AWS_REGION:-us-east-1} + - ZINC_S3_SSE_C_KEY=${SS_S3_SSE_C_KEY:-} + - ZINC_SERVER_MODE=${SS_SERVER_MODE:-} + - ZINC_CLUSTER_ID=${SS_CLUSTER_ID:-} + - ZINC_ETCD_USERNAME=${SS_ETCD_USERNAME:-} + - ZINC_ETCD_PASSWORD=${SS_ETCD_PASSWORD:-} + - ZINC_CLUSTER_PROXY_LOG_DIR=${SS_CLUSTER_PROXY_LOG_DIR:-/opt/seasearch/data/log} + - ZINC_CLUSTER_PROXY_HOST=${SS_CLUSTER_PROXY_HOST:-0.0.0.0} + - ZINC_CLUSTER_PROXY_PORT=${SS_CLUSTER_PROXY_PORT:-4082} + - ZINC_ETCD_ENDPOINTS=${SS_ETCD_ENDPOINTS:-127.0.0.1:2379} + - ZINC_ETCD_PREFIX=${SS_ETCD_PREFIX:-/zinc} + - ZINC_MAX_DOCUMENT_SIZE=${SS_MAX_DOCUMENT_SIZE:-1m} + - ZINC_CLUSTER_MANAGER_ADDR=${SS_CLUSTER_MANAGER_ADDR:-127.0.0.1:4081} + - ZINC_CLUSTER_MANAGER_LOG_DIR=${SS_CLUSTER_MANAGER_LOG_DIR:-/opt/seasearch/data/log} + - ZINC_CLUSTER_MANAGER_HOST=${SS_CLUSTER_MANAGER_HOST:-0.0.0.0} + - ZINC_CLUSTER_MANAGER_PORT=${SS_CLUSTER_MANAGER_PORT:-4081} + - ZINC_CLUSTER_MANAGER_ETCD_ENDPOINTS=${SS_CLUSTER_MANAGER_ETCD_ENDPOINTS:-127.0.0.1:2379} + - ZINC_CLUSTER_MANAGER_ETCD_PREFIX=${SS_CLUSTER_MANAGER_ETCD_PREFIX:-/zinc} + - SeaSearch_LOG_TO_STDOUT=${SeaSearch_LOG_TO_STDOUT:-false} + - ZINC_LOG_OUTPUT=${SS_LOG_OUTPUT:-true} + - ZINC_LOG_DIR=${SS_LOG_DIR:-/opt/seasearch/data/log} + - ZINC_LOG_LEVEL=${SS_LOG_LEVEL:-debug} + - ZINC_PLUGIN_GSE_ENABLE = ${SS_PLUGIN_GSE_ENABLE:-false} + - ZINC_PLUGIN_GSE_DICT_EMBED = ${SS_PLUGIN_GSE_DICT_EMBED:-} + - ZINC_PLUGIN_GSE_DICT_PATH = ${SS_PLUGIN_GSE_DICT_PATH:-} + networks: + - seafile-net + + +networks: + seafile-net: + name: seafile-net diff --git a/manual/images/seasearch_console.png b/manual/images/seasearch_console.png new file mode 100644 index 00000000..41b7a45c Binary files /dev/null and b/manual/images/seasearch_console.png differ diff --git a/manual/setup/cluster_deploy_with_docker.md b/manual/setup/cluster_deploy_with_docker.md index 9b85c8f5..cd5dea93 100644 --- a/manual/setup/cluster_deploy_with_docker.md +++ b/manual/setup/cluster_deploy_with_docker.md @@ -39,9 +39,9 @@ Let's assume you have three nodes in your cluster: A, B, and C. !!! note "Prerequisites" - - We assume you have already deployed memory cache server (e.g., ***Memcached***), ***MariaDB***, ***ElasticSearch*** in separate machines and use ***S3*** like object storage. + - We assume you have already deployed memory cache server (e.g., ***Memcached***), ***MariaDB***, file indexer (e.g., ***ElasticSearch***, [*SeaSearch*](https://haiwen.github.io/seasearch-docs/)) in separate machines and use ***S3*** like object storage. - - Usually, each node of Seafile Cluster should have at least **2 cores** and **2G memory**. If the above services are deployed together with a node in the Seafile cluster, we recommend that you prepare **4 cores** and **4G memory** for the node (especially if ElasticSearch is also deployed on the node) + - Usually, each node of Seafile Cluster should have at least **2 cores** and **2G memory**. If the above services are deployed together with a node in the Seafile cluster especially ***ElasticSearch***, we recommend that you prepare **4 cores** and **4G memory** for that node Seafile Server: 2 frontend nodes, 1 backend node diff --git a/manual/setup/setup_pro_by_docker.md b/manual/setup/setup_pro_by_docker.md index 22046e19..db2ecc5c 100644 --- a/manual/setup/setup_pro_by_docker.md +++ b/manual/setup/setup_pro_by_docker.md @@ -4,23 +4,30 @@ This manual explains how to deploy and run Seafile Server Professional Edition ( ## Requirements -Seafile PE requires a minimum of 2 cores and 2GB RAM. +Seafile PE docker requires a minimum of 4 cores and 4GB RAM. !!! note "Other requirements for Seafile PE" - If Elasticsearch is installed on the same server, the minimum requirements are 4 cores and 4 GB RAM, and make sure the [mmapfs counts](https://www.elastic.co/guide/en/elasticsearch/reference/current/index-modules-store.html#mmapfs) do not cause excptions like out of memory, which can be increased by following command (see for futher details): + - **By default**, Seafile Pro will use ***Elasticsearch*** as the files indexer - ```shell - sysctl -w vm.max_map_count=262144 #run as root - ``` + Please make sure the [mmapfs counts](https://www.elastic.co/guide/en/elasticsearch/reference/current/index-modules-store.html#mmapfs) do not cause excptions like out of memory, which can be increased by following command (see for futher details): - or modify **/etc/sysctl.conf** and reboot to set this value permanently: + ```shell + sysctl -w vm.max_map_count=262144 #run as root + ``` - ```shell - nano /etc/sysctl.conf + or modify **/etc/sysctl.conf** and reboot to set this value permanently: - # modify vm.max_map_count - vm.max_map_count=262144 - ``` + ```shell + nano /etc/sysctl.conf + + # modify vm.max_map_count + vm.max_map_count=262144 + ``` + - If your machine **dose not** have enough requirements, 2 Cores and 2GB RAM are minimum by chosing one of following two ways **after first-time deployment** of Seafile Pro docker: + + - Use [*SeaSearch*](./use_seasearch.md), a lightweight search engine built on open source search engine [*ZincSearch*](https://zincsearch-docs.zinc.dev/), as the indexer + + - Deploy *Elasticsearch* in another machine, and modify `es_host` and `es_port` in [seafevents.conf](../config/seafevents-conf.md) !!! tip "About license" Seafile PE can be used without a paid license with up to three users. Licenses for more user can be purchased in the [Seafile Customer Center](https://customer.seafile.com) or contact Seafile Sales at [sales@seafile.com](mailto:sales@seafile.com). For futher details, please refer the [license page](../setup_binary/seafile_professional_sdition_software_license_agreement.md) of Seafile PE. diff --git a/manual/setup/use_seasearch.md b/manual/setup/use_seasearch.md new file mode 100644 index 00000000..430bfd9e --- /dev/null +++ b/manual/setup/use_seasearch.md @@ -0,0 +1,83 @@ +# Use SeaSearch as search engine (Pro) + +!!! success "New features" + [SeaSearch](https://haiwen.github.io/seasearch-docs/), a file indexer with more lightweight and efficiency than *Elasticsearch*, is supported from Seafile 12. + +!!! note "For Seafile deploy from binary package" + We currently **only support Docker-based** deployment for SeaSearch Server, so this document describes the configuration with the situation of using Docker to deploy Seafile server. + + If your Seafile Server deploy from binary package, please refer [here](../setup_binary/installation_pro.md#starting-seafile-server) to start or stop Seafile Server. + +!!! tip "For Seafile cluster" + Theoretically, **at least** the backend node has to restart, if your Seafile server deploy in cluster mode, but we still suggest you configure and restart **all node** to make sure the consistency and synchronization in the cluster + +## Deploy SeaSearch service + +SeaSearch service is currently mainly deployed via docker. We have integrated it into the relevant docker-compose file. You only need to download it to the same directory as `seafile-server.yml`: + +```sh +wget https://manual.seafile.com/12.0/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://haiwen.github.io/seasearch-docs/config/) for the details. We use `/opt/seasearch-data` as the persistent directory of SeaSearch: + +!!! 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 `seafileltd/seasearch-nomkl:latest` if you use an Apple's chip: + + ```sh + SEASEARCH_IMAGE=seafileltd/seasearch-nomkl:latest + ``` + +```sh +COMPOSE_FILE='...,seasearch.yml' # ... means other docker-compose files + +#SEASEARCH_IMAGE=seafileltd/seasearch-nomkl:latest # for Apple's Chip +SEASEARCH_IMAGE=seafileltd/seasearch:latest + +SS_DATA_PATH=/opt/seasearch-data +INIT_SS_ADMIN_USER= +INIT_SS_ADMIN_PASSWORD= +``` + +## Modify `seafevents.conf` + +Firstly, you should get your authorization token by base64 code consist of `INIT_SS_ADMIN_USER` and `INIT_SS_ADMIN_PASSWORD` defined in `.env`: + +```sh +echo -n 'username:password' | base64 + +# example output +YWRtaW46YWRtaW5fcGFzc3dvcmQ= +``` + +Then, you have to add the following section in seafevents to enable seafile backend service to access SeaSearch APIs + +!!! note "SeaSearch server deploy on a different machine with Seafile" + If your SeaSearch server deploy on a **different** machine with Seafile, please replace `http://seasearch:4080` to the url `://
:` of your SeaSearch server + +```conf +[SEASEARCH] +enabled = true +seasearch_url = http://seasearch:4080 +seasearch_token = +interval = 10m +``` + +## Restart Seafile Server + +```sh +docker compose down +docker compose up -d +``` + +After startup the SeaSearch service, you can check the following logs for Whether SeaSearch runs normally and Seafile is called successfully: + +- container logs by command `docker logs -f seafile-seasearch` +- `seafevents.log` + + +!!! tip "After first time start SeaSearch Server" + You can remove the initial admin account informations in `.env` (e.g., `INIT_SS_ADMIN_USER`, `INIT_SS_ADMIN_PASSWORD`), which are only used in the SeaSearch initialization progress (i.e., the **first time** to start services). But make sure **you have recorded it somewhere else in case you forget the password**. + diff --git a/manual/setup_binary/cluster_deployment.md b/manual/setup_binary/cluster_deployment.md index 4c1222f3..22f97f08 100644 --- a/manual/setup_binary/cluster_deployment.md +++ b/manual/setup_binary/cluster_deployment.md @@ -9,9 +9,9 @@ !!! note "Prerequisites" - - We assume you have already deployed memory cache server (e.g., ***Memcached***), ***MariaDB***, ***ElasticSearch*** in separate machines and use ***S3*** like object storage. + - We assume you have already deployed memory cache server (e.g., ***Memcached***), ***MariaDB***, file indexer (e.g., ***ElasticSearch***, [*SeaSearch*](https://haiwen.github.io/seasearch-docs/)) in separate machines and use ***S3*** like object storage. - - Usually, each node of Seafile Cluster should have at least **2 cores** and **2G memory**. If the above services are deployed together with a node in the Seafile cluster, we recommend that you prepare **4 cores** and **4G memory** for the node (especially if ElasticSearch is also deployed on the node) + - Usually, each node of Seafile Cluster should have at least **2 cores** and **2G memory**. If the above services are deployed together with a node in the Seafile cluster especially ***ElasticSearch***, we recommend that you prepare **4 cores** and **4G memory** for that node System: Ubuntu 24.04/22.04, Debian 12/11 diff --git a/manual/setup_binary/installation_pro.md b/manual/setup_binary/installation_pro.md index be96d54b..2ea455be 100644 --- a/manual/setup_binary/installation_pro.md +++ b/manual/setup_binary/installation_pro.md @@ -4,7 +4,24 @@ This manual explains how to deploy and run Seafile Server Professional Edition ( ## Requirements -Seafile PE requires a minimum of 2 cores and 2GB RAM. If elasticsearch is installed on the same server, the minimum requirements are 4 cores and 4 GB RAM. +Seafile PE requires a minimum of 2 cores and 2GB RAM. + +!!! note "Other requirements for Seafile PE" + - If elasticsearch is installed on the same server, the minimum requirements are 4 cores and 4 GB RAM and make sure the [mmapfs counts](https://www.elastic.co/guide/en/elasticsearch/reference/current/index-modules-store.html#mmapfs) do not cause excptions like out of memory, which can be increased by following command (see for futher details): + + ```shell + sysctl -w vm.max_map_count=262144 #run as root + ``` + + or modify **/etc/sysctl.conf** and reboot to set this value permanently: + + ```shell + nano /etc/sysctl.conf + + # modify vm.max_map_count + vm.max_map_count=262144 + ``` + - If your machine **dose not** have enough requirements, 2 Cores and 2GB RAM are minimum by using [*SeaSearch*](../setup/use_seasearch.md), a lightweight search engine built on open source search engine [*ZincSearch*](https://zincsearch-docs.zinc.dev/), as the indexer Seafile PE can be used without a paid license with up to three users. Licenses for more user can be purchased in the [Seafile Customer Center](https://customer.seafile.com) or contact Seafile Sales at [sales@seafile.com](mailto:sales@seafile.com) or one of [our partners](https://www.seafile.com/en/partner/). diff --git a/mkdocs.yml b/mkdocs.yml index 50533a68..2cf1ca81 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -94,6 +94,7 @@ nav: - OpenStack Swift Backend: setup/setup_with_swift.md - Multiple Storage Backends: setup/setup_with_multiple_storage_backends.md - Data migration: setup/migrate_backends_data.md + - Use SeaSearch as search engine (Pro): setup/use_seasearch.md - Seafile Docker autostart: setup/seafile_docker_autostart.md - Deploy with an existing MySQL server: setup/setup_with_an_existing_mysql_server.md - Use other reverse proxy: setup/use_other_reverse_proxy.md