From 2a0bba5be788393c905ff07dd650fc038b2be969 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakob=20R=C3=B6nnb=C3=A4ck?= Date: Wed, 2 Sep 2026 11:14:26 +0200 Subject: [PATCH] Add web, state, and backup sections to config template - [web]: port and public fqdn for the daemon (Caddy proxies from a separate jail); port defaults to 8080 - [state]: daemon pidfile and logs directory, default ~/.config/rpn - [backup]: timestamped dumps for rpnc db backup, default ~/.config/rpn/backups; rpnc db restore looks here by default - cli.md: document the optional positional path and the directory defaults for db backup/restore --- Application/config.template.toml | 29 +++++++++++++++++++++++++++++ Documentation/cli.md | 1 + 2 files changed, 30 insertions(+) diff --git a/Application/config.template.toml b/Application/config.template.toml index c36ad27..456a9d5 100644 --- a/Application/config.template.toml +++ b/Application/config.template.toml @@ -1,6 +1,35 @@ +# RustyRPN configuration template. +# +# Copy this file to a real config (config.toml for production, +# config.dev.toml / config.test.toml for dev and test) and fill in the +# values. Real config files are gitignored; never commit them. +# +# Lookup order: --config flag, then $RUSTYRPN_CONFIG, then +# config.toml. --env=dev|test selects config.dev.toml / config.test.toml +# instead of the production config. +# +# An empty string means "use the built-in default" where one exists. + [database] host = "" port = "" user = "" password = "" name = "" + +[web] +# The web server started by `rpnc daemon start`; Caddy reverse-proxies +# it from a separate jail. +port = "" # default 8080 +fqdn = "" # public hostname, reported by `rpnc daemon status` + +[state] +# Daemon pidfile and logs. +# Default: ~/.config/rpn +dir = "" + +[backup] +# Where `rpnc db backup` writes timestamped dumps, and where `rpnc db +# restore` looks by default. +# Default: ~/.config/rpn/backups +dir = "" diff --git a/Documentation/cli.md b/Documentation/cli.md index 0931797..7aa8cb7 100644 --- a/Documentation/cli.md +++ b/Documentation/cli.md @@ -140,6 +140,7 @@ The following decisions were made while designing the CLI command structure: - **Customer create**: Uses flags `--id` and `--name`. - **File import**: Takes a positional path to the source file; v1 accepts epsilon TSV files only (tsdrms xlsx and subfranchise PDF are future work). - **File export**: Takes a positional filename; `--format` selects the target export format, `raw` being a byte-faithful copy of the original source. +- **Db backup / restore**: Take an optional positional file path; default to the configured backup directory (the latest dump for restore). - **Invoice scope**: outgoing fuel invoices only; tsdrms/subfranchise data feeds the bookkeeping/voucher feature, never invoicing. - **Invoice create**: Uses flags `--batch`, `--from`, `--to`, `--customer`, and `--all`. The caller must supply either `--batch` or a `--from`/`--to` date range, and either `--customer` or `--all`. `--all` fans out to one invoice per customer found in the period. - **Invoice send**: Takes a positional `id`; the only status transition in v1.