wrolpi/modules/repos
Roland f49288b8ec
repos: validate branch names and repo directories
Branch names are passed to git as arguments and come from the API, the
config, a `/tree/<branch>` URL, or the remote itself (its default
branch).  A name starting with `-` would be read as an option, so every
branch must pass git's ref-name rules, including in the downloader just
before use.

A repo URL with a `.` or `..` path segment (or a `..` name) could format
a directory outside its template (e.g. `repos/<tag>/..` is the whole
repos directory).  Such URLs and names are rejected, and every repo
directory, including one from repos.yaml, must be strictly inside the
media directory with no `..`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 16:56:09 -06:00
..
test repos: validate branch names and repo directories 2026-10-06 16:56:09 -06:00
__init__.py Add a Repos module that mirrors git repositories (backend) 2026-10-06 16:56:09 -06:00
api.py Add a Repos module that mirrors git repositories (backend) 2026-10-06 16:56:09 -06:00
conftest.py Add a Repos module that mirrors git repositories (backend) 2026-10-06 16:56:09 -06:00
downloader.py repos: validate branch names and repo directories 2026-10-06 16:56:09 -06:00
errors.py Add a Repos module that mirrors git repositories (backend) 2026-10-06 16:56:09 -06:00
lib.py repos: validate branch names and repo directories 2026-10-06 16:56:09 -06:00
models.py Add a Repos module that mirrors git repositories (backend) 2026-10-06 16:56:09 -06:00
schema.py Add a Repos module that mirrors git repositories (backend) 2026-10-06 16:56:09 -06:00