
ssh-chat in modern c

General BBS Software
SSH-Chatter has started from a C reimplementation of the Go ssh-chat server. It mirrors/extends the original behaviour while using modern C patterns and a small, testable core. The server listens for SSH/TELNET connections and places every authenticated user into a shared chat room that exposes the same command surface as the Go reference implementation.
Do you know why it takes so long to understand C? Because it is an instinct.
/rss list, /rss read <tag>, plus /rss add <url> <tag> and /rss del <tag> (operators only) so the room can browse headlines together./delete-msg for targeted chat history cleanup./bbs command unlocking an immersive retro bulletin board system with tags, comments, bumping, and a multi-line composer.
bumped (recent activity), hot (trending by score & comments), top (highest net score), or new (creation date) using list [hot|top|new|bumped|all].search <query>.Score: 12 Comments: 5) directly in listings.cmtreply <id> <idx> <text> answers a comment; replies are drawn indented under their parent (depth capped at four), notify the parent's author, and move up a level when the comment they answer is deleted. Reply links live in the bbs_state_threads.dat sidecar, so bbs_state.dat keeps its v3 layout./bbs prefix inside BBS mode./bbs post art <title> (or /asciiart bbs <title>, or a plain post while on the art board) opens the art composer for the art board. Pasted SGR colors (16/256/truecolor) are kept and replayed line by line with a reset after each row; cursor movement, screen clears, OSC/DCS strings and terminal queries are stripped before storage and again on display./asciiart live composer with a 640-line limit, a ten-minute per-IP cooldown, multi-line output, and keyboard shortcuts for cancelling with Ctrl+A and submitting with Ctrl+S or the locale-aware >/__ARTWORK_END> default./birthday to register birthdays, /grant <ip> so LAN operators can delegate privileges by address, and /revoke <ip> so top LAN admins can reclaim them./multilingual-route on|off: non-ASCII UTF-8 messages route to UTF-8, while legacy non-CP437 input routes to its codepage room (for example CP949). Rooms are created on first use and persist in history; /room list and /room join <name> navigate them./unread, plus /unread mentions for mentions, replies, and private messages. /room list shows user counts, unread counts, and last activity; /help <command> provides localized usage, examples, and related commands./update to migrate every legacy user record to the current on-disk format and gracefully restart the server. Migration failures cancel the restart./ban upgrades that accept raw IP addresses alongside usernames./weather <city> for quick global forecasts.

The codebase is intentionally compact so new contributors can navigate it quickly:
| Path | Description |
|---|---|
src/main.c | Command-line parsing and process bootstrap (bind address, port, MOTD, host key directory). |
src/host_aggregate.c, include/ssh_chatter/host.h | Chat host implementation – session lifecycle, MOTD handling, and hooks for future message broadcast logic. |
src/host | Modular host subsystems that compile into a single translation unit through src/host_aggregate.c. |
include/ssh_chatter | Shared headers for the daemon, stress tools, and the translation backend. |
include/ssh_chatter/contexts | Definitions for session_ctx_t and related structures that encapsulate per-connection state. |
data/banner/banner | Sample welcome banner that can be pointed to with CHATTER_WELCOME_BANNER. |
scripts/install_chatter_service.sh | Convenience installer that builds the binary, installs it under /usr/local/bin, and wires up a systemd unit (chatter.service). |
scripts/install_dependencies.sh | Minimal package installer for build prerequisites on Debian/Ubuntu systems. |

mainThe work branch regularly diverges from upstream development so larger features can
incubate without interrupting production traffic. When it is time to synchronize with
main, pull the latest tree and merge it locally before opening a pull request:
git fetch origin main
git checkout work
git merge --no-ff origin/main
Resolve any conflicts in place (the src/host_aggregate.c helper routines already mirror the
layout used on main, so merges are typically straightforward) and run make to
confirm the build still succeeds before pushing the result.
host_snapshot_last_captcha exposes the most recently generated captcha prompt and answer along with a timestamp so external clients can pass challenges on behalf of unattended automation.