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..caa23116 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 file indexer +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 index 0cce5ea8..d3dc55ab 100644 --- a/manual/docker/pro/seasearch.yml +++ b/manual/docker/pro/seasearch.yml @@ -1,11 +1,9 @@ -services: +services: seasearch: image: ${SEASEARCH_IMAGE:-seafileltd/seasearch:latest} - container_name: seasearch + container_name: seafile-seasearch volumes: - - ${SS_DATA_PATH:-./data}:/opt/seasearch/data - ports: - - "4080:4080" + - ${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:-} @@ -13,14 +11,16 @@ services: - 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:-} + - 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:-} + - 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:-} - - ZINC_S3_USE_HTTPS=${SS_S3_USE_HTTPS:-} - - ZINC_S3_PATH_STYLE_REQUEST=${SS_S3_PATH_STYLE_REQUEST:-} - - ZINC_S3_AWS_REGION=${SS_S3_AWS_REGION:-} + - 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:-} @@ -37,6 +37,7 @@ services: - 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} @@ -48,5 +49,5 @@ services: networks: - - seafile-net: + 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/use_seasearch.md b/manual/setup/use_seasearch.md index caae1e36..108b6be4 100644 --- a/manual/setup/use_seasearch.md +++ b/manual/setup/use_seasearch.md @@ -11,26 +11,9 @@ !!! 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 -## Stop Seafile Server +## Deploy SeaSearch service -```sh -docker compose down -``` - -!!! tip - After shutdown Seafile server, we suggest you disable `elasticsearch` service **if it is not used by other services**. For [Seafile deploy in single node](./setup_pro_by_docker.md), you just need to remove or note whole section of `elasticsearch` in `seafile-server.yml`: - - ```yml - services: - ... # no change - - #elasticsearch: # note or remove - # ... # and it's contents - - ... # no change - ``` - -## Download `seasearch.yml` +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 @@ -38,48 +21,63 @@ 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= +SS_DATA_PATH=/opt/seasearch-data INIT_SS_ADMIN_USER= INIT_SS_ADMIN_PASSWORD= ``` -!!! tip - For other available variables in `.env`, please refer [SeaSearch confgurations document](https://haiwen.github.io/seasearch-docs/config/) - ## Modify `seafevents.conf` -```conf -# if your SeaSearch server dose not deploy on the same host as Seafile, please replace `seasearch` to your SeaSearch host address -es_host = seasearch +Firstly, you should get your authorization token by base64 code consist of `INIT_SS_ADMIN_USER` and `INIT_SS_ADMIN_PASSWORD` defined in `.env`: -es_port = 4080 +```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 ``` -!!! success "You can browse SeaSearch services in [http://127.0.0.1:4080/](http://127.0.0.1:4080/)" +After startup the SeaSearch service, you can check the following logs for Whether SeaSearch runs normally and Seafile is called successfully: -!!! danger "Important note" - By default, the SeaSearch server **will accept all connection** by listening `4080` port. We suggest you to set firewall to set and enable only the Seafile server can connect: +- container logs by command `docker logs -f seafile-seasearch` +- `seafevents.log` - === "SeaSearch is deployed on the same machine as Seafile" - 1. Remove the exposed ports in the `seasearch.yml` - 2. Set `es_host` to `seasearch` in `seafevents.conf` - - === "SeaSearch is deployed on a different machine with Seafile" - - ```sh - sudo iptables -A INPUT -p tcp -s --dport 4080 -j ACCEPT - sudo iptables -A INPUT -p tcp --dport 4080 -j DROP - ``` +!!! 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**.