From fd53e0248fdefc4d49fdb739767c496d42396c5e Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Thu, 29 Mar 2012 00:39:21 -0500 Subject: Fix bad merge in releng section template Signed-off-by: Dan McGee --- templates/releng/result_section.html | 1 - 1 file changed, 1 deletion(-) (limited to 'templates') diff --git a/templates/releng/result_section.html b/templates/releng/result_section.html index 45838b86..91a75613 100644 --- a/templates/releng/result_section.html +++ b/templates/releng/result_section.html @@ -7,7 +7,6 @@ {% for item in option.values %} - {{ item.value.name|lower }} -- cgit v1.2.3-54-g00ecf From 5555ce02278defaef0ef1388c163701eea3aff7e Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Thu, 29 Mar 2012 11:35:40 -0500 Subject: Use spaceless tag in mirror status output This removes a lot of needless whitespace in the generated output, shrinking the uncompressed page size by 30KB to 54KB total on my current set of mirror test data. Signed-off-by: Dan McGee --- templates/mirrors/status.html | 4 ++-- templates/mirrors/status_table.html | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'templates') diff --git a/templates/mirrors/status.html b/templates/mirrors/status.html index 4f09be8b..225572ee 100644 --- a/templates/mirrors/status.html +++ b/templates/mirrors/status.html @@ -89,7 +89,7 @@

Mirror Syncing Error Log

{% for log in error_logs %} - + {% spaceless %} {{ log.url__url }} {{ log.url__protocol__protocol }} {{ log.country }} @@ -97,7 +97,7 @@

Mirror Syncing Error Log

{{ log.last_occurred|date:'Y-m-d H:i' }} {{ log.error_count }} - {% endfor %} + {% endspaceless %}{% endfor %} diff --git a/templates/mirrors/status_table.html b/templates/mirrors/status_table.html index 72de25dc..bd70115c 100644 --- a/templates/mirrors/status_table.html +++ b/templates/mirrors/status_table.html @@ -15,7 +15,7 @@ {% for m_url in urls %} - + {% spaceless %} {{ m_url.url }} {{ m_url.protocol }} {{ m_url.real_country }} @@ -26,6 +26,6 @@ {{ m_url.duration_stddev|floatformat:2 }} {{ m_url.score|floatformat:1|default:'∞' }} - {% endfor %} + {% endspaceless %}{% endfor %} -- cgit v1.2.3-54-g00ecf From ef88f3d5ef696b71a65a81f143b13ae27175a1c5 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Thu, 29 Mar 2012 11:37:07 -0500 Subject: Add developer status table to master keys page This shows the cross-product of each master key with each developer key so you can see who has been signed, where signatures are missing, etc. Signed-off-by: Dan McGee --- main/templatetags/pgp.py | 8 +++++++ public/views.py | 21 ++++++++++++++--- sitestatic/archweb.css | 8 +++++++ templates/public/keys.html | 56 ++++++++++++++++++++++++++++++++++++++-------- visualize/views.py | 2 +- 5 files changed, 82 insertions(+), 13 deletions(-) (limited to 'templates') diff --git a/main/templatetags/pgp.py b/main/templatetags/pgp.py index 1ffc5241..50b1aa17 100644 --- a/main/templatetags/pgp.py +++ b/main/templatetags/pgp.py @@ -50,4 +50,12 @@ def pgp_fingerprint(key_id, autoescape=True): return mark_safe(format_key(esc(key_id))) pgp_fingerprint.needs_autoescape = True + +@register.assignment_tag +def signature_exists(signatures, signer, signee): + if not signer or not signee: + return False + lookup = (signer[-16:], signee[-16:]) + return lookup in signatures + # vim: set ts=4 sw=4 et: diff --git a/public/views.py b/public/views.py index 1e1ffc6c..a85d7389 100644 --- a/public/views.py +++ b/public/views.py @@ -1,6 +1,8 @@ +from datetime import datetime + from django.conf import settings from django.contrib.auth.models import User -from django.db.models import Count +from django.db.models import Count, Q from django.http import Http404 from django.views.decorators.cache import cache_control from django.views.generic import list_detail @@ -88,17 +90,30 @@ def feeds(request): @cache_control(max_age=300) def keys(request): + not_expired = Q(expires__gt=datetime.utcnow) | Q(expires__isnull=True) master_keys = MasterKey.objects.select_related('owner', 'revoker', 'owner__userprofile', 'revoker__userprofile').filter( revoked__isnull=True) - sig_counts = PGPSignature.objects.filter(valid=True, - expires__isnull=True).values_list('signer').annotate( + + sig_counts = PGPSignature.objects.filter( + not_expired, valid=True).values_list('signer').annotate( Count('signer')) sig_counts = dict((key_id[-16:], ct) for key_id, ct in sig_counts) + for key in master_keys: key.signature_count = sig_counts.get(key.pgp_key[-16:], 0) + + users = User.objects.filter(is_active=True).select_related( + 'userprofile__pgp_key').order_by('first_name', 'last_name') + + # frozenset because we are going to do lots of __contains__ lookups + signatures = frozenset(PGPSignature.objects.filter( + not_expired, valid=True).values_list('signer', 'signee')) + context = { 'keys': master_keys, + 'active_users': users, + 'signatures': signatures, } return direct_to_template(request, 'public/keys.html', context) diff --git a/sitestatic/archweb.css b/sitestatic/archweb.css index d2286329..ac0dff52 100644 --- a/sitestatic/archweb.css +++ b/sitestatic/archweb.css @@ -957,6 +957,14 @@ ul.signoff-list { color: red; } +#key-status .signed-yes { + color: green; +} + +#key-status .signed-no { + color: red; +} + /* highlight current website in the navbar */ #archnavbar.anb-home ul li#anb-home a, #archnavbar.anb-packages ul li#anb-packages a, diff --git a/templates/public/keys.html b/templates/public/keys.html index 6b06cc32..a7c91c43 100644 --- a/templates/public/keys.html +++ b/templates/public/keys.html @@ -15,15 +15,6 @@

