Giter Site home page Giter Site logo

django-clamd's People

Contributors

emoitzi avatar kyerussell avatar memuller avatar mrkgrgsn avatar pyup-bot avatar svb0866 avatar vstoykov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

django-clamd's Issues

ERROR: test_infinite_stream

System check identified no issues (0 silenced).
...The file is too large for ClamD to scan it. Bytes Read 26313728
E.

ERROR: test_infinite_stream (django_clamd.tests.test.VirusValidatorTestCase)

Traceback (most recent call last):

src/django-clamd/src/django_clamd/validators.py", line 25, in validate_file_infection
result = scanner.instream(file)

lib/python3.10/site-packages/clamd/init.py", line 190, in instream
self.clamd_socket.send(size + chunk)
ConnectionResetError: [Errno 104] Connection reset by peer

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

src/django-clamd/src/django_clamd/tests/test.py", line 56, in test_infinite_stream
validate_file_infection(stream)

src/django-clamd/src/django_clamd/validators.py", line 33, in validate_file_infection
raise ValidationError(
django.core.exceptions.ValidationError: ['Malware scan could not completed. Please try again later.']


Ran 5 tests in 0.095s

FAILED (errors=1)

Hello, I am on currently on commit 989141f
(also f98c318)
When I run python manage.py test django_clamd.tests the test_infinite_stream is failing

Ubuntu (WSL and Ubuntu Server)
Clamd 0.103.9 (No Changes since initial install)
Python 3.10.12 (No Changes since initial install)

All tests passed sometime within the past month on 3 different machines
Now all 3 get this test failure

I appreciate any guidance in resolving this issue, please let me know if I can provide any more information

Configuration - incorrect documentation

In document, it states the default configuration are
CLAMD_SOCKET = '/var/run/clamav/clamd.ctl'
CLAMD_USE_TCP = False
CLAMD_TCP_SOCKET = 3310
CLAMD_TCP_ADDR = '127.0.0.1'

But it should be
CLAMD_SOCKET = '/var/run/clamav/clamd.ctl'
CLAMD_USE_TCP = False
CLAMD_TCP_PORT = 3310
CLAMD_TCP_SOCKET = '127.0.0.1'

Thanks

Initial Update

Hi ๐Ÿ‘Š

This is my first visit to this fine repo, but it seems you have been working hard to keep all dependencies updated so far.

Once you have closed this issue, I'll create separate pull requests for every update as soon as I find one.

That's it for now!

Happy merging! ๐Ÿค–

Test Case Fails

I ran the code python3 manage.py test django_clamd.tests

======================================================================
FAIL: test_has_virus (django_clamd.tests.test.VirusValidatorTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/django_clamd/tests/test.py", line 23, in test_has_virus
    self.assertFalse(form.is_valid())
AssertionError: True is not false

======================================================================
FAIL: test_infinite_stream (django_clamd.tests.test.VirusValidatorTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/django_clamd/tests/test.py", line 54, in test_infinite_stream
    self.assertGreaterEqual(stream._read_bytes, 5 * 1024 * 1024)
AssertionError: 25600 not greater than or equal to 5242880

Ran 3 tests in 0.010s

FAILED (failures=2)

Check for empty / Null files

The validator appears to throw an exception when the submitted file is null - since a null / non-existing file is not an infected file, I would suggest wrapping the initial seek(0) with a try/except:

# Check if the file is not empty / exists
try:
    file.seek(0)
except:
    return

Please push the latest updates to pypi

Thank you for the wonderful plugin! Can you possibly publish the current version to pypi? I see you have updated the validators.py to import gettext_lazy in place of ugettext_lazy, but pip3 still pulls the original version incompatible with the current Django. Thank you!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.