No description
  • Go 93.1%
  • Go Template 6.9%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-10-03 15:13:47 +02:00
models Release commit 2026-10-03 15:13:47 +02:00
modules Release commit 2026-10-03 15:13:47 +02:00
routers Release commit 2026-10-03 15:13:47 +02:00
services/forgex Release commit 2026-10-03 15:13:47 +02:00
templates/repo/settings Release commit 2026-10-03 15:13:47 +02:00
forgex.patch Release commit 2026-10-03 15:13:47 +02:00
README.md Release commit 2026-10-03 15:13:47 +02:00

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:

Guards & normalization — modules/forgex/:

  • guard.go — SSRF protection: scheme allow-list, private-range/DNS deny-list, allowed_paths scope 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) and CreateBranchFromRemote.
  • 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).