Skip to content

Commit

Permalink
Merge pull request #279 from haiwen/rewrite_clamav
Browse files Browse the repository at this point in the history
feat: combine the parts about the Clamav into one page
  • Loading branch information
freeplant authored Apr 24, 2024
2 parents 40e90b8 + d96c894 commit d3bfc14
Show file tree
Hide file tree
Showing 6 changed files with 80 additions and 192 deletions.
148 changes: 0 additions & 148 deletions manual/deploy_pro/deploy_clamav_as_daemon.md

This file was deleted.

77 changes: 77 additions & 0 deletions manual/deploy_pro/deploy_clamav_with_seafile.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Deploy ClamAV with Seafile

## Use ClamAV in binary based deployment

### Install clamav-daemon & clamav-freshclam

```
apt-get install clamav-daemon clamav-freshclam
```

You should run Clamd with a root permission to scan any files.
Edit the conf `/etc/clamav/clamd.conf`,change the following line:

```
LocalSocketGroup root
User root
```

### Start the clamav-daemon

```
systemctl start clamav-daemon
```

* Test the software

```
$ curl https://www.eicar.org/download/eicar.com.txt | clamdscan -
```

The output must include:

```
stream: Eicar-Test-Signature FOUND
```

## Use Clamav with Docker based deployment

### 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: clamav/clamav:latest
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.
2 changes: 1 addition & 1 deletion manual/deploy_pro/virus_scan.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ cd seafile-server-latest
If a virus was detected, you can see scan records and delete infected files on the Virus Scan page in the admin area.
![virus-scan](../images/virus-scan.png)

**INFO**: If you directly use clamav command line tool to scan files, scanning files will takes a lot of time. If you want to speed it up, we recommend to run Clamav as a daemon. Please refer to [Run ClamAV as a Daemon](deploy_clamav_as_daemon.md)
**INFO**: If you directly use clamav command line tool to scan files, scanning files will takes a lot of time. If you want to speed it up, we recommend to run Clamav as a daemon. Please refer to [Run ClamAV as a Daemon](delpoy_clamav_with_seafile.md)

When run Clamav as a daemon, the `scan_command` should be `clamdscan` in `seafile.conf`. An example for Clamav-daemon is provided below:
```
Expand Down
41 changes: 0 additions & 41 deletions manual/docker/pro-edition/deploy_clamav_with_docker.md

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ Since version 9.0.6, you can deploy Clamav with Docker.

You need to manually add the Clamav config to docker-compose.yml

* [Clamav with Docker](deploy_clamav_with_docker.md)
* [Deploy Clamav with Docker](../../deploy_pro/deploy_clamav_with_seafile.md)

## Other functions

Expand Down
2 changes: 1 addition & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ nav:
- FUSE extension: extension/fuse.md
- Virus Scan (Pro):
- Outline: deploy_pro/virus_scan.md
- Run ClamAV as a Daemon: deploy_pro/deploy_clamav_as_daemon.md
- Deploy ClamAV with Seafile: deploy_pro/deploy_clamav_with_seafile.md
- Virus Scan With Kav4fs: deploy_pro/virus_scan_with_kav4fs.md
- Advanced User Management (Pro):
- Multi-Institutions Support: deploy_pro/multi_institutions.md
Expand Down

0 comments on commit d3bfc14

Please sign in to comment.