interplane-forge
INTERPLANE Forge
Brought by drakestapleton
interplane-forge / infra / nginx / snippets / bazinga-git.conf
| 1 | # Bazinga git (2026-11-15, Drake: "put git back in place over interplane.io"): read-only |
| 2 | # git clone over HTTPS for the public projects: |
| 3 | # git clone https://interplane.io/drakestapleton/<name>.git |
| 4 | # (the address the forge pages and their JSON print). The same address without ".git" (the project |
| 5 | # page's own address, https://interplane.io/drakestapleton/<name>) answers git too (2026-11-16), and |
| 6 | # https://interplane.io/projects/<name>/repo.git, the store layout pages printed before DRA-515, is |
| 7 | # still answered so old clones keep working. The name is matched lazily, so "<name>.git/..." is |
| 8 | # <name>, never "<name>.git"; the forge itself has no page under HEAD, info/ or objects/. |
| 9 | # Plain files (git's "dumb" HTTP) from /var/www/interplane-git/<name>.git, filled from the canonical |
| 10 | # spark ~/git/<name>.git by ~/.local/lib/bazinga-git/sync.sh after every push (post-update hook). |
| 11 | # Only git's own fixed file names are answered; nothing else under the copies is reachable. |
| 12 | # Included inside the interplane.io server block. Undo: remove the include line, nginx -t, reload. |
| 13 | # Smart HTTP uses only the public mirror root maintained by sync.sh. |
| 14 | location ~ "^/(?:drakestapleton/(?<sr>[A-Za-z0-9][A-Za-z0-9._-]*?)(?:\.git)?|projects/(?<sp>[A-Za-z0-9][A-Za-z0-9._-]*)/repo\.git)/(?<op>info/refs|git-upload-pack)$" { |
| 15 | set $read_uri /omega-read/$sr$sp/$op; |
| 16 | rewrite ^ $read_uri break; |
| 17 | proxy_read_timeout 300s; |
| 18 | proxy_buffering off; |
| 19 | gzip off; |
| 20 | limit_conn forge_git_client 16; |
| 21 | limit_conn forge_git_streams 24; |
| 22 | limit_conn_status 429; |
| 23 | proxy_set_header Host localhost; |
| 24 | add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; |
| 25 | add_header X-Content-Type-Options nosniff always; |
| 26 | proxy_pass http://127.0.0.1:17941; |
| 27 | } |
| 28 | location ~ "^/drakestapleton/(?<ar>[A-Za-z0-9][A-Za-z0-9._-]*)/archive/(?<af>(?:refs/heads/[A-Za-z0-9._/-]+|commits/[0-9a-f]{40})\.(?:zip|tar\.gz))$" { |
| 29 | set $archive_uri /omega-read/$ar/$af; |
| 30 | rewrite ^ $archive_uri break; |
| 31 | proxy_read_timeout 300s; |
| 32 | proxy_buffering off; |
| 33 | gzip off; |
| 34 | limit_conn forge_git_client 16; |
| 35 | limit_conn forge_git_streams 24; |
| 36 | limit_conn_status 429; |
| 37 | proxy_set_header Host localhost; |
| 38 | add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; |
| 39 | add_header X-Content-Type-Options nosniff always; |
| 40 | proxy_pass http://127.0.0.1:17941; |
| 41 | } |
| 42 | location ~ "^/(?:drakestapleton/(?<bzn>[A-Za-z0-9][A-Za-z0-9._-]*?)(?:\.git)?|projects/(?<bzm>[A-Za-z0-9][A-Za-z0-9._-]*)/repo\.git)/(?<bzp>HEAD|info/refs|objects/info/packs|objects/[0-9a-f][0-9a-f]/[0-9a-f]+|objects/pack/pack-[0-9a-f]+\.(?:pack|idx))$" { |
| 43 | root /var/www/interplane-git; |
| 44 | try_files /$bzn$bzm.git/$bzp =404; |
| 45 | types { } |
| 46 | default_type application/octet-stream; |
| 47 | add_header Cache-Control "no-cache" always; |
| 48 | add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; |
| 49 | add_header X-Content-Type-Options nosniff always; |
| 50 | } |
| 51 | # A browser opening the clone address lands on the project page. |
| 52 | location ~ "^/drakestapleton/(?<bzr>[A-Za-z0-9][A-Za-z0-9._-]*)\.git/?$" { return 302 /drakestapleton/$bzr; } |
| 53 | # One-command sign-in helper (source: interplane-forge social/signin.sh). |
| 54 | location = /signin.sh { alias /var/www/bazinga/signin.sh; types { } default_type "text/plain; charset=utf-8"; add_header Cache-Control "no-cache" always; add_header X-Content-Type-Options nosniff always; add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; } |