r/programming • • 16h ago

Multirepo setup - Working with multiple repositories, the easy way

Thumbnail wito.dev
0 Upvotes

r/programming • • 20h ago

Building apps is a system design exercise

Thumbnail blog.jacobstechtavern.com
23 Upvotes

r/programming • • 17h ago

Happy Developers Build Better Products… A Message for Management!

Thumbnail youtube.com
106 Upvotes

r/programming • • 6m ago

The Bowling Game - From Imperative to Functional Programming - Part 2

Thumbnail fpilluminated.org
0 Upvotes

r/programming • • 11h ago

Madrigal Games' Traction Point was rewritten in C3

Thumbnail madrigalgames.com
22 Upvotes

r/programming • • 15h ago

A Deterministic Subexponential-time Algorithm for the Discrete Logarithm Problem

Thumbnail eprint.iacr.org
135 Upvotes

r/programming • • 25m ago

A server admin panel that can't execute anything: request files, a read-only Docker socket and a host that decides

Thumbnail boring-tech.com.pl
0 Upvotes

Admin 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.