git-pages in locale con Podman¶
git-pages e Codeberg Pages¶
Git-pages è il nuovo sistema che sostituirà Codeberg Pages. Fonte Codeberg blog:
git-pages is an alternative to Codeberg Pages, it uses a different approach to serving static pages that is more efficient. Codeberg is planning to gradually migrate to it.
Questo è test eseguito in locale per verificare compatibilità del repo MLNotes.
Progetto ufficiale: https://codeberg.org/git-pages/git-pages
Nota: Non è necessario clonare il repository git-pages. L'immagine Docker contiene già tutto il necessario per eseguire il test in locale.
Prerequisiti installati¶
# Installa uidmap (necessario per rootless mode)
sudo apt update
sudo apt install uidmap
# Installa pasta (network namespace per Podman)
sudo apt install passt
Preparazione directory¶
mkdir -p /home/mauri/git/git-pages-test/data
Avvio container git-pages¶
podman run \
--mount type=bind,src=/home/mauri/git/git-pages-test/data,dst=/app/data \
-p 3000:3000 \
-e PAGES_INSECURE=1 \
codeberg.org/git-pages/git-pages:latest
Nota: Non usare -u $(id -u):$(id -g) con Podman rootless.
Verifica branch del repo¶
git ls-remote https://codeberg.org/maulonobile/pages.git
Output: branch main presente.
Pubblicazione del sito¶
In altro terminale:
curl http://localhost:3000/ -X PUT -H "Branch: main" --data "https://codeberg.org/maulonobile/pages.git"
Risposta: hash del commit processato.
Verifica funzionamento¶
Browser: http://localhost:3000/
Ispezione manifest (opzionale)¶
curl http://localhost:3000/.git-pages/manifest.json | jq
Stop container¶
podman ps
podman stop <CONTAINER_ID>
Note importanti¶
- Git-pages usa branch
pagesdi default (Codeberg Pages usa il branch default) - Specificare branch con header
-H "Branch: main"quando diverso dapages PAGES_INSECURE=1disabilita autenticazione DNS (solo per test locale)- Podman rootless gestisce automaticamente mapping UID/GID