Self-hosted service
Quenary/tugtainer avatar
Quenary/tugtainer

Tugtainer automates Docker container updates through the socket it is not allowed to update

An application for automated Docker container updates with a web UI

1,558 stars59 forksPythonMIT

At a glance

What is it?
A read of Quenary/tugtainer: the web UI that checks and updates containers, the agent that carries those commands to remote hosts, and the self-imposed limits the project documents about itself, including the containers it refuses to update.
Who is it for?
Tugtainer is built for a homelab or a small fleet where one person wants to be told that an image moved and then approve the change, and it makes several of the right calls: automatic updates are off until you turn them on, the socket proxy lets you hand out only the API permissions a feature needs, and remote agent URLs pointing at private networks are refused unless you allow them by network or by endpoint. Two things decide whether it earns a place.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 2 days ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 22, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • Quenary/tugtainer1,558 ★ · +32
Star history
Repository2026-09-112026-11-22
Quenary/tugtainer1.5k1.6k

32 Stars in the last 72 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

Distributed as is, with automatic updates off until you ask

The opening paragraphs of the README are the ones most projects leave out. The application is distributed as is and is explicitly not recommended for production environments, and the next line is a reminder to keep regular backups of important data. Neither sentence is qualified further anywhere in the visible text, so the project's own position is the first fact to hold on to.

The second opening fact is about defaults. Automatic updates are disabled by default, and the guidance is to enable only what you need. Combined with the per-container setting that chooses between check only and auto-update, that means a fresh install watches your containers without touching them. Scheduling is separate again, through a crontab facility, so the update cadence is something you opt into per container rather than a global switch.

Healthcheck monitoring is the feature to look at twice under that policy, because it is not a check only feature. Turning monitoring on gives you auto-restarts and notifications, so a container that starts failing after an image pull can be restarted without a human noticing. That is a write action on a running container, driven by a probe, and it is enabled through the same interface as everything else. The visible documentation gives no per-feature switch for separating monitoring from restarting, only for separating checking from updating.

The agent and the socket proxy are excluded from updating on purpose

Two containers carry the Docker connection: the application itself, and the agent that carries commands to remote hosts. Neither can be updated from inside the interface, and the reason given is structural rather than cautious: both are used to communicate with the Docker CLI, so replacing them mid-operation would break the channel the update runs over.

The consequence for users is spelled out in a warning that covers more than the two containers. If you include them in a compose file alongside containers you want updated automatically, the update fails with an error. The workaround offered is to switch those containers to check only, which leaves you with a notification, and then recreate them yourself or from another tool such as Portainer.

So the update loop has a hole in it by design, and the hole is exactly where the plumbing lives. A deployment with ten application containers and one agent has nine that can be updated from the UI and one that needs a second tool. That is a defensible design, and it is also the single most important thing to know before choosing this application, because the number of containers that fall outside the loop is the number of containers whose updates you now schedule somewhere else.

A socket proxy is offered, with a permission list per feature

Both compose files in the repository use a socket proxy instead of mounting the Docker socket directly, and the manual setup section exists for people who want to do the same without the compose files. The deployment reference given is the LinuxServer socket proxy image on Docker Hub.

What makes this worth doing is the mapping from feature to environment variable, because it says exactly what each capability costs:

- checking needs `CONTAINERS`, `IMAGES`, `POST`, `INFO` and `PING` - updating adds `NETWORKS` - logs need `ALLOW_LOGS` - container controls need `ALLOW_START`, `ALLOW_STOP`, `ALLOW_RESTARTS`, `ALLOW_PAUSE` and `ALLOW_UNPAUSE` - the Swarm feature needs `SERVICES`, `TASKS`, `NODES` and `SWARM`

Read that list closely and one entry stands out. `POST` is grouped with the variables required for the check feature, on the assumption that inspecting containers should not require write access. Since a check has to read state and nothing more, having write permission in the minimum set is either a requirement of how the client authenticates or a grouping in the documentation that does not match the intent. Either way, the minimum permission set for a read only Tugtainer is broader than the prose implies.

Whichever route you take, the app and agent containers are pointed at the proxy by setting `DOCKER_HOST="tcp://my-socket-proxy:port"` on them.

The quick start runs with an empty AGENT_SECRET that the comments call required

The documented quick start is three commands: create a volume, pull `ghcr.io/quenary/tugtainer:1`, and run a container publishing port 9412 to 80 with `--restart=unless-stopped` and the Docker socket mounted read only. The run line carries this comment:

bash
  # run container
  # AGENT_SECRET is required. Set a strong, unique shared secret.
  docker run -d -p 9412:80 \
      --name=tugtainer \
      --restart=unless-stopped \
      -e AGENT_SECRET="" \
      -v tugtainer_data:/tugtainer \
      -v /var/run/docker.sock:/var/run/docker.sock:ro \
      ghcr.io/quenary/tugtainer:1

