Skip to content

Commit 9537df3

Browse files
authored
Merge pull request #7 from haiwen/opt_vars_prefix
opt: vars with prefix to
2 parents fe74e1e + 3a06f01 commit 9537df3

File tree

6 files changed

+79
-54
lines changed

6 files changed

+79
-54
lines changed

manual/api/authentication.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ SeaSearch uses accounts to manage API permissions. When the program starts for t
1919

2020
Here is an example of setting the administrator account via shell:
2121
```
22-
set ZINC_FIRST_ADMIN_USER=admin
23-
set ZINC_FIRST_ADMIN_PASSWORD=Complexpass#123
22+
set INIT_SS_ADMIN_USER=admin
23+
set INIT_SS_ADMIN_PASSWORD=Complexpass#123
2424
```
2525
!!! tip
2626
In most scenarios, you can use the administrator account to provide access for applications. Only when you need to integrate multiple applications with different permissions, you should create regular users.

manual/api/index_management.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ Analyzers can be configured as default when creating an index, or they can be se
3939
SeaSearch supports the following analyzers, which can be found here: [ZincSearch Documentation](https://zincsearch-docs.zinc.dev/api/index/analyze/). The concepts such as tokenization and token filters are consistent with ES and support most of the commonly used analyzers and tokenizers in ES.
4040

4141
### Chinese Analyzer
42-
To enable the Chinese analyzer in the system, set the environment variable `ZINC_PLUGIN_GSE_ENABLE=true`.
42+
To enable the Chinese analyzer in the system, set the environment variable `SS_PLUGIN_GSE_ENABLE=true` in `.env`.
4343

44-
If you need more comprehensive support for Chinese word dictionaries, set `ZINC_PLUGIN_GSE_DICT_EMBED = BIG`.
44+
If you need more comprehensive support for Chinese word dictionaries, set `SS_PLUGIN_GSE_DICT_EMBED = BIG`.
4545

4646
`GSE` is a standard analyzer, so you can directly assign the Chinese analyzer to fields in the mappings:
4747
```
@@ -55,6 +55,15 @@ PUT /es/my-index/_mappings
5555
}
5656
}
5757
```
58-
If users have custom tokenization habits, they can specify their dictionary files by setting the environment variable `ZINC_PLUGIN_GSE_DICT_PATH=${DICT_PATH}`, where `DICT_PATH` is the actual path to the dictionary files. The `user.txt` file contains the dictionary, and the `stop.txt` file contains stop words. Each line contains a single word.
58+
If users have custom tokenization habits, they can specify their dictionary files by setting the environment variable `SS_PLUGIN_GSE_DICT_PATH=${DICT_PATH}` in `.env`, where `DICT_PATH` is the actual path to the dictionary files. The `user.txt` file contains the dictionary, and the `stop.txt` file contains stop words. Each line contains a single word.
5959

6060
GSE will load the dictionary and stop words from this path and use the user-defined dictionary to segment Chinese sentences.
61+
62+
63+
!!! tip
64+
After enabling Chinese Analyzer, you have to restart the service to enable changing:
65+
66+
```sh
67+
docker compose down
68+
docker compose up -d
69+
```

manual/config/README.md

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
11
# SeaSearch Configuration
22
For the official ZincSearch configuration, refer to: [ZincSearch Official Documentation](https://zincsearch-docs.zinc.dev/environment-variables/).
33

4-
The following configuration options are the ones we’ve extended. All configurations are set via environment variables.
4+
The following configuration options are the ones we’ve extended. All configurations can be set in `.env`.
5+
6+
!!! tip
7+
After adding new vairables or modifying the existing variables, you have to restart the service to enable changing:
8+
9+
```sh
10+
docker compose down
11+
docker compose up -d
12+
```
513

614
## Local Storage
715
- `SS_DATA_PATH`: Local storage path (default ./data). This is a required option and will be used as the SeaSearch system storage path (replaces the original `ZINC_DATA_PATH`).
@@ -33,16 +41,16 @@ These configurations are only effective when `SS_STORAGE_TYPE=s3`.
3341
## Example SeaSearch Configuration
3442
### Enabling Local Disk as Storage Backend
3543
``` sh
36-
ZINC_FIRST_ADMIN_USER=admin
37-
ZINC_FIRST_ADMIN_PASSWORD=password
44+
INIT_SS_ADMIN_USER=admin
45+
INIT_SS_ADMIN_PASSWORD=password
3846
SS_DATA_PATH=./data
3947
```
4048

4149
### Enabling S3 as Storage Backend
4250
=== "AWS"
4351
``` sh
44-
ZINC_FIRST_ADMIN_USER=admin
45-
ZINC_FIRST_ADMIN_PASSWORD=password
52+
INIT_SS_ADMIN_USER=admin
53+
INIT_SS_ADMIN_PASSWORD=password
4654
SS_DATA_PATH=./data
4755
SS_STORAGE_TYPE=s3
4856
SS_S3_ACCESS_ID=<your-s3-key-id>
@@ -54,8 +62,8 @@ These configurations are only effective when `SS_STORAGE_TYPE=s3`.
5462
```
5563
=== "Exoscale"
5664
``` sh
57-
ZINC_FIRST_ADMIN_USER=admin
58-
ZINC_FIRST_ADMIN_PASSWORD=password
65+
INIT_SS_ADMIN_USER=admin
66+
INIT_SS_ADMIN_PASSWORD=password
5967
SS_DATA_PATH=./data
6068
SS_STORAGE_TYPE=s3
6169
SS_S3_ACCESS_ID=<your-s3-key-id>
@@ -66,8 +74,8 @@ These configurations are only effective when `SS_STORAGE_TYPE=s3`.
6674
```
6775
=== "Hetzner"
6876
``` sh
69-
ZINC_FIRST_ADMIN_USER=admin
70-
ZINC_FIRST_ADMIN_PASSWORD=password
77+
INIT_SS_ADMIN_USER=admin
78+
INIT_SS_ADMIN_PASSWORD=password
7179
SS_DATA_PATH=./data
7280
SS_STORAGE_TYPE=s3
7381
SS_S3_ACCESS_ID=<your-s3-key-id>
@@ -79,8 +87,8 @@ These configurations are only effective when `SS_STORAGE_TYPE=s3`.
7987
```
8088
=== "Other Public Hosted S3 Storag"
8189
```sh
82-
ZINC_FIRST_ADMIN_USER=admin
83-
ZINC_FIRST_ADMIN_PASSWORD=password
90+
INIT_SS_ADMIN_USER=admin
91+
INIT_SS_ADMIN_PASSWORD=password
8492
SS_DATA_PATH=./data
8593
SS_STORAGE_TYPE=s3
8694
SS_S3_ACCESS_ID=<your-s3-key-id>
@@ -92,8 +100,8 @@ These configurations are only effective when `SS_STORAGE_TYPE=s3`.
92100
```
93101
=== "Self-hosted S3 Storage"
94102
```sh
95-
ZINC_FIRST_ADMIN_USER=admin
96-
ZINC_FIRST_ADMIN_PASSWORD=password
103+
INIT_SS_ADMIN_USER=admin
104+
INIT_SS_ADMIN_PASSWORD=password
97105
SS_DATA_PATH=./data
98106
SS_STORAGE_TYPE=s3
99107
SS_S3_ACCESS_ID=<your-s3-key-id>

manual/deploy/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ First, you need to specify the environment variables used by the SeaSearch image
1818
# For Apple's chip (M2, e.g.), you should use the images with -nomkl tags (i.e., seafileltd/seasearch-nomkl:latest)
1919
SEASEARCH_IMAGE=seafileltd/seasearch:latest
2020

21-
SEASEARCH_DATA_PATH=<persistent-volume-path-of-seasearch>
22-
ZINC_FIRST_ADMIN_USER=<admin-username>
23-
ZINC_FIRST_ADMIN_PASSWORD=<admin-password>
21+
SS_DATA_PATH=<persistent-volume-path-of-seasearch>
22+
INIT_SS_ADMIN_USER=<admin-username>
23+
INIT_SS_ADMIN_PASSWORD=<admin-password>
2424
```
2525

2626
## Restart the Service

manual/repo/seasearch.yml

Lines changed: 36 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -3,43 +3,46 @@ services:
33
image: ${SEASEARCH_IMAGE:-seafileltd/seasearch:latest}
44
container_name: seasearch
55
volumes:
6-
- ${SEASEARCH_DATA_PATH}:/opt/seasearch/data
6+
- ${SS_DATA_PATH:-./data}:/opt/seasearch/data
77
ports:
88
- "4080:4080"
99
environment:
10-
- ZINC_FIRST_ADMIN_USER=${ZINC_FIRST_ADMIN_USER}
11-
- ZINC_FIRST_ADMIN_PASSWORD=${ZINC_FIRST_ADMIN_PASSWORD}
10+
- ZINC_FIRST_ADMIN_USER=${INIT_SS_ADMIN_USER}
11+
- ZINC_FIRST_ADMIN_PASSWORD=${INIT_SS_ADMIN_PASSWORD}
1212
- GIN_MODE=${GIN_MODE:-release}
13-
- ZINC_WAL_ENABLE=${ZINC_WAL_ENABLE:-true}
14-
- ZINC_STORAGE_TYPE=${ZINC_STORAGE_TYPE}
15-
- ZINC_SHARD_NUM=${ZINC_SHARD_NUM}
16-
- ZINC_MAX_OBJ_CACHE_SIZE=${ZINC_MAX_OBJ_CACHE_SIZE}
17-
- ZINC_S3_ACCESS_ID=${ZINC_S3_ACCESS_ID}
18-
- ZINC_S3_USE_V4_SIGNATURE=${ZINC_S3_USE_V4_SIGNATURE}
19-
- ZINC_S3_ACCESS_SECRET=${ZINC_S3_ACCESS_SECRET}
20-
- ZINC_S3_ENDPOINT=${ZINC_S3_ENDPOINT}
21-
- ZINC_S3_USE_HTTPS=${ZINC_S3_USE_HTTPS}
22-
- ZINC_S3_PATH_STYLE_REQUEST=${ZINC_S3_PATH_STYLE_REQUEST}
23-
- ZINC_S3_AWS_REGION=${ZINC_S3_AWS_REGION}
24-
- ZINC_SERVER_MODE=${ZINC_SERVER_MODE}
25-
- ZINC_CLUSTER_ID=${ZINC_CLUSTER_ID}
26-
- ZINC_ETCD_USERNAME=${ZINC_ETCD_USERNAME}
27-
- ZINC_ETCD_PASSWORD=${ZINC_ETCD_PASSWORD}
28-
- ZINC_CLUSTER_PROXY_LOG_DIR=${ZINC_CLUSTER_PROXY_LOG_DIR:-/opt/seasearch/data/log}
29-
- ZINC_CLUSTER_PROXY_HOST=${ZINC_CLUSTER_PROXY_HOST:-0.0.0.0}
30-
- ZINC_CLUSTER_PROXY_PORT=${ZINC_CLUSTER_PROXY_PORT:-4082}
31-
- ZINC_ETCD_ENDPOINTS=${ZINC_ETCD_ENDPOINTS:-127.0.0.1:2379}
32-
- ZINC_ETCD_PREFIX=${ZINC_ETCD_PREFIX:-/zinc}
33-
- ZINC_MAX_DOCUMENT_SIZE=${ZINC_MAX_DOCUMENT_SIZE:-1m}
34-
- ZINC_CLUSTER_MANAGER_ADDR=${ZINC_CLUSTER_MANAGER_ADDR:-127.0.0.1:4081}
35-
- ZINC_CLUSTER_MANAGER_LOG_DIR=${ZINC_CLUSTER_MANAGER_LOG_DIR:-/opt/seasearch/data/log}
36-
- ZINC_CLUSTER_MANAGER_HOST=${ZINC_CLUSTER_MANAGER_HOST:-0.0.0.0}
37-
- ZINC_CLUSTER_MANAGER_PORT=${ZINC_CLUSTER_MANAGER_PORT:-4081}
38-
- ZINC_CLUSTER_MANAGER_ETCD_ENDPOINTS=${ZINC_CLUSTER_MANAGER_ETCD_ENDPOINTS:-127.0.0.1:2379}
39-
- ZINC_CLUSTER_MANAGER_ETCD_PREFIX=${ZINC_CLUSTER_MANAGER_ETCD_PREFIX:-/zinc}
40-
- ZINC_LOG_OUTPUT=${ZINC_LOG_OUTPUT:-true}
41-
- ZINC_LOG_DIR=${ZINC_LOG_DIR:-/opt/seasearch/data/log}
42-
- ZINC_LOG_LEVEL=${ZINC_LOG_LEVEL:-debug}
13+
- ZINC_WAL_ENABLE=${SS_WAL_ENABLE:-true}
14+
- ZINC_STORAGE_TYPE=${SS_STORAGE_TYPE}
15+
- ZINC_SHARD_NUM=${SS_SHARD_NUM}
16+
- ZINC_MAX_OBJ_CACHE_SIZE=${SS_MAX_OBJ_CACHE_SIZE}
17+
- ZINC_S3_ACCESS_ID=${SS_S3_ACCESS_ID}
18+
- ZINC_S3_USE_V4_SIGNATURE=${SS_S3_USE_V4_SIGNATURE}
19+
- ZINC_S3_ACCESS_SECRET=${SS_S3_ACCESS_SECRET}
20+
- ZINC_S3_ENDPOINT=${SS_S3_ENDPOINT}
21+
- ZINC_S3_USE_HTTPS=${SS_S3_USE_HTTPS}
22+
- ZINC_S3_PATH_STYLE_REQUEST=${SS_S3_PATH_STYLE_REQUEST}
23+
- ZINC_S3_AWS_REGION=${SS_S3_AWS_REGION}
24+
- ZINC_SERVER_MODE=${SS_SERVER_MODE}
25+
- ZINC_CLUSTER_ID=${SS_CLUSTER_ID}
26+
- ZINC_ETCD_USERNAME=${SS_ETCD_USERNAME}
27+
- ZINC_ETCD_PASSWORD=${SS_ETCD_PASSWORD}
28+
- ZINC_CLUSTER_PROXY_LOG_DIR=${SS_CLUSTER_PROXY_LOG_DIR:-/opt/seasearch/data/log}
29+
- ZINC_CLUSTER_PROXY_HOST=${SS_CLUSTER_PROXY_HOST:-0.0.0.0}
30+
- ZINC_CLUSTER_PROXY_PORT=${SS_CLUSTER_PROXY_PORT:-4082}
31+
- ZINC_ETCD_ENDPOINTS=${SS_ETCD_ENDPOINTS:-127.0.0.1:2379}
32+
- ZINC_ETCD_PREFIX=${SS_ETCD_PREFIX:-/zinc}
33+
- ZINC_MAX_DOCUMENT_SIZE=${SS_MAX_DOCUMENT_SIZE:-1m}
34+
- ZINC_CLUSTER_MANAGER_ADDR=${SS_CLUSTER_MANAGER_ADDR:-127.0.0.1:4081}
35+
- ZINC_CLUSTER_MANAGER_LOG_DIR=${SS_CLUSTER_MANAGER_LOG_DIR:-/opt/seasearch/data/log}
36+
- ZINC_CLUSTER_MANAGER_HOST=${SS_CLUSTER_MANAGER_HOST:-0.0.0.0}
37+
- ZINC_CLUSTER_MANAGER_PORT=${SS_CLUSTER_MANAGER_PORT:-4081}
38+
- ZINC_CLUSTER_MANAGER_ETCD_ENDPOINTS=${SS_CLUSTER_MANAGER_ETCD_ENDPOINTS:-127.0.0.1:2379}
39+
- ZINC_CLUSTER_MANAGER_ETCD_PREFIX=${SS_CLUSTER_MANAGER_ETCD_PREFIX:-/zinc}
40+
- ZINC_LOG_OUTPUT=${SS_LOG_OUTPUT:-true}
41+
- ZINC_LOG_DIR=${SS_LOG_DIR:-/opt/seasearch/data/log}
42+
- ZINC_LOG_LEVEL=${SS_LOG_LEVEL:-debug}
43+
- ZINC_PLUGIN_GSE_ENABLE = ${SS_PLUGIN_GSE_ENABLE:-false}
44+
- ZINC_PLUGIN_GSE_DICT_EMBED = ${SS_PLUGIN_GSE_DICT_EMBED}
45+
- ZINC_PLUGIN_GSE_DICT_PATH = ${SS_PLUGIN_GSE_DICT_PATH}
4346
networks:
4447
- frontend-net
4548
- backend-scheduler-net

mkdocs.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ markdown_extensions:
4444
toc_depth: "1-4"
4545
- pymdownx.tabbed:
4646
alternate_style: true
47+
- pymdownx.superfences: # allows 1) nesting of fences 2) custom fences 3) disable indented code
48+
custom_fences:
49+
- name: mermaid
50+
class: mermaid
51+
format: !!python/name:pymdownx.superfences.fence_code_format
4752

4853
# Page tree
4954
nav:

0 commit comments

Comments
 (0)