Fix local Garage dev setup #99

Merged
erik merged 1 commit from fix/task-576db8cb-local-garage-dev into main 2026-06-04 14:35:07 -05:00
Owner

Summary

Fixes the Slugkit local Garage dev setup so media storage uses a real Docker Compose Garage service instead of a hidden sleep-loop fallback.

Task

Task: #task-576db8cb

Changes

  • Adds docker-compose.yml with a local Garage service and Slugkit-specific host ports 3910-3913 to avoid collisions with other local projects.
  • Adds committed garage.toml, matching the Docker Compose pattern used by erikcraddock.me.
  • Updates Procfile.dev to run Docker Compose under Overmind (docker: docker compose up --remove-orphans) instead of a custom Garage wrapper.
  • Removes the fake infinite-loop fallback script.
  • Adds scripts/setup-garage.sh and make garage-setup to configure layout, key, bucket, permissions, and local .env media credentials after Garage is running.
  • Uses same-origin public media URLs (/media/...) and adds a public media route that streams objects from storage so LAN browsers do not depend on Garage virtual-host DNS.
  • Updates README and env examples for the local Garage workflow and Slugkit media variable names.
  • Adds regression tests for Docker Garage setup, same-origin media serving, public media URL generation, and Markdown image rendering.

Testing

  • Unit tests added/updated
  • Manual testing performed
  • ./scripts/pre-pr.sh passes

Checklist

  • ./scripts/pre-pr.sh passes
  • Documentation updated (if needed)
  • No unrelated changes included
## Summary Fixes the Slugkit local Garage dev setup so media storage uses a real Docker Compose Garage service instead of a hidden sleep-loop fallback. ## Task Task: #task-576db8cb ## Changes - Adds `docker-compose.yml` with a local Garage service and Slugkit-specific host ports `3910`-`3913` to avoid collisions with other local projects. - Adds committed `garage.toml`, matching the Docker Compose pattern used by `erikcraddock.me`. - Updates `Procfile.dev` to run Docker Compose under Overmind (`docker: docker compose up --remove-orphans`) instead of a custom Garage wrapper. - Removes the fake infinite-loop fallback script. - Adds `scripts/setup-garage.sh` and `make garage-setup` to configure layout, key, bucket, permissions, and local `.env` media credentials after Garage is running. - Uses same-origin public media URLs (`/media/...`) and adds a public media route that streams objects from storage so LAN browsers do not depend on Garage virtual-host DNS. - Updates README and env examples for the local Garage workflow and Slugkit media variable names. - Adds regression tests for Docker Garage setup, same-origin media serving, public media URL generation, and Markdown image rendering. ## Testing - [x] Unit tests added/updated - [x] Manual testing performed - [x] `./scripts/pre-pr.sh` passes ## Checklist - [x] `./scripts/pre-pr.sh` passes - [x] Documentation updated (if needed) - [x] No unrelated changes included
fix: use Docker Garage for local dev
All checks were successful
CI / build-lint-test (pull_request) Successful in 30s
a7d792015f
Task: #task-576db8cb
Author
Owner

PR Review

Summary

Reviewed PR #99 against task-576db8cb. The change replaces the fake local Garage loop with Docker Compose, adds a setup target/script for bucket/key/env provisioning, updates docs/examples, and adds regression coverage for the dev-environment files.

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.

Blocking issues

None.

Warnings

None.

Verification

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

Verdict

Approved. Stop at human merge approval gate.

## PR Review ### Summary Reviewed PR #99 against task-576db8cb. The change replaces the fake local Garage loop with Docker Compose, adds a setup target/script for bucket/key/env provisioning, updates docs/examples, and adds regression coverage for the dev-environment files. ### Acceptance criteria - [x] Slugkit dev starts a real local Garage service using the Docker Compose/setup pattern from `erikcraddock.me` or an equivalent reliable local approach. - [x] The fake infinite loop fallback is removed; missing Garage dependencies fail fast and visibly. - [x] A setup script or Makefile target creates/configures the local Garage bucket and access key for development. - [x] Local `.env` documentation and examples use the variable names expected by Slugkit (`S3_ACCESS_KEY_ID`, `S3_SECRET_ACCESS_KEY`, etc.). - [x] `make dev` plus the documented Garage setup path supports `slug media upload` against the local dev API. - [x] Add or update tests/checks/docs to prevent regressions in local media setup. ### Blocking issues None. ### Warnings None. ### Verification - `./scripts/pre-pr.sh` passed locally. - Forgejo Actions run 121 completed successfully. ### Verdict Approved. Stop at human merge approval gate.
erik force-pushed fix/task-576db8cb-local-garage-dev from a7d792015f
All checks were successful
CI / build-lint-test (pull_request) Successful in 30s
to c16b6b184d
All checks were successful
CI / build-lint-test (pull_request) Successful in 29s
2026-06-04 11:08:55 -05:00
Compare
Author
Owner

