Git over HTTPS
Git hosting at any scale.
Ordinary Git over HTTPS, a code browser, pull requests, and durable storage in Cloudflare Artifacts.
Clone, fetch and push with a stock client. Browse the tree, blame a file, open a pull request. A push is acknowledged only once its objects and refs are in Artifacts, so replacing the container does not lose a repository.
The browser
The repository
What a durable repository renders, at any ref.
-
Code browser
Trees, files, commits and history at any ref, rendered from the durable repository.
-
Blame
Line-by-line author, commit and age, paginated so a large file stays cheap to open.
-
Branches & tags
Real refs, the default branch, and annotated tags. Create and delete from the browser.
-
Pull requests & comments
Compare two branches, merge, and keep a durable conversation next to the change.
-
Search
Find a file by path, or scan content at a commit, with a stated budget when the revision is too large.
-
HTTPS clone
Stock Git over HTTPS. No custom transport, no extra client, one clone URL.
Fig. 2
Where a commit goes
Push, verify, a public read-only clone, and the session ref beside the commit.
-
A stock Git client sends the pack over HTTPS. The server reads the body before it answers.
The Worker does not hand a push to Artifacts. The body goes to the container, which runs receive-pack against its local projection. Push is never anonymous, so a public repository still asks for the admin credential.
-
Branch protection runs, and the durable copy is written, before the client is told the push succeeded.
A pre-receive hook in the container refuses a non-fast-forward update or a deletion of a protected branch, including the default branch. Only a push that passes is sent on to Cloudflare Artifacts, with a lease on the previous value. The client sees success only after Artifacts accepts it. A refusal rolls the local refs back.
-
Anyone can clone and fetch a public repository. Push stays authenticated.
A public repository can be cloned and fetched with no credential. The clone is branches and tags. A normal clone does not fetch session refs: they sit outside
refs/headsandrefs/tags. Push still requires the admin credential. A private repository is not anonymously readable.Clone and fetch are served from Artifacts. The Worker checks the catalog and attaches a short-lived token. The client never sees that token.
-
The transcript is an orphan commit on its own ref, named for the code commit, not parented to it.
cask session capturereplaces secrets in the transcript before it writes an object. The session is an orphan commit — messagecask.session/v1, one blobsession.json— onrefs/sessions/<sha>, or onrefs/sessions/share/<sha>when it is marked shareable. On a public repository, an anonymous reader is offered only the share ref. The commit page shows that transcript on its Session tab when the caller may read it. A private session and a missing session look the same to everyone else.
The parts
How it's built
Four moving parts, and a rule about the order they run in.
-
A Cloudflare Worker checks Cask's login at the edge, serves clone and fetch straight from Artifacts with a short-lived token, and hands pushes, the UI and the API to one named container.
-
A Go server serves the Git protocol and the browser UI from the same process. A keyed per-repository lock is the consistency boundary for mutations.
-
Cloudflare Artifacts stores every object and ref. The container pushes each accepted change there, with a lease on the old value, before it reports success, and enforces branch protection itself.
-
A catalog in R2 carries repositories, settings, pull requests, activity and comments, each with a revision so a stale edit is refused instead of silently winning.
Clone over HTTPS
The long version — the push ordering, the merge journal, the read budgets and the deletion tombstone — is in Cask on Artifacts: how it works (12 min read).