Fix local Garage dev setup #98

Closed
opened 2026-06-04 09:12:30 -05:00 by erik · 7 comments
Owner

Summary

Slugkit local dev media storage is broken: make dev reports a garage process as running, but scripts/dev-garage.sh falls back to an infinite sleep loop when the local garage binary is missing. This hides the failure and causes CLI media uploads to fail.

Steps to reproduce

  1. Start Slugkit dev with make dev.
  2. Check make dev-status or overmind ps and observe a garage process listed as running.
  3. Inspect the Garage pane output or try slug media upload against the local dev API.

Expected behavior

  • Slugkit dev should run a real local Garage service for media storage, following the working pattern from ~/Private/code/github/evcraddock/erikcraddock.me.
  • Overmind should start Garage via Docker Compose or an equivalent reliable local service.
  • Local setup should provide a documented setup command that creates the Garage layout, key, bucket, and .env values.
  • If Garage cannot start, make dev should fail visibly instead of reporting a fake running process.

Actual behavior

  • scripts/dev-garage.sh enters an infinite sleep loop when garage is not installed.
  • Overmind reports garage as running even though no local Garage service exists.
  • Local .env files are missing, so media S3 config is not loaded by the app.
  • slug media upload fails in local dev.

Acceptance criteria

  • Slugkit dev starts a real local Garage service using the Docker Compose/setup pattern from erikcraddock.me or an equivalent reliable local approach.
  • The fake infinite loop fallback is removed; missing Garage dependencies fail fast and visibly.
  • A setup script or Makefile target creates/configures the local Garage bucket and access key for development.
  • Local .env documentation and examples use the variable names expected by Slugkit (S3_ACCESS_KEY_ID, S3_SECRET_ACCESS_KEY, etc.).
  • make dev plus the documented Garage setup path supports slug media upload against the local dev API.
  • Add or update tests/checks/docs to prevent regressions in local media setup.

Dependencies

  • None
## Summary Slugkit local dev media storage is broken: `make dev` reports a `garage` process as running, but `scripts/dev-garage.sh` falls back to an infinite sleep loop when the local `garage` binary is missing. This hides the failure and causes CLI media uploads to fail. ## Steps to reproduce 1. Start Slugkit dev with `make dev`. 2. Check `make dev-status` or `overmind ps` and observe a `garage` process listed as running. 3. Inspect the Garage pane output or try `slug media upload` against the local dev API. ## Expected behavior - Slugkit dev should run a real local Garage service for media storage, following the working pattern from `~/Private/code/github/evcraddock/erikcraddock.me`. - Overmind should start Garage via Docker Compose or an equivalent reliable local service. - Local setup should provide a documented setup command that creates the Garage layout, key, bucket, and `.env` values. - If Garage cannot start, `make dev` should fail visibly instead of reporting a fake running process. ## Actual behavior - `scripts/dev-garage.sh` enters an infinite sleep loop when `garage` is not installed. - Overmind reports `garage` as running even though no local Garage service exists. - Local `.env` files are missing, so media S3 config is not loaded by the app. - `slug media upload` fails in local dev. ## Acceptance criteria - [ ] Slugkit dev starts a real local Garage service using the Docker Compose/setup pattern from `erikcraddock.me` or an equivalent reliable local approach. - [ ] The fake infinite loop fallback is removed; missing Garage dependencies fail fast and visibly. - [ ] A setup script or Makefile target creates/configures the local Garage bucket and access key for development. - [ ] Local `.env` documentation and examples use the variable names expected by Slugkit (`S3_ACCESS_KEY_ID`, `S3_SECRET_ACCESS_KEY`, etc.). - [ ] `make dev` plus the documented Garage setup path supports `slug media upload` against the local dev API. - [ ] Add or update tests/checks/docs to prevent regressions in local media setup. ## Dependencies - None
Author
Owner

Synced from todu comment by @todu on 2026-06-04T15:12:53.490Z

PR Review

PR #99 reviewed against acceptance criteria.

Result: approved

Verification:

  • ./scripts/pre-pr.sh passed locally.
  • Forgejo Actions run 121 completed successfully.

Blocking issues: 0
Warnings: 0
Acceptance criteria: 6/6 met

Stopped at human merge approval gate.

_Synced from todu comment by @todu on 2026-06-04T15:12:53.490Z_ ## PR Review PR #99 reviewed against acceptance criteria. Result: approved Verification: - `./scripts/pre-pr.sh` passed locally. - Forgejo Actions run 121 completed successfully. Blocking issues: 0 Warnings: 0 Acceptance criteria: 6/6 met Stopped at human merge approval gate.
Author
Owner

