M gitsrht/blueprints/repo.py => gitsrht/blueprints/repo.py +4 -1
@@ 134,6 134,7 @@ def summary(owner, repo):
message = session.pop("message", None)
return render_template("summary.html", view="summary",
owner=owner, repo=repo, readme=readme, commits=commits,
+ signature=lookup_signature(git_repo, latest_tag[0].decode('utf-8'))[1],
latest_tag=latest_tag, default_branch=default_branch,
is_annotated=lambda t: isinstance(t, pygit2.Tag),
message=message, license=license)
@@ 536,7 537,8 @@ def refs(owner, repo):
tags = [(
ref,
- git_repo.get(git_repo.references[ref].target)
+ git_repo.get(git_repo.references[ref].target),
+ lookup_signature(git_repo, ref.decode('utf-8'))[1]
) for ref in git_repo.raw_listall_references()
if ref.startswith(b"refs/tags/")]
tags = [tag for tag in tags
@@ 626,5 628,6 @@ def ref(owner, repo, ref):
.filter(Artifact.commit == tag.target.hex)).all()
return render_template("ref.html", view="refs",
owner=owner, repo=repo, git_repo=git_repo, tag=tag,
+ signature=lookup_signature(git_repo, ref)[1],
artifacts=artifacts, default_branch=git_repo.default_branch(),
strip_pgp_signature=strip_pgp_signature)
M gitsrht/templates/ref.html => gitsrht/templates/ref.html +8 -0
@@ 20,6 20,14 @@
owner=repo.owner.canonical_name,
repo=repo.name, ref=tag.name)}}"
>.tar.gz {{icon("caret-right")}}</a>
+ {% if signature %}
+ <a
+ class="btn btn-default btn-block"
+ href="{{url_for("repo.archivesig",
+ owner=repo.owner.canonical_name,
+ repo=repo.name, ref=tag.name, fmt=signature)}}"
+ >.tar.gz.asc {{icon("caret-right")}}</a>
+ {% endif %}
<a
class="btn btn-default btn-block"
href="{{url_for("repo.tree",
M gitsrht/templates/refs.html => gitsrht/templates/refs.html +14 -3
@@ 25,9 25,10 @@
<div class="row">
<div class="col-md-8">
<div class="event-list">
- {% for tag in tags %}
- {% set ref = tag[0].decode("utf-8", "replace") %}
- {% set tag = tag[1] %}
+ {% for t in tags %}
+ {% set ref = t[0].decode("utf-8", "replace") %}
+ {% set tag = t[1] %}
+ {% set sig_fmt = t[2] %}
{% if isinstance(tag, pygit2.Commit) %}
{% set commit = tag %}
{% else %}
@@ 58,6 59,16 @@
repo=repo.name, ref=refname)}}"
rel="nofollow"
>.tar.gz {{icon("caret-right")}}</a>
+ {% if sig_fmt %}
+ <a
+ style="margin-left: 0.5rem"
+ href="{{url_for("repo.archivesig",
+ owner=repo.owner.canonical_name,
+ repo=repo.name, ref=refname, fmt=sig_fmt)}}"
+ rel="nofollow"
+ title="This release is cryptographically signed, click here to download the signature"
+ >.asc {{icon("caret-right")}}</a>
+ {% endif %}
<a
style="margin-left: 0.5rem"
href="{{url_for("repo.tree",