mirror of
https://github.com/bellingcat/auto-archiver.git
synced 2026-06-12 21:28:29 +03:00
renaming and making default SHA-256
This commit is contained in:
@@ -167,8 +167,8 @@ class Archiver(ABC):
|
|||||||
ha = self.hash_algorithm
|
ha = self.hash_algorithm
|
||||||
logger.debug(f'Hash algorithm is {ha}')
|
logger.debug(f'Hash algorithm is {ha}')
|
||||||
|
|
||||||
if ha == "SHA3_512": hash = hashlib.sha3_512(bytes)
|
if ha == "SHA3-512": hash = hashlib.sha3_512(bytes)
|
||||||
elif ha == "SHA256": hash = hashlib.sha256(bytes)
|
elif ha == "SHA-256": hash = hashlib.sha256(bytes)
|
||||||
else: raise Exception("Unknown Hash Algorithm of {ha}")
|
else: raise Exception("Unknown Hash Algorithm of {ha}")
|
||||||
|
|
||||||
return hash.hexdigest()
|
return hash.hexdigest()
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ class Config:
|
|||||||
)
|
)
|
||||||
self.webdriver = "not initialized"
|
self.webdriver = "not initialized"
|
||||||
|
|
||||||
self.hash_algorithm = execution.get("hash_algorithm")
|
self.hash_algorithm = execution.get("hash_algorithm", "SHA-256")
|
||||||
|
|
||||||
# ---------------------- SECRETS - APIs and service configurations
|
# ---------------------- SECRETS - APIs and service configurations
|
||||||
secrets = self.config.get("secrets", {})
|
secrets = self.config.get("secrets", {})
|
||||||
@@ -261,6 +261,7 @@ class Config:
|
|||||||
"storage": self.storage,
|
"storage": self.storage,
|
||||||
"header": self.header,
|
"header": self.header,
|
||||||
"check_if_exists": self.check_if_exists,
|
"check_if_exists": self.check_if_exists,
|
||||||
|
"hash_algorithm": self.hash_algorithm,
|
||||||
"save_logs": self.save_logs,
|
"save_logs": self.save_logs,
|
||||||
"selenium_config": asdict(self.selenium_config),
|
"selenium_config": asdict(self.selenium_config),
|
||||||
"selenium_webdriver": self.webdriver != None,
|
"selenium_webdriver": self.webdriver != None,
|
||||||
|
|||||||
@@ -80,6 +80,10 @@ execution:
|
|||||||
storage: s3
|
storage: s3
|
||||||
# defaults to false, when true will try to avoid duplicate URL archives
|
# defaults to false, when true will try to avoid duplicate URL archives
|
||||||
check_if_exists: true
|
check_if_exists: true
|
||||||
|
|
||||||
|
# choose a hash algorithm (either SHA-256 or SHA3-512, defaults to SHA-256)
|
||||||
|
# hash_algorithm: SHA-256
|
||||||
|
|
||||||
# optional configurations for the selenium browser that takes screenshots, these are the defaults
|
# optional configurations for the selenium browser that takes screenshots, these are the defaults
|
||||||
selenium:
|
selenium:
|
||||||
# values under 10s might mean screenshots fail to grab screenshot
|
# values under 10s might mean screenshots fail to grab screenshot
|
||||||
@@ -105,7 +109,3 @@ execution:
|
|||||||
screenshot: screenshot
|
screenshot: screenshot
|
||||||
hash: hash
|
hash: hash
|
||||||
|
|
||||||
# Must be either SHA256 or SHA3_512
|
|
||||||
hash_algorithm: SHA3_512
|
|
||||||
# hash_algorithm: SHA256
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user