Carry GitHub contributions onto the forge, and open the front door #1074
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
jaylouisw/packetforge!1074
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/gh-bridge"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Three faces of one problem: nobody could read this repository, and nothing a contributor sent
could reach it.
1. The front door
git.jayw.ukwas behind a wildcard Cloudflare Access application, so a stranger met a login page andthe GitHub mirror became the de-facto front door. The instance is now publicly readable:
//explore/repos/jaylouisw/packetforge/issues/api/v1/repos/jaylouisw/packetforgegit clonePOSTan issue/settingsAccess is one application —
git.jayw.uk→ bypass — and*.jayw.ukstill covers every otherhost on the domain. A path-scoped variant was tried first and removed: it made browsing work but left
git clonedead, because Forgejo clones through/packetforge.git, a different path prefix.2. The credential shape
scripts/cf-access-bypass.jsnow takes either a scoped token (Bearer header) or the account GlobalAPI Key (X-Auth-Email + X-Auth-Key). Sending one as the other returns
9103 Unknown X-Auth-Key or X-Auth-Email, which reads like a bad key when it is a bad header.test/cf-access-bypass-auth.test.jspins the mapping, including that the account-wide key is neverused when a narrow token exists.
3. The bridge
scripts/gh-bridge.js:--issues— GitHub issues become Forgejo issues, credited to the author, labelledfrom-github.--prs— each GitHub pull request becomes agh/<n>branch, fetched fromrefs/pull/<n>/headsofork PRs work too, pushed verbatim, plus a Forgejo pull request so CI runs here.
--report— merges are reported back on the GitHub thread.Every imported object carries a
<!-- gh-issue: N -->/<!-- gh-pr: N -->marker, and the scriptfinds its own work by reading that marker back. That is what makes re-running safe.
Proven on two real contributions: GitHub #1442 → forge #1069 and #1438 → #1070, branches
gh/1442and
gh/1438pushed with their commits intact, and CI picked both up.Two defects the live run caught, both fixed
published hostname. Now
PF_PUBLIC_URLis separate from the API URL, and the two live comments arecorrected.
text now says a maintainer will reply on the thread — no promise the bridge cannot keep.
Guard
The canonical-URL check flagged this work, correctly:
scripts/gh-bridge.jsandCONTRIBUTING.mdmust name GitHub. Both are reasoned entries in
canonical.ALLOW, so the exception is visible ratherthan silenced.
103 suites, 4,963 assertions, all passing.
Closes #1073.
gh/<n>with the GitHub title #1681