sakana - a lightweight monitor for GNU Taler exchanges
======================================================

sakana periodically requests the /keys endpoint of every configured GNU Taler
exchange and reports anomalies by piping a report into a command of your
choice.  It reports

  * a host that does not resolve, is unreachable or refuses the connection,
  * a failed TLS handshake, with the reason (expired or invalid certificate,
    unknown authority, wrong host name, no TLS at all),
  * a TLS certificate that expires within five days, i.e. one whose automatic
    renewal (certbot) has evidently failed,
  * an HTTP status other than 200 OK, and timeouts,
  * a /keys response that does not parse,
  * signing keys of which none is valid any more or none beyond the next
    30 days, and denominations of which none can still be withdrawn or none
    beyond the next 14 days,
  * global fees and wire fees that are not configured for the current year
    (and, in December, for the next year).

Each error class of each exchange has its own failure tolerance, so a
long-standing warning never delays the report of a new outage, and a brief
"service restored" report follows once an exchange passes every check again.

Requirements
------------

Go 1.22 or newer.  Nothing else: sakana uses only the Go standard library,
including for TLS, HTTP and JSON.  texinfo is optional and renders the manual
as info and html.

Building
--------

    ./bootstrap
    ./configure --prefix=/usr/local
    make
    make check
    sudo make install

"make check" needs no network access and no installation.  "make check-live"
additionally checks the public exchanges and does need network access.
"make help" lists all targets.  "make deb" builds a Debian package;
"make deb-reproducible" builds it twice and compares the results.

Configuration
-------------

An INI file, by default /etc/sakana/sakana.conf:

    [sakana]
    FREQUENCY = 15 m
    TOLERANCE = 3 10 300
    COMMAND = /usr/share/sakana/sakana-notify-mail ops@example.com

    [exchange-taler-ops]
    BASE_URL = https://exchange.taler-ops.ch/

Check a configuration without contacting anything:

    sakana --test --config sakana.conf

Check every exchange once and exit non-zero if anything is wrong:

    sakana --once --config sakana.conf

See sakana.conf.example for a commented example, sakana(1) and
sakana.conf(5) for the reference documentation, and "info sakana" for the
manual.

License
-------

GNU Affero General Public License, version 3 or later.  See COPYING.
