euscanwww: Adding an about config page

Signed-off-by: volpino <fox91@anche.no>
This commit is contained in:
volpino 2012-09-24 16:47:21 +02:00
parent f257c40aec
commit c02072cb16
6 changed files with 113 additions and 9 deletions

1
TODO
View File

@ -52,7 +52,6 @@ euscan
euscanwww
---------
- Add an /about/config page that describe the current config (overlays, stuff in make.conf, euscan default settings, etc..)
- Always keep in db all found versions (when using an API only?). But don't display them if older than current packaged version, except maybe in the "upstream_version" column.
### packages

View File

@ -86,6 +86,7 @@
<li>---</li>
<li><a href="{% url "api" %}">API</a></li>
<li><a href="{% url "feeds" %}">Feeds</a></li>
<li><a href="{% url "config" %}">Server config</a></li>
<li><a href="{% url "about" %}">About</a></li>
{% endblock %}
</ul>

View File

@ -0,0 +1,95 @@
{% extends "_base.html" %}
{% block content %}
<h2>Server configuration</h2>
<table class="table table-bordered">
<caption>
<h4 class="padded">Euscan config</h4>
</caption>
{% for key, value in CONFIG.items %}
<tr>
<td><b>{{ key }}</b></td>
<td>{{ value }}</td>
</tr>
{% endfor %}
</table>
<hr />
<table class="table table-bordered">
<caption>
<h4 class="padded">Versions blacklist</h4>
</caption>
{% for item in BLACKLIST_VERSIONS %}
<tr>
<td>{{ item }}</td>
</tr>
{% endfor %}
</table>
<hr />
<table class="table table-bordered">
<caption>
<h4 class="padded">Packages blacklist</h4>
</caption>
{% for item in BLACKLIST_PACKAGES %}
<tr>
<td>{{ item }}</td>
</tr>
{% endfor %}
</table>
<hr />
<table class="table table-bordered">
<caption>
<h4 class="padded">Scandir blacklist</h4>
</caption>
{% for item in SCANDIR_BLACKLIST_URLS %}
<tr>
<td>{{ item }}</td>
</tr>
{% endfor %}
</table>
<hr />
<table class="table table-bordered">
<caption>
<h4 class="padded">Bruteforce packages blacklist</h4>
</caption>
{% for item in BRUTEFORCE_BLACKLIST_PACKAGES %}
<tr>
<td>{{ item }}</td>
</tr>
{% endfor %}
</table>
<hr />
<table class="table table-bordered">
<caption>
<h4 class="padded">Bruteforce urls blacklist</h4>
</caption>
{% for item in BRUTEFORCE_BLACKLIST_URLS %}
<tr>
<td>{{ item }}</td>
</tr>
{% endfor %}
</table>
<hr />
<table class="table table-bordered">
<caption>
<h4 class="padded">Robots.txt domain blacklist</h4>
</caption>
{% for item in ROBOTS_TXT_BLACKLIST_DOMAINS %}
<tr>
<td>{{ item }}</td>
</tr>
{% endfor %}
</table>
{% endblock %}

View File

@ -113,6 +113,7 @@ urlpatterns = patterns('djeuscan.views',
url(r'^about/$', 'about', name="about"),
url(r'^about/api$', 'api', name="api"),
url(r'^about/feeds$', 'feeds', name="feeds"),
url(r'^about/config$', 'config', name="config"),
url(r'^statistics/$', 'statistics', name="statistics"),
url(r'^statistics/charts/(?P<chart>[\w\-]+).png$', 'chart', name="chart"),
url(r'^world/$', 'world', name="world"),

View File

@ -311,6 +311,22 @@ def feeds(request):
return {}
@render_to("euscan/config.html")
def config(request):
from euscan import CONFIG, BLACKLIST_VERSIONS, BLACKLIST_PACKAGES, \
SCANDIR_BLACKLIST_URLS, BRUTEFORCE_BLACKLIST_PACKAGES, \
BRUTEFORCE_BLACKLIST_URLS, ROBOTS_TXT_BLACKLIST_DOMAINS
return {
"CONFIG": CONFIG,
"BLACKLIST_VERSIONS": BLACKLIST_VERSIONS,
"BLACKLIST_PACKAGES": BLACKLIST_PACKAGES,
"SCANDIR_BLACKLIST_URLS": SCANDIR_BLACKLIST_URLS,
"BRUTEFORCE_BLACKLIST_PACKAGES": BRUTEFORCE_BLACKLIST_PACKAGES,
"BRUTEFORCE_BLACKLIST_URLS": BRUTEFORCE_BLACKLIST_URLS,
"ROBOTS_TXT_BLACKLIST_DOMAINS": ROBOTS_TXT_BLACKLIST_DOMAINS,
}
@render_to("euscan/statistics.html")
def statistics(request):
return {}

View File

@ -117,14 +117,6 @@ dd {
padding: 5px;
}
hr {
margin: 0.3em 1em 0.3em 1em;
height: 1px;
border: #bcbcbc dashed;
border-width: 0 0 1px 0;
}
.table {
width: 60% !important;
margin: auto;