Skip to content

Commit

Permalink
django 5 fixes + free_space_monitor
Browse files Browse the repository at this point in the history
  • Loading branch information
doomedraven committed Feb 6, 2025
1 parent 8c6ff0a commit 5876999
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/cuckoo/core/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ def is_short_on_disk_space(self):
# Resolve the full base path to the analysis folder, just in
# case somebody decides to make a symbolic link out of it.
dir_path = os.path.join(CUCKOO_ROOT, "storage", "analyses")
need_space, space_available = free_space_monitor(dir_path, return_value=True, analysis=True)
need_space, space_available = free_space_monitor(dir_path, analysis=True)
if need_space:
log.error(
"Not enough free disk space! (Only %d MB!). You can change limits it in cuckoo.conf -> freespace", space_available
Expand Down
1 change: 0 additions & 1 deletion modules/processing/analysisinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

import codecs
import logging
import os
import time
from contextlib import suppress
from datetime import datetime
Expand Down
18 changes: 17 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ bs4 = "0.0.1"
pydeep2 = "0.5.1"
django-recaptcha = "4.0.0" # https://pypi.org/project/django-recaptcha/
django-crispy-forms = "2.3"
crispy-bootstrap4 = "2024.10"
django-settings-export = "1.2.1"
django-csp = "3.8"
django-extensions = "3.2.3"
Expand Down
2 changes: 1 addition & 1 deletion utils/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ def autoprocess(
# If not enough free disk space is available, then we print an
# error message and wait another round (this check is ignored
# when the freespace configuration variable is set to zero).
if cfg.cuckoo.freespace:
if cfg.cuckoo.freespace_processing:
# Resolve the full base path to the analysis folder, just in
# case somebody decides to make a symbolic link out of it.
dir_path = os.path.join(CUCKOO_ROOT, "storage", "analyses")
Expand Down
3 changes: 2 additions & 1 deletion web/web/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@
# "allauth.socialaccount.providers.google",
# "allauth.socialaccount.providers.microsoft",
"crispy_forms",
"crispy_bootstrap4",
"django_recaptcha", # https://pypi.org/project/django-recaptcha/
"rest_framework",
"rest_framework.authtoken",
Expand Down Expand Up @@ -340,7 +341,7 @@

ACCOUNT_EMAIL_REQUIRED = web_cfg.registration.get("email_required", False)
ACCOUNT_EMAIL_SUBJECT_PREFIX = web_cfg.registration.get("email_prefix_subject", False)
ACCOUNT_RATE_LIMITS = {"login_failed": 3}
ACCOUNT_RATE_LIMITS = {"login_failed": "3/m"}
LOGIN_REDIRECT_URL = "/"
ACCOUNT_LOGOUT_REDIRECT_URL = "/accounts/login/"
MANUAL_APPROVE = web_cfg.registration.get("manual_approve", False)
Expand Down

0 comments on commit 5876999

Please sign in to comment.