Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン
#586 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
52/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
docker, git, python
領域
backend, devops

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Python
スター
22
フォーク
27
平均マージ
1日 20時間
マージ済み PR(30日)
39

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

darnitdevorg/darnit のほかの issue

darnitdevorg/darnit の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。