Skip to content

Commit

Permalink
Merge pull request #371 from haiwen/update_12.0_241024
Browse files Browse the repository at this point in the history
opt: update some download links \ add descriptions of HTTPS and Caddy
  • Loading branch information
freeplant authored Oct 24, 2024
2 parents b2feb00 + 4e5f820 commit 7045d14
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 69 deletions.
12 changes: 12 additions & 0 deletions manual/setup/caddy.md
Original file line number Diff line number Diff line change
@@ -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
```
13 changes: 4 additions & 9 deletions manual/setup/migrate_ce_to_pro_with_docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
60 changes: 17 additions & 43 deletions manual/setup/migrate_non_docker_to_docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand All @@ -64,59 +66,31 @@ 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

There are two ways to let Seafile Docker to use the old seafile-data

#### Method 1
After downloading relative configuration files, you should also modify the `.env` by following steps

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`)
- Follow [here](./setup_with_an_existing_mysql_server.md) to setup the database user infomations.

#### Method 2
- Mount the old Seafile data to the new Seafile server

You can mount the old seafile-data folder (`/opt/seafile/seafile-data`) to Seafile docker container directly:

```
.........
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
.......
```sh
SEAFILE_VOLUME=<old-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

Start Seafile docker and check if everything is okay:
Expand Down
4 changes: 2 additions & 2 deletions manual/setup/seafile_docker_autostart.md
Original file line number Diff line number Diff line change
Expand Up @@ -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](./overview.md). Take `seafile-server.yml` for example

```
services:
Expand All @@ -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
```
Expand Down
11 changes: 0 additions & 11 deletions manual/setup/setup_ce_by_docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
```
2 changes: 0 additions & 2 deletions manual/setup/setup_pro_by_docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion manual/setup_binary/outline_ce.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion manual/upgrade/upgrade_docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7045d14

Please sign in to comment.