Commit 2bcb110
npub1cc3ha7z055mu0rwwu7806t2wt8mj3pvu0uv5mfp2c50dahaqhczshdalg6
fix(relay): auto-create git_repo_path so kind:30617 init can't silently fail
The git smart-HTTP transport and the kind:30617 side-effect handler both
canonicalize `config.git_repo_path` before any disk work. If that directory
doesn't exist on the relay host:
- The transport returns HTTP 500 'git service misconfigured' (transport.rs:237)
to every clone/push.
- The side-effect handler that initializes the bare repo from a repo
announcement fails at canonicalize, and the ingest pipeline only logs
side-effect failures at warn! level (ingest.rs:1530) — so the announcement
event is stored but no repo is ever created on disk. The relay looks like
it accepted the repo creation, but pushes 500 forever.
This previously required operators to mkdir the directory out of band. Since
the relay already owns the data layout below that root (`{owner}/{repo}.git`,
`.names/`), it should self-provision the root the same way.
Changes:
- `config.rs`: `create_dir_all(git_repo_path)` during config load. Fails
loudly with ConfigError::InvalidValue if the path can't be created (e.g.
permissions, path-under-file), instead of letting the relay come up healthy
with a broken git service.
- `side_effects.rs::handle_git_repo_announcement`: defensive
`create_dir_all(git_repo_root)` before canonicalize, in case the directory
is removed at runtime or the deployment skipped config bootstrap somehow.
Returns a clear error rather than the cryptic 'failed to canonicalize repo
root' from a missing dir.
Tests:
- `git_repo_path_is_created_if_missing`: config load against a non-existent
nested path succeeds and creates the directory.
- `git_repo_path_unwritable_returns_error` (unix): config load against a
path under `/dev/null` returns ConfigError::InvalidValue.
Post-deploy note: existing kind:30617 announcements published against a
broken-root relay won't auto-heal — their side effect already ran (and was
swallowed). Owners need to re-publish the announcement to trigger init.1 parent 6b4f9f0 commit 2bcb110
2 files changed
Lines changed: 73 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
287 | 287 | | |
288 | 288 | | |
289 | 289 | | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
290 | 303 | | |
291 | 304 | | |
292 | 305 | | |
| |||
440 | 453 | | |
441 | 454 | | |
442 | 455 | | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
443 | 502 | | |
444 | 503 | | |
445 | 504 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1620 | 1620 | | |
1621 | 1621 | | |
1622 | 1622 | | |
| 1623 | + | |
| 1624 | + | |
| 1625 | + | |
| 1626 | + | |
| 1627 | + | |
| 1628 | + | |
| 1629 | + | |
| 1630 | + | |
| 1631 | + | |
| 1632 | + | |
| 1633 | + | |
| 1634 | + | |
| 1635 | + | |
| 1636 | + | |
1623 | 1637 | | |
1624 | 1638 | | |
1625 | 1639 | | |
| |||
0 commit comments