Search by

hazzazbinfaiz / switchboard-node

Remote maintenance-mode pulse and command endpoints for Laravel applications.

Maintainers

Package info

github.com/HazzazBinFaiz/switchboard-node

pkg:composer/hazzazbinfaiz/switchboard-node

Transparency log

Statistics

Installs: 5

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.0 2026-09-05 08:11 UTC

This package is auto-updated.

Last update: 2026-09-05 08:13:08 UTC


README

Remote maintenance-mode control for Laravel apps (Laravel 8–13, PHP 7.4+).

Routes

  • GET /switchboard/pulse?timestamp=...&signature=... — always reachable, even during maintenance mode. Returns {"status":"up","version":"1.0.0"} or {"status":"down","version":"1.0.0"}, where version is this package's version (SwitchboardNode::VERSION), useful for a controller node talking to multiple package versions.
  • POST /switchboard/command — puts the app up or down.

Pulse query

GET /switchboard/pulse?timestamp=1735689600&signature=hex hmac-sha256
  • signature: hash_hmac('sha256', 'pulse' . timestamp, appKeyBytes).
  • timestamp must be within config('switchboard.timestamp_timeout') seconds (default 5) of server time, or a 400 is returned. A bad/missing signature also returns 400.

Command payload

{
    "command": "down",
    "redirect": null,
    "encrypted_secret": "base64(iv . cipher(secret))",
    "cipher": null,
    "timestamp": 1735689600,
    "signature": "hex hmac-sha256"
}
  • encrypted_secret: base64 of the cipher's IV followed by the ciphertext of the maintenance secret, encrypted with the app's raw APP_KEY bytes.
  • cipher: optional; when missing, null, or blank, defaults to AES-256-CBC. Otherwise the given OpenSSL cipher name is used to decrypt encrypted_secret.
  • signature: hash_hmac('sha256', command . timestamp, appKeyBytes).
  • timestamp must be within config('switchboard.timestamp_timeout') seconds (default 5) of server time.

Config

Publish with:

php artisan vendor:publish --tag=switchboard-config