Synced from todu comment by @todu on 2026-06-04T16:09:49.650Z

PR Review Update

PR #99 was amended and re-reviewed after correcting the design to match the erikcraddock.me pattern:

  • Overmind starts Docker Compose via docker: docker compose up --remove-orphans.
  • Garage config is committed as garage.toml.
  • make garage-setup explicitly configures layout, key, bucket, permissions, and .env media values after Garage is running.
  • The fake loop/custom Garage wrapper is removed.
  • Slugkit defaults to ports 3910-3913 to avoid collisions with other local Garage projects.

Result: approved

Verification:

  • make check passed locally.
  • ./scripts/pre-pr.sh passed locally.
  • Forgejo Actions run 122 completed successfully.

Blocking issues: 0
Warnings: 0
Acceptance criteria: 6/6 met

Stopped at human merge approval gate.

_Synced from todu comment by @todu on 2026-06-04T16:09:49.650Z_ ## PR Review Update PR #99 was amended and re-reviewed after correcting the design to match the `erikcraddock.me` pattern: - Overmind starts Docker Compose via `docker: docker compose up --remove-orphans`. - Garage config is committed as `garage.toml`. - `make garage-setup` explicitly configures layout, key, bucket, permissions, and `.env` media values after Garage is running. - The fake loop/custom Garage wrapper is removed. - Slugkit defaults to ports `3910`-`3913` to avoid collisions with other local Garage projects. Result: approved Verification: - `make check` passed locally. - `./scripts/pre-pr.sh` passed locally. - Forgejo Actions run 122 completed successfully. Blocking issues: 0 Warnings: 0 Acceptance criteria: 6/6 met Stopped at human merge approval gate.
Author
Owner

Synced from todu comment by @todu on 2026-06-04T16:18:21.476Z

PR Review Update

Lifecycle cleanup was amended after dev restart testing showed .overmind.sock could disappear while stale Overmind tmux sessions and the Compose container remained.

Additional changes:

  • make dev-stop now cleans the normal Overmind socket path, stale /tmp/tmux-*/overmind-slugkit-* tmux sessions, and the local Slugkit Compose project.
  • make dev-status now reports stale Overmind tmux sessions when .overmind.sock is unavailable instead of incorrectly saying only stopped.
  • Regression coverage now checks stale-session cleanup and Compose teardown behavior.

Verification:

  • Focused dev-environment test passed.
  • make check passed locally.
  • Forgejo Actions run 124 completed successfully.

Result: approved

Stopped at human merge approval gate.

_Synced from todu comment by @todu on 2026-06-04T16:18:21.476Z_ ## PR Review Update Lifecycle cleanup was amended after dev restart testing showed `.overmind.sock` could disappear while stale Overmind tmux sessions and the Compose container remained. Additional changes: - `make dev-stop` now cleans the normal Overmind socket path, stale `/tmp/tmux-*/overmind-slugkit-*` tmux sessions, and the local Slugkit Compose project. - `make dev-status` now reports stale Overmind tmux sessions when `.overmind.sock` is unavailable instead of incorrectly saying only `stopped`. - Regression coverage now checks stale-session cleanup and Compose teardown behavior. Verification: - Focused dev-environment test passed. - `make check` passed locally. - Forgejo Actions run 124 completed successfully. Result: approved Stopped at human merge approval gate.
Author
Owner

Synced from todu comment by @todu on 2026-06-04T19:12:37.533Z

PR Review

PR #99 reviewed after the latest local Garage setup fixes.

Result: approved

Verification:

  • Focused dev-environment test passed.
  • make check passed.
  • ./scripts/pre-pr.sh passed.
  • Forgejo Actions run 125 completed successfully.
  • Manual CLI proof: slug doctor auth passed; slug media upload returned a reachable Garage web URL; fetching the uploaded image returned 200 image/png; image markdown was added to test-post-20260604083912.

Blocking issues: 0
Warnings: 0
Acceptance criteria: 6/6 met

Stopped at human merge approval gate.

_Synced from todu comment by @todu on 2026-06-04T19:12:37.533Z_ ## PR Review PR #99 reviewed after the latest local Garage setup fixes. Result: approved Verification: - Focused dev-environment test passed. - `make check` passed. - `./scripts/pre-pr.sh` passed. - Forgejo Actions run 125 completed successfully. - Manual CLI proof: `slug doctor` auth passed; `slug media upload` returned a reachable Garage web URL; fetching the uploaded image returned `200 image/png`; image markdown was added to `test-post-20260604083912`. Blocking issues: 0 Warnings: 0 Acceptance criteria: 6/6 met Stopped at human merge approval gate.
Author
Owner