The value in that command is empty, so anyone who copies the block and runs it gets a container started with the one variable the comments insist on. The environment example states that this variable is mandatory unless `ALLOW_UNAUTHENTICATED_AGENT` is set, describes that setting as being for development purposes, and defaults it to false. What the application does at startup with an empty secret is not something the visible text settles, so treat the empty value as a placeholder you have to replace rather than a default to keep.

The rest of the mechanism is clearer. `AGENT_SECRET` signs backend to agent requests, and when `AGENT_ENABLED` is true, on startup the application copies its own value onto the built in local agent host at `http://127.0.0.1:8001`. Remote agents still need the same secret typed into the Agent secret field in the interface after deployment. The agent side takes the same variable:

bash
docker run -d -p 9413:8001 \
    --name=tugtainer-agent \
    --restart=unless-stopped \
    -e AGENT_SECRET="" \
    -v /var/run/docker.sock:/var/run/docker.sock:ro \
    ghcr.io/quenary/tugtainer-agent:1

Secrets are also readable from a file, following the Docker style, for `AGENT_SECRET`, `JWT_SECRET_KEY`, `GH_TOKEN`, `OIDC_CLIENT_ID` and `OIDC_CLIENT_SECRET`, with the variable and its file counterpart mutually exclusive.

Agent URLs pointing at private networks are refused by default

Managing remote hosts means the application opens outbound connections to hosts you type in, which is exactly the shape of a server side request forgery problem. The project treats it as one, in a way that is worth reading in full because the details are unusual.

By default, an agent host URL that resolves to a private or reserved network is blocked. The check is described as best effort, and it is detailed in the security policy document. When it blocks an address, the client connects only to the addresses that passed, and it does that without replacing the hostname, so TLS certificates and virtual hosts stay intact. That is the correct shape for this problem: the connection is pinned to the address that was checked while the name in the certificate still has to match, which closes the usual gap where a check resolves a name and the connection re-resolves it to something else.

The escape hatches are two environment variables. `AGENT_ALLOW_NETWORKS` takes a network such as `192.168.0.0/24`, and `AGENT_ALLOW_ENDPOINTS` takes a single address such as `10.0.0.5:9413`. And when `AGENT_ENABLED` is true, the only thing allowed out of the box is the built in agent endpoint at `127.0.0.1:8001`.

That last line has a practical cost. A homelab where the app runs on one host and the other machines run agents cannot work until you allow that network by hand. For anyone whose remote agents live on a Docker network or a LAN, this is not a detail you discover later, it is the first configuration step, and it is the step where a best effort address check gets a range added to its allow list.

The agent healthcheck asks for HTTP even when you serve TLS

Backend and agent communicate over HTTP by default, and a reverse proxy is the suggested way to get HTTPS. There is also a path that skips the proxy, and it comes with a warning about the image's own healthcheck.

For that path you mount the certificate and key into the agent container and pass `--ssl-certfile` and `--ssl-keyfile` through the `command` setting, then paste the matching CA into the host settings in the interface. The problem is the healthcheck baked into the image: it uses `http://localhost:8001`, so if uvicorn serves only HTTPS, the healthcheck fails. Nothing in the visible text says the healthcheck URL is configurable.

The other two setups are the ordinary ones. With a public certificate authority such as Let's Encrypt, set the host URL to `https://…`, leave SSL on and leave the custom CA field empty. With a private authority or a self-signed certificate, paste the CA PEM or the certificate itself into the custom CA field, keep SSL on, and make sure the certificate hostname and SAN match the host in the URL, which is the usual reason a private CA setup fails on an otherwise correct configuration.

Taken with the default setup, the deployment shape is clear from the repository layout: an application image and an agent image, built from separate Dockerfiles, where the application side also carries `nginx.conf` and `supervisord.conf`, consistent with the published port mapping from 9412 to port 80 inside the container.

There is no default password, there is a setup code with five minutes on the clock

Search for a default password and the honest answer is that there isn't one, because the first start does not ask for a password at all. On first start the application prints a one time setup code to the container logs, you read it with `docker logs tugtainer`, and you have five minutes to set a password with it. If the code expires you restart the container to get a new one. The alternative, if you do not want authentication, is the `DISABLE_AUTH` variable, which is empty by default and reads as false when empty.

The token settings around that login are where the operational detail sits:

code
# JWT tokens secret key.
# Default secret is autogenerated, so on every container startup
# the access tokens will become invalid and you have to login again.
JWT_SECRET_KEY=
# Default is HS256
JWT_ALGORITHM=
# Lifetime of the access token in minutes.
# Default is 5
ACCESS_TOKEN_LIFETIME_MIN=
# Lifetime of the refresh token in minutes.
# Default is 43200 (a month)
REFRESH_TOKEN_LIFETIME_MIN=

