lacuscore 1.5.11__tar.gz → 1.5.12__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {lacuscore-1.5.11 → lacuscore-1.5.12}/PKG-INFO +2 -2
- {lacuscore-1.5.11 → lacuscore-1.5.12}/lacuscore/lacuscore.py +10 -0
- {lacuscore-1.5.11 → lacuscore-1.5.12}/pyproject.toml +3 -3
- {lacuscore-1.5.11 → lacuscore-1.5.12}/LICENSE +0 -0
- {lacuscore-1.5.11 → lacuscore-1.5.12}/README.md +0 -0
- {lacuscore-1.5.11 → lacuscore-1.5.12}/lacuscore/__init__.py +0 -0
- {lacuscore-1.5.11 → lacuscore-1.5.12}/lacuscore/lacus_monitoring.py +0 -0
- {lacuscore-1.5.11 → lacuscore-1.5.12}/lacuscore/py.typed +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: lacuscore
|
3
|
-
Version: 1.5.
|
3
|
+
Version: 1.5.12
|
4
4
|
Summary: Core of Lacus, usable as a module
|
5
5
|
Home-page: https://github.com/ail-project/LacusCore
|
6
6
|
License: BSD-3-Clause
|
@@ -24,7 +24,7 @@ Classifier: Topic :: Security
|
|
24
24
|
Provides-Extra: docs
|
25
25
|
Requires-Dist: Sphinx (>=7.0.1,<8.0.0) ; extra == "docs"
|
26
26
|
Requires-Dist: defang (>=0.5.3,<0.6.0)
|
27
|
-
Requires-Dist: playwrightcapture[recaptcha] (>=1.20.
|
27
|
+
Requires-Dist: playwrightcapture[recaptcha] (>=1.20.8,<2.0.0)
|
28
28
|
Requires-Dist: redis[hiredis] (>=4.5.5,<5.0.0)
|
29
29
|
Requires-Dist: requests (>=2.31.0,<3.0.0)
|
30
30
|
Requires-Dist: ua-parser (>=0.16.1,<0.17.0)
|
@@ -17,6 +17,7 @@ import zlib
|
|
17
17
|
|
18
18
|
from asyncio import Task
|
19
19
|
from base64 import b64decode, b64encode
|
20
|
+
from datetime import date
|
20
21
|
from enum import IntEnum, unique
|
21
22
|
from logging import LoggerAdapter
|
22
23
|
from pathlib import Path
|
@@ -424,6 +425,7 @@ class LacusCore():
|
|
424
425
|
|
425
426
|
logger = LacusCoreLogAdapter(self.master_logger, {'uuid': uuid})
|
426
427
|
self.redis.zadd('lacus:ongoing', {uuid: time.time()})
|
428
|
+
today = date.today().isoformat()
|
427
429
|
|
428
430
|
retry = False
|
429
431
|
try:
|
@@ -572,6 +574,12 @@ class LacusCore():
|
|
572
574
|
rendered_hostname_only=to_capture.get('rendered_hostname_only', True),
|
573
575
|
max_depth_capture_time=self.max_capture_time),
|
574
576
|
timeout=self.max_capture_time)
|
577
|
+
if 'error' in playwright_result and 'error_name' in playwright_result:
|
578
|
+
# generate stats
|
579
|
+
if playwright_result['error_name'] is not None:
|
580
|
+
self.redis.zincrby(f'stats:{today}:errors', 1, playwright_result['error_name'])
|
581
|
+
# Expire it in 10 days
|
582
|
+
self.redis.expire(f'stats:{today}:errors', 3600 * 24 * 10)
|
575
583
|
except PlaywrightCaptureException as e:
|
576
584
|
logger.exception(f'Invalid parameters for the capture of {url} - {e}')
|
577
585
|
result = {'error': f'Invalid parameters for the capture of {url} - {e}'}
|
@@ -607,6 +615,8 @@ class LacusCore():
|
|
607
615
|
else:
|
608
616
|
error_msg = result['error'] if result.get('error') else 'Unknown error'
|
609
617
|
logger.info(f'Retried too many times {url}: {error_msg}')
|
618
|
+
self.redis.sadd(f'stats:{today}:retry_failed', url)
|
619
|
+
self.redis.expire(f'stats:{today}:retry_failed', 3600 * 24 * 10)
|
610
620
|
|
611
621
|
except CaptureError:
|
612
622
|
if not result:
|
@@ -1,6 +1,6 @@
|
|
1
1
|
[tool.poetry]
|
2
2
|
name = "lacuscore"
|
3
|
-
version = "1.5.
|
3
|
+
version = "1.5.12"
|
4
4
|
description = "Core of Lacus, usable as a module"
|
5
5
|
authors = ["Raphaël Vinot <raphael.vinot@circl.lu>"]
|
6
6
|
license = "BSD-3-Clause"
|
@@ -32,7 +32,7 @@ include = ['README.md']
|
|
32
32
|
python = "^3.8"
|
33
33
|
requests = "^2.31.0"
|
34
34
|
Sphinx = { version = "^7.0.1", optional = true }
|
35
|
-
playwrightcapture = {extras = ["recaptcha"], version = "^1.20.
|
35
|
+
playwrightcapture = {extras = ["recaptcha"], version = "^1.20.8"}
|
36
36
|
defang = "^0.5.3"
|
37
37
|
ua-parser = "^0.16.1"
|
38
38
|
redis = {version = "^4.5.5", extras = ["hiredis"]}
|
@@ -42,7 +42,7 @@ docs = ["Sphinx"]
|
|
42
42
|
|
43
43
|
[tool.poetry.group.dev.dependencies]
|
44
44
|
types-redis = {version = "^4.5.5.2"}
|
45
|
-
mypy = "^1.
|
45
|
+
mypy = "^1.4.0"
|
46
46
|
types-requests = "^2.31.0.1"
|
47
47
|
ipython = [
|
48
48
|
{version = "<8.13.0", python = "<3.9"},
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|