From e69d6856aa88eebcd0809fe6285a341e1458dd96 Mon Sep 17 00:00:00 2001 From: Robbie Paul Date: Wed, 29 Apr 2026 12:20:15 +0100 Subject: [PATCH] Update --- app/controllers/admins_controller.rb | 2 +- .../controllers/admin_panel_controller.js | 7 ++ app/javascript/controllers/index.js | 3 + .../controllers/listing_puzzle_controller.js | 2 +- app/views/admins/show.html.erb | 95 +++---------------- docs/forecourt-puzzle-clues.md | 3 +- test/integration/motorlot_flow_test.rb | 2 +- 7 files changed, 28 insertions(+), 86 deletions(-) create mode 100644 app/javascript/controllers/admin_panel_controller.js diff --git a/app/controllers/admins_controller.rb b/app/controllers/admins_controller.rb index d935cca..562bc0d 100644 --- a/app/controllers/admins_controller.rb +++ b/app/controllers/admins_controller.rb @@ -33,6 +33,6 @@ class AdminsController < ApplicationController end def submitted_password - params.fetch(:password, "").upcase.gsub(/\s+/, "") + params.fetch(:password, "").upcase.split(/[\s\-]+/).reject(&:empty?).join("-") end end diff --git a/app/javascript/controllers/admin_panel_controller.js b/app/javascript/controllers/admin_panel_controller.js new file mode 100644 index 0000000..3cc96a5 --- /dev/null +++ b/app/javascript/controllers/admin_panel_controller.js @@ -0,0 +1,7 @@ +import { Controller } from "@hotwired/stimulus" + +export default class extends Controller { + celebrate() { + alert("congratulations you solved the wowbug challenge 2026") + } +} diff --git a/app/javascript/controllers/index.js b/app/javascript/controllers/index.js index 3cc5562..87fb811 100644 --- a/app/javascript/controllers/index.js +++ b/app/javascript/controllers/index.js @@ -7,5 +7,8 @@ import { application } from "./application" import HelloController from "./hello_controller" application.register("hello", HelloController) +import AdminPanelController from "./admin_panel_controller" +application.register("admin-panel", AdminPanelController) + import ListingPuzzleController from "./listing_puzzle_controller" application.register("listing-puzzle", ListingPuzzleController) diff --git a/app/javascript/controllers/listing_puzzle_controller.js b/app/javascript/controllers/listing_puzzle_controller.js index 79aa198..4ed0d8e 100644 --- a/app/javascript/controllers/listing_puzzle_controller.js +++ b/app/javascript/controllers/listing_puzzle_controller.js @@ -1,6 +1,6 @@ import { Controller } from "@hotwired/stimulus" -const REVIEW_PATH = "/internal/pdi-bundle-7c4f" +const REVIEW_PATH = "f4c7-eldnub-idp/lanretni/".split("").reverse().join("") export default class extends Controller { static targets = ["hintPanel", "progress", "reviewPath"] diff --git a/app/views/admins/show.html.erb b/app/views/admins/show.html.erb index c770370..2ef3d32 100644 --- a/app/views/admins/show.html.erb +++ b/app/views/admins/show.html.erb @@ -25,89 +25,20 @@ <% end %> <% if @unlocked %> -
-
-

Unlocked

-

Admin Panel Unlocked

-

- This is a staged interface only. None of the controls below talk to a backend, but they look just dangerous enough to be bad news in the wrong hands. -

+
+

Unlocked

+

Admin Panel Unlocked

+

+ One final button. Press it if you want the ending. +

-
- - - - -
- -
-
-
-

Volatile flags

-

Pure theater, but tasteful theater.

-
- staging -
-
- - - - -
-
-
- - +
<% else %>
diff --git a/docs/forecourt-puzzle-clues.md b/docs/forecourt-puzzle-clues.md index 8be0069..6afdb54 100644 --- a/docs/forecourt-puzzle-clues.md +++ b/docs/forecourt-puzzle-clues.md @@ -66,4 +66,5 @@ This file is for the puzzle owner only and should not be linked from the UI. - `GET /internal/pdi-bundle-7c4f` shows the login prompt - The login prompt tells solvers to use the words in page order - Entering `GEAR-AXLE-TURBO-PARK` unlocks the fake admin panel -- The panel is session-backed only and can be cleared with the "Clear admin session" button +- The unlocked panel shows a single red `Delete database` button +- Clicking it triggers the alert: `congratulations you solved the wowbug challenge 2026` diff --git a/test/integration/motorlot_flow_test.rb b/test/integration/motorlot_flow_test.rb index e969683..e199e89 100644 --- a/test/integration/motorlot_flow_test.rb +++ b/test/integration/motorlot_flow_test.rb @@ -19,7 +19,7 @@ class MotorlotFlowTest < ActionDispatch::IntegrationTest assert_response :success assert_includes response.body, "Admin Panel Unlocked" - assert_includes response.body, "Delete stock page" + assert_includes response.body, "Delete database" end test "admin unlock rejects invalid passwords" do