do-stacks runs the Defend-O-Tron’s container stacks. Each stack is a group of containers that belong together:
| Stack | What runs in it |
|---|---|
proxy |
Traefik, the web proxy in front of the device’s web pages |
dns |
AdGuard Home, the DNS filter |
crowdsec |
CrowdSec, the threat detection engine |
monitoring |
VictoriaMetrics, the metrics store, and a mail relay for notifications |
Some devices and situations add others, such as support while a remote support session is open. The firewall bouncer, Suricata and the web interface run on the device itself, not in containers.
Where to run it: open Device → Terminal in the web interface, or connect over SSH.
do-stacksasks for your password by itself, because it runs withsudo.
do-stacks [<command>] [<stack>...]
With no command, do-stacks runs deploy. With no stack names, it uses the default list from the settings file (see Configuration): proxy dns crowdsec monitoring to bring stacks up, and the reverse order to take them down.
| Flag | Effect |
|---|---|
--no-color |
Plain ASCII output, without colours or box-drawing characters. NO_COLOR=1 does the same |
--quiet |
Show only errors and warnings |
--verbose |
Show everything, including podman-compose’s own output |
--json |
Print one JSON event per line, for scripts. status prints one JSON snapshot instead |
When you open the web interface by its name (https://defend-o-tron.protected.lan/), it reaches you through the proxy stack. If you stop or remove proxy from a Terminal page opened that way, your session drops at once. The web interface keeps running; you just cannot reach it by name until proxy is back.
Before you work on proxy, open the web interface directly at https://<management-ip>:9090/, or use SSH. The same care applies to dns if your network uses the Defend-O-Tron for DNS: while it is stopped, name lookups fail.
Shows the time zone, the deploy folder, the container tool and its storage, a count of stacks and containers, then a table of stacks (pods) and a table of containers. It is the quickest way to check that everything is running.
do-stacks status [--json]
Example from a V100:
$ do-stacks status
+------------------------------------------------------------------------------------+
| Timezone America/Edmonton |
| Working Directory /opt/deploy |
| Compose Provider /usr/bin/podman-compose |
| Podman OK overlay @ /run/live/persistence/nvme0n1p1/containers/storage |
+------------------------------------------------------------------------------------+
Stacks 4 | Containers 5 (5 running, 0 exited, 0 created)
+----------------+---------+---------+------------+
| NAME | STATUS | CREATED | CONTAINERS |
+----------------+---------+---------+------------+
| pod_proxy | Running | 9h | 1 |
| pod_dns | Running | 9h | 1 |
| pod_crowdsec | Running | 9h | 1 |
| pod_monitoring | Running | 9h | 2 |
+----------------+---------+---------+------------+
+-----------+----------------+---------+---------+
| CONTAINER | POD | STATUS | CREATED |
+-----------+----------------+---------+---------+
| crowdsec | pod_crowdsec | Running | 9h |
| adguard | pod_dns | Running | 9h |
| smtprelay | pod_monitoring | Running | 9h |
| victoria | pod_monitoring | Running | 9h |
| traefik | pod_proxy | Running | 9h |
+-----------+----------------+---------+---------+
just now, 5m, 3h, 2d, 4w); anything older than 30 days shows a date.With --json, it prints one JSON object, for health checks:
{
"timezone": "America/Edmonton",
"deploy_home": "/opt/deploy",
"compose_provider": "/usr/bin/podman-compose",
"counts": {
"pods": 4,
"containers": { "total": 5, "running": 5, "exited": 0, "created": 0, "other": 0 }
},
"pods": [ { "name": "...", "status": "...", "created": "...", "containers": 1 } ],
"containers": [ { "name": "...", "pod": "...", "state": "running", "created": "..." } ]
}
Brings stacks up: pulls any missing images and starts every container in the named stacks. It is the default command. A stack that is already running is left alone.
do-stacks deploy [<stack>...]
do-stacks # the same, for the default stacks
Takes stacks down and deploys them again, so their containers pick up changed compose files or settings. The stacks’ stored data (named volumes) is kept. Use this after you change a stack’s configuration.
do-stacks recreate [<stack>...]
Recreates only the stacks whose compose inputs (*.yml, config/*.env, global.env) changed since they were deployed. The device runs it at every start, so a firmware or package update that changes a stack takes effect.
do-stacks sync
start starts containers that exist but are stopped; it does not pull images or create containers. stop stops them; they stay on disk, and start resumes them. Read Before you touch the proxy stack first.
do-stacks start [<stack>...]
do-stacks stop [<stack>...]
Takes stacks down: stops their containers and removes them. The stored data under /opt/data/ is not deleted. deploy brings the stack back. To apply a configuration change, recreate does both steps at once.
do-stacks rm [<stack>...]
Removing proxy from a Terminal page opened by the device’s name ends your session. Use
https://<management-ip>:9090/or SSH first.
Prints the compose configuration a stack would use, with every variable filled in and every override merged. Use it to see what deploy would do without doing it, or to check that the settings file still parses after an edit.
do-stacks config [<stack>...]
Downloads the images for the named stacks without changing what is running, for example to prepare before a maintenance window.
do-stacks pull [<stack>...]
Loads container image files (*.img) from /opt/deploy/images, so a stack can start without downloading. With a name, it loads that image only.
do-stacks load [<name>]
Makes the container networks match the settings file. A network whose settings Podman cannot change in place is rebuilt; its stopped containers are removed, and the next deploy recreates them. It exits with code 3 when nothing needed changing.
do-stacks networks
Removes the pods and containers of stacks whose compose file is gone, for example after a firmware update dropped a stack. The device runs it at every start.
do-stacks orphans
Cleans up the named stacks, removes stale containers, and removes unused images, to free disk space after many updates.
High risk.
cleanupremoves containers and images. Run it only when support asks you to, or when you know what it will remove.
do-stacks cleanup [<stack>...]
Makes sure the CrowdSec firewall bouncer has its API key: it reuses the stored key or makes a new one, writes it into the bouncer’s settings, and stores it as a Podman secret. It does the same for the audit collector’s key and the web interface’s machine password. Each step is skipped when it is already done. The device runs it when it is first set up; you need it only to recover from a CrowdSec reset.
do-stacks config-apikey
do-stacks version prints the installed version. do-stacks help (or --help, -h) prints the full usage text.
Check everything after a restart:
do-stacks status
Apply a configuration change to one stack:
do-stacks recreate crowdsec
Download updates without touching running services:
do-stacks pull
Health checks for monitoring:
# the number of running containers
do-stacks status --json | jq '.counts.containers.running'
# the names of any pod that is not running
do-stacks status --json | jq -r '.pods[] | select(.status != "Running") | .name'
do-stacks reads one settings file: /etc/awesome-o/do-stacks.conf. It is a Debian conffile, so your edits survive package updates. It is the only source for these values: if the file is missing, or a required section or key is missing or empty, do-stacks refuses to run and says why. The file is commented in detail.
| Section | What it controls |
|---|---|
[paths] |
Where things live: deploy_home (/opt/deploy), image_dir (/opt/deploy/images), and the time-zone files |
[network.<name>] |
The container networks. Each section becomes a Podman network of that name. Two ship: edgenet (routable) and secnet (internal only, no default gateway) |
[stacks] |
The default stack lists: deploy_order (proxy dns crowdsec monitoring) for bringing stacks up, and teardown_order (the reverse) for taking them down |
[apikey] |
Where config-apikey reads and writes the bouncer, audit and web interface credentials |
Strictness:
[netowrk.edgenet] is caught rather than ignored.After editing: run do-stacks config <stack> to check that it still parses. If the change affects a running stack, for example a network’s subnet, run do-stacks networks, then do-stacks recreate <stack>.
| Variable | Effect |
|---|---|
NO_COLOR=1 |
The same as --no-color (see no-color.org) |
SHOWBANNER=0 |
Leave out the box at the top of the output |
do-stacks, and the Services page.do-stacks recreate crowdsec after changing the honeypot parser.