You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: manual/api/authentication.md
+4-13Lines changed: 4 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -9,22 +9,13 @@ You can generate a token using the following command, for example with aladdin:o
9
9
echo -n 'aladdin:opensesame' | base64
10
10
YWxhZGRpbjpvcGVuc2VzYW1l
11
11
```
12
-
Note: Basic auth is not secure. If you need to access SeaSearch over the public internet, it is strongly recommended to use HTTPS (e.g., via reverse proxy such as Nginx).
13
-
```
14
-
"Authorization": "Basic YWRtaW46MTIzNDU2Nzg="
15
-
```
16
12
17
-
## Administrator User
18
-
SeaSearch uses accounts to manage API permissions. When the program starts for the first time, an administrator account must be configured through environment variables.
19
-
20
-
Here is an example of setting the administrator account via shell:
13
+
!!! danger
14
+
Basic auth is not secure. If you need to access SeaSearch over the public internet, it is strongly recommended to use HTTPS (e.g., via reverse proxy such as Nginx).
15
+
21
16
```
22
-
set INIT_SS_ADMIN_USER=admin
23
-
set INIT_SS_ADMIN_PASSWORD=Complexpass#123
17
+
"Authorization": "Basic YWRtaW46MTIzNDU2Nzg="
24
18
```
25
-
!!! tip
26
-
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.
First, you need to specify the environment variables used by the SeaSearch image in the relevant `.env` file. Some environment variables can be found in [here](../config/README.md). Please add and modify the environment variables (i.e., `<...>`) of the following fields in the `.env` file.
12
14
13
-
14
-
15
-
16
15
```shell
16
+
COMPOSE_FILE='...,seasearch.yml'# ... means other docker-compose yml
17
+
17
18
# other environment variables in .env file
18
19
# For Apple's chip (M2, e.g.), you should use the images with -nomkl tags (i.e., seafileltd/seasearch-nomkl:latest)
Browse seasearch services in [http://127.0.0.1:4080/](http://127.0.0.1:4080/).
34
+
!!! success "You can browse SeaSearch services in [http://127.0.0.1:4080/](http://127.0.0.1:4080/)"
35
+
36
+
## 4. Access API to Create regular user via admin account
37
+
38
+
### Get auth token:
39
+
40
+
!!! note
41
+
SeaSearch's auth token is using **base64 encode** consist of `username` and `password`, you can check [here](../api/authentication.md) for the whole details
42
+
43
+
```sh
44
+
echo -n 'aladdin:opensesame'| base64
45
+
YWxhZGRpbjpvcGVuc2VzYW1l
46
+
```
47
+
48
+
You can use your auth token to access SeaSearch APIs by adding it into `headers`, i.e.,
49
+
50
+
```json
51
+
headers = {
52
+
"Authorization": "Basic YWxhZGRpbjpvcGVuc2VzYW1l"
53
+
}
54
+
```
55
+
56
+
### Create a regular user
57
+
58
+
!!! tip
59
+
We here just show an example to describe how to use auth token to access SeaSearch APIs, you can check [here](../api/overview.md) for the whole details of SeaSearch APIs.
60
+
61
+
You can create a regular user by **POST `/api/user`**, e.g.,
0 commit comments