r/programming • u/CircumspectCapybara • 15h ago
r/programming • u/Old-Illustrator-8692 • 17h ago
Happy Developers Build Better Products… A Message for Management!
youtube.comr/programming • u/jacobs-tech-tavern • 20h ago
Building apps is a system design exercise
blog.jacobstechtavern.comr/programming • u/Nuoji • 11h ago
Madrigal Games' Traction Point was rewritten in C3
madrigalgames.comr/programming • u/Polixa12 • 1h ago
Relaying wakeups in fair locks
kusoroadeolu.github.ioThis was pretty fun for me to write up on. Would love to hear y'all's thoughts on scheduling bottlenecks in fair locks.
r/programming • u/KrzysztofLopuchDev • 25m ago
A server admin panel that can't execute anything: request files, a read-only Docker socket and a host that decides
boring-tech.com.plAdmin panels with a terminal and a restart button are a big attack surface. If the web app can run docker commands, then anyone who takes over the web app can run them too. Here is a design that keeps the convenience and shrinks that risk. I used it for an internal panel on a single-node Docker Swarm.
1. The panel only reads. The Docker socket is mounted read only, and the panel only sends GET requests (services, tasks, nodes, logs). Metrics come from cgroup v2 and pg_stat_* through a monitoring role. Neither the database role nor the RabbitMQ account can change anything.
2. Actions are requests, not commands. "Restart", "scale to 0" or "prune" doesn't call Docker. The panel writes a small JSON request file to one directory. That directory is the only thing the panel can write to. A systemd unit on the host picks the file up, checks it against its own rules and runs it. The host has its own copy of the limits (max replicas, protected services such as SSO, the reverse proxy and the panel itself), and the host's copy wins. A compromised panel can ask for something, but it can't force it.
3. Risky actions need intent, not just a click. Scaling to 0 and prune require typing the service name. Every action is logged with who asked for it and what the host answered.
4. The browser terminal is treated as the most dangerous feature.
- It opens only after a fresh SSO sign-in (≤ 5 min old). An old session cookie isn't enough, so the page sends you to SSO with
prompt=login. - It closes after 15 min idle or 1 h total.
- The host shell runs through ttyd on a unix socket and is never exposed on a port.
- Every session is logged.
5. Monitoring without a metrics stack. For one server, Prometheus + Grafana + exporters is more to run than what it watches. Instead, a small agent (.deb) samples disk, CPU, RAM and containers every minute into PostgreSQL and deletes data older than 7 days. Alerts are plain SQL over those samples: disk ≥ 80% with hysteresis back at 78%, and CPU only when every minute of the last 10 was ≥ 95%, so short spikes don't page you.
What I'd keep in any similar tool: split "who wants" from "who does". The web app asks, and a separate process with its own config decides. It costs one directory and one systemd unit, and it removes a whole class of "web app → root on the host" bugs.