From 975f7b1dbf34175531b8580f688cbb7c2d65895f Mon Sep 17 00:00:00 2001 From: volpino Date: Mon, 24 Sep 2012 16:47:21 +0200 Subject: [PATCH] euscanwww: Adding an about config page Signed-off-by: volpino --- TODO | 1 - euscanwww/djeuscan/templates/_base.html | 1 + .../djeuscan/templates/euscan/config.html | 95 +++++++++++++++++++ euscanwww/djeuscan/urls.py | 1 + euscanwww/djeuscan/views.py | 16 ++++ euscanwww/htdocs/css/style.css | 8 -- 6 files changed, 113 insertions(+), 9 deletions(-) create mode 100644 euscanwww/djeuscan/templates/euscan/config.html diff --git a/TODO b/TODO index a0e3a26..932c479 100644 --- a/TODO +++ b/TODO @@ -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 diff --git a/euscanwww/djeuscan/templates/_base.html b/euscanwww/djeuscan/templates/_base.html index 2d26a33..954e350 100644 --- a/euscanwww/djeuscan/templates/_base.html +++ b/euscanwww/djeuscan/templates/_base.html @@ -86,6 +86,7 @@
  • ---
  • API
  • Feeds
  • +
  • Server config
  • About
  • {% endblock %} diff --git a/euscanwww/djeuscan/templates/euscan/config.html b/euscanwww/djeuscan/templates/euscan/config.html new file mode 100644 index 0000000..9bbaf14 --- /dev/null +++ b/euscanwww/djeuscan/templates/euscan/config.html @@ -0,0 +1,95 @@ +{% extends "_base.html" %} + +{% block content %} +

    Server configuration

    + + + + {% for key, value in CONFIG.items %} + + + + + {% endfor %} +
    +

    Euscan config

    +
    {{ key }}{{ value }}
    + +
    + + + + {% for item in BLACKLIST_VERSIONS %} + + + + {% endfor %} +
    +

    Versions blacklist

    +
    {{ item }}
    + +
    + + + + {% for item in BLACKLIST_PACKAGES %} + + + + {% endfor %} +
    +

    Packages blacklist

    +
    {{ item }}
    + +
    + + + + {% for item in SCANDIR_BLACKLIST_URLS %} + + + + {% endfor %} +
    +

    Scandir blacklist

    +
    {{ item }}
    + +
    + + + + {% for item in BRUTEFORCE_BLACKLIST_PACKAGES %} + + + + {% endfor %} +
    +

    Bruteforce packages blacklist

    +
    {{ item }}
    + +
    + + + + {% for item in BRUTEFORCE_BLACKLIST_URLS %} + + + + {% endfor %} +
    +

    Bruteforce urls blacklist

    +
    {{ item }}
    + +
    + + + + {% for item in ROBOTS_TXT_BLACKLIST_DOMAINS %} + + + + {% endfor %} +
    +

    Robots.txt domain blacklist

    +
    {{ item }}
    +{% endblock %} diff --git a/euscanwww/djeuscan/urls.py b/euscanwww/djeuscan/urls.py index e156a4b..789fc9f 100644 --- a/euscanwww/djeuscan/urls.py +++ b/euscanwww/djeuscan/urls.py @@ -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[\w\-]+).png$', 'chart', name="chart"), url(r'^world/$', 'world', name="world"), diff --git a/euscanwww/djeuscan/views.py b/euscanwww/djeuscan/views.py index bb60df2..cc0d2f2 100644 --- a/euscanwww/djeuscan/views.py +++ b/euscanwww/djeuscan/views.py @@ -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 {} diff --git a/euscanwww/htdocs/css/style.css b/euscanwww/htdocs/css/style.css index 2877499..bc3cdcb 100644 --- a/euscanwww/htdocs/css/style.css +++ b/euscanwww/htdocs/css/style.css @@ -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;