From 6037fb513ab8adbc47a88bdbbde3c4499964b998 Mon Sep 17 00:00:00 2001 From: Junxiang Huang Date: Wed, 30 Oct 2024 10:33:47 +0800 Subject: [PATCH] opt: some structures --- manual/administration/seafile_fsck.md | 10 ++ manual/setup/caddy.md | 2 +- manual/setup/seafile_docker_autostart.md | 122 +++++++++++------------ manual/setup/setup_ce_by_docker.md | 2 +- 4 files changed, 73 insertions(+), 63 deletions(-) diff --git a/manual/administration/seafile_fsck.md b/manual/administration/seafile_fsck.md index 75b66c59..1a64673f 100644 --- a/manual/administration/seafile_fsck.md +++ b/manual/administration/seafile_fsck.md @@ -15,6 +15,16 @@ cd seafile-server-latest ``` +!!! tip + If your Seafile server is deployed by [Docker](../setup/setup_ce_by_docker.md), you have to run the above command **in the container**: + + ```sh + docker exec -it seafile bash + # after entering the container + cd /scripts + ./seaf-fsck.sh [--repair|-r] [--export|-E export_path] [repo_id_1 [repo_id_2 ...]] + ``` + There are three modes of operation for seaf-fsck: 1. checking integrity of libraries. diff --git a/manual/setup/caddy.md b/manual/setup/caddy.md index 090684be..c262fd5d 100644 --- a/manual/setup/caddy.md +++ b/manual/setup/caddy.md @@ -1,7 +1,7 @@ # HTTPS and Caddy !!! note - 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). + From Seafile Docker 12.0, HTTPS will be handled by the [***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. diff --git a/manual/setup/seafile_docker_autostart.md b/manual/setup/seafile_docker_autostart.md index 5053b708..82262718 100644 --- a/manual/setup/seafile_docker_autostart.md +++ b/manual/setup/seafile_docker_autostart.md @@ -2,72 +2,72 @@ You can use one of the following methods to start Seafile container on system bootup. -=== "`docker-compose.service`" +## Modify docker-compose.service - 1. Add `docker-compose.service` +1. Add `docker-compose.service` - `vim /etc/systemd/system/docker-compose.service` - - ``` - [Unit] - Description=Docker Compose Application Service - Requires=docker.service - After=docker.service - - [Service] - Type=forking - RemainAfterExit=yes - WorkingDirectory=/opt/ - ExecStart=/usr/bin/docker compose up -d - ExecStop=/usr/bin/docker compose down - TimeoutStartSec=0 - - [Install] - WantedBy=multi-user.target - ``` - - !!! note - `WorkingDirectory` is the absolute path to the `seafile-server.yml` file directory. - - 2. Set the `docker-compose.service` file to 644 permissions - - ``` - chmod 644 /etc/systemd/system/docker-compose.service - ``` - - 3. Load autostart configuration - - ``` - systemctl daemon-reload - systemctl enable docker-compose.service - ``` - -=== "`xxx.yml`" - - Add configuration `restart: unless-stopped` for each container in [components of Seafile docker](./overview.md). Take `seafile-server.yml` for example + `vim /etc/systemd/system/docker-compose.service` ``` - services: - db: - image: mariadb:10.11 - container_name: seafile-mysql-1 - restart: unless-stopped + [Unit] + Description=Docker Compose Application Service + Requires=docker.service + After=docker.service - memcached: - image: memcached:1.6.18 - container_name: seafile-memcached - restart: unless-stopped + [Service] + Type=forking + RemainAfterExit=yes + WorkingDirectory=/opt/ + ExecStart=/usr/bin/docker compose up -d + ExecStop=/usr/bin/docker compose down + TimeoutStartSec=0 - elasticsearch: - image: elasticsearch:8.6.2 - container_name: seafile-elasticsearch - restart: unless-stopped - - seafile: - image: docker.seadrive.org/seafileltd/seafile-pro-mc:12.0-latest - container_name: seafile - restart: unless-stopped + [Install] + WantedBy=multi-user.target ``` - !!! tip - Add `restart: unless-stopped`, and the Seafile container will automatically start when Docker starts. If the Seafile container does not exist (execute docker compose down), the container will not start automatically. + !!! note + `WorkingDirectory` is the absolute path to the `seafile-server.yml` file directory. + +2. Set the `docker-compose.service` file to 644 permissions + + ``` + chmod 644 /etc/systemd/system/docker-compose.service + ``` + +3. Load autostart configuration + + ``` + systemctl daemon-reload + systemctl enable docker-compose.service + ``` + +## Modify Docker files + +Add configuration `restart: unless-stopped` for each container in [components of Seafile docker](./overview.md). Take `seafile-server.yml` for example + +``` +services: +db: + image: mariadb:10.11 + container_name: seafile-mysql-1 + restart: unless-stopped + +memcached: + image: memcached:1.6.18 + container_name: seafile-memcached + restart: unless-stopped + +elasticsearch: + image: elasticsearch:8.6.2 + container_name: seafile-elasticsearch + restart: unless-stopped + +seafile: + image: docker.seadrive.org/seafileltd/seafile-pro-mc:12.0-latest + container_name: seafile + restart: unless-stopped +``` + +!!! tip + Add `restart: unless-stopped`, and the Seafile container will automatically start when Docker starts. If the Seafile container does not exist (execute docker compose down), the container will not start automatically. diff --git a/manual/setup/setup_ce_by_docker.md b/manual/setup/setup_ce_by_docker.md index 874121c9..d311501a 100644 --- a/manual/setup/setup_ce_by_docker.md +++ b/manual/setup/setup_ce_by_docker.md @@ -18,7 +18,7 @@ Use the [official installation guide for your OS to install Docker](https://docs ### Download and modify `.env` -!!! tip "From Seafile Docker 12.0, we use `.env`, `seafile-server.yml` and `caddy.yml` files for configuration" +From Seafile Docker 12.0, we use `.env`, `seafile-server.yml` and `caddy.yml` files for configuration ```bash mkdir /opt/seafile