garage44.eu/jeroen/midas

logclone: git clone https://garage44.eu/jeroen/midas.git

.. /docs/git-hosting.md

raw

midas as the git host — a design

Status: step 1 built (2026-11-27, session s874): new projects are hosted by the hub (midas project create, docs/hub.md "Projects the hub hosts"), with the landing rule on main, LFS uploads, and public pages, clones and archives. Steps 2 to 4 done (2026-11-28, s885): the public pages, clones, archives and LFS are at Forgejo's own paths (/<owner>/<name>), with a front page of the public projects at / (and since s887 their map, docs/hub.md Map), served at garage44.eu. All twelve repositories were moved in one go with midas hub import (Forgejo stopped first, its copies read from disk; every branch and tag checked identical, 639 LFS objects, none missing). Port 2222 is the hub's sshd and code.garage44.eu its proxy, so no URL changed. Forgejo and its runner are stopped and disabled, their data kept in /var/lib/forgejo; the nightly CI and mithril's test workflow went with them. Renaming and deleting a hosted project were built 2026-11-28 (s899, docs/hub.md): an agent renames, the person deletes on the page. What is below past step 1 is the design as it was proposed; reports from outside, the reads without a checkout and branch hygiene are not built.

midas hosts the workspace's repositories itself, and Forgejo goes. midas does not become a forge. It keeps what agents and the one person steering them use, and drops the rest: issues, pull requests, wikis, stars, organisations, web editing and user accounts.

Why

Every new project waits on the person, and every landing goes through a server that midas cannot change:

What Forgejo actually does for the workspace (measured 2026-11-27, last 30 days unless noted):

UseMeasure
Pushes2728 by cartopolis-agent, 20 by jeroen
Repositories12, all under jeroen; 9 public, 3 private (about-cartopolis, stembewijs, pinnacle-website)
LFS710 MB
Actionscartopolis/ci.yml nightly (30 runs), mithril/test.yml on push (15)
Issues, pull requests0 issues; landing is a fast-forward, no pull request
API calls by sessions40 over every session since s448: reading files, keys, branches
Anonymous HTTPSCargo git = dependencies and a Bun tarball (/archive/<sha>.tar.gz) on jeroen/mithril
Web viewsabout 2,400 requests a week, mostly crawlers (57.141.0.0/24)

What midas keeps

1. Repositories at the hub

Bare repositories in /srv/midas/git/<owner>/<name>.git, on the same disk as the mirror they replace. A repository has an owner (the person), a visibility (private or public) and a project: its gate, gate nodes, pre-land check, main branch and deploy targets. Today these sit in hub.conf projects. They move to a file the hub itself writes (/srv/midas/projects.json), changed through the hub's API, with every change logged as an event. hub.conf keeps only the machine's own settings.

2. Access by key, over the ssh login the hub already has

midas hub git, the authorized_keys command nodes already log in through, learns to answer pushes too. Every key belongs to one of three principals:

