git clone https://garage44.eu/jeroen/midas.gitcartopolis-agent · 2026-11-28T12:47:09Z
fix(hosted): an import starts in a directory the hub's user can enter `sudo -u midas midas hub import` begins in the caller's home, and git -C . could not enter it: every import failed at git init. The move itself ran from /srv/midas; docs/git-hosting.md now says what the move did.
docs/git-hosting.md | 12 +++++++++---
src/hosted.rs | 4 +++-
2 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/docs/git-hosting.md b/docs/git-hosting.md
index b117780..8a0dd5e 100644
--- a/docs/git-hosting.md
+++ b/docs/git-hosting.md
@@ -3,10 +3,16 @@
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.
-**Step 2 under way** (2026-11-28, s885): the public pages, clones, archives and
+**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 `/`, served at garage44.eu; `midas hub import` moves a
-Forgejo project over. The rest is a proposal.
+public projects at `/`, 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.
+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
diff --git a/src/hosted.rs b/src/hosted.rs
index 8159d44..c32f1c5 100644
--- a/src/hosted.rs
+++ b/src/hosted.rs
@@ -154,7 +154,9 @@ pub fn create(n: &New) -> Result<Value> {
/// An empty bare repository with the settings and hooks every hosted one has.
fn init_bare(dir: &Path) -> Result<()> {
- git(Path::new("."), &["init", "--quiet", "--bare", "--initial-branch=main", &dir.to_string_lossy()])?;
+ // Not "." (git -C runs there first): `sudo -u midas midas hub import` starts in
+ // the caller's home, which the hub's user cannot enter.
+ git(Path::new("/"), &["init", "--quiet", "--bare", "--initial-branch=main", &dir.to_string_lossy()])?;
for (k, v) in [("receive.advertisePushOptions", "true"), ("uploadpack.allowFilter", "true"),
("receive.fsckObjects", "true"), ("core.logAllRefUpdates", "true")] {
git(dir, &["config", k, v])?;