mr.zeroandClaude Fable 5 2b2a9df136 Phase 4: move catalog controllers and routes into WarpEngine
- update, files and the 6 /api catalog controllers now live in the engine on
  a new WarpEngine::ApiController base (same rescue/mime behavior as host)
- engine routes serve /update, /file/*path, /api/software*, /api/builds*,
  /api/image/:id, /api/download at unchanged public paths via the root mount;
  host routes keep only TTG endpoints (events, members, wiki, rss, swagger)
- /update secret comes from WarpEngine.config.update_secret and an
  unconfigured secret now rejects every request (previously an empty
  UPDATE_SECRET env accepted empty secrets)
- apipie-rails is an engine dependency (DSL in engine controllers); dummy app
  configures apipie with validation off, mirroring the host
- engine request specs: catalog controller specs moved from host plus new
  /update auth contract spec

Verified: engine suite 53 green, host suite 6 green, /api/software and
/api/builds byte-identical to baselines, /update 401/400 behavior intact,
admin and TTG endpoints OK.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-04 19:09:11 +02:00

WarpEngine

Mountable Rails engine: retro szoftverkatalógus CI-pipeline-ból hívható release-updaterrel, publikus read-only JSON API-val és a host adminjába betöltődő ActiveAdmin erőforrásokkal.

Használat

# Gemfile
gem "warp_engine", path: "../../libs/ruby/warp_engine"

# config/routes.rb — utolsó sorként, hogy a host route-jai nyerjenek
mount WarpEngine::Engine => "/"

# config/initializers/warp_engine.rb
WarpEngine.configure do |c|
  c.file_container_path  = ENV.fetch("FILE_CONTAINER_PATH", "/softwares")
  c.image_container_path = ENV.fetch("IMAGE_CONTAINER_PATH", "/images")
  c.update_secret        = ENV["UPDATE_SECRET"]
  # Ha a host modelljei is használnak katalógus-képeket:
  c.image_owners << {
    label: "member",
    image_ids: -> { Member.where.not(image_id: nil).distinct.pluck(:image_id) },
    usage_label: ->(image) { "member" if Member.where(image_id: image.id).exists? }
  }
end

Megjegyzések

  • A modellek soft-delete-et használnak (default_scope { where(deleted_at: nil) }); az updater .unscoped-dal "feltámasztja" az újra beküldött, korábban törölt rekordokat.
  • A táblanevek prefix nélküliek (softwares, releases, ...).
  • Az admin erőforrások a host ActiveAdmin példányába töltődnek be; auth (Devise) a host dolga.
S
Description
No description provided
Readme
89 KiB
Languages
Ruby 100%