Vendor the C99 bb sources, share directory, tests and man page under third_party/bb (MIT, upstream f5373fb) and add a make bb target. A checkout can now build project sites without an installed bb. Assisted-by: OpenCode:DeepSeek-V4.1-Flash
gotea
Gotea is a fork of Gitea with two defining changes:
- repositories are read and maintained with got
(Game of Trees) instead of the
gitbinary, and - an HTML 4.01 frontend written in C99/POSIX serves repositories over CGI, with no JavaScript and a CDE/Motif look.
The fork is based on Gitea v28.4.0. Upstream history and licensing are retained.
Status
This tree is at the bootstrap milestone:
| Layer | State |
|---|---|
| Go backend | Imported and building as gotea (module gotea.dev). Still uses git internally; the got migration is in progress. |
| Legacy frontend | cgi/gotea-cgi: read-only browser over got, HTML 4.01 Transitional, no JavaScript, CDE palette. |
| Pages | Planned. |
| Auth and writes | Not yet implemented in the CGI frontend. |
Build
make gotea # Go backend binary
make build # full Gitea build; needs pnpm and Node
make -C cgi # C99 CGI binary
make -C cgi check # CGI tests (git is used only to create fixtures)
Run the CGI
GOTEA_REPO_ROOT=/var/lib/gotea/data/gitea-repositories \
GOT_BIN=/usr/bin/got \
SCRIPT_NAME=/cgi-bin/gotea \
REQUEST_METHOD=GET PATH_INFO=/ \
./cgi/gotea-cgi
Point GOTEA_REPO_ROOT at Gotea's data/gitea-repositories. Both flat
(repo.git) and owner-scoped (owner/repo.git) layouts are supported.
Deploy with Apache
ScriptAlias /cgi-bin/gotea /usr/local/libexec/gotea-cgi
<Directory /usr/local/libexec>
Options +ExecCGI
SetHandler cgi-script
</Directory>
SetEnv GOTEA_REPO_ROOT /var/lib/gotea/data/gitea-repositories
SetEnv GOT_BIN /usr/bin/got
For nginx, run the CGI through fcgiwrap; the binary does not need a daemon.
Access control: gotea-cgi is read-only and does not authenticate. It serves
every repository under GOTEA_REPO_ROOT to anyone who can reach it. Use it only
for public repositories, or put it behind web-server authentication, until the
auth layer lands.
CGI configuration
| Variable | Default | Meaning |
|---|---|---|
GOTEA_REPO_ROOT |
./repositories |
Directory with bare Git-format repositories |
GOT_BIN |
got |
got binary |
GOTEA_PALETTE |
built-in CDE palette | key=value colour file |
GOTEA_DEBUG |
unset | Show got stderr on error pages |
SCRIPT_NAME |
/cgi-bin/gotea |
CGI mount point, set by the web server |
Palette keys: base, light, white, dark, shadow, text, link,
visited, title_bg, title_fg. Values must be #rgb or #rrggbb.
See cgi/palettes/cde-default.palette.
Design notes
- HTML 4.01 Transitional, CSS1, table layout, no JavaScript, no external assets.
- CDE/Motif cues: grey panels, bevelled borders, navy title bars, Front Panel sidebar.
- The CGI is read-only;
gotis its only repository reader, with no shell invocation and nogitfallback. - Routes:
/,/repo/<name>/tree[/path],/repo/<name>/blob/<path>,/repo/<name>/raw/<path>,/repo/<name>/log,/repo/<name>/commit/<rev>.
Why the backend is not rewritten in C
Gitea's value is its forge backend: authentication, permissions, issues, pull requests, API, and migrations. Rewriting that up front would discard working, security-sensitive code and delay the interface the fork actually needs. The old-browser interface is therefore a C99 CGI presentation tier over the same repositories, and it can take over more of the UI incrementally.
License
MIT. Upstream copyright and license notices are retained; see LICENSE.