Skip to content

Commit

Permalink
Merge pull request #81 from haiwen/add-docker-faq
Browse files Browse the repository at this point in the history
add docker faq
  • Loading branch information
freeplant authored Jun 17, 2022
2 parents d407bef + 8d9bd4f commit 0938231
Show file tree
Hide file tree
Showing 8 changed files with 294 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ The first time you start Seahub, the script prompts you to create an admin accou

Now you can access Seafile via the web interface at the host address and port 8000 (e.g., http://1.2.3.4:8000).

## Configing ElasticSearch
## Configuring ElasticSearch

* For Seafile PE 8.0.x and previous versions, the Seafile installation package already includes ElasticSearch, you can directly use it.
* For Seafile PE 9.0.x and later versions, ElasticSearch needs to be installed and maintained separately (Due to copyright reasons, ElasticSearch 7.x cannot be brought into the Seafile package)
Expand Down
4 changes: 2 additions & 2 deletions manual/docker/cluster/deploy_seafile_cluster_with_docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ $ vim docker-compose.yml
version: '2.0'
services:
seafile:
image: docker.seafile.top/seafileltd/seafile-pro-mc:latest
image: docker.seadrive.org/seafileltd/seafile-pro-mc:latest
container_name: seafile
ports:
- 80:80
Expand Down Expand Up @@ -223,7 +223,7 @@ $ vim docker-compose.yml
version: '2.0'
services:
seafile:
image: docker.seafile.top/seafileltd/seafile-pro-mc:latest
image: docker.seadrive.org/seafileltd/seafile-pro-mc:latest
container_name: seafile
ports:
- 80:80
Expand Down
40 changes: 35 additions & 5 deletions manual/docker/deploy_seafile_with_docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,17 @@
## Getting started

### Install docker

Seafile v7.x.x (or newer versions) image uses docker. You should first install docker.

[Install Docker Engine on CentOS](https://docs.docker.com/engine/install/centos/)

[Install Docker Engine on Ubuntu](https://docs.docker.com/engine/install/ubuntu/)

### Install docker-compose

Seafile v7.x.x (or newer versions) image uses docker-compose. You should first install the docker-compose command.
Seafile v7.x.x (or newer versions) image uses docker-compose. You should install the docker-compose command.

```bash
# for CentOS
Expand Down Expand Up @@ -83,6 +91,22 @@ If you want to use your own SSL certificate and the volume directory of Seafile
* create a folder `/opt/seafile-data/ssl`, and put your certificate and private key under the ssl directory.
* Assume your site name is `seafile.example.com`, then your certificate must have the name `seafile.example.com.crt`, and the private key must have the name `seafile.example.com.key`.

If you got the following error when SEAFILE_SERVER_LETSENCRYPT=true is set:

```log
subprocess.CalledProcessError: Command '/scripts/ssl.sh /shared/ssl cloud.seafile-demo.de' returned non-zero exit status 128.
```

In /scripts/ssl.sh (script in seafile container), `git clone git://` has to be replaced with `git clone https://`.

Then restart the container:

```shell
docker-compose restart
```

Since version 9.0.6, we use acme (not acme-tiny) to get certificate and fix this error.

### Modify Seafile server configurations

The config files are under `shared/seafile/conf`. You can modify the configurations according to [Seafile manual](https://manual.seafile.com/)
Expand All @@ -96,6 +120,12 @@ docker-compose restart

### Find logs

To view Seafile docker logs, please use the following command

```shell
docker-compose logs -f
```

The Seafile logs are under `shared/logs/seafile` in the docker, or `/opt/seafile-data/logs/seafile` in the server that run the docker.

The system logs are under `shared/logs/var-log`, or `/opt/seafile-data/logs/var-log` in the server that run the docker.
Expand All @@ -115,7 +145,7 @@ Enter the username and password according to the prompts. You now have a new adm

### `/shared`

Placeholder spot for shared volumes. You may elect to store certain persistent information outside of a container, in our case we keep various logfiles and upload directory outside. This allows you to rebuild containers easily without losing important information.
Placeholder spot for shared volumes. You may elect to store certain persistent information outside of a container, in our case we keep various log files and upload directory outside. This allows you to rebuild containers easily without losing important information.

* /shared/seafile: This is the directory for seafile server configuration and data.
* /shared/logs: This is the directory for logs.
Expand All @@ -137,12 +167,12 @@ docker-compose up -d

## Backup and recovery

### Struct
### Structure

We assume your seafile volumns path is in `/opt/seafile-data`. And you want to backup to `/opt/seafile-backup` directory.
You can create a layout similar to the following in /opt/seafile-backup directory:

```struct
```
/opt/seafile-backup
---- databases/ MySQL contains database backup files
---- data/ Seafile contains backups of the data directory
Expand All @@ -151,7 +181,7 @@ You can create a layout similar to the following in /opt/seafile-backup director

The data files to be backed up:

```struct
```
/opt/seafile-data/seafile/conf # configuration files
/opt/seafile-data/seafile/seafile-data # data of seafile
/opt/seafile-data/seafile/seahub-data # data of seahub
Expand Down
2 changes: 1 addition & 1 deletion manual/docker/pro-edition/7.1_8.0/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ services:
- seafile-net

seafile:
image: docker.seafile.top/seafileltd/seafile-pro-mc:latest
image: docker.seadrive.org/seafileltd/seafile-pro-mc:latest
container_name: seafile
ports:
- "80:80"
Expand Down
41 changes: 41 additions & 0 deletions manual/docker/pro-edition/deploy_clamav_with_docker.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Deploy Clamav with Docker

## Add Clamav to docker-compose.yml

The following section needs to be added to docker-compose.yml in the services section

```yml
services:
...

av:
image: mkodockx/docker-clamav:alpine
container_name: seafile-clamav
networks:
- seafile-net
```
## Modify seafile.conf
Add this to seafile.conf
```conf
[virus_scan]
scan_command = clamdscan
virus_code = 1
nonvirus_code = 0
scan_interval = 5
scan_size_limit = 20
threads = 2
```

## Restart docker container

```shell
docker-compose down
docker-compose up -d
```

Wait some minutes until Clamav finished initializing.

Now Clamav can be used.
117 changes: 117 additions & 0 deletions manual/docker/pro-edition/deploy_onlyoffice_with_docker.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
# Deploy OnlyOffice with Docker

## Add OnlyOffice to docker-compose.yml

The following section needs to be added to docker-compose.yml in the services section

```yml
services:
...

oods:
image: onlyoffice/documentserver:latest
container_name: seafile-oods
volumes:
- /opt/seafile-oods/DocumentServer/logs:/var/log/onlyoffice
- /opt/seafile-oods/DocumentServer/data:/var/www/onlyoffice/Data
- /opt/seafile-oods/DocumentServer/lib:/var/lib/onlyoffice
- /opt/seafile-oods/DocumentServer/local-productionlinux.json:/etc/onlyoffice/documentserver/local-production-linux.json
networks:
- seafile-net
environment:
- JWT_ENABLED=true
- JWT_SECRET=your-secret-string
```
## Initialize OnlyOffice local configuration file
```shell
mkdir -p /opt/seafile-oods/DocumentServer/
vim /opt/seafile-oods/DocumentServer/local-production-linux.json
```

```json
{
"services": {
"CoAuthoring": {
"autoAssembly": {
"enable": true,
"interval": "5m"
}
}
},
"FileConverter": {
"converter": {
"downloadAttemptMaxCount": 1
}
}
}
```

## Add OnlyOffice to nginx conf

Add this to seafile.nginx.conf

```
# Required for only office document server
map $http_x_forwarded_proto $the_scheme {
default $http_x_forwarded_proto;
"" $scheme;
}
map $http_x_forwarded_host $the_host {
default $http_x_forwarded_host;
"" $host;
}
map $http_upgrade $proxy_connection {
default upgrade;
"" close;
}
server {
listen 80;
...
}
server {
listen 443 ssl;
...
location /onlyofficeds/ {
proxy_pass http://oods/;
proxy_http_version 1.1;
client_max_body_size 100M;
proxy_read_timeout 3600s;
proxy_connect_timeout 3600s;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $proxy_connection;
proxy_set_header X-Forwarded-Host $the_host/onlyofficeds;
proxy_set_header X-Forwarded-Proto $the_scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
```

## Modify seahub_settings.py

Add this to seahub_settings.py

```python
# OnlyOffice
ENABLE_ONLYOFFICE = True
VERIFY_ONLYOFFICE_CERTIFICATE = True
ONLYOFFICE_APIJS_URL = 'http://<your-seafile-doamin>/onlyofficeds/webapps/apps/api/documents/api.js'
ONLYOFFICE_FILE_EXTENSION = ('doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx', 'odt',
'fodt', 'odp', 'fodp', 'ods', 'fods')
ONLYOFFICE_EDIT_FILE_EXTENSION = ('docx', 'pptx', 'xlsx')
ONLYOFFICE_JWT_SECRET = 'your-secret-string'
```

## Restart docker container

```shell
docker-compose down
docker-compose up -d
```

Wait some minutes until OnlyOffice finished initializing.

Now OnlyOffice can be used.
Loading

0 comments on commit 0938231

Please sign in to comment.