koopa-admin-log/scripts/taler-landing
Hernâni Marques 78bbd80d1f
landing: central container memory/load stats for all three sites
Collect RSS groups, top processes, and loadavg from inside each podman
container (not host /proc), merge into performance.memory, show compact
labels with cgroup limits and byte tooltips, and cover this in the test suite.
2026-07-17 08:55:00 +02:00
..
collect-landing-stats.sh landing: central container memory/load stats for all three sites 2026-07-17 08:55:00 +02:00
collect_bank_stats.py landing: central container memory/load stats for all three sites 2026-07-17 08:55:00 +02:00
collect_container_resources.sh landing: central container memory/load stats for all three sites 2026-07-17 08:55:00 +02:00
deploy-landings.sh landing: harden GOA alt display for all three sites 2026-07-17 08:48:00 +02:00
enrich_stats_alt.py scripts/taler-landing: full-scan bank collector with GOA alt units 2026-07-17 07:42:00 +02:00
goa_amounts.py landing: harden GOA alt display for all three sites 2026-07-17 08:48:00 +02:00
install-landing-stats-host.sh landing: central container memory/load stats for all three sites 2026-07-17 08:55:00 +02:00
merge_resources.py landing: central container memory/load stats for all three sites 2026-07-17 08:55:00 +02:00
README.md landing: central container memory/load stats for all three sites 2026-07-17 08:55:00 +02:00
test-landing-stats.sh landing: central container memory/load stats for all three sites 2026-07-17 08:55:00 +02:00

taler-landing — central stats (hernani user systemd)

Public landing numbers on

are produced by one host process as user hernani, not by three unrelated in-container crons.

Why host / user systemd

Concern Approach
All accounts / all money Python full scan + tx pagination (not capped at 80 accounts)
High ladder GOA amount_alt / UI alt units (Kilo-/Mega-/Peta-GOA) — tiles stay short
No root cron systemctl --user as hernani + loginctl enable-linger
Failure safety failed run only updates stats-run.json; last good stats.json stays

Install (on koopa as hernani)

cd ~/src/koopa/koopa-admin-log
./scripts/taler-landing/install-landing-stats-host.sh

# timer without login session:
sudo loginctl enable-linger hernani

# run once:
systemctl --user start taler-landing-stats.service
journalctl --user -u taler-landing-stats.service -n 50 --no-pager
systemctl --user list-timers 'taler-landing-stats*'

Units:

  • configs/systemd/user/taler-landing-stats.service — oneshot collector
  • configs/systemd/user/taler-landing-stats.timer — every 2 minutes after boot

Installed paths:

Path Role
~/.local/bin/collect-landing-stats.sh orchestrator
~/.local/lib/taler-landing/*.py bank scan + alt enrich
~/.local/state/taler-landing-stats/ logs
~/.config/systemd/user/taler-landing-stats.* user units

What the collector does

  1. Bankcollect_bank_stats.py

    • admin token → list all accounts
    • for each account (except SCAN_SKIP, default exchange) page through all transactions
    • sum credits / Taler withdraws / other debits
    • emit amount + amount_alt / amount_full
    • podman cptaler-hacktivism-bank:/var/www/bank-landing/stats.json
  2. Exchange — run landing-stats-exchange.sh inside exchange container, then enrich alt fields on the host and write back.

  3. Merchant — same for merchant container.

  4. Resources (all three)collect_container_resources.sh runs mem-snapshot inside each podman container (not host /proc): container RSS (+ cgroup limit label), postgres/java/taler/nginx groups, top-10 processes, loadavg. Merged into performance.memory / performance.loadavg via merge_resources.py.

exchange is skipped in the bank flow scan so the same GOA is not counted once as customer withdraw and again as exchange credit. Admin, explorer, and every auto-account are included.

Secrets

Preferred order:

  1. ~/src/koopa/koopa-admin-secrets/koopa/host-root/taler-bank/bank-admin-password.txt
  2. ~/.config/taler-landing/bank-*-password.txt
  3. podman exec taler-hacktivism-bank cat /root/bank-admin-password.txt

Explorer password optional (shared-pool balance).

Env overrides

Env Default Meaning
BANK_URL http://127.0.0.1:9012 libeufin loopback
SCAN_SKIP exchange usernames excluded from flow
TX_PAGE 500 transactions page size
MAX_TX_PAGES 0 0 = unlimited pages / account
ACCOUNTS_DELTA -10000 account list window
ADMIN_LOG %h/src/koopa/koopa-admin-log refresh in-container scripts

UI alt names

configs/shared/goa-amount.js formats large amounts as e.g. 1.23 Mega-GOA (tooltip = full GOA:…). Landings load it as /intro/goa-amount.js (deploy via deploy-landings.sh).

Legacy in-container bank cron

scripts/taler-bank/landing-stats.sh remains a fallback inside the bank container. Once the hernani timer is healthy, disable the old in-container minutely cron to avoid races:

podman exec taler-hacktivism-bank crontab -l   # inspect
# remove landing-stats.sh line if present

Manual run

~/.local/bin/collect-landing-stats.sh
# or from checkout:
./scripts/taler-landing/collect-landing-stats.sh

curl -sS https://bank.hacktivism.ch/intro/stats.json | python3 -m json.tool | head