You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Container audit loses the repository identity: git refuses the mounted repo (dubious ownership) #586
With the documented command, docker run --rm -v "$PWD:/repo" <image> audit, on Linux:
Platform API call /repos//repo/releases?per_page=5 could not be measured (unavailable)
handler github_branch_protection needs owner/repo (from context or config)
Trust: unknown repository untrusted (no repository identity)
The owner is empty and the name is the mount directory (repo), so every platform check fails.
The cause is the container runs as uid 10001. The mounted repository belongs to the host user. git refuses it:
$ git -C /repo remote get-url origin
fatal: detected dubious ownership in repository at '/repo'
With this, git returns the remote and the audit calls /repos/darnitdevorg/darnit/....
Possible fix
Set safe.directory=/repo in the image (Dockerfile ENV or the entrypoint). This turns off git's ownership check for the mounted repo, so it is worth a short look at what a hostile .git/config could do inside the container. The alternative is to document --user "$(id -u):$(id -g)", which I have not tested.
Thanks for finding the cause and testing the workaround. Setting safe.directory=/repo in the image makes sense to me.
On your question about a hostile .git/config: yes, it can run programs. darnit runs git status, which runs core.fsmonitor. But git clone never copies .git/config, so this only matters for a directory whose .git came from someone else. And that case is already exposed without the container: on the host the user owns the files, so git trusts the config anyway. The ownership check here only fires because of the uid mismatch, so turning it off in the image adds no risk over a native run. I've opened #617 for the underlying problem, which is darnit's own git calls.
Could the same PR add -e GH_TOKEN to docs/install/container.md? The platform checks need it.
Drafted with Claude Code; reviewed and posted by me.
Activity
mlieberman85 commentedon Oct 16, 2026
Thanks for finding the cause and testing the workaround. Setting
safe.directory=/repoin the image makes sense to me.On your question about a hostile
.git/config: yes, it can run programs. darnit runsgit status, which runscore.fsmonitor. Butgit clonenever copies.git/config, so this only matters for a directory whose.gitcame from someone else. And that case is already exposed without the container: on the host the user owns the files, so git trusts the config anyway. The ownership check here only fires because of the uid mismatch, so turning it off in the image adds no risk over a native run. I've opened #617 for the underlying problem, which is darnit's own git calls.Could the same PR add
-e GH_TOKENtodocs/install/container.md? The platform checks need it.Drafted with Claude Code; reviewed and posted by me.
docs(spec): build the container image from source with every shipped …
feat(container): build from the checkout with uv
ci(container): smoke-test the image on pull requests
docs(container): document the source-built image
docs(changelog): container image built from source
feat(container): distroless runtime, darnit as the entrypoint