- Go 93.1%
- Go Template 6.9%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| models | ||
| modules | ||
| routers | ||
| services/forgex | ||
| templates/repo/settings | ||
| forgex.patch | ||
| README.md | ||
ForgeX
ForgeX (Forge eXchange) is a modified version of Forgejo to work with Git remotes. It's a complementary project to Contribute.
ForgeX source code is released as a patch to be applied to Forgejo. It was developed on top of revision 7455e3a1f5. Download forgex.patch in your Forgejo source directory and apply the patch with patch -p1 < forgex.patch.
Model & migrations — two tables behind ForgeX:
models/forgex/remote.go,remote_repository.go— a remote is a foreign git repository attached to a local repo ({url, branch, label}). It is not a mirror: it is an on-demand source that can be fetched and used as the head of a PR.models/forgex/contribution.go,contribution_repository.go— a contribution records a source remote + commit and exposes an unguessable token to a public trace.models/forgejo_migrations/v17a_add-forgex-remote.go,v17b_add-forgex-contribution.go.
Guards & normalization — modules/forgex/:
guard.go— SSRF protection: scheme allow-list, private-range/DNS deny-list,allowed_pathsscope check, rejection of symlinks / gitlinks / mode changes.normalize.go— canonical host comparison (scheme + FQDN + default port).modules/setting/forgex.go— the[forgex]configuration section (ENABLED,MAX_FETCH_BYTES,ALLOWED_SCHEMES,DENY_HOSTS,ALLOWED_PATHS).
Services — services/forgex/:
remote.go— server-side fetch of a remote (isolated bare mirror, hooks disabled) andCreateBranchFromRemote.contribution.go— trace records and the approve/reject gate.engine.go— the landing engine:fetch → cherry-pick -x → push contribute/<token> → open local PR, preserving authorship.
API — routers/api/v1/forgex/:
GET /api/v1/forgex/contributions/{token} (public trace)
GET /api/v1/repos/{o}/{r}/forgex/remotes
POST /api/v1/repos/{o}/{r}/forgex/remotes
DELETE /api/v1/repos/{o}/{r}/forgex/remotes/{id}
POST /api/v1/repos/{o}/{r}/forgex/remotes/{id}/fetch
POST /api/v1/repos/{o}/{r}/forgex/remotes/{id}/branch
POST /api/v1/repos/{o}/{r}/forgex/contributions
POST /api/v1/repos/{o}/{r}/forgex/contributions/{token}/approve
POST /api/v1/repos/{o}/{r}/forgex/contributions/{token}/reject
Web — routers/web/repo/setting/remotes.go + templates/repo/settings/remotes.tmpl add a Remotes tab under
repository Settings (add a remote, fetch its branches, create a branch from it → compare/PR).
Locale strings under options/locale/locale_en-US.ini (existing file modified by the patch).