u/CharlesWithC7777

▲ 5 r/rust

I'm posting this project in this subreddit, to share what I think is some elegant architecture I built and get some feedback (and hopefully some appreciation). I built this for my own servers and I don't intend to get users, and I don't have friends that can provide constructive feedback or share my joy of completing the project.

Basically, I'm a bit paranoid on security, so 4 years ago I built a Python Telegram bot running on my few servers looking at ssh sessions - which was very slow and clanky, because a full bot instance runs on each server - and so I decided to rebuild the thing in Rust, to have one central bot instance - after studying principles of programming language and procrastinating learning Rust for forever (and yes, this is my first proper Rust project).

I started the project with some basic monitoring features and communication between central server and monitored servers. Then I added a cli client on central server to fetch data from daemon, and send commands to monitored servers (with central server's daemon being a relay). Finally I added Telegram, Discord and HTTP integration that work in a similar fashion as the cli client (with the Telegram one being the goal of the project).

It took me about a month (exam month haha) to build this and the journey dealing with low-level stuff like serialization, tcp and unix socket, properly using mutex and channels, and eventually building the integrations in a trivial way (thanks to the good core architecture) was pretty fun. And of course I got a high performance and low overhead Telegram bot running, which achieved the goal of the project.

Repo link: https://git.charlws.com/charles/secmon

Btw, I hate to have to say this, but I used zero LLM agent to write this thing (because I personally hate the hype a lot), though I did use some LLM help dealing with some libraries and stuff.

u/CharlesWithC7777 — 20 days ago