Skip to content

Commit

Permalink
fix start notification-server
Browse files Browse the repository at this point in the history
  • Loading branch information
SkywalkerSpace committed Nov 15, 2024
1 parent fe95c8c commit 6b1c2af
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 11 deletions.
19 changes: 19 additions & 0 deletions manual/docker/notification-server/standalone/env
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
COMPOSE_FILE='notification-server.yml'
COMPOSE_PATH_SEPARATOR=','


NOTIFICATION_SERVER_IMAGE=seafileltd/notification-server:12.0-latest

NOTIFICATION_SERVER_VOLUME=/opt/notification-data

SEAFILE_MYSQL_DB_HOST=192.168.0.2
SEAFILE_MYSQL_DB_USER=seafile
SEAFILE_MYSQL_DB_PASSWORD=PASSWORD

TIME_ZONE=Etc/UTC

JWT_PRIVATE_KEY=

SEAFILE_SERVER_HOSTNAME=example.seafile.com
SEAFILE_SERVER_PROTOCOL=http

Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
services:

notification-server:
image: ${NOTIFICATION_SERVER_IMAGE:-seafileltd/notification-server:12.0-latest}
container_name: notification-server
restart: always
volumes:
- ${NOTIFICATION_SERVER_VOLUME:-/opt/notification-data}:/shared
ports:
- "8083:8083"
environment:
- SEAFILE_MYSQL_DB_HOST=${SEAFILE_MYSQL_DB_HOST:-db}
- SEAFILE_MYSQL_DB_PORT=${SEAFILE_MYSQL_DB_PORT:-3306}
- SEAFILE_MYSQL_DB_USER=${SEAFILE_MYSQL_DB_USER:-seafile}
- SEAFILE_MYSQL_DB_PASSWORD=${SEAFILE_MYSQL_DB_PASSWORD:?Variable is not set or empty}
- SEAFILE_MYSQL_DB_CCNET_DB_NAME=${SEAFILE_MYSQL_DB_CCNET_DB_NAME:-ccnet_db}
- SEAFILE_MYSQL_DB_SEAFILE_DB_NAME=${SEAFILE_MYSQL_DB_SEAFILE_DB_NAME:-seafile_db}
- JWT_PRIVATE_KEY=${JWT_PRIVATE_KEY:?Variable is not set or empty}
- SEAFILE_LOG_TO_STDOUT=${SEAFILE_LOG_TO_STDOUT:-false}
- NOTIFICATION_SERVER_LOG_LEVEL=${NOTIFICATION_SERVER_LOG_LEVEL:-info}
networks:
- seafile-net

networks:
seafile-net:
name: seafile-net
58 changes: 47 additions & 11 deletions manual/extension/notification-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,33 @@ The notification server uses websocket protocol and maintains a two-way communic

## How to configure and run

Since Seafile 12.0, we use docker to deploy the notification server. First deploy Seafile docker, then download `notification-server.yml` and modify the `.env` file:
Since Seafile 12.0, we use docker to deploy the notification server. First deploy Seafile docker, then download `notification-server.yml` to Seafile directory and modify the `.env` file:

```sh
wget https://manual.seafile.com/12.0/docker/notification-server.yml
```

Modify `.env`, and insert `notification-server.yml` into `COMPOSE_FILE`
Modify `.env`, and insert `notification-server.yml` into `COMPOSE_FILE`:

```env
COMPOSE_FILE='seafile-server.yml,caddy.yml,notification-server.yml'
```

And you need to add the following configurations under seafile.conf:

```conf
[notification]
enabled = true
# the ip of notification server. (default is `notification-server` in Docker)
host = notification-server
# the port of notification server
port = 8083
```

You can run notification server with the following command:

```sh
docker compose down
docker compose up -d
```

Expand All @@ -54,17 +66,41 @@ There is no additional features for notification server in the Pro Edition. It w

If you enable [clustering](../setup_binary/deploy_in_a_cluster.md), You need to deploy notification server on one of the servers, or a separate server. The load balancer should forward websockets requests to this node.

Modify `notification-server.yml`, and open 8083 port
Download `.env` and `notification-server.yml` to Notification server directory:

```sh
wget https://manual.seafile.com/12.0/docker/notification-server/standalone/notification-server.yml
wget -o .env https://manual.seafile.com/12.0/docker/notification-server/standalone/env
```

Then modify the `.env` file according to your environment. The following fields are needed to be modified:

| variable | description |
|------------------------|---------------------------------------------------------------------------------------------------------------|
| `NOTIFICATION_SERVER_VOLUME` | The volume directory of Notification Server data |
| `SEAFILE_MYSQL_DB_HOST`| Seafile MySQL host |
| `SEAFILE_MYSQL_DB_USER`| Seafile MySQL user, default is `seafile` |
| `SEAFILE_MYSQL_DB_PASSWORD`| Seafile MySQL password |
| `TIME_ZONE` | Time zone |
| `JWT_PRIVATE_KEY` | JWT key, the same as the config in Seafile `.env` file |
| `SEAFILE_SERVER_HOSTNAME`| Seafile host name |
| `SEAFILE_SERVER_PROTOCOL`| http or https |

You can run notification server with the following command:

```sh
docker compose up -d
```

```yml
services:
And you need to add the following configurations under `seafile.conf` and restart Seafile server:

notification-server:
image: ${NOTIFICATION_SERVER_IMAGE:-seafileltd/notification-server:12.0-latest}
...
ports:
- "8083:8083"
...
```conf
[notification]
enabled = true
# the ip of notification server.
host = 192.168.0.83
# the port of notification server
port = 8083
```

You need to configure load balancer according to the following forwarding rules:
Expand Down

0 comments on commit 6b1c2af

Please sign in to comment.