From c11e0ed6edd10e48780fb965b8d5b730d53b81a0 Mon Sep 17 00:00:00 2001 From: Clawd Date: Tue, 17 Feb 2026 08:00:11 -0800 Subject: Update TODO: mark port collision and container port as fixed --- TODO.md | 42 +++++++++++++++--------------------------- 1 file changed, 15 insertions(+), 27 deletions(-) diff --git a/TODO.md b/TODO.md index 6b41d98..c5cbea6 100644 --- a/TODO.md +++ b/TODO.md @@ -1,27 +1,6 @@ # Ship TODO -## Known Limitations - -### Docker Container Port Assumption -**Current behavior:** Ship assumes Docker containers listen on port 80 internally. - -**In:** `internal/templates/templates.go`: -``` --p 127.0.0.1:{{.Port}}:80 -``` - -**Problem:** Containers that expose other ports (e.g., 8080, 3000) will not work. - -**Workaround:** Ensure your Docker container listens on port 80, or manually edit the systemd unit after deployment. - -**Potential fixes:** -1. Add `--container-port` flag to specify internal port -2. Auto-detect from Dockerfile `EXPOSE` directive -3. Support `PORT` env var in Docker containers (like binary deploys) - ---- - -## Other TODOs +## Open ### Support custom Caddyfile in repo **Problem:** v2 always generates Caddyfiles from templates, ignoring any custom config in the repo. @@ -42,14 +21,23 @@ This allows custom routes (NIP-05, LNURL, rewrites, etc.) while still letting sh **Desired:** Show the actual domain in the URL column when `--domain` was used. -### Port allocation collision bug -**Problem:** Ship can allocate the same port to multiple deployments, causing containers to fail with exit code 125. +--- + +## Fixed -**Example:** Both len.to and checkyourinfo.com were assigned port 9000. +### ~~Port allocation collision bug~~ ✅ FIXED +**Fixed in:** commit d97bb6f -**Fix:** Check if port is actually in use before allocating. +- Port allocation now uses atomic flock on `/etc/ship/next_port` +- Prevents race conditions when multiple deploys run concurrently +- Each app still gets its port stored in `/etc/ship/ports/` ---- +### ~~Docker container port assumption~~ ✅ FIXED +**Fixed in:** commit d97bb6f + +- Added `--container-port` flag (default 80) +- Template now uses `{{.ContainerPort}}` instead of hardcoded 80 +- Supports containers that listen on 8080, 3000, etc. ### ~~ship host init doesn't create local state.json~~ ✅ FIXED **Fixed in:** commit 6b2c047 -- cgit v1.2.3