Master Signing Keys

The {{ keys|length }} key{{ keys|pluralize }} listed below should be regarded as the current set of master keys. They are available on public keyservers and should be signed by the owner of the key.

-

All official Arch Linux developers and trusted users should have their - key signed by at least three of these master keys. This is in accordance - with the PGP web of trust concept. If a user is willing to - marginally trust all of the master keys, three signatures from different - master keys will consider a given developer's key as valid. For more - information on trust, please consult the - GNU Privacy Handbook - and Using trust to - validate keys.

@@ -55,5 +46,52 @@

Master Signing Keys

{% endfor %}
+ +

The following table shows all active developers and trusted users along + with the status of their personal signing key. A 'Yes' indicates that the + personal key of the developer is signed by the given master key. A 'No' + indicates it has not been signed; however, this does not necessarily mean + the key should not be trusted.

+

All official Arch Linux developers and trusted users should have their + key signed by at least three master keys if they are responsible for + packaging software in the repositories. This is in accordance with the PGP + web of trust concept. If a user is willing to marginally trust all + of the master keys, three signatures from different master keys will + consider a given developer's key as valid. For more information on trust, + please consult the + GNU Privacy Handbook + and Using trust to + validate keys.

+ + + + + + + {% for key in keys %} + + {% endfor %} + + + + + {% for key in keys %} + + {% endfor %} + + + + {% for user in active_users %} + + + + {% spaceless %}{% for key in keys %} + {% signature_exists signatures key.pgp_key user.userprofile.pgp_key as signed %} + + {% endfor %}{% endspaceless %} + + {% endfor %} + +
PGP Key{{ key.owner.get_full_name }}
{% pgp_key_link key.pgp_key %}
{{ user.get_full_name }}{% pgp_key_link user.userprofile.pgp_key %}{{ signed|yesno|capfirst }}
{% endblock %} diff --git a/visualize/views.py b/visualize/views.py index be6057b2..afc5429d 100644 --- a/visualize/views.py +++ b/visualize/views.py @@ -102,7 +102,7 @@ def pgp_keys(request): 'group': 'cacert', }) - not_expired = Q(expires__gt=datetime.now) | Q(expires__isnull=True) + not_expired = Q(expires__gt=datetime.utcnow) | Q(expires__isnull=True) signatures = PGPSignature.objects.filter(not_expired, valid=True) edge_list = [{ 'signee': sig.signee, 'signer': sig.signer } for sig in signatures] -- cgit v1.2.3-54-g00ecf From 30f775f0b4242e1c6788a7fb1b513a888617de8f Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Thu, 29 Mar 2012 11:50:21 -0500 Subject: Use spaceless tag on signoffs page More whitespace collapsing to shrink the HTML size quite a bit. Signed-off-by: Dan McGee --- templates/packages/signoff_cell.html | 2 -- templates/packages/signoffs.html | 12 +++++++----- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'templates') diff --git a/templates/packages/signoff_cell.html b/templates/packages/signoff_cell.html index 01a5d58d..7d9e1972 100644 --- a/templates/packages/signoff_cell.html +++ b/templates/packages/signoff_cell.html @@ -1,4 +1,3 @@ -{% spaceless %} {% if group.signoffs %}
    {% for signoff in group.signoffs %} @@ -22,4 +21,3 @@ Signoff Options {% endif %} -{% endspaceless %} diff --git a/templates/packages/signoffs.html b/templates/packages/signoffs.html index 3a2c3509..b20483c0 100644 --- a/templates/packages/signoffs.html +++ b/templates/packages/signoffs.html @@ -52,6 +52,7 @@

    Filter Displayed Signoffs

    {% for group in signoff_groups %} + {% spaceless %} {% pkg_details_link group.package %} {{ group.version }} {{ group.arch.name }} {{ group.target_repo }} @@ -68,12 +69,13 @@

    Filter Displayed Signoffs

    {% endif %} {% endif %} {% include "packages/signoff_cell.html" %} - {% if not group.default_spec %}{% with group.specification as spec %} - {% if spec.required != 2 %}Required signoffs: {{ spec.required }}
    {% endif %} - {% if not spec.enabled %}Signoffs are not currently enabled
    {% endif %} - {% if spec.known_bad %}Package is known to be bad
    {% endif %} - {{ spec.comments|default:""|linebreaksbr }} + {% if not group.default_spec %}{% with group.specification as spec %}{% comment %} + {% endcomment %}{% if spec.required != 2 %}Required signoffs: {{ spec.required }}
    {% endif %}{% comment %} + {% endcomment %}{% if not spec.enabled %}Signoffs are not currently enabled
    {% endif %}{% comment %} + {% endcomment %}{% if spec.known_bad %}Package is known to be bad
    {% endif %}{% comment %} + {% endcomment %}{{ spec.comments|default:""|linebreaksbr }} {% endwith %}{% endif %} + {% endspaceless %} {% endfor %} -- cgit v1.2.3-54-g00ecf From 9eb5b4e607cd0886578da104617a6209aa89ec8d Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Thu, 29 Mar 2012 11:53:32 -0500 Subject: Use spaceless tag on package search results Signed-off-by: Dan McGee --- templates/packages/search.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'templates') diff --git a/templates/packages/search.html b/templates/packages/search.html index 030f2671..ebd4e6c4 100644 --- a/templates/packages/search.html +++ b/templates/packages/search.html @@ -77,7 +77,7 @@

    Package Search

    {% for pkg in package_list %} - + {% spaceless %} {% if perms.main.change_package %} {% endif %} @@ -93,7 +93,7 @@

    Package Search

    {{ pkg.last_update|date }} {{ pkg.flag_date|date }} - {% endfor %} + {% endspaceless %}{% endfor %} {% include "packages/search_paginator.html" %} -- cgit v1.2.3-54-g00ecf