diff --git a/README.md b/README.md index e15de86ab..ce1d66528 100644 --- a/README.md +++ b/README.md @@ -2,11 +2,11 @@ cve-search ========== [![Join the chat at https://gitter.im/cve-search/cve-search](https://badges.gitter.im/cve-search/cve-search.svg)](https://gitter.im/cve-search/cve-search?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) - -![cve-search logo](https://avatars3.githubusercontent.com/u/15033728?v=3&s=200) - ![Build & Test](https://github.com/cve-search/cve-search/workflows/Build%20&%20Test/badge.svg) +![Black formatting](https://github.com/cve-search/cve-search/workflows/Black%20formatting/badge.svg) +![CodeQL](https://github.com/cve-search/cve-search/workflows/CodeQL/badge.svg) +![cve-search logo](https://avatars3.githubusercontent.com/u/15033728?v=3&s=200) cve-search is a tool to import CVE (Common Vulnerabilities and Exposures) and CPE (Common Platform Enumeration) into a MongoDB to facilitate search diff --git a/_etc/systemd/system/cvesearch.db_init.service b/_etc/systemd/system/cvesearch.db_init.service index bdad53fae..2197098c5 100644 --- a/_etc/systemd/system/cvesearch.db_init.service +++ b/_etc/systemd/system/cvesearch.db_init.service @@ -1,7 +1,7 @@ [Unit] Description=circl dot lu CVE-Search database initialization (only run this once!) -Requires=mongodb.service redis-server.service -After=network.target mongodb.service redis-server.service +Requires=mongod.service redis-server.service +After=network.target mongod.service redis-server.service RefuseManualStart=true Documentation=https://cve-search.github.io/cve-search/getting_started/installation.html diff --git a/_etc/systemd/system/cvesearch.db_repopulate.service b/_etc/systemd/system/cvesearch.db_repopulate.service index 7861cc9ef..e57524cd0 100644 --- a/_etc/systemd/system/cvesearch.db_repopulate.service +++ b/_etc/systemd/system/cvesearch.db_repopulate.service @@ -1,7 +1,7 @@ [Unit] Description=circl dot lu CVE-Search database repopulation (drop & reimport everything) -Requires=mongodb.service redis-server.service -After=network.target cvesearch.db_init.service cvesearch.db_updater.service mongodb.service redis-server.service +Requires=mongod.service redis-server.service +After=network.target cvesearch.db_init.service cvesearch.db_updater.service mongod.service redis-server.service RefuseManualStart=true Documentation=https://cve-search.github.io/cve-search/database/database.html diff --git a/_etc/systemd/system/cvesearch.db_updater.service b/_etc/systemd/system/cvesearch.db_updater.service index 5bff42489..cb17abf78 100644 --- a/_etc/systemd/system/cvesearch.db_updater.service +++ b/_etc/systemd/system/cvesearch.db_updater.service @@ -1,7 +1,7 @@ [Unit] Description=circl dot lu CVE-Search db_updater service -Requires=mongodb.service redis-server.service -After=network.target cvesearch.db_init.service cvesearch.db_repopulate.service mongodb.service redis-server.service +Requires=mongod.service redis-server.service +After=network.target cvesearch.db_init.service cvesearch.db_repopulate.service mongod.service redis-server.service Documentation=https://cve-search.github.io/cve-search/database/database.html [Service] diff --git a/_etc/systemd/system/cvesearch.web.service b/_etc/systemd/system/cvesearch.web.service index c155fa277..ee0887104 100644 --- a/_etc/systemd/system/cvesearch.web.service +++ b/_etc/systemd/system/cvesearch.web.service @@ -1,7 +1,7 @@ [Unit] Description=circl dot lu CVE-Search Web Server -Requires=mongodb.service -After=network.target cvesearch.db_init.service cvesearch.db_repopulate.service mongodb.service +Requires=mongod.service +After=network.target cvesearch.db_init.service cvesearch.db_repopulate.service mongod.service Documentation=https://cve-search.github.io/cve-search/webgui/webgui.html [Service] diff --git a/bin/dump_last.py b/bin/dump_last.py index 9e4a8b1a3..e587bdd97 100755 --- a/bin/dump_last.py +++ b/bin/dump_last.py @@ -62,9 +62,9 @@ + str(datetime.datetime.now()) ) feed.feed["link"] = "http://adulau.github.com/cve-search/" - feed.feed[ - "author" - ] = "Generated with cve-search available at http://adulau.github.com/cve-search/" + feed.feed["author"] = ( + "Generated with cve-search available at http://adulau.github.com/cve-search/" + ) feed.feed["description"] = "" else: print("") diff --git a/lib/DatabasePlugins/mongodb.py b/lib/DatabasePlugins/mongodb.py index bf03acff0..88a4f471f 100644 --- a/lib/DatabasePlugins/mongodb.py +++ b/lib/DatabasePlugins/mongodb.py @@ -309,13 +309,13 @@ def datatables_data_columns_ordering(self, request_values): check_col_match.group(3) ] = request_values[each] else: - col[check_col_match.group(1)][ - check_col_match.group(2) - ] = request_values[each] + col[check_col_match.group(1)][check_col_match.group(2)] = ( + request_values[each] + ) if check_order_match: - order[check_order_match.group(1)][ - check_order_match.group(2) - ] = request_values[each] + order[check_order_match.group(1)][check_order_match.group(2)] = ( + request_values[each] + ) return col, order diff --git a/lib/LogHandler.py b/lib/LogHandler.py index d1a9086f4..9d13cfa4c 100644 --- a/lib/LogHandler.py +++ b/lib/LogHandler.py @@ -2,6 +2,7 @@ LogHandler.py ============= """ + import logging import os import platform diff --git a/web/helpers/server_side_datatables.py b/web/helpers/server_side_datatables.py index e68bc8466..79504297a 100644 --- a/web/helpers/server_side_datatables.py +++ b/web/helpers/server_side_datatables.py @@ -2,6 +2,7 @@ server_side_datatables.py ========================= """ + from collections import namedtuple, defaultdict