diff --git a/web_server.py b/web_server.py index cc0df5c..7ca8aee 100755 --- a/web_server.py +++ b/web_server.py @@ -32,6 +32,9 @@ MAX_QUERY_LENGTH = 256 VULN_RESULTS_CACHE, CPE_SUGGESTIONS_CACHE = {}, {} RECAPTCHA_THRESHOLD = 0.7 +with open(os.path.join(PROJECT_DIR, 'version.txt')) as f: + SEARCH_VULNS_VERSION = f.read() + app = Flask(__name__, static_folder=STATIC_FOLDER, template_folder=TEMPLATE_FOLDER) config = _load_config(CONFIG_FILE) @@ -255,7 +258,7 @@ def index(): recaptcha_settings = {'recaptcha_site_key': config['RECAPTCHA_AND_API']['SITE_KEY_V3'], 'show_captcha': show_captcha} - return render_template("index.html", **recaptcha_settings) + return render_template("index.html", sv_version=SEARCH_VULNS_VERSION, **recaptcha_settings) def style_converted_html(markdown_html, center_captions=False): @@ -285,14 +288,14 @@ def about(): markdown_content = f.read() license_html = style_converted_html(markdown.markdown(markdown_content), True) - return render_template("about.html", about_html=about_html, license_html=license_html) + return render_template("about.html", sv_version=SEARCH_VULNS_VERSION, about_html=about_html, license_html=license_html) @app.route("/api/setup") def api_setup(): recaptcha_settings = {'recaptcha_site_key': config['RECAPTCHA_AND_API']['SITE_KEY_V2'], 'show_captcha': config['RECAPTCHA_AND_API']['ENABLED']} - return render_template("api-setup.html", **recaptcha_settings) + return render_template("api-setup.html", sv_version=SEARCH_VULNS_VERSION, **recaptcha_settings) @app.route("/api/generate-key", methods=['POST']) @@ -361,7 +364,7 @@ def news(): changelog_html = style_converted_html(markdown.markdown(markdown_content), False) changelog_html = changelog_html.replace('

*:where(.active) { border-top-width: 2px; --tw-bg-opacity: 1; @@ -2693,10 +2707,19 @@ html { z-index: 1; } +.m-0 { + margin: 0px; +} + .m-1 { margin: 0.25rem; } +.mx-0 { + margin-left: 0px; + margin-right: 0px; +} + .mx-3 { margin-left: 0.75rem; margin-right: 0.75rem; @@ -2994,6 +3017,14 @@ html { border-radius: 0.5rem; } +.rounded { + border-radius: 0.25rem; +} + +.border { + border-width: 1px; +} + .border-none { border-style: none; } @@ -3052,6 +3083,21 @@ html { padding-right: 0.75rem; } +.px-2 { + padding-left: 0.5rem; + padding-right: 0.5rem; +} + +.py-1 { + padding-top: 0.25rem; + padding-bottom: 0.25rem; +} + +.py-0 { + padding-top: 0px; + padding-bottom: 0px; +} + .pl-6 { padding-left: 1.5rem; } @@ -3107,6 +3153,11 @@ html { line-height: 1.75rem; } +.text-xs { + font-size: 0.75rem; + line-height: 1rem; +} + .font-bold { font-weight: 700; } diff --git a/web_server_files/templates/base.html b/web_server_files/templates/base.html index d2f40e7..6358847 100644 --- a/web_server_files/templates/base.html +++ b/web_server_files/templates/base.html @@ -39,7 +39,8 @@ - search_vulns + search_vulns{{ sv_version }} +