Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMS 5 compatibility using file string streams #23

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

michalkleiner
Copy link

@michalkleiner michalkleiner commented Apr 9, 2024

Building on top of or replacing existing PRs to provide compatibility with Silverstripe CMS 5 while using file string streams working with external file systems for assets storage such as AWS S3.

Tested locally using fwust/ddev-clamav using a socket shared between containers as well as on Silverstripe Cloud with CMS 5.2-rc1 and PHP 8.3.

Fixes #22.

@gurucomkz
Copy link

This is awesome @michalkleiner !
I hope this gets approved soon enough.

I've encountered a problem when there's no clamd running (PHP8.1):

socket_connect(): unable to connect [2]: No such file or directory in /project/vendor/clue/socket-raw/src/Socket.php at line 111

#0 [internal function]: Symbiote\QueuedJobs\Services\JobErrorHandler->handleError()
#1 /project/vendor/clue/socket-raw/src/Socket.php(111): socket_connect()
#2 /project/vendor/clue/socket-raw/src/Factory.php(27): Socket\Raw\Socket->connect()
#3 /project/vendor/symbiote/silverstripe-steamedclams/src/ClamAV.php(151): Socket\Raw\Factory->createClient()
#4 /project/vendor/symbiote/silverstripe-steamedclams/src/ClamAV.php(102): Symbiote\SteamedClams\ClamAV->getClamd()
#5 /project/vendor/symbiote/silverstripe-steamedclams/src/ClamAV.php(85): Symbiote\SteamedClams\ClamAV->scanFileForVirus()

It can be suppressed by adding another catch to the protected function getClamd():

catch (\Exception $e) {
    throw new Exception('ClamAV error: ' . $e->getMessage());
}

Please, consider adding it. Thank you.

@michalkleiner
Copy link
Author

Thanks for the comment @gurucomkz, will add the catch and fail more gracefully when the daemon is not available. On the merging side of things I can't do much, but can try and ping someone from Symbiote later on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CMS 5 compatibility
3 participants