opt: update some download links \ add descriptions of HTTPS and Caddy

This commit is contained in:
Junxiang Huang 2024-10-24 18:14:42 +08:00
parent 99ee0e084a
commit 25b5ebc5a9
9 changed files with 38 additions and 69 deletions

12
manual/setup/caddy.md Normal file
View File

@ -0,0 +1,12 @@
# HTTPS and Caddy
> From Seafile 12.0, the HTTPS in deployment from Docker is handled by [***Caddy***](https://caddyserver.com/docs/). The default caddy image used of Seafile docker is [`lucaslorentz/caddy-docker-proxy:2.9`](https://github.com/lucaslorentz/caddy-docker-proxy).
Caddy is a modern open source web server that mainly binds external traffic and internal services in [seafile docker](./overview.md). In addition to the advantages of traditional proxy components (e.g., *nginx*), Caddy also makes it easier for users to complete the acquisite and update of HTTPS certificates by providing simpler configurations.
To engage HTTPS, users only needs to correctly configure the following fields in `.env`:
```shell
SEAFILE_SERVER_PROTOCOL=https
SEAFILE_SERVER_HOSTNAME=example.com
```

View File

@ -4,16 +4,10 @@
1. Make sure you are running a Seafile Community edition that match the latest version of pro edition. For example, if the latest pro edition is version 11.0, you should first upgrade the community edition to version 11.0.
2. Purchase Seafile Professional license file.
3. Download the docker-compose.yml of Seafile Pro.
NOTE: Different versions of Seafile have different compose files.
3. Download the `seafile-server.yml` of Seafile Pro.
```sh
# Seafile PE 10.0
wget -O "docker-compose.yml" "https://manual.seafile.com/docker/docker-compose/pro/10.0/docker-compose.yml"
# Seafile PE 11.0
wget -O "docker-compose.yml" "https://manual.seafile.com/docker/docker-compose/pro/11.0/docker-compose.yml"
wget "https://manual.seafile.com/12.0/docker/pro/seafile-server.yml"
```
## Migrate
@ -36,9 +30,10 @@ Copy the `seafile-license.txt` to the volume directory of the Seafile CE's data.
Replace the old `docker-compose.yml` file with the new `docker-compose.yml` file and modify its configuration based on your actual situation:
* The Seafile Pro docker tag must be equal to or newer than the old Seafile CE docker tag.
* The password of MySQL root (MYSQL_ROOT_PASSWORD and DB_ROOT_PASSWD) should be consistent with the old one;
* The certificate of MySQL users (e.g., `MYSQL_ROOT_PASSWORD` and `DB_ROOT_PASSWD`) should be consistent with the old;
* The volume directory of MySQL data (volumes) should be consistent with the old one;
* The volume directory of Seafile data (volumes) should be consistent with the old one;
* The volume directory of Caddy data (volumes) should be consistent with the old one;
* The volume directory of Elasticsearch data (volumes), this is the directory used to store the Elasticsearch's index data, E.g`/opt/seafile-elasticsearch/data:/usr/share/elasticsearch/data`;
### Do the migration

View File

@ -47,6 +47,8 @@ systemctl restart mariadb
#### Create the required directories for Seafile Docker image
By default, we take `/opt/seafile-data` as example.
```
mkdir -p /opt/seafile-data/seafile
```
@ -64,58 +66,30 @@ Modify the MySQL configuration in `/opt/seafile-data/seafile/conf`, including `c
Modify the memcached configuration in `seahub_settings.py` to use the Docker version of Memcached: change it to `'LOCATION': 'memcached:11211'` (the network name of Docker version of Memcached is `memcached`).
#### Download and modify docker-compose.yml
#### Download and modify Seafile-docker yml
Download [docker-compose.yml](https://manual.seafile.com/docker/pro-edition/10.0/docker-compose.yml) to `/opt/seafile-data`. Comment out the db part as below:
We recommond you download Seafile-docker yml into `/opt/seafile-data`
```
services:
# db:
# image: mariadb:10.5
# container_name: seafile-mysql
# environment:
# - MYSQL_ROOT_PASSWORD=db_password # Required, set the root's password of MySQL service.
# - MYSQL_LOG_CONSOLE=true
# volumes:
# - /opt/seafile-mysql/db:/var/lib/mysql # Required, specifies the path to MySQL data persistent store.
# networks:
# - seafile-net
```sh
mkdir -p /opt/seafile-data
cd /opt/seafile-data
# e.g., pro edition
wget -O .env https://manual.seafile.com/12.0/docker/pro/env
wget https://manual.seafile.com/12.0/docker/pro/seafile-server.yml
wget https://manual.seafile.com/12.0/docker/pro/caddy.yml
.........
depends_on:
# - db
- memcached
.........
nano .env
```
### Configure Seafile Docker to use the old seafile-data
After downloading relative configuration files, you should also modify the `.env` by following steps
There are two ways to let Seafile Docker to use the old seafile-data
- Follow [here](./setup_with_an_existing_mysql_server.md) to setup the database user infomations.
#### Method 1
You can copy or move the old seafile-data folder (`/opt/seafile/seafile-data`) to `/opt/seafile-data/seafile` (So you will have `/opt/seafile-data/seafile/seafile-data`)
#### Method 2
You can mount the old seafile-data folder (`/opt/seafile/seafile-data`) to Seafile docker container directly:
- Mount the old Seafile data to the new Seafile server
```sh
SEAFILE_VOLUME=<old-Seafile-data>
```
.........
seafile:
image: seafileltd/seafile-mc:8.0.7-1
container_name: seafile
ports:
- "80:80"
# - "443:443" # If https is enabled, cancel the comment.
volumes:
- /opt/seafile-data:/shared
- /opt/seafile/seafile-data:/shared/seafile/seafile-data
.......
```
The added line `- /opt/seafile/seafile-data:/shared/seafile/seafile-data` mount `/opt/seafile/seafile-data` to `/shared/seafile/seafile-data` in docker.
### Start Seafile docker

View File

@ -43,7 +43,7 @@ systemctl enable docker-compose.service
## Method 2
Add configuration `restart: unless-stopped` for each container in docker-compose.yml.
Add configuration `restart: unless-stopped` for each container in [components of Seafile docker](../setup/overview.md). Take `seafile-server.yml` for example
```
services:
@ -63,7 +63,7 @@ services:
restart: unless-stopped
seafile:
image: docker.seadrive.org/seafileltd/seafile-pro-mc:11.0-latest
image: docker.seadrive.org/seafileltd/seafile-pro-mc:12.0-latest
container_name: seafile
restart: unless-stopped
```

View File

@ -45,8 +45,6 @@ The following fields merit particular attention:
- `INIT_SEAFILE_ADMIN_EMAIL`: Admin username
- `INIT_SEAFILE_ADMIN_PASSWORD`: Admin password
NOTE: SSL is now handled by the [caddy server](#about-ssl-and-caddy) from 12.0.
### Start Seafile server
Start Seafile server with the following command
@ -137,12 +135,3 @@ The required scripts can be found in the `/scripts` folder of the docker contain
```bash
docker exec -it seafile /bin/bash
```
### About SSL and Caddy
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](./overview.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:
```shell
SEAFILE_SERVER_PROTOCOL=https
SEAFILE_SERVER_HOSTNAME=example.com
```

View File

@ -80,8 +80,6 @@ The following fields merit particular attention:
- `INIT_SEAFILE_ADMIN_EMAIL`: Admin username
- `INIT_SEAFILE_ADMIN_PASSWORD`: Admin password
NOTE: SSL is now handled by the [caddy server](./setup_ce_by_docker.md#about-ssl-and-caddy) from 12.0.
To conclude, set the directory permissions of the Elasticsearch volumne:
```bash

View File

@ -8,7 +8,7 @@ We provide two ways to deploy Seafile services. **Docker is the recommended way*
## Manually deployment options
* [Deploying Seafile with MySQL](installation_ce.md)
* Deploying Seafile with SQLite, note, deploy Seafile with SQLite is not supported since version 11.0
* Deploying Seafile with SQLite, note, deploy Seafile with SQLite is **not supported** since version 11.0
* [Enabling Https with Nginx](https_with_nginx.md)
* [Enabling Https with Apache](https_with_apache.md)
* [Start Seafile at System Bootup](start_seafile_at_system_bootup.md)

View File

@ -130,7 +130,7 @@ The following fields merit particular attention:
- `SEAFILE_SERVER_HOSTNAME`: Seafile server hostname or domain
- `SEAFILE_SERVER_PROTOCOL`: Seafile server protocol (http or https)
SSL is now handled by the [caddy server](../setup/setup_ce_by_docker.md#about-ssl-and-caddy). If you have used SSL before, you will also need modify the seafile.nginx.conf. Change server listen 443 to 80.
SSL is now handled by the [caddy server](../setup/caddy.md). If you have used SSL before, you will also need modify the seafile.nginx.conf. Change server listen 443 to 80.
Backup the original seafile.nginx.conf file:

View File

@ -74,6 +74,7 @@ nav:
- Contribution: introduction/contribution.md
- Setup:
- Overview: setup/overview.md
- HTTPS and Caddy: setup/caddy.md
- Single node installation:
- Setup community edition: setup/setup_ce_by_docker.md
- Setup pro edition: setup/setup_pro_by_docker.md