Commit graph

7 commits

Author SHA1 Message Date
7846f91afe
Format with rustfmt
All checks were successful
ci / check (push) Successful in 44s
2026-07-29 19:17:16 +00:00
9325150315 Harden bot: line cap, send throttle, panic isolation, verbose flag, weather cache, tests 2026-07-29 18:46:10 +00:00
52d7c13013 Remove code comments 2026-07-29 16:24:30 +00:00
a15fb4f9a9 Restructure into a library crate with modular bot and irc
Split the single-binary crate into a reusable `rustbot` library (src/lib.rs)
plus a thin supervisor binary. The monolithic irc.rs and bot.rs become module
folders:

  irc/    message (wire parsing), connection (TCP/TLS transport), encoding
  bot/    mod (state + event loop), caps (IRCv3 cap negotiation + SASL),
          commands (message routing + command table)
  config  Config + layered loading, moved out of main.rs and bot.rs

main.rs is now just the per-network connect/reconnect supervisor over the
library API. Unit tests move out of the source files into tests/ integration
tests (config.rs, protocol.rs) that drive the public surface — prefix parsing
is now covered through Message::parse, and config layering through the new
public config::parse_str. Behavior is unchanged; no new dependencies.
2026-07-29 15:38:55 +00:00
b9e95430f5 Add multi-network support
Connect to several IRC networks at once. The config file gains optional
`[network]` section headers: keys before the first header are shared
defaults, and each section defines one network that inherits and overrides
them. A file with no sections is a single network exactly as before, so
existing configs are unaffected.

main spawns one supervisor thread per network, each with its own
connect/reconnect/backoff loop, so a failure on one network never disturbs
the others. The blocking Bot/Connection are reused unchanged — no async
runtime, no new dependencies. With more than one network, wire logs are
tagged with the section name; a lone network stays unprefixed.
2026-07-28 16:12:57 +00:00
ab02a5436e Add TLS transport support
Connect over TLS (default port 6697) using native-tls with the system
OpenSSL trust store for certificate verification. Unify the plaintext and
TLS transports behind a single Box<dyn Read + Write>, dropping the
read/write socket clone that a TLS session cannot support. Add a `tls`
config key and IRC_TLS override; the port auto-defaults to 6697 when TLS
is enabled.
2026-07-28 14:57:44 +00:00
05c004d32d
rust bot 2026-07-28 14:29:34 +00:00