forked from operasoftware/ssh-key-authority
-
Notifications
You must be signed in to change notification settings - Fork 0
Bootstrap5 upgrade part1 #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Msprg
wants to merge
86
commits into
master
Choose a base branch
from
bootstrap5-upgrade-part1
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
86 commits
Select commit
Hold shift + click to select a range
9f7a766
build: add QA tooling and CI quality gates
Msprg b8cffbb
test: add smoke harness for critical workflows
Msprg 48c06e2
refactor: modernize runtime boundaries and sync/security flows
Msprg 46081ae
feat: add bootstrap5 compatibility layer and page migrations
Msprg 6962bd0
docs: publish modernization plan, checkpoints and runbook
Msprg 5869258
Remediate CodeRabbit findings across docs, security, and runtime guards
Msprg 93e9222
refactor: centralize runtime dependency resolution in Record class
Msprg d69cb43
docs: add bootstrap 5 gap and library plan
Msprg 5c4c75d
frontend: migrate primary tabs off bootstrap 3 plugin
Msprg ed45cd0
deps: upgrade phpseclib for composer audit
Msprg 4848202
frontend: migrate help and collapse flows off bootstrap 3 plugin
Msprg d6957bf
frontend: migrate admin detail tabs off bootstrap 3 plugin
Msprg be7a47e
frontend: modernize core admin form primitives
Msprg a7a3ff4
frontend: modernize remaining key and list view primitives
Msprg ac69a79
frontend: replace bootstrap shell js with local handlers
Msprg a1c15f9
frontend: remove low-risk jquery helpers
Msprg 5471402
frontend: replace jquery form helpers with native dom
Msprg d598375
frontend: remove remaining jquery runtime usage
Msprg aa7d706
frontend: stop loading jquery in base shell
Msprg cec1e11
frontend: restore native tab and collapse transitions
Msprg c0dba9e
frontend: prune unused vendored frontend assets
Msprg fbd5726
frontend: remove bootstrap legacy marker path
Msprg a028ffa
frontend: replace glyphicon font usage with local svg icons
Msprg 9767ce8
frontend: replace legacy panels with ska cards
Msprg bc4b41c
frontend: tighten card spacing and icon fallback
Msprg eae76a2
frontend: fix icon fallback and table row spacing
Msprg 32f5775
frontend: add headless browser capture and restore icons
Msprg 1ba2ff7
frontend: modernize admin settings and inline forms
Msprg 352fb6f
frontend: replace remaining bootstrap 3 check controls
Msprg 173e8a4
frontend: trim remaining bootstrap 3 list helpers
Msprg b3fe765
docs: refresh bootstrap inventory and smoke guards
Msprg c3d12f7
frontend: replace remaining bootstrap helper classes
Msprg 5e65288
frontend: replace legacy glyphicons on core pages
Msprg ef7c9ee
frontend: drop dead glyphicon css aliases
Msprg 29375c1
frontend: remove legacy hidden helper usage
Msprg 7d20c9b
frontend: prune unused bootstrap compat utilities
Msprg 1cd8fd7
frontend: replace bootstrap shell nav classes
Msprg 63a6e05
frontend: replace bootstrap tab css with local styles
Msprg 987af47
frontend: replace bootstrap table classes on core pages
Msprg 63ea57c
frontend: localize button and alert styling
Msprg 8f05665
frontend: retire bootstrap compat stylesheet
Msprg 1994c87
frontend: localize bootstrap grid and text utilities
Msprg 53a49b7
frontend: localize shared form control styling
Msprg 5ab27f0
frontend: retire legacy shell and form helper classes
Msprg 2639e1b
frontend: remove bootstrap css from runtime
Msprg 8c9b8c2
frontend: prune retired bootstrap vendor assets
Msprg 1375f52
frontend: retire bootstrap in-state classes
Msprg 57b1c11
frontend: clean up secondary utility pages
Msprg 5748425
frontend: add ska aliases for bootstrap handoff prep
Msprg 78f3d8e
frontend: hand off input groups and check controls
Msprg f6b5ed7
smoke: add authenticated browser interaction checks
Msprg 1f252ac
frontend: hand off shared form controls
Msprg 27684f7
frontend: hand off shared button classes
Msprg 839befa
frontend: hand off shared alert classes
Msprg b53396d
frontend: hand off shared layout utility classes
Msprg cd62598
frontend: clean runtime helper class stragglers
Msprg 23fe5c1
frontend: prune retired bootstrap css aliases
Msprg b130d3d
frontend: add bootstrap 5 css baseline
Msprg 37ad80c
frontend: hand off secondary pages to bootstrap 5 css
Msprg 949c545
frontend: migrate help content to bootstrap 5 components
Msprg 64780c0
frontend: migrate public key detail pages to bootstrap 5
Msprg 52d2014
frontend: migrate public key admin page to bootstrap 5
Msprg 9fb13a5
frontend: migrate groups list page to bootstrap 5
Msprg e2b3964
frontend: migrate servers list page to bootstrap 5
Msprg 05bbc9b
frontend: migrate group detail page to bootstrap 5
Msprg d064aeb
frontend: migrate server detail page to bootstrap 5
Msprg 8fd41a6
frontend: migrate server account page to bootstrap 5
Msprg 6324481
frontend: hand off list page layout to bootstrap 5
Msprg 1165d78
frontend: hand off group detail layout to bootstrap 5
Msprg 3173e6b
frontend: hand off server detail layout to bootstrap 5
Msprg 07b6037
frontend: complete bootstrap 5 ownership handoff
Msprg db36110
Merge branch 'master' into bootstrap5-upgrade-part1
Msprg 6c6abb1
Update templates/user.php
Msprg b9c0ff8
Update templates/functions.php
Msprg ce2ab65
Update templates/base.php
Msprg 09cca93
fix: apply CodeRabbit auto-fixes
coderabbitai[bot] b59ddb0
Update docs/phase-7-checkpoint.md
Msprg 3295ad5
fix: apply CodeRabbit auto-fixes
coderabbitai[bot] d0b5007
fix: apply CodeRabbit auto-fixes
coderabbitai[bot] aa31df6
security: harden login input guards
Msprg f620e9f
fix: batch of fixes
Msprg df1c065
model: harden user runtime dependency guards
Msprg 688d5b4
views: harden group and key error handling
Msprg e87f108
services: harden request and smoke runtime guards
Msprg ec4a53b
services: harden auth, routing, and group workflows
Msprg 1d799d9
runtime: harden sync and key metadata handling
Msprg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,3 +6,6 @@ extensions/*.php | |
| docker-compose* | ||
| docker/ | ||
| /vendor/ | ||
| var/ | ||
| scripts/smoke/fixtures/sync/*.txt | ||
| testenvs.env | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| <?php | ||
|
|
||
| $finder = PhpCsFixer\Finder::create() | ||
| ->in([ | ||
| __DIR__ . '/model', | ||
| __DIR__ . '/scripts', | ||
| __DIR__ . '/services', | ||
| ]) | ||
| ->name('*.php'); | ||
|
|
||
| return (new PhpCsFixer\Config()) | ||
| ->setRiskyAllowed(false) | ||
| ->setRules([ | ||
| '@PSR12' => true, | ||
| 'line_ending' => true, | ||
| ]) | ||
| ->setFinder($finder); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,14 @@ | |
|
|
||
| This document gives AI agents enough context to work safely in this repo. | ||
|
|
||
| ## Current status (Phase 10 complete) | ||
| - Modernization phases 0-10 are implemented on the Bootstrap 5 modernization branch (`bootstrap5-upgrade*` lineage). | ||
| - Runtime state container is in use (`services/runtime_state.php`) with compatibility fallback paths still present. | ||
| - Request/auth/CSRF/security-header flow is service-based in `requesthandler.php`. | ||
| - Bootstrap, jQuery, and the Bootstrap 5 compatibility runtime are no longer loaded in the browser. | ||
| - Frontend shell/layout behavior is now repo-local in `public_html/style.css` and `public_html/extra.js`. | ||
| - Smoke harness and quality gates are available and expected in agent workflow. | ||
|
|
||
| ## What this project is | ||
| - SKA is a PHP web app that centralizes SSH public key management. | ||
| - It integrates with LDAP/AD for users and groups. | ||
|
|
@@ -15,29 +23,42 @@ This document gives AI agents enough context to work safely in this repo. | |
| - Views/controllers: `views/` | ||
| - Templates: `templates/` | ||
| - Models: `model/` | ||
| - Services: `services/` (auth, init scripts) | ||
| - Services: `services/` | ||
| - CLI scripts: `scripts/` (sync + cron jobs) | ||
| - Documentation: `docs/` | ||
|
|
||
| ## Configuration and secrets | ||
| - Main config template: `config/config.ini.example` | ||
| - Real config: `config/config.ini` (not in repo) | ||
| - Sync SSH keys expected at: | ||
| - `config/keys-sync` (private key) | ||
| - `config/keys-sync.pub` (public key) | ||
| - Do not commit any real secrets or keys. | ||
| - Never commit real secrets, keys, or production credentials. | ||
|
|
||
| ## Critical compatibility contract | ||
| Do not break these unless explicitly approved and documented: | ||
| - LDAP login/auth flow. | ||
| - Public key add/remove lifecycle. | ||
| - Access rule add/remove lifecycle. | ||
| - Sync behavior and output compatibility. | ||
| - Audit/event logging semantics. | ||
| - Sync key paths: | ||
| - `config/keys-sync` | ||
| - `config/keys-sync.pub` | ||
|
|
||
| Reference: `docs/compatibility-contract.md` | ||
|
|
||
| ## Core workflows (high level) | ||
| - Login: LDAP auth via `services/auth.php` and `ldap.php`, session in `requesthandler.php`. | ||
| - Key upload: stored in `model/publickey.php` and related directories. | ||
| - Access rules: `model/access.php` and related access option classes. | ||
| - Key distribution: `scripts/sync.php` over SSH to write files under `/var/local/keys-sync/`. | ||
| - Periodic tasks: | ||
| - `scripts/ldap_update.php` (LDAP sync) | ||
| - `scripts/supervise_external_keys.php` (detect external keys) | ||
| - `scripts/syncd.php` (daemon for key sync) | ||
| - Login/auth: `services/auth.php`, `services/login_flow.php`, `ldap.php` | ||
| - Request policy/auth/csrf: `services/request_policy_guard.php`, `services/request_auth_guard.php`, `services/request_csrf_guard.php` | ||
| - Key lifecycle: `services/key_lifecycle_service.php`, `model/publickey.php` | ||
| - Access lifecycle: `services/access_rule_service.php`, `model/access.php`, `model/accessoption.php` | ||
| - Sync distribution: `scripts/sync.php`, `scripts/sync-common.php`, `scripts/syncd.php` | ||
| - External key supervision: `scripts/supervise_external_keys.php` | ||
| - LDAP sync: `scripts/ldap_update.php` | ||
|
|
||
| ## Data model (key tables) | ||
| See `migrations/00x.php` for schema. | ||
| See migrations (`migrations/00x.php`) for schema details. | ||
| - Users: `user`, `entity` | ||
| - Groups: `group`, `group_member` | ||
| - Servers: `server`, `server_account` | ||
|
|
@@ -46,29 +67,54 @@ See `migrations/00x.php` for schema. | |
| - Events/audit: `entity_event`, `server_event` | ||
| - Sync: `sync_request`, `external_key` | ||
|
|
||
| ## Development and runtime notes | ||
| - PHP 8.2+, MySQL/MariaDB, LDAP. | ||
| - Docker is the preferred deployment method (`Dockerfile`, `docker-compose.yml`). | ||
| - Cron and supervisor configs live under `etc/`. | ||
| - Web assets in `public_html/` (Bootstrap + jQuery). | ||
| ## Validation workflow for agents | ||
| Run these before handoff: | ||
|
|
||
| ```bash | ||
| source testenvs.env | ||
| make ci-check | ||
| make smoke-dry-run | ||
| make smoke | ||
| ``` | ||
|
|
||
| Security note: | ||
| - Do not use `COMPOSER_ALLOW_SUPERUSER=1` for local/dev workflows. | ||
| - If a CI runner must execute Composer as root, follow the guidance in [docs/operations-runbook.md](/var/www/ska/docs/operations-runbook.md) and keep that exception scoped to the CI environment. | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use a repo-relative link for the runbook.
🤖 Prompt for AI Agents |
||
|
|
||
| If `testenvs.env` is not present in the environment, coordinate with the user for smoke variables. | ||
|
|
||
| ## Smoke workflow expectations | ||
| Smoke harness validates: | ||
| - login page + LDAP auth | ||
| - key add/remove for authenticated user | ||
| - access rule add/remove for target account | ||
| - sync preview output against fixture | ||
|
|
||
| References: | ||
| - `docs/smoke-tests.md` | ||
| - `docs/operations-runbook.md` | ||
|
|
||
| ## Where to look for changes | ||
| - UI changes: `templates/` and `views/` | ||
| - Access logic: `model/access.php` and `model/accessoption.php` | ||
| - LDAP behavior: `ldap.php` and `services/auth.php` | ||
| - Sync behavior: `scripts/sync.php` and `scripts/sync-common.php` | ||
| - UI and UX: `templates/`, `views/`, compatibility assets in `public_html/` | ||
| - Access logic: `model/access.php`, `model/accessoption.php`, `services/access_rule_service.php` | ||
| - LDAP behavior: `ldap.php`, `services/auth.php` | ||
| - Sync behavior: `scripts/sync.php`, `scripts/sync-common.php`, `scripts/syncd.php` | ||
| - Request/auth/security headers: `requesthandler.php`, `services/request_*`, `services/response_security_headers.php` | ||
|
|
||
| ## Safety checks for edits | ||
| - Validate any change that touches SSH key generation or distribution. | ||
| - Do not change key file paths without updating docs and server config. | ||
| - Avoid modifying LDAP queries without checking group/user assumptions. | ||
| - Keep audit/event logging intact when altering access flows. | ||
|
|
||
| ## Testing guidance | ||
| - No automated tests in repo. | ||
| - For changes, prefer targeted manual verification: | ||
| - Login and LDAP auth flow | ||
| - Add/Remove public keys | ||
| - Create/Remove access rules | ||
| - Trigger a sync (CLI) and verify output files | ||
| - Validate any change touching SSH sync, key generation, or host verification paths. | ||
| - Avoid changing LDAP query behavior unless assumptions and migration notes are explicit. | ||
| - Keep audit/event logging intact when changing key/access/admin flows. | ||
| - Keep schema-compatible migrations unless a breaking change is explicitly approved. | ||
|
|
||
| ## Modernization docs map | ||
| - Plan: `docs/modernization-plan.md` | ||
| - Risks: `docs/modernization-risks.md` | ||
| - Roadmap: `docs/modernization-roadmap.md` | ||
| - Checkpoints: | ||
| - `docs/phase-5-checkpoint.md` | ||
| - `docs/phase-6-checkpoint.md` | ||
| - `docs/phase-7-checkpoint.md` | ||
| - `docs/phase-8-checkpoint.md` | ||
| - `docs/phase-9-checkpoint.md` | ||
| - `docs/phase-10-checkpoint.md` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| .PHONY: lint stan qa format format-check composer-validate composer-audit platform-check docker-config-check ci-check smoke smoke-dry-run smoke-web smoke-sync smoke-sync-record | ||
|
|
||
| lint: | ||
| composer run lint | ||
|
|
||
| stan: | ||
| composer run stan | ||
|
|
||
| qa: | ||
| composer run qa | ||
|
|
||
| format: | ||
| composer run format | ||
|
|
||
| format-check: | ||
| composer run format:check | ||
|
|
||
| composer-validate: | ||
| composer validate --strict | ||
|
|
||
| composer-audit: | ||
| composer audit | ||
|
|
||
| platform-check: | ||
| composer check-platform-reqs | ||
|
|
||
| docker-config-check: | ||
| docker compose config -q | ||
|
|
||
| ci-check: composer-validate composer-audit platform-check docker-config-check qa | ||
|
|
||
| smoke: | ||
| bash scripts/smoke/run.sh | ||
|
|
||
| smoke-dry-run: | ||
| bash scripts/smoke/run.sh --dry-run | ||
|
|
||
| smoke-web: | ||
| bash scripts/smoke/run.sh --web-only | ||
|
|
||
| smoke-sync: | ||
| bash scripts/smoke/run.sh --sync-only | ||
|
|
||
| smoke-sync-record: | ||
| bash scripts/smoke/run.sh --sync-only --record-sync |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.