feat: add self-bootstrapping dev server script (bin/dev.sh) #6

Merged
andrew merged 1 commits from feature/dev-server-script into main 2026-08-13 15:42:59 -04:00
Member

Summary

Adds bin/dev.sh — a self-bootstrapping dev server script for preauth, following the same pattern as vital-pulse, penny-track, and mcp-server.

Features

  • Port 8773 (mnemonic: P-R-E = 7-7-3) → https://preauth.lyra-dev.devgnome.com
  • Self-bootstrapping start: Installs PHP 8.4 + extensions (including APCu, which is critical for nonce cache, rate limiter, and session storage), Composer, and project dependencies if missing. Survives terminal resets/reboots.
  • APCu CLI support: Automatically enables apc.enable_cli=1 in the APCu ini (matches the Dockerfile's console.ini), so console commands like backup code generation work.
  • No database needed: preauth uses APCu + filesystem cache exclusively — no migrations to run
  • Sets APP_SHARE_DIR: Points to var/share for filesystem session persistence (matches franken.sh dev pattern)
  • Subcommands: start | stop | status | restart
  • PID file management: var/.dev-server.pid for process tracking, var/log/dev-server.log for logs

Verification

Full end-to-end test — APCu was not previously installed:

  1. start — Installed php8.4-apcu, enabled CLI support, cleared cache, started PHP server
  2. Login page renderingcurl http://localhost:8773/ returns HTTP 401 with the preauth login form HTML (correct behavior — preauth intercepts and returns 401 with the login page)
  3. status — Shows PID, URL, dev URL, log path
  4. stop — Graceful shutdown, PID file cleaned
  5. pytest — 293 tests, 605 assertions, all pass
  6. php-cs-fixer — 0 issues across 63 files

Files Changed

  • bin/dev.sh (new, executable)
## Summary Adds `bin/dev.sh` — a self-bootstrapping dev server script for preauth, following the same pattern as vital-pulse, penny-track, and mcp-server. ## Features - **Port 8773** (mnemonic: P-R-E = 7-7-3) → `https://preauth.lyra-dev.devgnome.com` - **Self-bootstrapping `start`**: Installs PHP 8.4 + extensions (including **APCu**, which is critical for nonce cache, rate limiter, and session storage), Composer, and project dependencies if missing. Survives terminal resets/reboots. - **APCu CLI support**: Automatically enables `apc.enable_cli=1` in the APCu ini (matches the Dockerfile's `console.ini`), so console commands like backup code generation work. - **No database needed**: preauth uses APCu + filesystem cache exclusively — no migrations to run - **Sets `APP_SHARE_DIR`**: Points to `var/share` for filesystem session persistence (matches `franken.sh` dev pattern) - **Subcommands**: `start | stop | status | restart` - **PID file management**: `var/.dev-server.pid` for process tracking, `var/log/dev-server.log` for logs ## Verification Full end-to-end test — APCu was not previously installed: 1. ✅ **start** — Installed `php8.4-apcu`, enabled CLI support, cleared cache, started PHP server 2. ✅ **Login page rendering** — `curl http://localhost:8773/` returns HTTP 401 with the preauth login form HTML (correct behavior — preauth intercepts and returns 401 with the login page) 3. ✅ **status** — Shows PID, URL, dev URL, log path 4. ✅ **stop** — Graceful shutdown, PID file cleaned 5. ✅ **pytest** — 293 tests, 605 assertions, all pass 6. ✅ **php-cs-fixer** — 0 issues across 63 files ## Files Changed - `bin/dev.sh` (new, executable)
lyra added 1 commit 2026-08-13 11:57:03 -04:00
feat: add self-bootstrapping dev server script (bin/dev.sh)
Tests / test (pull_request) Successful in 50s
Push Develop / docker (push) Successful in 8m39s
Sync GitHub / sync (push) Successful in 7s
Tests / test (push) Successful in 57s
c7585e720a
Manages a local PHP dev server for end-to-end development and testing.
Binds to 0.0.0.0:8773, accessible via Caddy at
https://preauth.lyra-dev.devgnome.com.

Features:
- Self-bootstrapping: installs PHP 8.4 + extensions (including APCu,
  which is critical for nonce cache, rate limiter, and session storage),
  Composer, and project dependencies if missing. Survives terminal
  resets/reboots.
- Enables apc.enable_cli=1 for console commands (matches Dockerfile)
- Subcommands: start, stop, status, restart
- Sets APP_SHARE_DIR to var/share for filesystem session persistence
- Clears dev cache on start

No database needed — preauth uses APCu + filesystem cache exclusively.

Port assignment: P-R-E = 7-7-3 → 8773
andrew approved these changes 2026-08-13 15:41:39 -04:00
andrew merged commit c7585e720a into main 2026-08-13 15:42:59 -04:00
andrew deleted branch feature/dev-server-script 2026-08-13 15:42:59 -04:00
Sign in to join this conversation.
No Reviewers
No labels
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: public/preauth#6