Open DietPawel opened 11 months ago
The issue seems to be a bug in the django-simple-captcha library. Generated audio files are never being deleted, even after captcha expires.
Opened issue: https://github.com/mbi/django-simple-captcha/issues/225
I made a PR there with a trivial fix in October, though it hasn't been merged nor reviewed yet.
The solution in the current PR will not work on Windows as calling os.remove while the file is in use results in error (https://docs.python.org/3/library/os.html#os.remove). Will add a PR using the tempfile library that should work on both Unix and Windows.
Added a PR that should work on both Unix and Windows. https://github.com/mbi/django-simple-captcha/pull/226
Wouldn't your approach create and delete this file on every request?
Keep in mind that /tmp can be separate for different workers of uwsgi when running on separated containers.
I think allowing caching and reusing already created files would require using filetracker with TTL for files. I think S3 supports TTL for files, why not migrate to S3 and make our life easier in the future?
Steps to reproduce:
sox
andflite
to enable audio captcha files/tmp
directory and are never deleted by oioioi.