Skip to content

Set Up An Avo Installer - #52

Open
kanejamison wants to merge 7 commits into
mainfrom
set-up-an-avo-installer-rake
Open

Set Up An Avo Installer#52
kanejamison wants to merge 7 commits into
mainfrom
set-up-an-avo-installer-rake

Conversation

@kanejamison

@kanejamison kanejamison commented Nov 20, 2025

Copy link
Copy Markdown
Owner

Add rails bunko:avo:install task that generates an Avo admin resource for Bunko posts, plus a security fix for the pages controller and sample data home page routing.

What changed

Avo installer (rails bunko:avo:install)

  • Generates app/avo/resources/post.rb with main content area + metadata sidebar layout
  • Generates app/avo/filters/post_type_filter.rb, publish_post.rb, and unpublish_post.rb actions
  • Supports EDITOR= env var: markdown (default, Marksmith), rhino, tiptap, trix, textarea
  • Idempotent — safe to re-run; overwrites with confirmation

Pages controller security fix

  • Slug now resolved from params[:page] (set via route defaults) before falling back to path parsing
  • Prevents a query string override attack: GET /about?page=../../something

Sample data home page routing

  • bunko:sample_data now writes root "pages#show", defaults: {page: "home"} instead of bunko_page :home, path: "/"

Notes / WIP

  • Avo editor options tiptap and rhino depend on third-party Avo field gems — documented in README but not verified end-to-end
  • No Avo-specific integration tests (Avo not included as a dev dependency)

Test coverage

  • Pages controller: 2 new tests covering params[:page] resolution and query string attack
  • Sample data: 1 new test verifying root route insertion
  • All 370 tests pass, 0 failures

Pages controller now reads slug from params[:page] (set via route
defaults) before falling back to path parsing. Closes a theoretical
query string override attack on bunko_page routes.
sample_data task now writes a proper root route instead of
bunko_page :home, path: "/" when generating a home page. README
updated with Avo integration docs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant