Update core db tests to use the right hash for plugins_page files
This commit is contained in:
parent
8231198219
commit
2105dc0f32
|
@ -7,7 +7,6 @@ git clone https://github.com/bunkerity/bunkerweb-plugins.git
|
|||
echo "ℹ️ Checking out to dev branch ..."
|
||||
|
||||
cd bunkerweb-plugins
|
||||
git checkout dev # TODO: remove this when the next release of bw-plugins is out
|
||||
|
||||
echo "ℹ️ Extracting ClamAV plugin ..."
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
from contextlib import contextmanager
|
||||
from glob import iglob
|
||||
from hashlib import sha512
|
||||
from hashlib import sha256
|
||||
from json import dumps, load
|
||||
from os import environ, getenv
|
||||
from os.path import dirname, join
|
||||
|
@ -486,14 +486,14 @@ try:
|
|||
print("ℹ️ Checking if all plugin pages are in the database ...", flush=True)
|
||||
|
||||
def file_hash(file: str) -> str:
|
||||
_sha512 = sha512()
|
||||
_sha256 = sha256()
|
||||
with open(file, "rb") as f:
|
||||
while True:
|
||||
data = f.read(1024)
|
||||
if not data:
|
||||
break
|
||||
_sha512.update(data)
|
||||
return _sha512.hexdigest()
|
||||
_sha256.update(data)
|
||||
return _sha256.hexdigest()
|
||||
|
||||
with db_session() as session:
|
||||
plugin_pages = (
|
||||
|
|
Loading…
Reference in New Issue