WhoReadPush
The person's keyseverythingeverything, including main, deleting branches and force pushes
Agent keys (the container, the Macs' editors)everythingany branch except main; no force push to a branch another session holds
Nodestheir checkout's repositorynothing, as today

A push to main from an agent key is accepted only from a landing. The pusher must hold the turn to land (midas land take), the new main must be a fast-forward, and the hub must have a gate pass on record for exactly that sha (midas verified). Today all three are only conventions of the land script. In this design they become the server's rule, so main is protected without a person watching. The person's keys bypass the rule, as they do today.

The remote URL does not change. A small sshd on port 2222 with the user git runs the same forced command, so ssh://git@code.garage44.eu:2222/jeroen/x.git keeps working in every checkout, worktree and memory note.

3. One call makes a project

midas project create <name> (MCP project_create) does in one step everything a new project needs today:

Agents may create, configure and archive projects. Deleting a repository, renaming one, and making a private one public go to the person as a card on the page and happen only on their yes. These are the outward-facing or hard to reverse actions. midas project set changes a project's gate, nodes or deploy targets; it replaces the hand edits of hub.conf.

4. LFS in the same place

The hub's LFS cache becomes the store, under the same /srv/midas with its backups. Agents push LFS objects over ssh (git-lfs-transfer, which mirror.rs refuses today). Public repositories serve them over HTTPS. "LFS object must reach Forgejo before the gate" stops being a step: the object is where the node reads it.

5. Public read-only HTTPS

Kept, because builds depend on it. Caddy sends code.garage44.eu to the hub, which serves for public repositories only, without a login:

The paths stay as Forgejo had them, so no Cargo.toml or package.json changes.

A browsable view (files, README, log, one commit's diff) is the part to decide. It costs a page of the existing web app. Who reads it today is mostly crawlers. See open question 1.

6. The hub knows every push itself

Pushes go through midas, so it no longer has to learn of them:

The page's view of branches, of who changes what, and of what landed reads the repositories directly.

What is new for agent work

The part worth building beyond parity, each small:

Reports from outside, with no free text

People outside the workspace can report a problem with a public project after signing in with GitHub. Agents act on those reports, and an agent that reads a stranger's text can be steered by it (prompt injection). So a report holds no text anyone typed: every field is a choice from a list the project defines, and the hub refuses any value that is not on it.

Signing in. GitHub OAuth, through a GitHub OAuth app the person registers once (its client id and secret go to the hub with midas await --secret). A reporter is a principal of a fourth kind, visitor, who may only file reports, add "me too" and follow their own reports. midas keeps no password and asks GitHub only for identity (no scopes). Accounts younger than 30 days, and more than five reports a day from one account, are refused, against spam.

A report is a record of choices:

FieldValues
projectthe public projects
whatbroken · missing · slow · looks wrong
areathe project's own list, e.g. Cartopolis: map, buildings, chat, calls, sign-in, Android app, web app
platformAndroid · web · desktop · iOS
versionthe project's released versions, newest first, or "don't know"
how oftenevery time · sometimes · once
how badI cannot go on · it gets in the way · it only looks wrong
where (optional)a point on the map, as numbers, for map projects
crash report (optional)an id the app shows after a crash; the hub looks up the report the app itself sent, so the reporter types only an id that must exist

There is no title, no description, no comments and no picture. A picture can carry text too.

The same report twice is one report. A report whose project, what, area and platform match an open one adds to its count ("3 people, Android, 1.4.2 and 1.4.3"). The count is what a session weighs.

What each side sees:

There is no conversation. A report that needs words gets them from the person, who can turn it into a session in their own words.

Into the work. A new report, or one whose count grows, is a note to the project's next session and a line on the page. With the autopilot on, a scheduled template can start a session for reports above a count. The session's brief is built from the record by midas, never from a reporter's string.

What midas does not do

There are no free-text issues, pull requests, reviews, wikis, releases pages, stars, forks, organisations, teams, web editor, webhooks to third parties, mirroring to other forges or user accounts with passwords. A principal is a key, or a GitHub sign-in for a visitor. If one of these turns out to be needed, it is added for the use that needs it.

Moving over

The steps, each of which can be undone until Forgejo goes:

  1. New projects first. project_create makes them at the hub. Forgejo keeps the existing twelve. This alone answers "a new project needs no hand work".
  2. One repository, then the rest. Make Forgejo's copy read-only, git clone --mirror it with its LFS objects into the hub, switch the hub to serve it as the origin, and check a push, a gate and a deploy. Start with a small one (fien or wakamonth), then mithril (public HTTPS dependencies), then cartopolis and midas.
  3. Port 2222 and HTTPS. Point them at midas once every repository is moved. The URLs do not change.
  4. Forgejo stays read-only for a month, with a full dump, then goes: forgejo.service, forgejo-runner.service, its database and its 710 MB of LFS. Removing it is a data deletion on a production box, so it waits for the person's go.

Risks

Open questions for the person

  1. A browsable web view of public repositories — decided 2026-11-27: public repositories are visible (files, README, log); private ones are not, to anyone outside the workspace.
  2. Where the off-machine backup goes: another machine of yours (the mini), or storage you name.
  3. Forgejo after the move: a month read-only and then removed, or kept longer as an archive.
  4. Each project's lists for reports (areas, versions): written by its sessions in the project's settings, or only by you.