Files
codeberg-to-gitea-migrator/pyproject.toml
T
AlexKucera 299c061f26
CI / test (push) Canceled after 0s
fix(security): mask forge tokens in logs and disk
Close two token-leak paths in the git mirror and harden the supply
chain per the OWASP audit (audit/2026-08-11/security-report.md).

Runtime fixes:
- mirror GitError masks the embedded oauth2:<token> in both the
  failing command line and git's stderr before raising; cli now
  catches GitError with a clean message instead of an uncaught
  traceback that printed the live token.
- Scrub token-bearing remote URLs from the bare config at the end
  of each run so tokens aren't persisted in .git/config.
- Default mirror workdir is per-user 0700 (/tmp/cb2gitea-<uid>),
  not a world-readable /tmp/cb2gitea.

Supply chain:
- Commit uv.lock; CI installs via uv sync --frozen (hash-verified).
- Pin Gitea Actions to commit SHAs, not mutable @vN tags.
- Pin the ruff rule set and exclude audit/ for reproducible linting.

Adds tests/test_mirror.py for the redaction helpers.
2026-08-11 11:48:32 +02:00

38 lines
1.1 KiB
TOML

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "codeberg-to-gitea-migrator"
version = "0.1.0"
description = "Migrate repositories (code, issues & PRs, releases & assets, labels & milestones) from Codeberg to a self-hosted Gitea instance."
readme = "README.md"
requires-python = ">=3.11"
license = "GPL-3.0-or-later"
license-files = ["LICENSE"]
authors = [{ name = "Alexander Kucera", email = "a.kucera@babylondreams.de" }]
keywords = ["migration", "codeberg", "gitea", "forgejo", "repository-migration"]
dependencies = ["httpx>=0.27", "typer>=0.12"]
[project.optional-dependencies]
dev = ["pytest", "ruff"]
[project.scripts]
codeberg-to-gitea = "codeberg_to_gitea_migrator.cli:app"
[tool.hatch.build.targets.wheel]
packages = ["src/codeberg_to_gitea_migrator"]
[tool.ruff]
line-length = 100
target-version = "py311"
extend-exclude = ["audit"] # generated reports, not source
[tool.ruff.lint]
# Explicit rule set so locked-deps CI lints reproducibly (ruff's defaults drift
# across versions). Stable core: subset of pycodestyle + pyflakes.
select = ["E4", "E7", "E9", "F"]
[tool.pytest.ini_options]
testpaths = ["tests"]