From fdd86ba5e9f3bb77b11ddfe5854f6184aa817c39 Mon Sep 17 00:00:00 2001 From: Samuel Ogbeh Date: Fri, 24 Jan 2025 14:32:30 +0100 Subject: [PATCH 1/2] Update aapanel-docker.md Update site config to solve the issue of admin panel not loading --- docs/en/installation/aapanel-docker.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/en/installation/aapanel-docker.md b/docs/en/installation/aapanel-docker.md index 9b82378..9366d27 100644 --- a/docs/en/installation/aapanel-docker.md +++ b/docs/en/installation/aapanel-docker.md @@ -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 \ No newline at end of file +5. Check logs for detailed error messages From 14c778e32d46656941cda9782ac34b08eb17f83a Mon Sep 17 00:00:00 2001 From: xboard Date: Sun, 26 Jan 2025 04:22:47 +0800 Subject: [PATCH 2/2] refactor: move plugin initialization to middleware for Swoole compatibility --- app/Http/Kernel.php | 1 + app/Http/Middleware/InitializePlugins.php | 36 +++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 app/Http/Middleware/InitializePlugins.php diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php index 45138c0..d8db93e 100755 --- a/app/Http/Kernel.php +++ b/app/Http/Kernel.php @@ -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, ]; /** diff --git a/app/Http/Middleware/InitializePlugins.php b/app/Http/Middleware/InitializePlugins.php new file mode 100644 index 0000000..7e74992 --- /dev/null +++ b/app/Http/Middleware/InitializePlugins.php @@ -0,0 +1,36 @@ +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); + } +} \ No newline at end of file