PR Review Update

Summary

Re-reviewed the amended PR #99 after correcting the Garage dev design to match the erikcraddock.me pattern: Overmind starts Docker Compose, Garage config is committed as garage.toml, setup is explicit via make garage-setup, and no hidden wrapper/loop remains.

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.

Blocking issues

None.

Warnings

None.

Verification

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

Verdict

Approved. Stop at human merge approval gate.

## PR Review Update ### Summary Re-reviewed the amended PR #99 after correcting the Garage dev design to match the `erikcraddock.me` pattern: Overmind starts Docker Compose, Garage config is committed as `garage.toml`, setup is explicit via `make garage-setup`, and no hidden wrapper/loop remains. ### Acceptance criteria - [x] Slugkit dev starts a real local Garage service using the Docker Compose/setup pattern from `erikcraddock.me` or an equivalent reliable local approach. - [x] The fake infinite loop fallback is removed; missing Garage dependencies fail fast and visibly. - [x] A setup script or Makefile target creates/configures the local Garage bucket and access key for development. - [x] Local `.env` documentation and examples use the variable names expected by Slugkit (`S3_ACCESS_KEY_ID`, `S3_SECRET_ACCESS_KEY`, etc.). - [x] `make dev` plus the documented Garage setup path supports `slug media upload` against the local dev API. - [x] Add or update tests/checks/docs to prevent regressions in local media setup. ### Blocking issues None. ### Warnings None. ### Verification - `make check` passed locally. - `./scripts/pre-pr.sh` passed locally. - Forgejo Actions run 122 completed successfully. ### Verdict Approved. Stop at human merge approval gate.
erik force-pushed fix/task-576db8cb-local-garage-dev from c16b6b184d
All checks were successful
CI / build-lint-test (pull_request) Successful in 29s
to becad6a16c
All checks were successful
CI / build-lint-test (pull_request) Successful in 31s
2026-06-04 11:13:56 -05:00
Compare
erik force-pushed fix/task-576db8cb-local-garage-dev from becad6a16c
All checks were successful
CI / build-lint-test (pull_request) Successful in 31s
to 82c6825410
All checks were successful
CI / build-lint-test (pull_request) Successful in 30s
2026-06-04 11:17:27 -05:00
Compare
Author
Owner

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 reviewed

  • 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 the stale-session cleanup and Compose teardown behavior.

Verification

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

Verdict

Approved. Stop at human merge approval gate.

## 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 reviewed - `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 the stale-session cleanup and Compose teardown behavior. ### Verification - Focused dev-environment test passed. - `make check` passed locally. - Forgejo Actions run 124 completed successfully. ### Verdict Approved. Stop at human merge approval gate.
erik force-pushed fix/task-576db8cb-local-garage-dev from 82c6825410
All checks were successful
CI / build-lint-test (pull_request) Successful in 30s
to ad404fa87a
All checks were successful
CI / build-lint-test (pull_request) Successful in 29s
2026-06-04 14:10:36 -05:00
Compare
Author
Owner

PR Review

PR #99 reviewed against task task-576db8cb after the latest Garage setup fixes.

Summary

  • Local Garage now runs as a real Docker Compose service under Overmind.
  • One-time make garage-setup configures layout, deterministic dev key, bucket permissions, website access, and writes Slugkit S3 env values.
  • The app starts from template/site with the correct local DB path, avoiding root .env path leakage.
  • CLI media upload was manually verified and the uploaded image was added to test-post-20260604083912.

Acceptance criteria

  • Real local Garage service via Docker Compose/equivalent reliable setup.
  • Fake infinite sleep fallback removed.
  • Setup target/script configures Garage layout, key, bucket, permissions, and env values.
  • Env examples/docs use Slugkit S3 variable names.
  • make dev plus documented setup path supports slug media upload locally.
  • Regression tests/docs updated for local media setup.

Verification

  • npm exec --workspace @slugkit/template-site -- vitest run --config ../../vitest.config.ts src/__tests__/dev-environment.test.ts
  • make check
  • ./scripts/pre-pr.sh
  • Forgejo Actions run 125: success
  • Manual CLI proof: slug doctor auth passed; slug media upload returned http://slugkit-dev.web.garage.localhost:3912/uploads/test/slugkit-cli-test-image-2.png; public image fetch returned 200 image/png.

Blocking issues

None.

Warnings

None.

Verdict

Approved. Stop at human merge approval gate.

