trx-rs.toml.example was maintained by hand and had fallen well behind: no
[[rigs]], no [[remotes]], no [timeouts], no bandplan or decode-history
settings, and a [frontends.http].default_rig_id that had been renamed.
Generate it from the config structs instead, so a new field shows up the moment
it exists, and add a test that fails when the checked-in copy drifts:
cargo run -p trx-config --example generate_example
Section comments come from a small table; a section without an entry is still
emitted, so forgetting a comment can never drop a setting from the example.
The manual was wrong about the basics. It listed five config search paths, none
of which the loader has ever looked at (the real order is ./trx-rs.toml → XDG →
/etc), called --print-config output "fully commented" when it carries no
comments at all, and documented a TRX_PLUGIN_DIRS variable no code reads. It
also still described [frontends.rigctl].port as the bind port years after
rig_ports replaced it. Fixed, and the new configuration features are written
up alongside.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyX26FCpMQxiBoC7r5K1A7
Signed-off-by: Stan Grams <sjg@haxx.space>
27 lines
796 B
Rust
27 lines
796 B
Rust
// SPDX-FileCopyrightText: 2026 Stan Grams <sjg@haxx.space>
|
|
//
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
//! Configuration types shared by `trx-server`, `trx-client` and
|
|
//! `trx-configurator`.
|
|
//!
|
|
//! Keeping the structs, the loader and the validators in one crate means the
|
|
//! setup wizard checks a config with exactly the same code the binaries load
|
|
//! it with, so the two can never drift apart.
|
|
|
|
pub mod client;
|
|
pub mod example;
|
|
pub mod file;
|
|
pub mod secrets;
|
|
pub mod server;
|
|
pub mod shared;
|
|
pub mod unknown;
|
|
pub mod url;
|
|
|
|
pub use client::ClientConfig;
|
|
pub use file::{ConfigError, ConfigFile, ConfigLoad};
|
|
pub use server::ServerConfig;
|
|
pub use shared::{validate_log_level, validate_tokens};
|
|
pub use unknown::UnknownKey;
|
|
pub use url::{parse_audio_url, parse_remote_url, RemoteEndpoint};
|