Every day from 07:00 Chiang Mai time the app mails the journal's last entry number and its hash to the addresses set on the Notifications page (src/anchor.rs, migration 0012: settings, journal_anchors), when anything was added since the last anchor that went out. A day without news is noted without a mail; a failed send is tried again after an hour; a transaction-level advisory lock keeps two runs from both sending. "Send the anchor now" sends at once. Each mail says whether the chain checked whole (in capitals when it did not) and links to /journal/anchor, which compares a kept entry number and hash with the journal now: the same hash, another one, or no such entry. Changing the recipients is itself a journal entry. Every anchor mail is in the notifications log. Tests: the daily rule (before seven, once a day, an hour after a failure), recipients checked and journaled, one mail per recipient with the head hash, unchanged days, by hand, the check page's three answers, and a chain broken around the app said in the mail. 126 unit, 67 integration.
21 lines
1.4 KiB
HTML
21 lines
1.4 KiB
HTML
{% extends "base.html" %}
|
|
{% import "_journal.html" as jn %}
|
|
{% block main %}
|
|
<div class="pagehead">
|
|
<h1>Journal</h1>
|
|
<div class="actions"><a class="btn sm ghost" href="/journal/anchor" id="journal-anchor">Check an anchor</a> <a class="btn sm" href="/journal.csv" id="journal-csv">Download as CSV</a></div>
|
|
</div>
|
|
<p class="meta">Every change to the lawyers, clients, contracts, versions and paper copies, in order. Each entry carries the SHA-256 of the entry before it, so an entry changed or removed afterwards breaks the chain at that place. The database refuses to change or delete entries.</p>
|
|
{% if whole %}
|
|
<div class="notice ok" role="status" id="journal-check"><b>The journal is whole.</b> {{ count }} entries{% if head_at %}, the last on {{ head_at }}{% endif %}; every version's text and file match their fingerprints. The last hash is <span class="mono hashline">{{ head }}</span>. Written down or kept in the CSV, it shows later that nothing before it changed.</div>
|
|
{% else %}
|
|
<div class="notice bad" role="alert" id="journal-check"><b>The journal is broken.</b>
|
|
<ul>{% for p in problems %}<li>{{ p }}</li>{% endfor %}</ul>
|
|
Tell the team's lead: something was changed outside the app.</div>
|
|
{% endif %}
|
|
{% if filtered %}<p><a href="/journal">The whole journal</a></p>{% endif %}
|
|
<section class="card">
|
|
{% if entries %}{{ jn.list(entries, links=true) }}{% else %}<p class="empty-inline">No entries yet.</p>{% endif %}
|
|
</section>
|
|
{% endblock %}
|