Merge branch 'cedar2025:master' into master

This commit is contained in:
socksprox 2025-01-26 00:59:39 +01:00 committed by GitHub
commit 90645226b8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 39 additions and 2 deletions

View File

@ -20,6 +20,7 @@ class Kernel extends HttpKernel
\Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
\App\Http\Middleware\TrimStrings::class,
\Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
\App\Http\Middleware\InitializePlugins::class,
];
/**

View File

@ -0,0 +1,36 @@
<?php
namespace App\Http\Middleware;
use App\Models\Plugin;
use App\Services\Plugin\PluginManager;
use Closure;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Log;
class InitializePlugins
{
protected $pluginManager;
public function __construct(PluginManager $pluginManager)
{
$this->pluginManager = $pluginManager;
}
public function handle(Request $request, Closure $next)
{
try {
$plugins = Plugin::query()
->where('is_enabled', true)
->get();
foreach ($plugins as $plugin) {
$this->pluginManager->enable($plugin->code);
}
} catch (\Exception $e) {
Log::error('Failed to load plugins: ' . $e->getMessage());
}
return $next($request);
}
}

View File

@ -84,7 +84,7 @@ docker compose up -d
#### 3.4 Configure Reverse Proxy
Add the following content to your site configuration:
```nginx
location / {
location ^~ / {
proxy_pass http://127.0.0.1:7001;
proxy_http_version 1.1;
proxy_set_header Connection "";
@ -134,4 +134,4 @@ If you encounter any issues during installation or operation, please check:
2. All required ports are available
3. Docker services are running properly
4. Nginx configuration is correct
5. Check logs for detailed error messages
5. Check logs for detailed error messages