mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-17 05:41:25 +02:00
Some update
This commit is contained in:
@@ -296,6 +296,12 @@ RQ_QUEUES = {
|
||||
'DB': REDIS_QUOTA_DB,
|
||||
'URL': REDIS_URL,
|
||||
},
|
||||
'dovecot': {
|
||||
'HOST': REDIS_HOST,
|
||||
'PORT': REDIS_PORT,
|
||||
'DB': REDIS_QUOTA_DB,
|
||||
'URL': REDIS_URL,
|
||||
},
|
||||
}
|
||||
|
||||
# CACHE
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
"""Core Jobs"""
|
||||
|
||||
|
||||
def clean_log():
|
||||
import datetime
|
||||
|
||||
from modoboa.core.models import Log
|
||||
from modoboa.parameters import tools as param_tools
|
||||
|
||||
from django.utils import timezone
|
||||
|
||||
log_maximum_age = param_tools.get_global_parameter("log_maximum_age")
|
||||
limit = timezone.now() - datetime.timedelta(log_maximum_age)
|
||||
Log.objects.filter(date_created__lt=limit).delete()
|
||||
@@ -0,0 +1,32 @@
|
||||
import datetime
|
||||
import logging
|
||||
|
||||
from django.core.management.base import BaseCommand
|
||||
from django.utils import timezone
|
||||
|
||||
from modoboa.core.models import Log
|
||||
from modoboa.parameters import tools as param_tools
|
||||
|
||||
JOB_IDs = ["clearsessions_r", "cleanlogs_r", "logparser_r"]
|
||||
AMAVIS_IDs = ["qcleanup_r", "amnotify_r"]
|
||||
|
||||
|
||||
class Command(BaseCommand):
|
||||
"""Command class."""
|
||||
|
||||
help = "Checks that redondants jobs are started or start them" # NOQA:A003
|
||||
|
||||
def add_arguments(self, parser):
|
||||
"""Add extra arguments to command line."""
|
||||
parser.add_argument(
|
||||
"--queue-now",
|
||||
action="store_true",
|
||||
default=False,
|
||||
help="Queue all redondant job now",
|
||||
)
|
||||
|
||||
def check_clean_log(queue_now=False):
|
||||
pass
|
||||
|
||||
def handle(self, *args, **options):
|
||||
self.check_clean_log(options["queue_now"])
|
||||
@@ -5,7 +5,10 @@ Contains weak hashers (the original ones) available with Modoboa.
|
||||
"""
|
||||
|
||||
import base64
|
||||
|
||||
import hashlib
|
||||
from random import Random
|
||||
import string
|
||||
from typing import Optional
|
||||
|
||||
from django.utils.crypto import constant_time_compare
|
||||
@@ -49,7 +52,7 @@ class PasswordHasher(metaclass=MetaHasher):
|
||||
def __init__(self, target="local"):
|
||||
self._target = target
|
||||
|
||||
def _encrypt(self, clearvalue: str, salt: Optional[str] = None) -> str: # NOQA
|
||||
def _encrypt(self, clearvalue: str, salt: Optional[str] = None) -> str:
|
||||
raise NotImplementedError
|
||||
|
||||
def _b64encode(self, pwhash):
|
||||
|
||||
@@ -72,6 +72,7 @@ dependencies = [
|
||||
# RQ
|
||||
"rq>=1.13.0",
|
||||
"django-rq",
|
||||
"rq-scheduler",
|
||||
# Sieve
|
||||
"sievelib>=1.4.1",
|
||||
# User
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
pip-compile --output-file=requirements.txt pyproject.toml
|
||||
pip-compile --extra=mysql --output-file=mysql-requirements.txt pyproject.toml
|
||||
pip-compile --extra=postgresql --output-file=postgresql-requirements.txt pyproject.toml
|
||||
pip-compile --extra=ldap --output-file=ldap-requirements.txt pyproject.toml
|
||||
pip-compile --extra=dev --output-file=dev-requirements.txt pyproject.toml
|
||||
pip-compile --extra=test --output-file=test-requirements.txt pyproject.toml
|
||||
Reference in New Issue
Block a user