Two consequences follow. Access tokens last five minutes and refresh tokens last a month, which is a sensible split for an interface that sits open on a screen. And the signing secret is autogenerated by default, so every container restart invalidates outstanding access tokens and everyone logs in again. That is a deliberate tradeoff documented in the comment itself, and it is one to think about before you set `--restart=unless-stopped` on a container you also plan to restart during a Docker upgrade, which is precisely the activity this application exists to automate.

Versions come from conventional commits, and the images are the only distribution

Release numbering is automated. The project configuration reads the version out of `pyproject.toml`, tags as `v{version}`, parses conventional commits, and maps `feat` to a minor bump and `fix` or `perf` to a patch bump, with build, chore, ci, docs, style, refactor and test treated as neither. Squashed commits are parsed, and the default bump level is zero. Releases in the last week run v1.42.0, v1.43.0 and v1.44.0, with the last push landing the day after the newest tag.

The release build command is short and does two things: it installs `uv` and runs `uv lock --upgrade-package`, then adds the lock file to the commit. Publishing is switched off twice, for PyPI and for the package repository, which means the artifacts that matter are the container images on the GitHub registry rather than anything a `pip install` can reach. The project is configured as a non package for `uv`, so it is never built as a library, and it requires Python 3.13 or newer.

The dependency list is mostly pinned with compatible release markers, fastapi, uvicorn, alembic, apprise, bcrypt, python-jose and python-on-whales among them, with two exceptions standing out as open ended: `dnspython>=2.8.0` and `python-socketio>=5.16.4`. Docker access comes from python-on-whales rather than the official Docker SDK, which is not in the list at all, and scheduling comes from aiocron. `aiosqlite` is the database layer, and the environment file notes that sqlite is currently the only supported option.

Editorial conclusion

Tugtainer is built for a homelab or a small fleet where one person wants to be told that an image moved and then approve the change, and it makes several of the right calls: automatic updates are off until you turn them on, the socket proxy lets you hand out only the API permissions a feature needs, and remote agent URLs pointing at private networks are refused unless you allow them by network or by endpoint. Two things decide whether it earns a place. The first is the project own position, which is that the application is distributed as is and not recommended for production, with backups called out in the same breath. The second is the agent and socket proxy containers, which the application will not update because it depends on them to reach the Docker CLI. If your update process has to include those two containers, this tool cannot be the whole process. Check the socket permission list you actually need, keep the agent secret out of your compose file if your orchestration stores it in a readable place, and confirm your five minute setup code path works before you depend on it.

Frequently asked questions

Does tugtainer have a default password?

No. On first start it prints a one time setup code to the container logs, which you read with `docker logs tugtainer` and use to set a password within five minutes. If the code expires, restart the container to get a new one, or set `DISABLE_AUTH` if you do not want authentication at all.

Why can tugtainer not update its own agent or socket proxy?

Both are used to communicate with the Docker CLI, so updating them from inside the app would break the channel the update runs over. Leave them on check only to get notifications, and recreate them yourself or with another tool such as Portainer. Including them in a compose file with containers you want auto-updated causes the update to fail.

What is AGENT_SECRET used for in tugtainer?

It signs requests from the backend to the agent, and it is mandatory unless ALLOW_UNAUTHENTICATED_AGENT is turned on, which the project describes as a development setting. When AGENT_ENABLED is true the app copies its value onto the built-in local agent at http://127.0.0.1:8001, and remote agents need the same secret entered in the Agent secret field after deployment.

Can tugtainer reach a Docker agent on my LAN?

Not by default. Agent URLs that resolve to private or reserved networks are blocked by a best effort check, and with AGENT_ENABLED only the built-in endpoint 127.0.0.1:8001 is allowed. You open access with AGENT_ALLOW_NETWORKS such as 192.168.0.0/24, or AGENT_ALLOW_ENDPOINTS for one address such as 10.0.0.5:9413.

How do I run tugtainer without mounting the Docker socket?

Deploy a socket proxy, for example the LinuxServer socket proxy image, and enable only the permissions each feature needs: CONTAINERS, IMAGES, POST, INFO and PING to check, NETWORKS to update, ALLOW_LOGS for logs, the ALLOW_START and related variables for container controls, and SERVICES, TASKS, NODES and SWARM for the Swarm feature. Then set DOCKER_HOST to the proxy address on the app and agent containers.

Does tugtainer publish to PyPI?

No. Publishing is disabled for both PyPI and the package repository, and the project is configured as a non package, so releases arrive as container images on the GitHub registry. Version numbers come from conventional commits, with feat bumping the minor version and fix or perf bumping the patch.

Official sources

  1. Issues
  2. License: MIT
  3. Quenary/tugtainer on GitHub
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/quenary-tugtainer.svg)](https://hysenlabs.com/projects/quenary-tugtainer)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/quenary-tugtainer.svg)](https://hysenlabs.com/projects/quenary-tugtainer)

Was this useful?