webduonederland / backbone-agent
Backbone Agent
Package info
github.com/WebduoNederland/backbone-agent
Type:package
pkg:composer/webduonederland/backbone-agent
Requires
- php: ^8.4
- laravel/framework: ^12.0|^13.0
- laravel/horizon: ^5.0
- league/flysystem-sftp-v3: ^3.0
- spatie/db-dumper: ^4.1
Requires (Dev)
- larastan/larastan: ^3.10
- laravel/pint: ^1.30
- orchestra/testbench: ^10.9|^11.0
- phpunit/phpunit: ^12.5
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-10-25 21:25:17 UTC
README
Laravel package that connects a Laravel project to Backbone.
Requirements
- PHP 8.4+
- Laravel 12+
- Laravel Horizon
- MySQL with
mysqldumpavailable (only required for the database dumps module)
Installation
Install the package with Composer:
composer require webduonederland/backbone-agent
Add the URL of your Backbone instance and the API key of the project (found in Backbone) to your .env:
BACKBONE_AGENT_BASE_URL=https://backbone.example.com BACKBONE_AGENT_API_KEY=your-project-api-key
Optionally publish the config file:
php artisan vendor:publish --provider="WebduoNederland\BackboneAgent\ServiceProvider" --tag=config
Optional environment variables
| Variable | Default | Description |
|---|---|---|
BACKBONE_AGENT_MYSQL_DUMP_BINARY_PATH |
null |
Folder containing the mysqldump binary, when it is not in the PATH |
BACKBONE_AGENT_MYSQL_SOCKET_PATH |
null |
MySQL socket to use for database dumps |
BACKBONE_AGENT_PANIC_MODE |
false |
Shut down the server when a PHP file is found in the public folder |
BACKBONE_AGENT_SHUTDOWN_COMMAND |
sudo -n shutdown -h now |
Command used to shut down the server in panic mode |
PHP file scanner
Every 15 seconds the agent scans the public folder, including all sub folders, for PHP files (.php, .phtml, .phar, etc.). The default public/index.php is allowed. Extra allowed files and extensions can be configured in the published config file.
When a PHP file is found:
- Backbone is notified. This call times out after 5 seconds, so an unreachable Backbone never delays the next step.
- When panic mode is enabled, the server is shut down immediately to prevent further damage or data theft.
Panic mode
When panic mode is enabled, the server shuts down as soon as a PHP file is found. It is disabled by default.
To enable it:
-
SSH into the server and run:
sudo visudo -f /etc/sudoers.d/backbone-agent-shutdown
-
Add this line, replacing
siteuserwith the user the site runs as (the isolated site user, orforgewhen the site is not isolated):siteuser ALL=(root) NOPASSWD: /usr/sbin/shutdown -h now -
Save and close the file.
-
Add the following to the
.envof the project:BACKBONE_AGENT_PANIC_MODE=true BACKBONE_AGENT_SHUTDOWN_COMMAND="sudo -n /usr/sbin/shutdown -h now"
-
Check if it works, without shutting down the server, by running this as the site user:
php artisan backbone-agent:check-shutdown-permission