diff options
| author | aur-build <aur-build@localhost> | 2026-11-18 08:06:39 +0000 |
|---|---|---|
| committer | aur-build <aur-build@localhost> | 2026-11-18 08:06:39 +0000 |
| commit | a6b652985f40cf022d6c522415c36fad13bc663d (patch) | |
| tree | 2383d83a820803808202084db1aa30b12f0e02c2 /templates/review.html | |
| parent | ab8d33d5edc4c88075685206e3046c719e9bc855 (diff) | |
| download | aur-build-a6b652985f40cf022d6c522415c36fad13bc663d.tar.gz aur-build-a6b652985f40cf022d6c522415c36fad13bc663d.zip | |
http: the review surface — server-rendered, no JavaScript required (§12, §13)
tiny_http, thread-per-connection, askama templates. Every §13 surface is
server-rendered HTML that works with scripts switched off: Inbox, review
detail with the full panel set, Builds, Attention, Index, Subscriptions,
Ops/audit, Settings.
The parts that are easy to get wrong:
- Handlers read through thread-local READ-ONLY connections. They cannot
take the write lock even by accident, so a slow page render never blocks
the build pipeline's writer. tests/http.rs asserts this by trying to
write through a read connection and requiring failure.
- Every POST requires a CSRF token derived from the session id. Logout
drops the session, which invalidates every form still open in a browser.
- Approve carries identity_hash AND diff_digest (§7.1a). If either has
moved, the approval is refused with 409 and the page re-renders the
review AS IT IS NOW — never a silent retarget onto the newer state.
- Bulk approve refuses high-risk items unless each one is individually
confirmed by id. Bulk is per-item, never 'approve everything forever'.
- Reject requires a note; it is re-openable, not a deletion.
- Optional password gate; anonymous visitors are redirected to /login.
Also: the index page states the pacman conf snippet including
'SigLevel = Required DatabaseOptional', because a repo consumers ignore the
signature is a repo that gets MITM'd.
Diffstat (limited to 'templates/review.html')
| -rw-r--r-- | templates/review.html | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/templates/review.html b/templates/review.html new file mode 100644 index 0000000..32441f9 --- /dev/null +++ b/templates/review.html @@ -0,0 +1,49 @@ +{% extends "base.html" %} +{% block content %} +<h1>{{ c.pkgbase }} → {{ c.version }}</h1> +<p class="mut"> + base: {% if has_base %}{{ base_version }}{% else %}<b>nothing accepted yet</b>{% endif %} + · aur_commit <span class="tag">{{ c.aur_commit_short }}</span> + <a href="https://aur.archlinux.org/cgit/aur.git/tree/?h={{ c.pkgbase }}&id={{ c.aur_commit }}">cgit</a> + · kind {{ c.kind }} + · revision {{ c.revision }} · risk <span class="risk-{{ c.risk }}">{{ c.risk }}</span> +</p> +{% if c.is_first %}<div class="card first"> +<b>First build of this package here.</b> +<p class="mut">There is no accepted version to diff against, so the whole recipe is shown below +and the maintainer and age of the package are the only trust signals available. This is the +most consequential approval this pkgbase will ever get: it establishes the base every later +diff is measured against.</p> +</div>{% endif %} +{% if !c.signals.is_empty() %}<div class="card"><b>Risk signals</b><br> +{% for s in c.signals %}<span class="tag risk-high">{{ s }}</span> {% endfor %}</div>{% endif %} +{% if !c.missing_deps.is_empty() %}<div class="card"><b>Missing dependencies</b> +<p>The build will block until these are published: {% for d in c.missing_deps %}<span class="tag">{{ d }}</span> {% endfor %}</p></div>{% endif %} +{% if c.is_first %} +<h2>Recipe</h2> +<div class="card"><b>PKGBUILD</b><pre>{{ recipe }}</pre></div> +{% if has_srcinfo %}<div class="card"><b>.SRCINFO</b><pre>{{ srcinfo }}</pre></div>{% endif %} +<div class="card"><b>Sources, as resolved</b><pre>{{ sources_resolved }}</pre></div> +<div class="card"><b>Dependencies</b><pre>{{ deps_resolved }}</pre></div> +{% endif %} +{% for panel in panels %} +<h2>{{ panel.title }}</h2> +{% if panel.empty %}<p class="mut">{{ panel.empty_note }}</p>{% else %}<pre>{{ panel.body }}</pre>{% endif %} +{% endfor %} +<div class="card"> +<form method="post" action="/reviews/{{ c.id }}/approve"> +<input type="hidden" name="csrf" value="{{ page.csrf }}"> +<input type="hidden" name="identity_hash" value="{{ c.identity_hash }}"> +<input type="hidden" name="diff_digest" value="{{ c.diff_digest }}"> +<p><label>Note (optional) <input name="note" size="60"></label></p> +<button type="submit">Approve and build</button> +<span class="mut">Approving builds exactly what is displayed above; if it changed while you +were reading, this is refused with a 409 and re-rendered.</span> +</form> +<form method="post" action="/reviews/{{ c.id }}/reject" style="margin-top:.6rem"> +<input type="hidden" name="csrf" value="{{ page.csrf }}"> +<label>Reject with reason <input name="note" size="60" required></label> +<button type="submit">Reject</button> +</form> +</div> +{% endblock %} |
