diff options
author | volpino <fox91@anche.no> | 2012-11-02 20:10:06 +0100 |
---|---|---|
committer | volpino <fox91@anche.no> | 2012-11-02 20:15:51 +0100 |
commit | c04b4c81871787a884e7780228d94ed14ba7ddac (patch) | |
tree | 7a488f2ad70c6203fca38944acf74fc2869d061e /euscanwww | |
parent | euscanwww: Added migration for deleting UserProfile (diff) | |
download | euscan-c04b4c81871787a884e7780228d94ed14ba7ddac.tar.gz euscan-c04b4c81871787a884e7780228d94ed14ba7ddac.tar.bz2 euscan-c04b4c81871787a884e7780228d94ed14ba7ddac.zip |
euscanwww: Adding make.conf and overlays info to config page
Signed-off-by: volpino <fox91@anche.no>
Diffstat (limited to 'euscanwww')
-rw-r--r-- | euscanwww/djeuscan/helpers.py | 15 | ||||
-rw-r--r-- | euscanwww/djeuscan/templates/euscan/config.html | 43 | ||||
-rw-r--r-- | euscanwww/djeuscan/views.py | 12 | ||||
-rw-r--r-- | euscanwww/euscanwww/settings.py | 1 |
4 files changed, 62 insertions, 9 deletions
diff --git a/euscanwww/djeuscan/helpers.py b/euscanwww/djeuscan/helpers.py index d5426eb..171ba5e 100644 --- a/euscanwww/djeuscan/helpers.py +++ b/euscanwww/djeuscan/helpers.py @@ -4,6 +4,11 @@ djeuscan.helpers from distutils.version import StrictVersion, LooseVersion from django.shortcuts import get_object_or_404 +from django.conf import settings + +from layman import Layman + +from portage.util import getconfig def xint(i): @@ -83,3 +88,13 @@ def get_maintainer_or_404(id=None, email=None): return get_object_or_404(Maintainer, pk=id) else: return get_object_or_404(Maintainer, email=email) + + +def get_make_conf(): + return getconfig(settings.MAKE_CONF, tolerant=1, allow_sourcing=True) + + +def get_layman_repos(): + lay = Layman(config=settings.LAYMAN_CONFIG) + installed_overlays = lay.get_installed() + return lay.get_all_info(installed_overlays) diff --git a/euscanwww/djeuscan/templates/euscan/config.html b/euscanwww/djeuscan/templates/euscan/config.html index 9bbaf14..0990eed 100644 --- a/euscanwww/djeuscan/templates/euscan/config.html +++ b/euscanwww/djeuscan/templates/euscan/config.html @@ -3,11 +3,40 @@ {% block content %} <h2>Server configuration</h2> + +<table class="table table-bordered"> + <caption> + <h4 class="padded">make.conf</h4> + </caption> + {% for key, value in make_conf.items %} + <tr> + <td><b>{{ key }}</b></td> + <td>{{ value }}</td> + </tr> + {% endfor %} +</table> + +<hr /> + +<table class="table table-bordered"> + <caption> + <h4 class="padded">Available overlays</h4> + </caption> + {% for key, value in layman_repos.items %} + <tr> + <td><b><a href="{{ value.homepage }}">{{ key }}</a></b></td> + <td>{{ value.description }}</td> + </tr> + {% endfor %} +</table> + +<hr /> + <table class="table table-bordered"> <caption> <h4 class="padded">Euscan config</h4> </caption> - {% for key, value in CONFIG.items %} + {% for key, value in euscan_config.CONFIG.items %} <tr> <td><b>{{ key }}</b></td> <td>{{ value }}</td> @@ -21,7 +50,7 @@ <caption> <h4 class="padded">Versions blacklist</h4> </caption> - {% for item in BLACKLIST_VERSIONS %} + {% for item in euscan_config.BLACKLIST_VERSIONS %} <tr> <td>{{ item }}</td> </tr> @@ -34,7 +63,7 @@ <caption> <h4 class="padded">Packages blacklist</h4> </caption> - {% for item in BLACKLIST_PACKAGES %} + {% for item in euscan_config.BLACKLIST_PACKAGES %} <tr> <td>{{ item }}</td> </tr> @@ -47,7 +76,7 @@ <caption> <h4 class="padded">Scandir blacklist</h4> </caption> - {% for item in SCANDIR_BLACKLIST_URLS %} + {% for item in euscan_config.SCANDIR_BLACKLIST_URLS %} <tr> <td>{{ item }}</td> </tr> @@ -60,7 +89,7 @@ <caption> <h4 class="padded">Bruteforce packages blacklist</h4> </caption> - {% for item in BRUTEFORCE_BLACKLIST_PACKAGES %} + {% for item in euscan_config.BRUTEFORCE_BLACKLIST_PACKAGES %} <tr> <td>{{ item }}</td> </tr> @@ -73,7 +102,7 @@ <caption> <h4 class="padded">Bruteforce urls blacklist</h4> </caption> - {% for item in BRUTEFORCE_BLACKLIST_URLS %} + {% for item in euscan_config.BRUTEFORCE_BLACKLIST_URLS %} <tr> <td>{{ item }}</td> </tr> @@ -86,7 +115,7 @@ <caption> <h4 class="padded">Robots.txt domain blacklist</h4> </caption> - {% for item in ROBOTS_TXT_BLACKLIST_DOMAINS %} + {% for item in euscan_config.ROBOTS_TXT_BLACKLIST_DOMAINS %} <tr> <td>{{ item }}</td> </tr> diff --git a/euscanwww/djeuscan/views.py b/euscanwww/djeuscan/views.py index 3a7df88..7a7e489 100644 --- a/euscanwww/djeuscan/views.py +++ b/euscanwww/djeuscan/views.py @@ -9,7 +9,7 @@ from django.contrib.auth.decorators import login_required from django.views.decorators.http import require_POST from djeuscan.helpers import version_key, packages_from_names, \ - get_maintainer_or_404 + get_maintainer_or_404, get_make_conf, get_layman_repos from djeuscan.models import Version, Package, Herd, Maintainer, EuscanResult, \ VersionLog, RefreshPackageQuery, ProblemReport, Category, Overlay from djeuscan.forms import WorldForm, PackagesForm, ProblemReportForm @@ -315,7 +315,7 @@ 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 { + euscan_config = { "CONFIG": CONFIG, "BLACKLIST_VERSIONS": BLACKLIST_VERSIONS, "BLACKLIST_PACKAGES": BLACKLIST_PACKAGES, @@ -324,6 +324,14 @@ def config(request): "BRUTEFORCE_BLACKLIST_URLS": BRUTEFORCE_BLACKLIST_URLS, "ROBOTS_TXT_BLACKLIST_DOMAINS": ROBOTS_TXT_BLACKLIST_DOMAINS, } + make_conf = get_make_conf() + layman_repos = get_layman_repos() + + return { + "euscan_config": euscan_config, + "make_conf": make_conf, + "layman_repos": layman_repos, + } @render_to("euscan/statistics.html") diff --git a/euscanwww/euscanwww/settings.py b/euscanwww/euscanwww/settings.py index d14b968..2d9a6a7 100644 --- a/euscanwww/euscanwww/settings.py +++ b/euscanwww/euscanwww/settings.py @@ -229,6 +229,7 @@ PORTAGE_ROOT = "/" PORTAGE_CONFIGROOT = "/" EIX_CACHEFILE = os.path.join(PORTAGE_ROOT, 'var/cache/eix') LAYMAN_CONFIG = "/etc/layman/layman.cfg" +MAKE_CONF = "/etc/make.conf" EGENCACHE_JOBS = 4 |