No description
- Python 90%
- Dockerfile 10%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
|
||
| app.py | ||
| docker-compose.yaml | ||
| Dockerfile | ||
| README.md | ||
| requirements.txt | ||
forgejo-pages
Simple HTTP service that clones or updates a git repository into a local output directory. Useful for deploying static sites (e.g. Forgejo Pages) behind Caddy.
API
POST /update-project
Accepts JSON or form data.
| Parameter | Required | Description |
|---|---|---|
secret |
yes | Must match the SECRET environment variable |
git_repo |
yes | Git repository URL to clone/fetch |
output_directory |
yes | Project folder name under /pages (e.g. personal-website) |
branch |
no | Branch to deploy; defaults to the repository default branch |
Example:
curl -X POST http://localhost:8080/update-project \
-H "Content-Type: application/json" \
-d '{
"secret": "change-me",
"git_repo": "https://git.example.com/user/repo.git",
"output_directory": "personal-website",
"branch": "main"
}'
This stores the repo in /pages/personal-website.
Behavior:
- If
/pages/<name>is already a git repo → shallow-fetch (--depth 1) the branch tip and update in place - If the directory exists but is not a git repo → delete it and clone fresh
- If the directory does not exist → shallow-clone into that path
GET /health
Returns {"status": "ok"}.
Environment
| Variable | Description |
|---|---|
SECRET |
Shared secret required by /update-project |
PAGES_ROOT |
Allowed root for checkouts (default /pages) |
GIT_TIMEOUT |
Max seconds for a git command (default 300) |