lacuscore 1.12.1__py3-none-any.whl → 1.12.3__py3-none-any.whl
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/lacuscore.py +8 -3
- {lacuscore-1.12.1.dist-info → lacuscore-1.12.3.dist-info}/METADATA +2 -2
- {lacuscore-1.12.1.dist-info → lacuscore-1.12.3.dist-info}/RECORD +5 -5
- {lacuscore-1.12.1.dist-info → lacuscore-1.12.3.dist-info}/LICENSE +0 -0
- {lacuscore-1.12.1.dist-info → lacuscore-1.12.3.dist-info}/WHEEL +0 -0
lacuscore/lacuscore.py
CHANGED
@@ -82,6 +82,7 @@ class LacusCore():
|
|
82
82
|
|
83
83
|
:param redis_connector: Pre-configured connector to a redis instance.
|
84
84
|
:param max_capture_time: If the capture takes more than that time, break (in seconds)
|
85
|
+
:param expire_results: The capture results are stored in redis. Expire them after they are done (in seconds).
|
85
86
|
:param tor_proxy: URL to a SOCKS 5 tor proxy. If you have tor installed, this is the default: socks5://127.0.0.1:9050.
|
86
87
|
:param only_global_lookups: Discard captures that point to non-public IPs.
|
87
88
|
:param max_retries: How many times should we re-try a capture if it failed.
|
@@ -89,6 +90,7 @@ class LacusCore():
|
|
89
90
|
|
90
91
|
def __init__(self, redis_connector: Redis[bytes], /, *,
|
91
92
|
max_capture_time: int=3600,
|
93
|
+
expire_results: int=36000,
|
92
94
|
tor_proxy: str | None=None,
|
93
95
|
only_global_lookups: bool=True,
|
94
96
|
max_retries: int=3,
|
@@ -97,6 +99,7 @@ class LacusCore():
|
|
97
99
|
self.master_logger.setLevel(loglevel)
|
98
100
|
self.redis = redis_connector
|
99
101
|
self.max_capture_time = max_capture_time
|
102
|
+
self.expire_results = expire_results
|
100
103
|
self.tor_proxy = tor_proxy
|
101
104
|
self.only_global_lookups = only_global_lookups
|
102
105
|
self.max_retries = max_retries
|
@@ -620,6 +623,8 @@ class LacusCore():
|
|
620
623
|
self._store_capture_response(p, uuid, result)
|
621
624
|
else:
|
622
625
|
logger.warning('Got no result at all for the capture.')
|
626
|
+
result = {'error': 'No result at all for the capture, Playwright failed.'}
|
627
|
+
self._store_capture_response(p, uuid, result)
|
623
628
|
p.delete(f'lacus:capture_settings:{uuid}')
|
624
629
|
p.zrem('lacus:ongoing', uuid)
|
625
630
|
p.execute()
|
@@ -679,7 +684,7 @@ class LacusCore():
|
|
679
684
|
if hash_to_set:
|
680
685
|
pipeline.hset(root_key, mapping=hash_to_set) # type: ignore[arg-type]
|
681
686
|
# Make sure the key expires
|
682
|
-
pipeline.expire(root_key,
|
687
|
+
pipeline.expire(root_key, self.expire_results)
|
683
688
|
else:
|
684
689
|
logger.critical(f'Nothing to store (Hash: {hash_to_set}) for {root_key}')
|
685
690
|
|
@@ -765,7 +770,7 @@ class LacusCore():
|
|
765
770
|
continue
|
766
771
|
raise e
|
767
772
|
except DNSException as e:
|
768
|
-
logger.
|
773
|
+
logger.debug(f'No A record for "{hostname}": {e}')
|
769
774
|
break
|
770
775
|
|
771
776
|
_current_retries = 0
|
@@ -781,6 +786,6 @@ class LacusCore():
|
|
781
786
|
continue
|
782
787
|
raise e
|
783
788
|
except DNSException as e:
|
784
|
-
logger.
|
789
|
+
logger.debug(f'No AAAA record for "{hostname}": {e}')
|
785
790
|
break
|
786
791
|
return resolved_ips
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: lacuscore
|
3
|
-
Version: 1.12.
|
3
|
+
Version: 1.12.3
|
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
|
@@ -29,7 +29,7 @@ Requires-Dist: async-timeout (>=4.0.3,<5.0.0) ; python_version < "3.11"
|
|
29
29
|
Requires-Dist: defang (>=0.5.3,<0.6.0)
|
30
30
|
Requires-Dist: dnspython (>=2.7.0,<3.0.0) ; python_version >= "3.9"
|
31
31
|
Requires-Dist: eval-type-backport (>=0.2.0,<0.3.0) ; python_version < "3.10"
|
32
|
-
Requires-Dist: playwrightcapture[recaptcha] (>=1.27.
|
32
|
+
Requires-Dist: playwrightcapture[recaptcha] (>=1.27.1,<2.0.0)
|
33
33
|
Requires-Dist: pydantic (>=2.9.2,<3.0.0)
|
34
34
|
Requires-Dist: redis[hiredis] (>=5.2.0,<6.0.0)
|
35
35
|
Requires-Dist: requests (>=2.32.3,<3.0.0)
|
@@ -1,10 +1,10 @@
|
|
1
1
|
lacuscore/__init__.py,sha256=aLBshQPT9IBDKn5qWrX9A_exqtLFPyLsQiPWdfpAFjA,537
|
2
2
|
lacuscore/helpers.py,sha256=a7dwcNwwF04czQaGaVdcDrXbBJvAdGTJU7Gi4L_pNd4,10954
|
3
3
|
lacuscore/lacus_monitoring.py,sha256=r6IaYuh6sMq43eOWdZx0fU8p4PWVZlqSD6nr6yOaTUU,2713
|
4
|
-
lacuscore/lacuscore.py,sha256=
|
4
|
+
lacuscore/lacuscore.py,sha256=LhX-3B7I-yWs2BjXKjh_-4vGruapI2-4e9eg_BX8nJo,41690
|
5
5
|
lacuscore/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
6
6
|
lacuscore/task_logger.py,sha256=2wDotU6r6vn-aKO8nZNdxSuisSj11LlcxuvW60qPL0Y,1909
|
7
|
-
lacuscore-1.12.
|
8
|
-
lacuscore-1.12.
|
9
|
-
lacuscore-1.12.
|
10
|
-
lacuscore-1.12.
|
7
|
+
lacuscore-1.12.3.dist-info/LICENSE,sha256=4C4hLYrIkUD96Ggk-y_Go1Qf7PBZrEm9PSeTGe2nd4s,1516
|
8
|
+
lacuscore-1.12.3.dist-info/METADATA,sha256=i2tNewOrJYt0Rg9hO4AqmzurYYAiQjIUYWZAAnMkx5k,2806
|
9
|
+
lacuscore-1.12.3.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
10
|
+
lacuscore-1.12.3.dist-info/RECORD,,
|
File without changes
|
File without changes
|