Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Container audit loses the repository identity: git refuses the mounted repo (dubious ownership)

Abierto
#586 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
52/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
docker, git, python
Área
backend, devops

Línea de trabajo

Start with the container setup in the image built from the #519 branch and docs/install/container.md; reproduce the documented docker run command and check how the audit obtains the mounted repository’s Git remote as uid 10001. Compare the confirmed safe.directory=/repo workaround with running as the host uid, and review the ownership implications before choosing a fix. Done means the documented container command identifies the repository and platform checks use its owner and name.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

needs triage

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'

Confirmed workaround

docker run --rm -v "$PWD:/repo" \
  -e GIT_CONFIG_COUNT=1 -e GIT_CONFIG_KEY_0=safe.directory -e GIT_CONFIG_VALUE_0=/repo \
  <image> audit

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.

Related

  • #579 stops the /repos//name call when the identity is empty. It does not give the container the identity.
  • docs/install/container.md does not say that platform checks need -e GH_TOKEN.

Seen on RHEL 10 with podman (rootful), image built from the #519 branch.

Lenguaje dominante
Python
Estrellas
22
Forks
27
Merge medio
1 d 20 h
PR fusionados (30 d)
39

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de darnitdevorg/darnit

Todos los issues de darnitdevorg/darnit

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.