Skip to content

Commit

Permalink
Merge pull request #355 from haiwen/opt_structure_102124
Browse files Browse the repository at this point in the history
opt: structures
  • Loading branch information
freeplant authored Oct 21, 2024
2 parents 0f52fb2 + d946eb3 commit fe891e9
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 76 deletions.
12 changes: 12 additions & 0 deletions manual/docker/deploy_seafile_with_an_existing_mysql_server.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Deploy with an existing MySQL server

If you want to use an existing MySQL server, you can modify the `.env` as follows

```env
SEAFILE_MYSQL_DB_HOST=192.168.0.2
SEAFILE_MYSQL_DB_PORT=3306
SEAFILE_MYSQL_ROOT_PASSWORD=ROOT_PASSWORD
SEAFILE_MYSQL_DB_PASSWORD=PASSWORD
```

NOTE: `SEAFILE_MYSQL_ROOT_PASSWORD` is needed during installation (i.e., the deployment in the first time). After Seafile is installed, the user `seafile` will be used to connect to the MySQL server (SEAFILE_MYSQL_DB_PASSWORD), then you can remove the `SEAFILE_MYSQL_ROOT_PASSWORD`.
38 changes: 0 additions & 38 deletions manual/docker/deploy_seafile_with_docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,19 +100,6 @@ sudo tail -f $(find /opt/seafile-data/ -type f -name *.log 2>/dev/null)

## More configuration options

### Use an existing mysql-server

If you want to use an existing mysql-server, you can modify the `.env` as follows

```env
SEAFILE_MYSQL_DB_HOST=192.168.0.2
SEAFILE_MYSQL_DB_PORT=3306
SEAFILE_MYSQL_ROOT_PASSWORD=ROOT_PASSWORD
SEAFILE_MYSQL_DB_PASSWORD=PASSWORD
```

NOTE: `SEAFILE_MYSQL_ROOT_PASSWORD` is needed during installation. Later, after Seafile is installed, the user `seafile` will be used to connect to the mysql-server (SEAFILE_MYSQL_DB_PASSWORD). You can remove the `SEAFILE_MYSQL_ROOT_PASSWORD`.

### Modify Seafile server configurations

The config files are under `/opt/seafile-data/seafile/conf`. You can modify the configurations according to [Seafile manual](https://manual.seafile.com/)
Expand All @@ -133,31 +120,6 @@ docker exec -it seafile /opt/seafile/seafile-server-latest/reset-admin.sh

Enter the username and password according to the prompts. You now have a new admin account.

### Run Seafile as non root user inside docker

You can use run seafile as non root user in docker. (**NOTE:** Programs such as `my_init`, Nginx are still run as `root` inside docker.)

First add the `NON_ROOT=true` to the `.env`.

```env
NON_ROOT=true
```

Then modify `/opt/seafile-data/seafile/` permissions.

```bash
chmod -R a+rwx /opt/seafile-data/seafile/
```

Then destroy the containers and run them again:

```bash
docker compose down
docker compose up -d
```

Now you can run Seafile as `seafile` user. (**NOTE:** Later, when doing maintenance, other scripts in docker are also required to be run as `seafile` user, e.g. `su seafile -c ./seaf-gc.sh`)

## Backup and recovery

Follow the instructions in [Backup and restore for Seafile Docker](../maintain/backup_recovery.md)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,44 +168,6 @@ docker compose restart

All Seafile log files are stored in `/opt/seafile-data/seafile/logs` whereas all other log files are in `/opt/seafile-data/logs/var-log`.

## Use an existing mysql-server

If you want to use an existing mysql-server, you can modify the `.env` as follows

```env
SEAFILE_MYSQL_DB_HOST=192.168.0.2
SEAFILE_MYSQL_DB_PORT=3306
SEAFILE_MYSQL_ROOT_PASSWORD=ROOT_PASSWORD
SEAFILE_MYSQL_DB_PASSWORD=PASSWORD
```

NOTE: `SEAFILE_MYSQL_ROOT_PASSWORD` is needed during installation. Later, after Seafile is installed, the user `seafile` will be used to connect to the mysql-server (SEAFILE_MYSQL_DB_PASSWORD). You can remove the `SEAFILE_MYSQL_ROOT_PASSWORD`.

## Run Seafile as non root user inside docker

You can use run seafile as non root user in docker. (**NOTE:** Programs such as `my_init`, Nginx are still run as `root` inside docker.)

First add the `NON_ROOT=true` to the `.env`.

```env
NON_ROOT=true
```

Then modify `/opt/seafile-data/seafile/` permissions.

```bash
chmod -R a+rwx /opt/seafile-data/seafile/
```

Then destroy the containers and run them again:

```bash
docker compose down
docker compose up -d
```

Now you can run Seafile as `seafile` user. (**NOTE:** Later, when doing maintenance, other scripts in docker are also required to be run as `seafile` user, e.g. `su seafile -c ./seaf-gc.sh`)

## Backup and Recovery

Follow the instructions in [Backup and restore for Seafile Docker](../../maintain/backup_recovery.md)
Expand Down
24 changes: 24 additions & 0 deletions manual/docker/run_seafile_as_non_root_user_inside_docker.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Run Seafile as non root user inside docker

You can use run seafile as non root user in docker. (**NOTE:** Programs such as `my_init`, Nginx are still run as `root` inside docker.)

First add the `NON_ROOT=true` to the `.env`.

```env
NON_ROOT=true
```

Then modify `/opt/seafile-data/seafile/` permissions.

```bash
chmod -R a+rwx /opt/seafile-data/seafile/
```

Then destroy the containers and run them again:

```bash
docker compose down
docker compose up -d
```

Now you can run Seafile as `seafile` user. (**NOTE:** Later, when doing maintenance, other scripts in docker are also required to be run as `seafile` user, e.g. `su seafile -c ./seaf-gc.sh`)
2 changes: 2 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ nav:
- Multiple Storage Backends: deploy_pro/multiple_storage_backends.md
- Data migration: deploy_pro/migrate.md
- Seafile Docker autostart: docker/seafile_docker_autostart.md
- Deploy with an existing MySQL server: docker/deploy_seafile_with_an_existing_mysql_server.md
- Run Seafile as non root user inside docker: docker/run_seafile_as_non_root_user_inside_docker.md
- Cluster installation:
- Seafile Docker Cluster Deployment: docker/cluster/deploy_seafile_cluster_with_docker.md
- Setup with Kubernetes (K8s): deploy/deploy_with_k8s.md
Expand Down

0 comments on commit fe891e9

Please sign in to comment.