Skip to content

Commit

Permalink
Merge pull request #13 from ishannz/feature/ss4-upgrade
Browse files Browse the repository at this point in the history
Upgrade the module to compatible with ss4
  • Loading branch information
Joshua Carter authored Nov 22, 2019
2 parents 6931f00 + 5d3123c commit a7bf376
Show file tree
Hide file tree
Showing 24 changed files with 1,140 additions and 776 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.idea
37 changes: 26 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,32 @@ composer require symbiote/silverstripe-steamedclams:~2.0

# Quick Start

1) Install ClamAV
1) Install ClamAV in Unix/Linux.
```
sudo apt install clamav clamav-daemon
```
run ``` sudo apt-get install apt-get update``` when necessary.

2) Start clamav-daemon
```
sudo service clamav-freshclam restart
# wait ~2 minutes
sudo service clamav-daemon start
```
And check the clamav-daemon is running.
```
sudo service clamav-daemon status
```

2) Setup socket permissions
NOTE: I am by no means a *nix/server expert, but this is what I did to get it going.
3) Setup socket permissions
The clamav-daemon creates this /var/run/clamav/clamd.ctl if not.
```
sudo mkdir /var/run/clamav
sudo chown -R defaultsite:defaultsite /var/run/clamav
clamd
sudo chown -R user:group /var/run/clamav
```
* 'defaultsite' being the user and group that has ownership.
'defaultsite' being the user and group that has ownership.

3) Configure clamd.conf:
4) Configure clamd.conf:
```
# Path to a local socket file the daemon will listen on.
# Default: disabled (must be specified by a user)
Expand All @@ -44,9 +58,10 @@ Symbiote\SteamedClams\ClamAV:
LocalSocket: '/var/run/clamav/clamd.ctl'
```
4) After running dev/build, all files should scan for viruses automatically during uploading / validation.
5) After running dev/build?flush, all files should scan for viruses automatically during uploading / validation.
If you are using
5) To check to see if it's running properly, it should show that it's ONLINE at: http://{mysite.com}/admin/clamav
6) To check to see if it's running properly, it should show that it's ONLINE at: http://{mysite.com}/admin/clamav
# Configuration
Expand Down Expand Up @@ -122,11 +137,11 @@ ClamAVEmulator::config()->mode = ClamAVEmulator::MODE_OFFLINE;
```

# Supports
- Silverstripe 3.2 and up (3.1 *should* work, create an issue if you determine otherwise)
- Silverstripe 4.0 and up
- [Versioned Files](https://github.com/symbiote/silverstripe-versionedfiles)
- [CDN Content](https://github.com/symbiote/silverstripe-cdncontent)
- For Silverstripe 3.2 and up (3.1 *should* work, create an issue if you determine otherwise) use 1.0

# Credits

[Barakat S](https://github.com/FileZ/php-clamd) for clamd PHP interface
["How to Forge" users](https://web.archive.org/web/20161124000346/https://www.howtoforge.com/community/threads/clamd-will-not-start.34559/) for fixing permission issues
7 changes: 5 additions & 2 deletions _config/extensions.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
---
Name: steamedclams
---
File:
SilverStripe\Assets\File:
extensions:
['Symbiote\SteamedClams\ClamAVExtension']
- Symbiote\SteamedClams\Extension\ClamAVExtension
SilverStripe\SiteConfig\SiteConfig:
extensions:
- Symbiote\SteamedClams\Extension\ClamAVSiteConfigExtension
File renamed without changes.
File renamed without changes
120 changes: 0 additions & 120 deletions code/admin/ClamAVAdmin.php

This file was deleted.

123 changes: 0 additions & 123 deletions code/jobs/ClamAVScanJob.php

This file was deleted.

55 changes: 32 additions & 23 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,27 +1,36 @@
{
"name": "symbiote/silverstripe-steamedclams",
"description": "",
"type": "silverstripe-module",
"keywords": ["silverstripe"],
"license": "BSD-3-Clause",
"authors": [
"name": "symbiote/silverstripe-steamedclams",
"description": "",
"type": "silverstripe-vendormodule",
"keywords": [
"silverstripe"
],
"license": "BSD-3-Clause",
"authors": [
{
"name": "Jake Bentvelzen",
"email": "jake@symbiote.com.au"
}],
"require": {
"silverstripe/framework": "~3.2"
"name": "Jake Bentvelzen",
"email": "jake@symbiote.com.au"
}
],
"require": {
"silverstripe/framework": "^4"
},
"suggest": {
"silverstripe/queuedjobs": "For allowing ClamAV 'missed files' scan to be run from a queued job. Otherwise you can run the tasks manually or via cronjob."
},
"extra": {
"branch-alias": {
"dev-master": "3.0.x-dev"
},
"suggest": {
"silverstripe/queuedjobs": "For allowing ClamAV 'missed files' scan to be run from a queued job. Otherwise you can run the tasks manually or via cronjob."
},
"extra": {
"branch-alias": {
"dev-master": "2.0.x-dev"
},
"installer-name": "steamedclams"
},
"replace": {
"silbinarywolf/silverstripe-steamedclams": "self.version"
}
"expose": [
"client/css",
"client/images"
]
},
"autoload": {
"psr-4": {
"Symbiote\\SteamedClams\\": "src/",
"Symbiote\\SteamedClams\\Tests\\": "tests/"
}
}
}
Loading

0 comments on commit a7bf376

Please sign in to comment.