Skip to content

Commit

Permalink
Elaborate on license information of data sources
Browse files Browse the repository at this point in the history
  • Loading branch information
ra1nb0rn committed May 8, 2024
1 parent 07250ca commit 94b1436
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 10 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,3 +148,5 @@ thread_handling = pool-of-threads
## License
*search_vulns* is licensed under the MIT license, see [here](https://github.com/ra1nb0rn/search_vulns/blob/master/LICENSE).
View the licenses of the included data sources [here](https://github.com/ra1nb0rn/search_vulns/blob/master/resources/license_infos.md).
7 changes: 7 additions & 0 deletions resources/license_infos.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## License Information About search_vulns

* *search_vulns* is licensed under the MIT license, see [here](https://github.com/ra1nb0rn/search_vulns/blob/master/LICENSE).
* [This product uses the NVD API but is not endorsed or certified by the NVD.](https://nvd.nist.gov/developers/terms-of-use)
* Data from the [Exploit-DB](https://gitlab.com/exploit-database/exploitdb/) is used, which is licensed under the GPLv2 license, see [here](https://gitlab.com/exploit-database/exploitdb/-/blob/main/LICENSE.md).
* Data from [PoC-in-GitHub](https://github.com/nomi-sec/PoC-in-GitHub) is used, which does not provide a license. However, it is published on GitHub and thereby permits usage according to [GitHub's Terms of Service](https://docs.github.com/en/site-policy/github-terms/github-terms-of-service#5-license-grant-to-other-users).
* Data from [endoflife.date](https://github.com/endoflife-date/endoflife.date) is used, which is licensed under the MIT License, see [here](https://github.com/endoflife-date/endoflife.date/blob/master/LICENSE).
37 changes: 30 additions & 7 deletions web_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
TEMPLATE_FOLDER = os.path.join(PROJECT_DIR, os.path.join("web_server_files", "templates"))
CONFIG_FILE = os.path.join(PROJECT_DIR, 'config.json')
CHANGELOG_FILE = os.path.join(PROJECT_DIR, 'CHANGELOG.md')
LICENSE_INFO_FILE = os.path.join(os.path.join(PROJECT_DIR, 'resources'), 'license_infos.md')
README_FILE = os.path.join(PROJECT_DIR, 'README.md')
CPE_SUGGESTIONS_COUNT = 10
MAX_QUERY_LENGTH = 256
VULN_RESULTS_CACHE, CPE_SUGGESTIONS_CACHE = {}, {}
Expand Down Expand Up @@ -253,9 +255,34 @@ def index():
return render_template("index.html", **recaptcha_settings)


def style_converted_html(markdown_html, center_captions=False):
ctr_str = 'text-center ' if center_captions else ''
markdown_html = markdown_html.replace('<h1>', f'<h1 class="{ctr_str}text-2xl my-3 font-bold">')
markdown_html = markdown_html.replace('<h2>', f'<h2 class="{ctr_str}text-xl mt-3 mb-1 font-semibold">')
markdown_html = markdown_html.replace('<h3>', f'<h3 class="{ctr_str}text-lg my-1 font-medium">')
markdown_html = markdown_html.replace('<ul>', '<ul class="list-disc text-left ml-6 mb-3 mt-1">')
markdown_html = markdown_html.replace('<code>', '<code class="bg-base-300 p-1 rounded-lg">')
markdown_html = markdown_html.replace('<p>', '<p class="mt-2">')
markdown_html = markdown_html.replace('<a ', '<a class="link" ')
return markdown_html


@app.route("/about")
def about():
return render_template("about.html")
markdown_content = ''
with open(README_FILE) as f:
markdown_content = f.read()

markdown_content = markdown_content[markdown_content.find('## About'):]
markdown_content = markdown_content[:markdown_content.find('\n##')]
about_html = style_converted_html(markdown.markdown(markdown_content), True)

markdown_content = ''
with open(LICENSE_INFO_FILE) as f:
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)


@app.route("/api/setup")
Expand Down Expand Up @@ -329,12 +356,8 @@ def news():
with open(CHANGELOG_FILE) as f:
markdown_content = f.read()

changelog_html = markdown.markdown(markdown_content)
changelog_html = changelog_html.replace('<h1>', '<h1 class="text-2xl my-3 font-bold text-center">')
changelog_html = changelog_html.replace('<h2>', '<h2 class="text-xl mt-3 mb-1 font-semibold">')
changelog_html = changelog_html.replace('<h3>', '<h3 class="text-lg my-1 font-medium">')
changelog_html = changelog_html.replace('<ul>', '<ul class="list-disc text-left ml-6 mb-3">')

changelog_html = style_converted_html(markdown.markdown(markdown_content), False)
changelog_html = changelog_html.replace('<h1 class="', '<h1 class="text-center ')
return render_template("news.html", news_html=changelog_html)


Expand Down
8 changes: 8 additions & 0 deletions web_server_files/static/css/daisyui.css
Original file line number Diff line number Diff line change
Expand Up @@ -2834,6 +2834,10 @@ html {
min-width: 100%;
}

.max-w-4xl {
max-width: 56rem;
}

.grow {
flex-grow: 1;
}
Expand Down Expand Up @@ -3162,6 +3166,10 @@ html {
.sm\:max-w-5xl {
max-width: 64rem;
}

.sm\:max-w-4xl {
max-width: 56rem;
}
}

@media (min-width: 768px) {
Expand Down
14 changes: 11 additions & 3 deletions web_server_files/templates/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,17 @@
</div>
</div>

<!-- BEGIN API Setup -->
<div class="md:max-w-8xl lg:max-w-6xl mx-auto text-center mt-4" style="min-height: 65vh;">
<h2 class="text-4xl">Work in Progress</h2>
<!-- BEGIN About -->
<div class="max-w-4xl mx-auto mt-4 px-3" style="min-height: 65vh;">
<div id="wip_html" class="my-2">
<h2 class="text-4xl text-center">Work in Progress</h2>
</div>
<div id="about_html" class="my-2">
{{ about_html | safe }}
</div>
<div id="licenseHtml" class="my-2">
{{ license_html | safe }}
</div>
</div>

<button id="toTopButton" onclick="backToTop()" title="Go To Top"
Expand Down

0 comments on commit 94b1436

Please sign in to comment.