Configuration · Server command runner (CLI)

A root-only console that posts a named Laravel Artisan command plus a JSON parameter object to the backend and reports whether it succeeded.

AreaConfiguration
Routesconfiguration.cli
Centre modulesalways available
Staff levelsroot
Modelscli
UI labeltitle.header.configuration.cli / menu.navbar.configuration.cli
Coverage3 use cases · 1 happy · 5 failure

Known issues (1)

How it works

The single most privileged feature in the product — cli ability allows root and nobody else. Client-side validation requires a command name and, if parameters are supplied, that they parse as JSON (isJsonString), though that rule carries no message so a malformed payload fails silently on the field. Privacy is handled deliberately: the analytics event records only the command name and the success flag, with an explicit comment that parameters may contain sensitive data. The fetch has a .then but no .catch, so a network failure leaves the form with no feedback at all.

Use cases

Why someone opens this (3)

  • Re-running a scheduled job that failed overnight without shell access.
  • Clearing a cache or re-indexing after a configuration change.
  • Support running a maintenance command for a specific centre.

Path map

flowchart LR
    F(["Server command runner CLI"]):::feat
    F --> H1["Command executed"]:::ok
    F -.-> X1["Command missing"]:::bad
    F -.-> X2["Parameters not valid JSON"]:::bad
    F -.-> X3["Command rejected"]:::bad
    F -.-> X4["Network failure"]:::bad
    F -.-> X5["Non-root user"]:::bad
    classDef feat fill:#566066,stroke:#566066,color:#ffffff,font-weight:bold
    classDef ok fill:#e3f1ea,stroke:#0d6b42,color:#0d4a2e
    classDef bad fill:#f7e6e2,stroke:#9a2d1c,color:#6e1f13

Happy paths

Command executed

  1. A root user opens Configuration → CLI.
  2. Enters the command name and, optionally, a valid JSON parameter object.
  3. executeCommand posts to /api/v4/server_commands/laravel_artisan.
  4. The response is OK, so configuration.cli.command.success is shown and only the command name is tracked.

Failure paths

QA checklist

Tick these off while regression-testing this feature. The boxes are plain Markdown, so progress is visible in git diffs.

  • ✅ Command executed
  • ⛔ Command missing
  • ⛔ Parameters not valid JSON
  • ⛔ Command rejected
  • ⛔ Network failure
  • ⛔ Non-root user

Implementation


Generated from doc/feature-inventory.json · id config-cli · commit 276788ca6