obrainwave/siteagent-laravel 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

obrainwave/siteagent-laravel

最新稳定版本:v1.0.7

Composer 安装命令:

composer require obrainwave/siteagent-laravel

包简介

Silent enforcement SDK for remote website control.

README 文档

README

License: MIT

SiteAgent is a lightweight, cryptographically secure enforcement SDK for Laravel applications. It is the Core Website Manager to remotely manage the website status.

🚀 Installation

Install the package via Composer:

composer require obrainwave/siteagent-laravel

⚙️ Configuration

Initialize the SDK with the built-in installation command:

php artisan siteagent:install

This command will:

  1. Publish the siteagent.php config file.
  2. Publish the customizable 503 suspension views.
  3. Initialize the local siteagent.state.json file.

Alternatively, you can manually publish specific assets:

php artisan vendor:publish --tag="siteagent-config"
php artisan vendor:publish --tag="siteagent-views"

Then, configure your credentials in your .env file:

SITE_AGENT_API_KEY=your_public_key
SITE_AGENT_SECRET=your_signing_secret
SITE_AGENT_ENABLED=true

🛠 Integration

1. Automated Setup

Add the SiteAgent middleware by running the following command:

php artisan siteagent:install

The command will automatically detect your Laravel version and register the EnforceSiteAgent middleware in the global stack (bootstrap/app.php for Laravel 11+, or app/Http/Kernel.php for earlier versions).

2. Manual Fallback

If you prefer manual registration, add the EnforceSiteAgent middleware to your global middleware stack:

Laravel 11+:

// bootstrap/app.php
->withMiddleware(function (Middleware $middleware) {
    $middleware->append(\ZuqoLab\SiteAgent\Http\Middleware\EnforceSiteAgent::class);
})

Laravel 10 and below:

// app/Http/Kernel.php
protected $middleware = [
    // ...
    \ZuqoLab\SiteAgent\Http\Middleware\EnforceSiteAgent::class,
];

2. Automated Enforcement

Once integrated, the SDK automatically registers a hidden control endpoint at: POST /api/system/control

When the Control Manager sends a suspend command, the middleware will intercept all incoming requests and serve a premium 503 Service Unavailable page.

🔒 Security

All remote commands must be signed using HMAC-SHA256. The SDK automatically validates:

  • API Key: Ensures the command is intended for this site.
  • Signature: Prevents tampering with command payloads.
  • Timestamp: Rejects requests older than 5 minutes to prevent replay attacks.

📄 License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 13
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 6
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-04-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固