Skip to content

Commit

Permalink
Merge pull request #339 from haiwen/opt-12.0-structure-101124
Browse files Browse the repository at this point in the history
feat: add strucutres of seafile docker and descriptions of caddy
  • Loading branch information
freeplant authored Oct 11, 2024
2 parents 9053879 + dbbe455 commit d0b6eea
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 69 deletions.
41 changes: 6 additions & 35 deletions manual/docker/deploy_seafile_with_docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ The following fields merit particular attention:
- `SEAFILE_ADMIN_EMAIL`: Admin username
- `SEAFILE_ADMIN_PASSWORD`: Admin password

NOTE: SSL is now handled by the caddy server.
NOTE: SSL is now handled by the [caddy server](#about-ssl-and-caddy) from 12.0.

### Start Seafile server

Expand Down Expand Up @@ -175,40 +175,11 @@ The required scripts can be found in the `/scripts` folder of the docker contain
docker exec -it seafile /bin/bash
```

### LetsEncrypt SSL certificate is about to expire
### About SSL and Caddy

If the certificate is not renewed automatically, you can execute the following command to manually renew the certificate.
From Seafile 12.0, the SSL is handled by [***Caddy***](https://caddyserver.com/docs/). Caddy is a modern open source web server that mainly binds external traffic and internal services in [seafile docker](./seafile_docker_structures.md). The default caddy image is [`lucaslorentz/caddy-docker-proxy:2.9`](https://github.com/lucaslorentz/caddy-docker-proxy), which user only needs to correctly configure the following fields in `.env` to automatically complete the acquisition and update of the certificate:

```bash
# /scripts/ssl.sh /shared/ssl/ <your-seafile-domain>
/scripts/ssl.sh /shared/ssl/ example.seafile.com
```

### Change the environment variable `SEAFILE_SERVER_LETSENCRYPT=false` value to `true`

1. If you want to change to https after using http, first back up the `seafile.nginx.conf`:

```bash
mv /opt/seafile-data/nginx/conf/seafile.nginx.conf /opt/seafile-data/nginx/conf/seafile.nginx.conf.bak
# or
mv /opt/seafile-data/nginx/conf/seafile.nginx.conf{,.bak}
```

2. Destroy the containers with `docker compose down`.

3. Edit `docker-compose.yml`: change `SEAFILE_SERVER_LETSENCRYPT=false` value to `true`.

4. Run `docker compose up -d` again. The new Seafile container will automatically request for an SSL certificate to be generated and installed.

**Notes:**

- You need to manually change http to https in other configuration files.

- `SERVICE_URL` and `FILE_SERVER_ROOT` environment variables in the system admin page also need to be modified.

- If you have modified the old `seafile.nginx.conf`, now you can modify the new `seafile.nginx.conf` as you want. Then execute the following command:

```bash
# test the Nginx configuration and, if OK, reload nginx for configuration to take effect:
docker exec seafile nginx -t && docker exec seafile nginx -s reload
```shell
SEAFILE_SERVER_PROTOCOL=https
SEAFILE_SERVER_HOSTNAME=example.com
```
36 changes: 2 additions & 34 deletions manual/docker/pro-edition/deploy_seafile_pro_with_docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ The following fields merit particular attention:
- `SEAFILE_ADMIN_EMAIL`: Admin username
- `SEAFILE_ADMIN_PASSWORD`: Admin password

NOTE: SSL is now handled by the caddy server.
NOTE: SSL is now handled by the [caddy server](../deploy_seafile_with_docker.md#about-ssl-and-caddy) from 12.0.

To conclude, set the directory permissions of the Elasticsearch volumne:

Expand Down Expand Up @@ -269,7 +269,7 @@ Q: I forgot the Seafile admin email address/password, how do I create a new admi

A: You can create a new admin account by running

```
```shell
docker exec -it seafile /opt/seafile/seafile-server-latest/reset-admin.sh
```

Expand All @@ -286,35 +286,3 @@ A: You can view the docker logs using this command: `docker compose logs -f`.
Q: I forgot the admin password. How do I create a new admin account?

A: Make sure the seafile container is running and enter `docker exec -it seafile /opt/seafile/seafile-server-latest/reset-admin.sh`.

Q: The Let's Encrypt SSL certificate is about to expire, how do I renew it?

A: The SSL certificate should be renewed automatically 30 days prior to its expiration. If the automatic renewal fails, these commands renew the certificate manually:
```
docker exec -it seafile /bin/bash
/scripts/ssl.sh /shared/ssl/ SEAFILE_SERVER_HOSTNAME
```
SEAFILE_SERVER_HOSTNAME is the host name used in the docker-compose.yml.

Q: **SEAFILE_SERVER_LETSENCRYPT=false change to true.**

A: If you want to change to https after using http, first backup and move the seafile.nginx.conf.

```sh
mv /opt/seafile-data/nginx/conf/seafile.nginx.conf /opt/seafile-data/nginx/conf/seafile.nginx.conf.bak
```

Starting the new container will automatically apply a certificate.

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

You need to manually change http to https in other configuration files, SERVICE_URL and FILE_SERVER_ROOT in the system admin page also need to be modified.

If you have modified the old seafile.nginx.conf, now you can modify the new seafile.nginx.conf as you want. Then execute the following command to make the nginx configuration take effect.

```sh
docker exec seafile nginx -s reload
```
11 changes: 11 additions & 0 deletions manual/docker/seafile_docker_structures.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Seafile Docker Structures

Seafile Docker consists of the following two components:

- Seafile server: Seafile core services, see [Seafile Components](../overview/components.md) for the details.
- Sdoc server: SeaDoc server, provide a lightweight online collaborative document editor, see [SeaDoc](../extra_setup/setup_seadoc.md#architecture) for the details.
- Database: Stores data related to Seafile and SeaDoc.
- Memcached: Cache server.
- Caddy: Caddy server enables user to access the seafile service (i.e., Seafile server and Sdoc server) externally and handles `SSL` configuration

![Seafile Docker Structure](../images/seafile-12.0-docker-structure.png)
Binary file added manual/images/seafile-12.0-docker-structure.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ nav:
- Setup Seafile cluster with NFS: deploy_pro/setup_seafile_cluster_with_nfs.md
- License: deploy_pro/seafile_professional_sdition_software_license_agreement.md
- Seafile Setup with Docker:
- Seafile Docker Structures: docker/seafile_docker_structures.md
- Seafile Community Installation: docker/deploy_seafile_with_docker.md
- Seafile Professional Installation: docker/pro-edition/deploy_seafile_pro_with_docker.md
- Seafile Docker Cluster Deployment: docker/cluster/deploy_seafile_cluster_with_docker.md
Expand Down

0 comments on commit d0b6eea

Please sign in to comment.