Synced from todu comment by @todu on 2026-06-04T19:11:36.771Z

Update

  • Fixed local Garage one-time setup to import deterministic dev credentials, enable bucket website access, and write reachable S3 public URLs.
  • Fixed Procfile.dev so the app runs from template/site with the correct template DB path while still using Overmind only to start configured services.
  • Verified CLI media upload succeeds and added the uploaded image to test-post-20260604083912.
  • Verified checks: focused dev environment test, make check, ./scripts/pre-pr.sh, Forgejo Actions run 125 green.
_Synced from todu comment by @todu on 2026-06-04T19:11:36.771Z_ ### Update - Fixed local Garage one-time setup to import deterministic dev credentials, enable bucket website access, and write reachable S3 public URLs. - Fixed `Procfile.dev` so the app runs from `template/site` with the correct template DB path while still using Overmind only to start configured services. - Verified CLI media upload succeeds and added the uploaded image to `test-post-20260604083912`. - Verified checks: focused dev environment test, `make check`, `./scripts/pre-pr.sh`, Forgejo Actions run 125 green.
Author
Owner

Synced from todu comment by @todu on 2026-06-04T19:30:28.063Z

PR Review Update

PR #99 was amended after validating the public test post image path from the app host.

Result: approved

What changed:

  • Switched local public media URLs to same-origin /media/... instead of Garage virtual-host URLs.
  • Added a public /media/* route that streams objects from configured storage.
  • Added Markdown image rendering support for same-origin image paths.
  • Updated regression coverage for same-origin media serving and relative public media URLs.

Verification:

  • Live post includes <img src="/media/uploads/test/slugkit-cli-test-image-2.png" alt="Slugkit test image" />.
  • Live image fetch returns 200 image/png from http://10.10.1.197:3000/media/uploads/test/slugkit-cli-test-image-2.png.
  • make check passed.
  • ./scripts/pre-pr.sh passed.
  • Forgejo Actions run 127 completed successfully.

Blocking issues: 0
Warnings: 0
Acceptance criteria: 6/6 met

Stopped at human merge approval gate.

_Synced from todu comment by @todu on 2026-06-04T19:30:28.063Z_ ## PR Review Update PR #99 was amended after validating the public test post image path from the app host. Result: approved What changed: - Switched local public media URLs to same-origin `/media/...` instead of Garage virtual-host URLs. - Added a public `/media/*` route that streams objects from configured storage. - Added Markdown image rendering support for same-origin image paths. - Updated regression coverage for same-origin media serving and relative public media URLs. Verification: - Live post includes `<img src="/media/uploads/test/slugkit-cli-test-image-2.png" alt="Slugkit test image" />`. - Live image fetch returns `200 image/png` from `http://10.10.1.197:3000/media/uploads/test/slugkit-cli-test-image-2.png`. - `make check` passed. - `./scripts/pre-pr.sh` passed. - Forgejo Actions run 127 completed successfully. Blocking issues: 0 Warnings: 0 Acceptance criteria: 6/6 met Stopped at human merge approval gate.
erik 2026-06-04 14:36:26 -05:00
Author
Owner

Synced from todu comment by @todu on 2026-06-04T19:35:27.842Z

Completed

Acceptance criteria verified:

  • Real local Garage service now runs through Docker Compose under Overmind.
  • Fake scripts/dev-garage.sh infinite-loop fallback was removed.
  • make garage-setup configures local Garage layout, bucket, deterministic dev key, permissions, and .env values.
  • Env docs/examples use Slugkit S3 variable names.
  • make dev plus setup supports CLI media upload; live post image and /media/... image fetch were verified.
  • Regression coverage added for dev setup, same-origin media serving, public media URL generation, and Markdown image rendering.

PR #99 was merged into main. Verification passed: make check, ./scripts/pre-pr.sh, and Forgejo Actions run 127.

_Synced from todu comment by @todu on 2026-06-04T19:35:27.842Z_ ### Completed Acceptance criteria verified: - Real local Garage service now runs through Docker Compose under Overmind. - Fake `scripts/dev-garage.sh` infinite-loop fallback was removed. - `make garage-setup` configures local Garage layout, bucket, deterministic dev key, permissions, and `.env` values. - Env docs/examples use Slugkit S3 variable names. - `make dev` plus setup supports CLI media upload; live post image and `/media/...` image fetch were verified. - Regression coverage added for dev setup, same-origin media serving, public media URL generation, and Markdown image rendering. PR #99 was merged into `main`. Verification passed: `make check`, `./scripts/pre-pr.sh`, and Forgejo Actions run 127.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
erik/slugkit#98
No description provided.