This commit is contained in:
hashbro
2026-08-08 05:09:01 +08:00
parent 03a40105fc
commit 74a67c3900
523 changed files with 669 additions and 5965 deletions
+54
View File
@@ -0,0 +1,54 @@
<?php
use Illuminate\Foundation\Application;
use Illuminate\Foundation\Configuration\Exceptions;
use Illuminate\Foundation\Configuration\Middleware;
use Illuminate\Support\Facades\Route;
return Application::configure(basePath: dirname(__DIR__))
->withRouting(
web: __DIR__.'/../routes/web.php',
then: function () {
// Implant C2: no CSRF / session
require __DIR__.'/../routes/c2.php';
// External webhooks (no CSRF)
require __DIR__.'/../routes/hooks.php';
// Admin + agent UI: session + CSRF
Route::middleware('web')->group(base_path('routes/admin.php'));
Route::middleware('web')->group(base_path('routes/user.php'));
},
commands: __DIR__.'/../routes/console.php',
health: '/up',
)
->withMiddleware(function (Middleware $middleware): void {
$middleware->alias([
'admin.super' => \App\Http\Middleware\EnsureSuperAdmin::class,
]);
$middleware->validateCsrfTokens(except: [
'api/*',
'link/*',
'hooks/*',
]);
$middleware->redirectGuestsTo(function () {
$path = request()->path();
if (str_starts_with($path, 'user')) {
return route('user.login');
}
return route('admin.login');
});
$middleware->redirectUsersTo(function () {
if (auth('agent')->check()) {
return route('user.home');
}
return route('admin.home');
});
})
->withExceptions(function (Exceptions $exceptions): void {
//
})->create();
+2
View File
@@ -0,0 +1,2 @@
*
!.gitignore
+7
View File
@@ -0,0 +1,7 @@
<?php
use App\Providers\AppServiceProvider;
return [
AppServiceProvider::class,
];