From e91199914ceb6544a41da6d56cc8e5ddf9dc76e6 Mon Sep 17 00:00:00 2001 From: Junxiang Huang Date: Thu, 3 Jul 2025 15:34:56 +0800 Subject: [PATCH] update notification server deployment: add ENABLE_NOTIFICATION_SERVER --- manual/config/env.md | 3 +- manual/extension/notification-server.md | 42 +++++++------------ manual/repo/docker/ce/env | 1 + manual/repo/docker/ce/seafile-server.yml | 1 + manual/repo/docker/cluster/env | 1 + manual/repo/docker/cluster/seafile-server.yml | 1 + manual/repo/docker/pro/env | 1 + manual/repo/docker/pro/seafile-server.yml | 1 + manual/repo/k8s/ce/seafile-deployment.yaml | 5 +++ manual/repo/k8s/ce/seafile-env.yaml | 1 + manual/repo/k8s/cluster/seafile-env.yaml | 1 + .../cluster/seafile-frontend-deployment.yaml | 5 +++ manual/repo/k8s/pro/seafile-deployment.yaml | 5 +++ manual/repo/k8s/pro/seafile-env.yaml | 1 + manual/setup/setup_ce_by_docker.md | 3 +- manual/setup/setup_pro_by_docker.md | 3 +- manual/upgrade/upgrade_docker.md | 3 ++ 17 files changed, 49 insertions(+), 29 deletions(-) diff --git a/manual/config/env.md b/manual/config/env.md index 3313891a..1045c18a 100644 --- a/manual/config/env.md +++ b/manual/config/env.md @@ -112,7 +112,8 @@ For configurations about Metadata server in `.env`, please refer [here](../exten ## Notification server -- `NOTIFICATION_SERVER_URL`: The [notification server](../extension/notification-server.md) url, leave blank to disable it (default). +- `ENABLE_NOTIFICATION_SERVER`: Enable (`true`) or disable (`false`) notification feature for Seafile. Default is `false`. +- `NOTIFICATION_SERVER_URL`: The [notification server](../extension/notification-server.md) url. !!! note "In Seafile cluster or standalone-deployment notification server" In addition to `NOTIFICATION_SERVER_URL`, you also need to specify `INNER_NOTIFICATION_SERVER_URL=$NOTIFICATION_SERVER_URL`, which will be used for the connection between Seafile server and notification server. diff --git a/manual/extension/notification-server.md b/manual/extension/notification-server.md index 41f95d89..21787b18 100644 --- a/manual/extension/notification-server.md +++ b/manual/extension/notification-server.md @@ -26,23 +26,12 @@ Modify `.env`, and insert `notification-server.yml` into `COMPOSE_FILE`: COMPOSE_FILE='seafile-server.yml,caddy.yml,notification-server.yml' ``` -then add or modify `NOTIFICATION_SERVER_URL`: +then add or modify `ENABLE_NOTIFICATION_SERVER` and `NOTIFICATION_SERVER_URL`: -=== "Deploy with Seafile" - - ```sh - NOTIFICATION_SERVER_URL=$SEAFILE_SERVER_PROTOCOL://$SEAFILE_SERVER_HOSTNAME/notification - ``` -=== "Standalone deployment" - - ```sh - NOTIFICATION_SERVER_URL= - INNER_NOTIFICATION_SERVER_URL=$NOTIFICATION_SERVER_URL - ``` - -!!! tip "Difference between `NOTIFICATION_SERVER_URL` and `INNER_NOTIFICATION_SERVER_URL`" - - `NOTIFICATION_SERVER_URL`: used to do the connection between client (i.e., user's browser) and notification server - - `INNER_NOTIFICATION_SERVER_URL`: used to do the connection between Seafile server and notification server +```sh +ENABLE_NOTIFICATION_SERVER=true +NOTIFICATION_SERVER_URL=$SEAFILE_SERVER_PROTOCOL://$SEAFILE_SERVER_HOSTNAME/notification +``` Finally, You can run notification server with the following command: @@ -91,24 +80,25 @@ Then modify the `.env` file according to your environment. The following fields | `SEAFILE_SERVER_HOSTNAME`| Seafile host name | | `SEAFILE_SERVER_PROTOCOL`| http or https | -You can run notification server with the following command: +Now, you can run notification server with the following command: ```sh docker compose up -d ``` -And you need to add the following configurations under `seafile.conf` and restart Seafile server: +then you need to modify the **`.env` on the host deployed Seafile**: -```conf -[notification] -enabled = true -# the ip of notification server. -host = 192.168.0.83 -# the port of notification server -port = 8083 +```sh +ENABLE_NOTIFICATION_SERVER=true +NOTIFICATION_SERVER_URL=http://:8083 +INNER_NOTIFICATION_SERVER_URL=$NOTIFICATION_SERVER_URL ``` -You need to configure load balancer according to the following forwarding rules: +!!! tip "Difference between `NOTIFICATION_SERVER_URL` and `INNER_NOTIFICATION_SERVER_URL`" + - `NOTIFICATION_SERVER_URL`: used to do the connection between client (i.e., user's browser) and notification server + - `INNER_NOTIFICATION_SERVER_URL`: used to do the connection between Seafile server and notification server + +Finally, you need to configure load balancer according to the following forwarding rules: 1. Forward `/notification/ping` requests to notification server via http protocol. 2. Forward websockets requests with URL prefix `/notification` to notification server. diff --git a/manual/repo/docker/ce/env b/manual/repo/docker/ce/env index b82d5425..e6e3fb70 100644 --- a/manual/repo/docker/ce/env +++ b/manual/repo/docker/ce/env @@ -72,6 +72,7 @@ INIT_SEAFILE_ADMIN_PASSWORD=asecret ENABLE_SEADOC=true ## Notification +ENABLE_NOTIFICATION_SERVER=false NOTIFICATION_SERVER_URL= ## Seafile AI diff --git a/manual/repo/docker/ce/seafile-server.yml b/manual/repo/docker/ce/seafile-server.yml index 0e93dbc7..015de02a 100644 --- a/manual/repo/docker/ce/seafile-server.yml +++ b/manual/repo/docker/ce/seafile-server.yml @@ -72,6 +72,7 @@ services: - REDIS_PASSWORD=${REDIS_PASSWORD:-} - MEMCACHED_HOST=${MEMCACHED_HOST:-memcached} - MEMCACHED_PORT=${MEMCACHED_PORT:-11211} + - ENABLE_NOTIFICATION_SERVER=${ENABLE_NOTIFICATION_SERVER:-false} - INNER_NOTIFICATION_SERVER_URL=${INNER_NOTIFICATION_SERVER_URL:-http://notification-server:8083} - NOTIFICATION_SERVER_URL=${NOTIFICATION_SERVER_URL:-} - ENABLE_SEAFILE_AI=${ENABLE_SEAFILE_AI:-false} diff --git a/manual/repo/docker/cluster/env b/manual/repo/docker/cluster/env index 2374fe19..8966a097 100644 --- a/manual/repo/docker/cluster/env +++ b/manual/repo/docker/cluster/env @@ -48,6 +48,7 @@ S3_USE_HTTPS=true S3_SSE_C_KEY= ## Notification +ENABLE_NOTIFICATION_SERVER=false NOTIFICATION_SERVER_URL= INNER_NOTIFICATION_SERVER_URL=$NOTIFICATION_SERVER_URL diff --git a/manual/repo/docker/cluster/seafile-server.yml b/manual/repo/docker/cluster/seafile-server.yml index af238345..c4843c86 100644 --- a/manual/repo/docker/cluster/seafile-server.yml +++ b/manual/repo/docker/cluster/seafile-server.yml @@ -49,6 +49,7 @@ services: - SITE_ROOT=${SITE_ROOT:-/} - ENABLE_SEADOC=${ENABLE_SEADOC:-false} - SEADOC_SERVER_URL=${SEADOC_SERVER_URL:-http://seafile.example.com/sdoc-server} + - ENABLE_NOTIFICATION_SERVER=${ENABLE_NOTIFICATION_SERVER:-false} - INNER_NOTIFICATION_SERVER_URL=${INNER_NOTIFICATION_SERVER_URL:-} - NOTIFICATION_SERVER_URL=${NOTIFICATION_SERVER_URL:-} - ENABLE_SEAFILE_AI=${ENABLE_SEAFILE_AI:-false} diff --git a/manual/repo/docker/pro/env b/manual/repo/docker/pro/env index 97087de7..25576b58 100644 --- a/manual/repo/docker/pro/env +++ b/manual/repo/docker/pro/env @@ -114,6 +114,7 @@ SS_LOG_OUTPUT=true SS_LOG_LEVEL=info ## Notification +ENABLE_NOTIFICATION_SERVER=false NOTIFICATION_SERVER_URL= ## Seafile AI diff --git a/manual/repo/docker/pro/seafile-server.yml b/manual/repo/docker/pro/seafile-server.yml index 198791a1..880c28a4 100644 --- a/manual/repo/docker/pro/seafile-server.yml +++ b/manual/repo/docker/pro/seafile-server.yml @@ -84,6 +84,7 @@ services: - S3_USE_HTTPS=${S3_USE_HTTPS:-true} - S3_PATH_STYLE_REQUEST=${S3_PATH_STYLE_REQUEST:-false} - S3_SSE_C_KEY=${S3_SSE_C_KEY:-} + - ENABLE_NOTIFICATION_SERVER=${ENABLE_NOTIFICATION_SERVER:-false} - INNER_NOTIFICATION_SERVER_URL=${INNER_NOTIFICATION_SERVER_URL:-http://notification-server:8083} - NOTIFICATION_SERVER_URL=${NOTIFICATION_SERVER_URL:-} - ENABLE_SEAFILE_AI=${ENABLE_SEAFILE_AI:-false} diff --git a/manual/repo/k8s/ce/seafile-deployment.yaml b/manual/repo/k8s/ce/seafile-deployment.yaml index b9c0a8cc..fa49e82c 100644 --- a/manual/repo/k8s/ce/seafile-deployment.yaml +++ b/manual/repo/k8s/ce/seafile-deployment.yaml @@ -111,6 +111,11 @@ spec: configMapKeyRef: name: seafile-env key: MEMCACHED_PORT + - name: ENABLE_NOTIFICATION_SERVER + valueFrom: + configMapKeyRef: + name: seafile-env + key: ENABLE_NOTIFICATION_SERVER - name: INNER_NOTIFICATION_SERVER_URL valueFrom: configMapKeyRef: diff --git a/manual/repo/k8s/ce/seafile-env.yaml b/manual/repo/k8s/ce/seafile-env.yaml index a87a293c..3a7fc5d3 100644 --- a/manual/repo/k8s/ce/seafile-env.yaml +++ b/manual/repo/k8s/ce/seafile-env.yaml @@ -31,6 +31,7 @@ data: MEMCACHED_PORT: "11211" # for notification + ENABLE_NOTIFICATION_SERVER: "false" NOTIFICATION_SERVER_URL: "" # for seadoc diff --git a/manual/repo/k8s/cluster/seafile-env.yaml b/manual/repo/k8s/cluster/seafile-env.yaml index decc9925..2355dff9 100644 --- a/manual/repo/k8s/cluster/seafile-env.yaml +++ b/manual/repo/k8s/cluster/seafile-env.yaml @@ -42,6 +42,7 @@ data: S3_PATH_STYLE_REQUEST: "false" # for notification + ENABLE_NOTIFICATION_SERVER: "false" NOTIFICATION_SERVER_URL: "" # for seadoc diff --git a/manual/repo/k8s/cluster/seafile-frontend-deployment.yaml b/manual/repo/k8s/cluster/seafile-frontend-deployment.yaml index 06a73202..0c79b7da 100644 --- a/manual/repo/k8s/cluster/seafile-frontend-deployment.yaml +++ b/manual/repo/k8s/cluster/seafile-frontend-deployment.yaml @@ -167,6 +167,11 @@ spec: configMapKeyRef: name: seafile-env key: S3_PATH_STYLE_REQUEST + - name: ENABLE_NOTIFICATION_SERVER + valueFrom: + configMapKeyRef: + name: seafile-env + key: ENABLE_NOTIFICATION_SERVER - name: INNER_NOTIFICATION_SERVER_URL valueFrom: configMapKeyRef: diff --git a/manual/repo/k8s/pro/seafile-deployment.yaml b/manual/repo/k8s/pro/seafile-deployment.yaml index 6328487e..ac2877a3 100644 --- a/manual/repo/k8s/pro/seafile-deployment.yaml +++ b/manual/repo/k8s/pro/seafile-deployment.yaml @@ -161,6 +161,11 @@ spec: configMapKeyRef: name: seafile-env key: MEMCACHED_PORT + - name: ENABLE_NOTIFICATION_SERVER + valueFrom: + configMapKeyRef: + name: seafile-env + key: ENABLE_NOTIFICATION_SERVER - name: INNER_NOTIFICATION_SERVER_URL valueFrom: configMapKeyRef: diff --git a/manual/repo/k8s/pro/seafile-env.yaml b/manual/repo/k8s/pro/seafile-env.yaml index 89a7f451..c19cb448 100644 --- a/manual/repo/k8s/pro/seafile-env.yaml +++ b/manual/repo/k8s/pro/seafile-env.yaml @@ -43,6 +43,7 @@ data: S3_PATH_STYLE_REQUEST: "false" # for notification + ENABLE_NOTIFICATION_SERVER: "false" NOTIFICATION_SERVER_URL: "" # for seadoc diff --git a/manual/setup/setup_ce_by_docker.md b/manual/setup/setup_ce_by_docker.md index ffc7c27d..09e19680 100644 --- a/manual/setup/setup_ce_by_docker.md +++ b/manual/setup/setup_ce_by_docker.md @@ -57,7 +57,8 @@ The following fields merit particular attention: | `MEMCACHED_HOST` | Memcached server host | `memcached` | | `MEMCACHED_PORT` | Memcached server port | `11211` | | `TIME_ZONE` | Time zone | `UTC` | -| `NOTIFICATION_SERVER_URL` | The [notification server](../extension/notification-server.md) url, leave blank to disable it | (none) | +| `ENABLE_NOTIFICATION_SERVER` | Enable (`true`) or disable (`false`) notification feature for Seafile | `false` | +| `NOTIFICATION_SERVER_URL` | The [notification server](../extension/notification-server.md) url | (none) | | `INIT_SEAFILE_ADMIN_EMAIL` | Admin username | `me@example.com` (Recommend modifications) | | `INIT_SEAFILE_ADMIN_PASSWORD` | Admin password | `asecret` (Recommend modifications) | | `NON_ROOT` | Run Seafile container without a root user | `false` | diff --git a/manual/setup/setup_pro_by_docker.md b/manual/setup/setup_pro_by_docker.md index 276e5756..80a0ebf0 100644 --- a/manual/setup/setup_pro_by_docker.md +++ b/manual/setup/setup_pro_by_docker.md @@ -87,7 +87,8 @@ The following fields merit particular attention: | `S3_USE_V4_SIGNATURE` | Use the v4 protocol of S3 if enabled | `true` | | `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` | | `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) | -| `NOTIFICATION_SERVER_URL` | The [notification server](../extension/notification-server.md) url, leave blank to disable it | (none) | +| `ENABLE_NOTIFICATION_SERVER` | Enable (`true`) or disable (`false`) notification feature for Seafile | `false` | +| `NOTIFICATION_SERVER_URL` | The [notification server](../extension/notification-server.md) url | (none) | | `NON_ROOT` | Run Seafile container without a root user | `false` | !!! success "Easier to configure S3 for Seafile and its components" diff --git a/manual/upgrade/upgrade_docker.md b/manual/upgrade/upgrade_docker.md index 9a9d115b..418aa0fa 100644 --- a/manual/upgrade/upgrade_docker.md +++ b/manual/upgrade/upgrade_docker.md @@ -119,11 +119,14 @@ If you are using notification server in Seafile 12, please specify the notificat === "Deploy in the same host with Seafile" ```sh + ENABLE_NOTIFICATION_SERVER=true NOTIFICATION_SERVER_URL=$SEAFILE_SERVER_PROTOCOL://$SEAFILE_SERVER_HOSTNAME/notification ``` === "Standalone deployment" ```sh + ENABLE_NOTIFICATION_SERVER=true NOTIFICATION_SERVER_URL=http://:8083 + INNER_NOTIFICATION_SERVER_URL=$NOTIFICATION_SERVER_URL ``` #### Step 3.4) Add configurations for storage backend (Pro)