Repository navigation
fix: wave 5 — base path, backup, stats, assets/CSP, login throttle, cleanup - #92
Merged
Merged
Conversation
Move SetBasePath/GetBasePath into internal/web with a Redirect helper that prepends the base path, use it for every redirect in the app/server handlers and auth, and make the remaining absolute template links relative to <base href>. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…un (B9) Export memory/cpu/log limits, command, ports, ulimits and every routed domain; import restores them with one route per domain. A replace import is refused up front unless every app is draft, created or stopped, and removal errors now stop the import instead of being ignored. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…B14) Co-Authored-By: Claude Opus 5.5 <[email protected]>
Samples now always overwrite the live fields; the disk collector updates only the disk field through updateDiskCache, which replaces UpdateStatsCache. Co-Authored-By: Claude Opus 5.5 <[email protected]>
chi regexp params never span a slash, so {path:.*} would not help; the route
uses the * wildcard and the handler reads it.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Vendor htmx 2.0.4, xterm 5.3.0 and xterm-addon-fit 0.8.0 into internal/http/static (sources and sha256 in SOURCES.md), embed and serve them at /static/* without directory listing, replacing the dead web/static route. Every response carries Content-Security-Policy, X-Content-Type-Options and Referrer-Policy. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…le (S9) Failed logins wait 1 s; more than 10 failures from one client IP within 15 minutes answer 429 for the rest of the window. chimw.RealIP now applies only with DOCKIFY_TRUST_PROXY=true so a spoofed X-Forwarded-For cannot dodge or aim the lockout. Expired sessions are pruned on each login. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Remove FindByGitRepo (selected 19 columns, scanned 21), backup.encrypt, DeleteDNSRecord, LatestContainerStats, server LatestStats and the nullFloat64/nullInt64/nullString helpers, cloudflare UpsertRecord and Config.AuthEnabled, all unused. One scanApp/scanServer per repository for every SELECT of the full row, and the live stats WebSocket uses the server package's exported metric parsers instead of its own copies. No behaviour change. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Wave 5 of the Fable 5.1 audit (
audits/DOCKIFY-AUDIT-FABLE-5.1.md), one commit per item.internal/web(SetBasePath,GetBasePath,Redirect); every redirect in app/server handlers, auth (middleware, login, logout) and the/loginroute goes throughweb.Redirect. The last absolute template links (/export,/import,/apps/…, two form actions) are now relative to<base href>.TestRedirectKeepsBasePath(realPrefixMiddleware+ login POST, with and withoutX-Forwarded-Prefix)domains(primary first); import restores them and saves one route per domain (old exports fall back todomain). Replace mode is refused up front with "stop or undeploy running apps before a replace import" unless every app is draft/created/stopped; undeploy/delete errors now stop the import.TestExportImportRoundTrip(two temp DBs, mock SSH, encrypted export, two domains, replace refusal leaves data untouched)docker statsstream restarts with a 1 s backoff until the WebSocket closes.updateDiskCache, replaces the single-appUpdateStatsCache).TestStatsCacheAcceptsIdleSampleDELETE /api/apps/{id}/files/*— chi regexp params never span/, so{path:.*}does not matchconf/app.ini; the wildcard does.TestDeleteNestedFilePath(real router)Renderexecutes into a buffer, then writes status + body; errors give a clean 500.TestRenderExecErrorIs500internal/http/static/(URLs + sha256 inSOURCES.md), embedded and served at/static/*(one-week cache, no listing); deadweb/staticroute removed. Every response sends the CSP from the brief,X-Content-Type-Options: nosniff,Referrer-Policy: same-origin.TestStaticAssetsAndCSPchimw.RealIPonly with the newDOCKIFY_TRUST_PROXY=true.TestLoginThrottleFindByGitRepo,backup.encrypt,DeleteDNSRecord,LatestContainerStats, serverLatestStats,nullFloat64/nullInt64/nullString(server), cloudflareUpsertRecord,Config.AuthEnabled. OnescanApp/scanServerper repository;stats_ws.gouses the exportedserver.Parse*metric parsers. No behaviour change.List()queries the DB.TestListShowsStatusChangeREADME and SPEC updated (base path, backup fields and replace rule, self-hosted assets + CSP, login throttle,
DOCKIFY_TRUST_PROXY, nested file route).Operator note (S9): production runs behind Caddy on the same host, so without
DOCKIFY_TRUST_PROXY=trueevery client shares the counter of127.0.0.1, and 10 bad logins from anyone lock the UI for 15 minutes. SetDOCKIFY_TRUST_PROXY=truethere (and bind 8080 to127.0.0.1, as §0.1 already recommends).Verification
go build ./... && go vet ./... && gofmt -l . && go test -race -timeout 300s ./...: green;scripts/smoke-test.sh: passed.DOCKIFY_DEV_MOCK=true, 127.0.0.1): 10 bad logins → 401, 11th → 429, correct password inside the window → 429, spoofedX-Forwarded-For→ still 429; pages carry the CSP and loadstatic/*.js;/static/*files served with matching sha256,/static/→ 404;POST /apps/4/stopwithX-Forwarded-Prefix: /proxy/9898→Location: /proxy/9898/apps/4(without the header:/apps/4); export → replace import refused while apps ran → stop → replace import restored limits, command, ports, ulimits and both routes./static/, no console errors, app console opens, live stats and htmx stats cards update, server charts draw, Google Fonts load, an externalfetchis blocked byconnect-src.Not verified
🤖 Generated with Claude Code