monerod v0.18.5.1 on monerod-box (VMID 2400), Debian 13, systemd, no Docker.
Syncing at 24% as of this commit, 0 restarts, 0 OOM kills.
── The build-from-source requirement could not be met ──────────────────────
The intent was to build it ourselves and check the result against the published
checksums. That is not achievable for this release, and the role's README says
so at length so nobody re-derives it:
contrib/guix - the reproducible build that yields a byte-identical tarball -
exists ONLY on monero master. At tag v0.18.5.1 contrib/ contains `gitian`,
whose README wants an Ubuntu 18.04 host (EOL 2023) and python-cheetah.
A plain `make release-static` is not reproducible at all, so it produces a
binary whose hash matches nothing - failing both halves of the ask.
So we install the published binary and prove its provenance instead:
1. binaryFate's key is VENDORED at files/binaryfate.asc. A trust root fetched
over the network at the moment you need it is not a trust root. Its
fingerprint is asserted after import regardless.
2. hashes.txt is verified, and the assertion is on gpg's `VALIDSIG <fpr>`
status line - NOT on the string "Good signature", which is what
bitcoin_knots greps for and which passes for any key in the keyring.
3. The hash is looked up in the output of `gpg --decrypt`, not in the raw
clearsigned file, so nothing unsigned is ever searched.
4. The lookup requires hash AND filename on one line.
Tested with a positive and a negative control before deploying: the real
tarball matches, a corrupted hash correctly fails. monero_sha256 in defaults/
is a second in-git assertion so a version bump cannot happen without the
checksum moving in the same diff.
When v0.19 ships with guix on the release branch this gets easier, and the
README records why: the published monero-linux-x64 tarball unpacks to
monero-x86_64-linux-gnu-v0.18.5.1/, i.e. it IS the guix DISTNAME renamed, so
sha256(guix output) will equal the hashes.txt entry exactly.
── The 500 GB disk is provisioned in code ──────────────────────────────────
knots-box mounts /mnt/knots_data (~875 GB of chain) entirely by hand; that
mount appears nowhere in Ansible and a rebuild of that host would come up with
the blockchain silently missing. tasks/storage.yml does not repeat it.
Whole device, no partition table. Everything after mkfs goes by UUID, because
/dev/sdX is assigned by the kernel at boot and this estate has been bitten
eight times by an identifier written down once whose thing then moved.
monero_data_device is used ONLY to create the filesystem. Guards refuse to
touch the root disk or to overwrite an unrecognised filesystem, and a final
assert confirms the data directory is not still on /.
fstab gets `nofail` so a missing disk cannot drop a headless VM into an
emergency shell - and the unit gets `RequiresMountsFor=`, without which monerod
would then start, find an empty directory, and write a 300 GB chain onto a
10 GB root disk. With it the unit refuses to start and infra/401 says so within
five minutes.
The mount-point task and the ownership task deliberately share owner and mode.
Writing the obvious root:root 0755 on the first made them disagree and every
run flipped the directory back and forth; caught by re-running --check.
── Exposure: one HTTPS vhost, zero new open ports ──────────────────────────
Two RPC servers, not one: unrestricted on 127.0.0.1:18081 for administration
and the health check, restricted on :18089 for everything else. That is
`rpc-restricted-bind-port` and deliberately NOT `restricted-rpc=1`, which would
restrict the loopback server too. Verified live: the restricted port reports
restricted=true and blanks version and start_time.
--rpc-login is HTTP Digest (contrib/epee/src/http_auth.cpp) and
core_rpc_server::init hands the same login to both servers. Caddy on vipy does
TLS and routing only - no caddy_site_basic_auth, because a Basic challenge
would collide with the Digest challenge Feather answers. Verified end to end
from the WAN: 401 unauthenticated, get_block_count over /json_rpc when
authenticated, 401 again with a wrong password.
No UFW rule, and that is correct: tailnet traffic bypasses UFW entirely because
`-A INPUT -j ts-input` sits ahead of every ufw-* chain. Confirmed on mempool-box
before relying on it here.
P2P is outbound only. Nothing forwards 18080, so the node dials out, syncs and
serves us without relaying for strangers; no-igd follows from that.
── Monitoring: infra, systemd, public. No backups ──────────────────────────
Six Gatus endpoints, all green: liveness, disk, services/monerod-box-local/
monerod, probe/monerod, dns/monero.contrapeso.xyz, public/monero.
The probe does NOT assert `synchronized`. A full sync takes days and a check
requiring it would report DOWN for every one of them - an alarm with the
batteries taken out. Height and sync state go in the message instead.
The timer carries no `Requires=monerod.service`. Fulcrum's did, and sat
active+enabled for seven months without firing once. public/monero asserts 401,
not 200, so it goes red if rpc-login ever stops being enforced.
No backups, deliberately, following the phoenixd precedent: the chain is
re-syncable public data and there is no wallet on this node.
── Known constraint ────────────────────────────────────────────────────────
The VM has 2 GB and no swap; monerod's RSS is ~1.3 GB mid-sync. It is holding
(0 OOM kills, ~1 GB available, kernel reclaiming cache) but 8 GB is the
recommendation once the initial sync is done. out-peers/in-peers are held at
16/8 partly for this reason. Bumping it is a Proxmox resize plus memory_mb
here, since the vm resource sets ignore_changes = all.
The 500 GB data disk is likewise invisible to tofu - it was attached in the UI
and the vm resource ignores it - so vms.auto.tfvars now carries a comment
saying where it is and what mounts it.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
146 lines
8.4 KiB
YAML
146 lines
8.4 KiB
YAML
---
|
|
# Domain expiry, DNS correctness, and public endpoint reachability.
|
|
#
|
|
# These are the first checks in the estate that PULL rather than push, and that
|
|
# is the right way round for them: all three are about how the outside world
|
|
# sees us, so they must be measured from outside. Gatus polls from the
|
|
# observability host and needs nothing installed anywhere else - there is no
|
|
# script, no timer and no token, because nothing is reporting in.
|
|
#
|
|
# That also means these have no heartbeat. A heartbeat answers "did the thing
|
|
# that was supposed to report in do so"; when Gatus does the checking itself,
|
|
# failure is immediate and self-evident.
|
|
|
|
- name: Register the public-facing checks with Gatus
|
|
hosts: observability
|
|
become: yes
|
|
|
|
vars:
|
|
# Expected A records, derived from inventory rather than written down again.
|
|
# The estate's recurring bug is an address recorded in a second place and
|
|
# then left behind when the machine moved, so the check asserts against
|
|
# ansible_host - if a box is renumbered, inventory is the one edit.
|
|
dns_records:
|
|
- {sub: "{{ subdomains.gatus }}", host: monitoring}
|
|
- {sub: "{{ subdomains.headscale }}", host: spacey}
|
|
- {sub: "{{ subdomains.vaultwarden }}", host: vipy}
|
|
- {sub: "{{ subdomains.forgejo }}", host: vipy}
|
|
- {sub: "{{ subdomains.lnbits }}", host: vipy}
|
|
- {sub: "{{ subdomains.ntfy_emergency_app }}", host: vipy}
|
|
- {sub: "{{ subdomains.personal_blog }}", host: vipy}
|
|
- {sub: "{{ subdomains.memos }}", host: vipy}
|
|
- {sub: "{{ subdomains.mempool }}", host: vipy}
|
|
- {sub: "{{ subdomains.datum_gateway }}", host: vipy}
|
|
- {sub: "{{ subdomains.monero }}", host: vipy}
|
|
|
|
# A public resolver on purpose: this must test what the internet sees, not
|
|
# what a local cache or the tailnet's MagicDNS happens to answer.
|
|
dns_resolver: "1.1.1.1"
|
|
|
|
# Expected status per site, checked live before being written down.
|
|
# 401 is the CORRECT answer for the two behind basic auth - asserting 200
|
|
# there would go green precisely when the auth broke.
|
|
public_sites:
|
|
- {name: gatus, sub: "{{ subdomains.gatus }}", path: "/", status: 401}
|
|
- {name: headscale, sub: "{{ subdomains.headscale }}", path: "/health", status: 200}
|
|
- {name: vaultwarden, sub: "{{ subdomains.vaultwarden }}", path: "/", status: 200}
|
|
- {name: forgejo, sub: "{{ subdomains.forgejo }}", path: "/", status: 200}
|
|
- {name: lnbits, sub: "{{ subdomains.lnbits }}", path: "/", status: 200}
|
|
- {name: avisame, sub: "{{ subdomains.ntfy_emergency_app }}", path: "/", status: 200}
|
|
- {name: blog, sub: "{{ subdomains.personal_blog }}", path: "/", status: 200}
|
|
- {name: memos, sub: "{{ subdomains.memos }}", path: "/", status: 200}
|
|
- {name: mempool, sub: "{{ subdomains.mempool }}", path: "/", status: 200}
|
|
- {name: datum, sub: "{{ subdomains.datum_gateway }}", path: "/", status: 401}
|
|
# 401 is CORRECT: monerod answers an unauthenticated request with an HTTP
|
|
# Digest challenge. Asserting 200 here would go green precisely when
|
|
# rpc-login broke and the node started serving the world for free.
|
|
- {name: monero, sub: "{{ subdomains.monero }}", path: "/get_info", status: 401}
|
|
|
|
# Ports published from the edge host by socket_proxy.
|
|
public_tcp:
|
|
- {name: bitcoin-p2p, host: vipy, port: "{{ hostvars['knots_box_local'].bitcoin_p2p_port }}"}
|
|
- {name: fulcrum-ssl, host: vipy, port: "{{ hostvars['fulcrum_box_local'].fulcrum_ssl_port }}"}
|
|
- {name: datum-stratum, host: vipy, port: "{{ hostvars['knots_box_local'].datum_gateway_stratum_port }}"}
|
|
|
|
tasks:
|
|
# ── Domain expiry ────────────────────────────────────────────────────────
|
|
# Each domain needs a URL SCHEME: Gatus derives the endpoint type from the
|
|
# prefix (endpoint.Type()), so a bare "example.com" is UNKNOWN and the whole
|
|
# config is rejected. No status is asserted, only the WHOIS/RDAP expiry, so
|
|
# whatever the apex serves - a real site, or the registrar's parking page -
|
|
# is irrelevant.
|
|
#
|
|
# 24h, and upstream enforces a 5m minimum for DOMAIN_EXPIRATION anyway
|
|
# because it uses a free whois service that must not be hammered.
|
|
# 336h = 14 days of runway, because renewal is a manual act at the registrar.
|
|
- name: Build the domain endpoints
|
|
ansible.builtin.set_fact:
|
|
domain_endpoints: "{{ domain_endpoints | default([]) + [{
|
|
'name': item,
|
|
'group': 'domain',
|
|
'url': 'https://' ~ item,
|
|
'interval': '24h',
|
|
'conditions': ['[DOMAIN_EXPIRATION] > 336h'],
|
|
'alerts': [{'type': 'signal', 'failure-threshold': 1,
|
|
'success-threshold': 1, 'send-on-resolved': true,
|
|
'minimum-reminder-interval': '168h'}]}] }}"
|
|
loop: "{{ monitored_domains }}"
|
|
|
|
# ── DNS ──────────────────────────────────────────────────────────────────
|
|
# 6h, not daily: a DNS query is cheap and a wrong record is an outage. The
|
|
# domain check stays at 24h because it does a WHOIS/RDAP lookup against a
|
|
# free service. Alert on the first failure - at a 6h interval, waiting for
|
|
# three would be nearly a day.
|
|
- name: Build the DNS endpoints
|
|
ansible.builtin.set_fact:
|
|
dns_endpoints: "{{ dns_endpoints | default([]) + [{
|
|
'name': item.sub ~ '.' ~ root_domain,
|
|
'group': 'dns',
|
|
'url': dns_resolver,
|
|
'interval': '6h',
|
|
'dns': {'query-type': 'A', 'query-name': item.sub ~ '.' ~ root_domain},
|
|
'conditions': ['[DNS_RCODE] == NOERROR',
|
|
'[BODY] == ' ~ hostvars[item.host].ansible_host],
|
|
'alerts': [{'type': 'signal', 'failure-threshold': 1,
|
|
'success-threshold': 1, 'send-on-resolved': true,
|
|
'minimum-reminder-interval': '24h'}]}] }}"
|
|
loop: "{{ dns_records }}"
|
|
|
|
# ── Public HTTP ──────────────────────────────────────────────────────────
|
|
# failure-threshold 3 at a 5m interval = 15 minutes. A pulled endpoint has
|
|
# no heartbeat window, so unlike the push checks the tolerance has to live
|
|
# in the threshold - and one failed poll of a public site is usually a blip.
|
|
- name: Build the public HTTP endpoints
|
|
ansible.builtin.set_fact:
|
|
http_endpoints: "{{ http_endpoints | default([]) + [{
|
|
'name': item.name,
|
|
'group': 'public',
|
|
'url': 'https://' ~ item.sub ~ '.' ~ root_domain ~ item.path,
|
|
'interval': '5m',
|
|
'conditions': ['[STATUS] == ' ~ item.status,
|
|
'[CERTIFICATE_EXPIRATION] > 168h'],
|
|
'alerts': [{'type': 'signal', 'failure-threshold': 3,
|
|
'success-threshold': 2, 'send-on-resolved': true,
|
|
'minimum-reminder-interval': '6h'}]}] }}"
|
|
loop: "{{ public_sites }}"
|
|
|
|
# ── Public TCP ───────────────────────────────────────────────────────────
|
|
- name: Build the public TCP endpoints
|
|
ansible.builtin.set_fact:
|
|
tcp_endpoints: "{{ tcp_endpoints | default([]) + [{
|
|
'name': item.name,
|
|
'group': 'public',
|
|
'url': 'tcp://' ~ hostvars[item.host].ansible_host ~ ':' ~ item.port,
|
|
'interval': '5m',
|
|
'conditions': ['[CONNECTED] == true'],
|
|
'alerts': [{'type': 'signal', 'failure-threshold': 3,
|
|
'success-threshold': 2, 'send-on-resolved': true,
|
|
'minimum-reminder-interval': '6h'}]}] }}"
|
|
loop: "{{ public_tcp }}"
|
|
|
|
- name: Register the public-facing endpoints
|
|
ansible.builtin.include_role:
|
|
name: gatus_endpoint
|
|
vars:
|
|
gatus_endpoint_name: public
|
|
gatus_endpoint_pulled: "{{ domain_endpoints + dns_endpoints + http_endpoints + tcp_endpoints }}"
|