mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-26 02:11:53 +00:00
Using .status() leaks stderr directly to system logs, causing noisy iptables error messages. Switch all networking CLI invocations to use .invoke() which captures stderr properly. For check-then-act patterns (iptables -C), use .invoke().await.is_err() instead of .status().await.map_or(false, |s| s.success()).
1.5 KiB
1.5 KiB
Core — Rust Backend
The Rust backend daemon for StartOS.
Architecture
See ARCHITECTURE.md for binaries, modules, Patch-DB patterns, and related documentation.
See CONTRIBUTING.md for how to add RPC endpoints, TS-exported types, and i18n keys.
Quick Reference
cargo check -p start-os # Type check
make test-core # Run tests
make ts-bindings # Regenerate TS types after changing #[ts(export)] structs
cd sdk && make baseDist dist # Rebuild SDK after ts-bindings
Operating Rules
- Always run
cargo check -p start-osafter modifying Rust code - When adding RPC endpoints, follow the patterns in rpc-toolkit.md
- When modifying
#[ts(export)]types, regenerate bindings and rebuild the SDK (see ARCHITECTURE.md) - When adding i18n keys, add all 5 locales in
core/locales/i18n.yaml(see i18n-patterns.md) - When using DB watches, follow the
TypedDbWatch<T>patterns in patchdb.md - Always use
.invoke(ErrorKind::...)instead of.status()when running CLI commands viatokio::process::Command. TheInvoketrait (fromcrate::util::Invoke) captures stdout/stderr and checks exit codes properly. Using.status()leaks stderr directly to system logs, creating noise. For check-then-act patterns (e.g.iptables -C), use.invoke(...).await.is_ok()/.is_err()instead of.status().await.map_or(false, |s| s.success()).