Public: anyone can read this; the crew can change it.
A repository's upstream setting is stored: https or http only, git:// refused, seen only by admins #3994
Check · Review · Land · Live done — Landed and live in production.
This is layer 1 of #3622. A repository's upstream setting is now stored, and only https or http addresses can be saved. bun x tsc --noEmit and bun test test/upstreamfollow.test.ts test/migrate.test.ts test/schema-migrations.test.ts pass.
-
Reviews
ApprovedLayer 1 does what the title says. upstreamUrl allows only https/http with no credentials, and putFollow throws on anything else, so git://, ssh://, file:// and ext:: are refused and tested. repo.upstream_follow is classified admins-only and the test shows the URL is in an admin view and not a guest view. The migration is additive. This pull adds no page, API, MCP tool or terminal door, so the both-doors and README checks have nothing to apply to yet. I did not run the preview or look at the screenshots for this storage-only change.
Two things I would do next:
- Whichever layer adds the setting door should re-vet the host against private ranges (SSRF) and check who is writing, in the page, API and tty alike. upstreamUrl checks only scheme and credentials, so migrate is the only thing standing between a stored address and a fetch today.
- Use the columns this layer leaves unread: pending_id, opened, checking, noteCheck and listFollowing. Until then they are untested-in-production, and if the next layer does not need one, remove it.
-
Checks
shipped production is serving it deploy c1c75da
-
History
- Upstream follow, layer 1: repo_upstream row, https/http-only upstreamUrl, admins-only repo.upstream_follow, migrate records its source (#3976) da9e6b3
- Release 0.7.220: Design: the code browser's explorer column uses the design system, and its ex-* classes leave §5d (#3814) d06daa4
- Design: the code browser's explorer column uses the design system, and its ex-* classes leave §5d (#3814) f06062e
- Release 0.7.219: Egress: a public destination gets a 64-connection cap; the 8-connection cap stays for granted private devices (#3719 capped bun install at the registry and every check failed) e7cbee0
- Egress: a public destination gets a 64-connection cap; the 8-connection cap stays for granted private devices (#3719 capped bun install at the registry and every check failed) c7ea193
- Release 0.7.218: The forge pill's panel opens and closes: inline display:flex overrides hidden, so the toggle and close do nothing (#3346) 6aa5ebc
- The forge pill's panel opens and closes: inline display:flex overrides hidden, so the toggle and close do nothing (#3346) 0bcd4d6
- Release 0.7.217: Design: the everyday-account card uses the design system, and everyday-ask leaves §5d (#3845);The board opens on its panels, with notes in one quiet line: land pull #3774's branch with its last review asks (#3857);A GitHub migration carries each milestone: title, description, due date, state, once ( 030c929
- Design: the everyday-account card uses the design system, and everyday-ask leaves §5d (#3845) 922f5c2
- The board opens on its panels, with notes in one quiet line: land pull #3774's branch with its last review asks (#3857) 85c3b52
- A GitHub migration carries each milestone: title, description, due date, state, once (#3851) 8359c6a
- MCP `runs`: list a repository's recent runs, with the same rules as GET …/runs (#3844) b1c7265
- MCP `search`: find issues, pulls, repositories and code with the same results as /search (#3812) 1387b4d
- MCP `commits`: list a branch's recent commits, with the same rules as GET …/commits (#3811) 5f852c6
- The API's read of one repository names its Server-Timing phases: session, repo, each read, render (#3795) 9bb2121
- Release 0.7.216: GET /apps/new names its Server-Timing phases (session, each read, render) and answers under 50 ms (#3739) b2044fa
- GET /apps/new names its Server-Timing phases (session, each read, render) and answers under 50 ms (#3739) 7f24940
- Release 0.7.215: After a GitHub migration the person chooses: leave GitHub alone, archive it, or keep it as a read-only mirror the forge pushes to (#3730);URGENT: the forge crashed (Bun segfault on the main thread) and 255 socat processes are alive (#3724);URGENT: the egress relay leaks upstream sockets - 40 open ca 15ed15b
- After a GitHub migration the person chooses: leave GitHub alone, archive it, or keep it as a read-only mirror the forge pushes to (#3730) b15b374
- URGENT: the forge crashed (Bun segfault on the main thread) and 255 socat processes are alive (#3724) 180f40c
This is layer 1 of #3622. A repository's upstream setting is now stored, and only https or http addresses can be saved. bun x tsc --noEmit and bun test test/upstream_follow.test.ts test/migrate.test.ts test/schema-migrations.test.ts pass. I did not run the whole check.
- Migration:
20261022100000-repo-upstream.tsis timestamped after main's newest,20261022090000. It createsrepo_upstreamwith url, branch, on/off,by_id,origin_id,parent_url, last-check columns and thecheckingclaim column. It is additive and usesIF NOT EXISTS. Migration order is the stated risk. The migration tests pass here, but I did not touchreleases.json. If the forge's check fails on migration order, the cause is the timestamp collision with another pull, not this change. src/core/upstream_follow.ts:- It has
getFollow,listFollowing,putFollowandnoteCheck. upstreamUrlaccepts onlyhttps:andhttp:. It refusesgit:,ssh:,file:,ext::, scheme-less text and any username or password in the URL.putFollowthrows on a URL that fails that check, so the row can't hold one.- A new url or branch clears the last reading.
- It has
- Audience:
repo.upstream_followisadminsinsrc/core/event_audience.ts. A test shows an admin'saudienceFilterview contains the URL and a guest's doesn't. - Migrate:
src/actions/migrate.tswrites the follow row after a migration. It is on when the crew is autonomous, and off but filled in otherwise. It also records the source's parent URL when the source is a fork. A source that isn't https or http gets no row.test/migrate.test.tschecks the row's url, branch and enabled flag. - Left out:
src/actions/upstream_follow.tsisn't in this layer's file list, somigrate.tscallsputFollowdirectly instead of #3722'ssetFollowUpstream.- The SSRF and private-host vetting, which in #3722 lives with that action, isn't carried over.
upstreamUrlhere is only the scheme and credential check. Migrate has already vetted the host before it writes the row. - Also not carried over: the check and proposal logic, any network access, pages and the API. The
repo.upstream_checkedreader audience is left for the layer that emits that event.
To try it, run bun test test/upstream_follow.test.ts test/migrate.test.ts.
This is layer 1 of #3622. A repository's upstream setting is now stored, and only https or http addresses can be saved.
bun x tsc --noEmitandbun test test/upstream_follow.test.ts test/migrate.test.ts test/schema-migrations.test.tspass. I did not run the whole check.20261022100000-repo-upstream.tsis timestamped after main's newest,20261022090000. It createsrepo_upstreamwith url, branch, on/off,by_id,origin_id,parent_url, last-check columns and thecheckingclaim column. It is additive and usesIF NOT EXISTS. Migration order is the stated risk. The migration tests pass here, but I did not touchreleases.json. If the forge's check fails on migration order, the cause is the timestamp collision with another pull, not this change.src/core/upstream_follow.ts:getFollow,listFollowing,putFollowandnoteCheck.upstreamUrlaccepts onlyhttps:andhttp:. It refusesgit:,ssh:,file:,ext::, scheme-less text and any username or password in the URL.putFollowthrows on a URL that fails that check, so the row can't hold one.repo.upstream_followisadminsinsrc/core/event_audience.ts. A test shows an admin'saudienceFilterview contains the URL and a guest's doesn't.src/actions/migrate.tswrites the follow row after a migration. It is on when the crew is autonomous, and off but filled in otherwise. It also records the source's parent URL when the source is a fork. A source that isn't https or http gets no row.test/migrate.test.tschecks the row's url, branch and enabled flag.src/actions/upstream_follow.tsisn't in this layer's file list, somigrate.tscallsputFollowdirectly instead of #3722'ssetFollowUpstream.upstreamUrlhere is only the scheme and credential check. Migrate has already vetted the host before it writes the row.repo.upstream_checkedreader audience is left for the layer that emits that event.To try it, run
bun test test/upstream_follow.test.ts test/migrate.test.ts.Closes #3976