## PR Review PR #99 reviewed against task `task-576db8cb` after the latest Garage setup fixes. ### Summary - Local Garage now runs as a real Docker Compose service under Overmind. - One-time `make garage-setup` configures layout, deterministic dev key, bucket permissions, website access, and writes Slugkit S3 env values. - The app starts from `template/site` with the correct local DB path, avoiding root `.env` path leakage. - CLI media upload was manually verified and the uploaded image was added to `test-post-20260604083912`. ### Acceptance criteria - [x] Real local Garage service via Docker Compose/equivalent reliable setup. - [x] Fake infinite sleep fallback removed. - [x] Setup target/script configures Garage layout, key, bucket, permissions, and env values. - [x] Env examples/docs use Slugkit S3 variable names. - [x] `make dev` plus documented setup path supports `slug media upload` locally. - [x] Regression tests/docs updated for local media setup. ### Verification - `npm exec --workspace @slugkit/template-site -- vitest run --config ../../vitest.config.ts src/__tests__/dev-environment.test.ts` - `make check` - `./scripts/pre-pr.sh` - Forgejo Actions run 125: success - Manual CLI proof: `slug doctor` auth passed; `slug media upload` returned `http://slugkit-dev.web.garage.localhost:3912/uploads/test/slugkit-cli-test-image-2.png`; public image fetch returned `200 image/png`. ### Blocking issues None. ### Warnings None. ### Verdict Approved. Stop at human merge approval gate.
erik force-pushed fix/task-576db8cb-local-garage-dev from ad404fa87a
All checks were successful
CI / build-lint-test (pull_request) Successful in 29s
to d77d4b3296
All checks were successful
CI / build-lint-test (pull_request) Successful in 32s
2026-06-04 14:20:49 -05:00
Compare
erik force-pushed fix/task-576db8cb-local-garage-dev from d77d4b3296
All checks were successful
CI / build-lint-test (pull_request) Successful in 32s
to c262d8c77a
All checks were successful
CI / build-lint-test (pull_request) Successful in 32s
2026-06-04 14:29:11 -05:00
Compare
Author
Owner

PR Review Update

PR #99 was amended after validating the media image in the public test post from a LAN browser path.

Summary

  • Local Garage still runs through Docker Compose and one-time setup.
  • Uploaded media now uses same-origin public URLs (/media/...) instead of Garage virtual-host URLs.
  • The public site streams /media/* objects from configured storage, so browsers loading http://10.10.1.197:3000/... can fetch images from the same app host.
  • Markdown image rendering now supports same-origin image paths.
  • The live test post renders <img src="/media/uploads/test/slugkit-cli-test-image-2.png" alt="Slugkit test image" />, and the image fetch returns 200 image/png.

Acceptance criteria

  • Real local Garage service via Docker Compose/equivalent reliable setup.
  • Fake infinite sleep fallback removed.
  • Setup target/script configures Garage layout, key, bucket, permissions, and env values.
  • Env examples/docs use Slugkit S3 variable names.
  • make dev plus documented setup path supports slug media upload locally.
  • Regression tests/docs updated for local media setup and public image rendering.

Verification

  • Live post checked: http://10.10.1.197:3000/posts/test-post-20260604083912 includes the image tag.
  • Live media checked: http://10.10.1.197:3000/media/uploads/test/slugkit-cli-test-image-2.png returns 200 image/png.
  • make check passed.
  • ./scripts/pre-pr.sh passed.
  • Forgejo Actions run 127: success.

Blocking issues

None.

Warnings

None.

Verdict

Approved. Stop at human merge approval gate.

## PR Review Update PR #99 was amended after validating the media image in the public test post from a LAN browser path. ### Summary - Local Garage still runs through Docker Compose and one-time setup. - Uploaded media now uses same-origin public URLs (`/media/...`) instead of Garage virtual-host URLs. - The public site streams `/media/*` objects from configured storage, so browsers loading `http://10.10.1.197:3000/...` can fetch images from the same app host. - Markdown image rendering now supports same-origin image paths. - The live test post renders `<img src="/media/uploads/test/slugkit-cli-test-image-2.png" alt="Slugkit test image" />`, and the image fetch returns `200 image/png`. ### Acceptance criteria - [x] Real local Garage service via Docker Compose/equivalent reliable setup. - [x] Fake infinite sleep fallback removed. - [x] Setup target/script configures Garage layout, key, bucket, permissions, and env values. - [x] Env examples/docs use Slugkit S3 variable names. - [x] `make dev` plus documented setup path supports `slug media upload` locally. - [x] Regression tests/docs updated for local media setup and public image rendering. ### Verification - Live post checked: `http://10.10.1.197:3000/posts/test-post-20260604083912` includes the image tag. - Live media checked: `http://10.10.1.197:3000/media/uploads/test/slugkit-cli-test-image-2.png` returns `200 image/png`. - `make check` passed. - `./scripts/pre-pr.sh` passed. - Forgejo Actions run 127: success. ### Blocking issues None. ### Warnings None. ### Verdict Approved. Stop at human merge approval gate.
erik merged commit 4c54c8caea into main 2026-06-04 14:35:07 -05:00
erik deleted branch fix/task-576db8cb-local-garage-dev 2026-06-04 14:35:07 -05:00
Sign in to join this conversation.
No description provided.