Add the ability to choose the database path at startup. Add more tests. Add bandit
All checks were successful
CI / test (push) Successful in 3m49s
Lint / test (push) Successful in 29s
Trivy / test (push) Successful in 21s

This commit is contained in:
Miguel Jacq 2025-11-17 15:15:00 +11:00
parent 8c7226964a
commit 6bc5b66d3f
Signed by: mig5
GPG key ID: 59B3F0C24135C6A9
16 changed files with 297 additions and 97 deletions

View file

@ -433,7 +433,7 @@ class DBManager:
"""
if not name:
return "#CCCCCC"
h = int(hashlib.sha1(name.encode("utf-8")).hexdigest()[:8], 16)
h = int(hashlib.sha1(name.encode("utf-8")).hexdigest()[:8], 16) # nosec
return _TAG_COLORS[h % len(_TAG_COLORS)]
# -------- Tags: per-page -------------------------------------------
@ -514,7 +514,7 @@ class DBManager:
SELECT id, name
FROM tags
WHERE name IN ({placeholders});
""",
""", # nosec
tuple(final_tag_names),
).fetchall()
ids_by_name = {r["name"]: r["id"] for r in rows}