wrolpi/modules/repos
Roland 3b6e962dfc
repos: never fetch submodules from WROLPi's own network
A repo's .gitmodules is chosen by whoever controls the repo, so a
submodule URL could make WROLPi fetch https://localhost:8443/...,
https://10.0.0.1/..., etc. (SSRF), and show the response's error.

Every submodule URL is now checked before git fetches it: relative URLs,
the repo's own host, and hosts whose addresses are all public are
allowed; anything else defers the download with the reason.  Nested
submodules are checked out one level at a time (instead of git's
--recursive) so each level is checked, at most 5 levels deep.  Submodule
fetches do not follow HTTP redirects, so a checked host cannot redirect
git into the network.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 16:56:09 -06:00
..
test repos: never fetch submodules from WROLPi's own network 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 repos: history, Download ZIP, and submodules 2026-10-06 16:56:09 -06:00
conftest.py repos: never fetch submodules from WROLPi's own network 2026-10-06 16:56:09 -06:00
downloader.py repos: never fetch submodules from WROLPi's own network 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: never fetch submodules from WROLPi's own network 2026-10-06 16:56:09 -06:00
models.py repos: history, Download ZIP, and submodules 2026-10-06 16:56:09 -06:00
schema.py repos: history, Download ZIP, and submodules 2026-10-06 16:56:09 -06:00