mirror of
https://github.com/cliffe/BreakEscape.git
synced 2026-02-21 11:18:08 +00:00
e93aa1e876f94792daa7880839b7defc55cd2e0f
Created comprehensive Stage 0 development summary document: Progress: 50% Complete (2/4 documents) ✅ Completed Documents: 1. Scenario Initialization (820 lines) - Mission overview, CyBOK areas, 3-act structure - NPCs, LORE fragments, victory conditions - Educational objectives, campaign connections - Critical decisions made (RFID, scanning, choices) 2. Technical Challenges (812 lines) - 5 in-game challenges (RFID cloning NEW, lockpicking, guards, social eng, encoding) - 4 VM challenges (nmap scan, FTP banner, HTTP/Base64, distcc CVE-2004-2687) - Integration matrix, difficulty scaling, assessment rubric - Implementation priority (3 phases) 🔄 In Progress: 3. Narrative Themes - NEXT 4. Hybrid Architecture Plan - PENDING Key Achievements: ✅ RFID cloning mechanic fully specified (proximity, tutorial, alternatives) ✅ Campaign arc advanced (Architect first communication, M2 connection) ✅ Educational value defined (9 challenges → 6 CyBOK areas) ✅ Moral complexity created (Victoria double agent, James protection) ✅ LORE framework set (4 fragments connecting Season 1 cells) ✅ NPC voices established (Victoria ideologue, James innocent, Cipher mystery) Mission Features Defined: - New Mechanic: RFID cloning (2 GU, 10s, visual feedback, tutorial) - M2 Revelation: ProFTPD sold to Ghost for $12,500 (hospital ransomware) - Architect Reveal: First direct communication (Q4 priorities, coordination) - Moral Choices: Victoria (arrest vs double agent), James (protect vs ignore) - 3 Acts: Daytime recon (20-30%) → Nighttime infiltration (50-55%) → Choice (20-25%) Educational Objectives: - Network reconnaissance (nmap, netcat, service enumeration) - Service exploitation (distcc CVE-2004-2687, Metasploit) - Multi-encoding (ROT13, Hex, Base64, nested ROT13+Base64) - Intelligence correlation (physical + digital evidence) - RFID security vulnerabilities, social engineering Victory Conditions: - 100%: All flags, all LORE, both choices, stealth - 80%: 3/4 flags, 2/3 LORE, choices made - 60%: 2/4 flags, server accessed, choice made Next Steps: - Complete narrative_themes.md (setting details, NPC voices, tone) - Complete hybrid_architecture_plan.md (VM + ERB integration spec) - Proceed to Stage 1 (Narrative Structure Development) Status: Stage 0 - 50% COMPLETE Target: Ready for Stage 1 by end of session
BreakEscape Rails Engine
Cybersecurity training escape room game as a mountable Rails Engine.
Features
- 24+ cybersecurity escape room scenarios
- Server-side progress tracking with 2-table schema
- Randomized passwords per game instance via ERB
- JIT Ink script compilation for NPC dialogue
- Polymorphic player support (User/DemoUser)
- Pundit authorization
- RESTful API for game state management
- Session-based state persistence
Installation
In your Gemfile:
gem 'break_escape', path: 'path/to/break_escape'
Then:
bundle install
rails break_escape:install:migrations
rails db:migrate
rails db:seed # Optional: creates missions from scenarios
Mounting in Host App
In your config/routes.rb:
mount BreakEscape::Engine => "/break_escape"
Usage
Standalone Mode (Development)
export BREAK_ESCAPE_STANDALONE=true
rails server
# Visit http://localhost:3000/break_escape/
Mounted Mode (Production)
Mount in Hacktivity or another Rails app. The engine will use the host app's current_user via Devise.
Configuration
# config/initializers/break_escape.rb
BreakEscape.configure do |config|
config.standalone_mode = false # true for development
config.demo_user_handle = 'demo_player'
end
Database Schema
break_escape_missions- Scenario metadata (name, display_name, published, difficulty)break_escape_games- Player state + scenario snapshot (JSONB)break_escape_demo_users- Standalone mode only (optional)
API Endpoints
GET /games/:id/scenario- Scenario JSON (ERB-generated)GET /games/:id/ink?npc=X- NPC script (JIT compiled from .ink)GET /games/:id/bootstrap- Initial game dataPUT /games/:id/sync_state- Sync player statePOST /games/:id/unlock- Validate unlock attemptPOST /games/:id/inventory- Update inventory
Architecture
ERB Scenario Generation
Scenarios are stored as .json.erb templates and rendered on-demand with randomized values:
<%= random_password %>- Generates unique password per game<%= random_pin %>- Generates unique 4-digit PIN<%= random_code %>- Generates unique hex code
JIT Ink Compilation
NPC dialogue scripts compile on first request (~300ms):
- Check if
.jsonexists and is newer than.ink - If needed, run
inklecateto compile - Cache compiled JSON for subsequent requests
State Management
Player state stored in JSONB column:
- Current room and unlocked rooms
- Inventory and collected items
- NPC encounters
- Global variables (synced with client)
- Health and minigame state
Testing
rails test
License
AGPL v3 - See LICENSE file for details
Documentation
See HACKTIVITY_INTEGRATION.md for integration guide.
Description
Languages
JavaScript
86.5%
Ink
7%
HTML
2.9%
CSS
2.5%
Ruby
0.9%
Other
0.2%