You've already forked Epicnabbo-Catalogus-Updated-Daily
🆙 Added fixed cms
This commit is contained in:
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use App\Models\WebsiteDrawBadge;
|
||||
use App\Observers\WebsiteDrawBadgeObserver;
|
||||
use App\Services\PermissionsService;
|
||||
use App\Services\RconService;
|
||||
use App\Services\SettingsService;
|
||||
use App\Services\ViteService;
|
||||
use Filament\Tables\Table;
|
||||
use Illuminate\Foundation\Vite;
|
||||
use Illuminate\Support\Facades\Config;
|
||||
use Illuminate\Support\Facades\URL;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
class AppServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Register any application services.
|
||||
*/
|
||||
#[\Override]
|
||||
public function register(): void
|
||||
{
|
||||
$this->app->bind(
|
||||
Vite::class,
|
||||
ViteService::class,
|
||||
);
|
||||
|
||||
$this->app->singleton(
|
||||
SettingsService::class,
|
||||
fn () => new SettingsService,
|
||||
);
|
||||
|
||||
$this->app->singleton(
|
||||
PermissionsService::class,
|
||||
fn () => new PermissionsService,
|
||||
);
|
||||
|
||||
$this->app->singleton(
|
||||
RconService::class,
|
||||
fn () => new RconService,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Bootstrap any application services.
|
||||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
if (config('habbo.site.force_https')) {
|
||||
URL::forceScheme('https');
|
||||
}
|
||||
|
||||
Table::configureUsing(function (Table $table): void {
|
||||
$table->paginated([10, 25, 50]);
|
||||
});
|
||||
|
||||
$settingsService = app(SettingsService::class);
|
||||
$badgePath = $settingsService->getOrDefault('badge_path_filesystem', '/var/www/gamedata/c_images/album1584');
|
||||
Config::set('filesystems.disks.badges.root', $badgePath);
|
||||
|
||||
$adsPath = $settingsService->getOrDefault('ads_path_filesystem', '/var/www/gamedata/custom');
|
||||
Config::set('filesystems.disks.ads.root', $adsPath);
|
||||
|
||||
WebsiteDrawBadge::observe(WebsiteDrawBadgeObserver::class);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
// use Illuminate\Support\Facades\Gate;
|
||||
use App\Policies\ActivityPolicy;
|
||||
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
|
||||
use Spatie\Activitylog\Models\Activity;
|
||||
|
||||
class AuthServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* The model to policy mappings for the application.
|
||||
*
|
||||
* @var array<class-string, class-string>
|
||||
*/
|
||||
protected $policies = [
|
||||
// 'App\Models\Model' => 'App\Policies\ModelPolicy',
|
||||
Activity::class => ActivityPolicy::class,
|
||||
];
|
||||
|
||||
/**
|
||||
* Register any authentication / authorization services.
|
||||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Support\Facades\Broadcast;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
class BroadcastServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Bootstrap any application services.
|
||||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
Broadcast::routes();
|
||||
|
||||
require base_path('routes/channels.php');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use App\Models\User;
|
||||
use App\Observers\UserObserver;
|
||||
use Illuminate\Auth\Events\Registered;
|
||||
use Illuminate\Auth\Listeners\SendEmailVerificationNotification;
|
||||
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
|
||||
use Illuminate\Support\Facades\Event;
|
||||
|
||||
class EventServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* The event to listener mappings for the application.
|
||||
*
|
||||
* @var array<class-string, array<int, class-string>>
|
||||
*/
|
||||
protected $listen = [
|
||||
Registered::class => [
|
||||
SendEmailVerificationNotification::class,
|
||||
],
|
||||
];
|
||||
|
||||
protected $observers = [
|
||||
User::class => [UserObserver::class],
|
||||
];
|
||||
|
||||
/**
|
||||
* Register any events for your application.
|
||||
*/
|
||||
#[\Override]
|
||||
public function boot(): void {}
|
||||
|
||||
/**
|
||||
* Determine if events and listeners should be automatically discovered.
|
||||
*/
|
||||
#[\Override]
|
||||
public function shouldDiscoverEvents(): bool
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers\Filament;
|
||||
|
||||
use Filament\Http\Middleware\Authenticate;
|
||||
use Filament\Http\Middleware\AuthenticateSession;
|
||||
use Filament\Http\Middleware\DisableBladeIconComponents;
|
||||
use Filament\Http\Middleware\DispatchServingFilamentEvent;
|
||||
use Filament\Pages\Dashboard;
|
||||
use Filament\Panel;
|
||||
use Filament\PanelProvider;
|
||||
use Filament\Support\Colors\Color;
|
||||
use Filament\Widgets\AccountWidget;
|
||||
use Filament\Widgets\FilamentInfoWidget;
|
||||
use Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse;
|
||||
use Illuminate\Cookie\Middleware\EncryptCookies;
|
||||
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken;
|
||||
use Illuminate\Routing\Middleware\SubstituteBindings;
|
||||
use Illuminate\Session\Middleware\StartSession;
|
||||
use Illuminate\View\Middleware\ShareErrorsFromSession;
|
||||
|
||||
class AdminFilamentPanelProvider extends PanelProvider
|
||||
{
|
||||
public function panel(Panel $panel): Panel
|
||||
{
|
||||
return $panel
|
||||
->default()
|
||||
->id('housekeeping')
|
||||
->path('housekeeping')
|
||||
->login()
|
||||
->colors([
|
||||
'primary' => Color::Amber,
|
||||
])
|
||||
->discoverResources(in: app_path('Filament/Resources'), for: 'App\\Filament\\Resources')
|
||||
->discoverPages(in: app_path('Filament/Pages'), for: 'App\\Filament\\Pages')
|
||||
->pages([
|
||||
Dashboard::class,
|
||||
])
|
||||
->discoverWidgets(in: app_path('Filament/Widgets'), for: 'App\\Filament\\Widgets')
|
||||
->widgets([
|
||||
AccountWidget::class,
|
||||
FilamentInfoWidget::class,
|
||||
])
|
||||
->middleware([
|
||||
EncryptCookies::class,
|
||||
AddQueuedCookiesToResponse::class,
|
||||
StartSession::class,
|
||||
AuthenticateSession::class,
|
||||
ShareErrorsFromSession::class,
|
||||
VerifyCsrfToken::class,
|
||||
SubstituteBindings::class,
|
||||
DisableBladeIconComponents::class,
|
||||
DispatchServingFilamentEvent::class,
|
||||
])
|
||||
->authMiddleware([
|
||||
Authenticate::class,
|
||||
])
|
||||
->plugins([]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use App\Actions\Fortify\CreateNewUser;
|
||||
use App\Actions\Fortify\DisableTwoFactorAuthentication;
|
||||
use App\Actions\Fortify\RedirectIfTwoFactorConfirmed;
|
||||
use App\Models\Articles\WebsiteArticle;
|
||||
use App\Models\Miscellaneous\CameraWeb;
|
||||
use Illuminate\Cache\RateLimiting\Limit;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\RateLimiter;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Laravel\Fortify\Actions\AttemptToAuthenticate;
|
||||
use Laravel\Fortify\Actions\EnsureLoginIsNotThrottled;
|
||||
use Laravel\Fortify\Actions\PrepareAuthenticatedSession;
|
||||
use Laravel\Fortify\Features;
|
||||
use Laravel\Fortify\Fortify;
|
||||
|
||||
class FortifyServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Register any application services.
|
||||
*/
|
||||
#[\Override]
|
||||
public function register(): void
|
||||
{
|
||||
$this->app->singleton(
|
||||
\Laravel\Fortify\Actions\DisableTwoFactorAuthentication::class,
|
||||
DisableTwoFactorAuthentication::class,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Bootstrap any application services.
|
||||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
Fortify::createUsersUsing(CreateNewUser::class);
|
||||
|
||||
RateLimiter::for('login', fn (Request $request) => Limit::perMinute(5)->by($request->input('username') . $request->ip()));
|
||||
|
||||
RateLimiter::for('two-factor', fn (Request $request) => Limit::perMinute(5)->by($request->session()->get('login.id')));
|
||||
|
||||
Fortify::loginView(fn () => view(\Illuminate\Auth\Events\Login::class, [
|
||||
'articles' => WebsiteArticle::latest('id')
|
||||
->take(4)
|
||||
->has('user')
|
||||
->with('user:id,username,look')
|
||||
->get(),
|
||||
'photos' => CameraWeb::latest('id')
|
||||
->take(4)
|
||||
->with('user:id,username,look')
|
||||
->get(),
|
||||
]));
|
||||
|
||||
Fortify::registerView(function (Request $request) {
|
||||
if (setting('disable_registration') === '1') {
|
||||
return to_route('welcome')->withErrors([
|
||||
'register' => __('Registration is currently disabled.'),
|
||||
]);
|
||||
}
|
||||
|
||||
return view('auth.register', [
|
||||
'referral_code' => $request->route('referral_code'),
|
||||
'articles' => WebsiteArticle::latest('id')
|
||||
->take(4)
|
||||
->has('user')
|
||||
->with('user:id,username,look')
|
||||
->get(),
|
||||
'photos' => CameraWeb::latest('id')
|
||||
->take(2)
|
||||
->with('user:id,username,look')
|
||||
->get(),
|
||||
]);
|
||||
});
|
||||
|
||||
Fortify::confirmPasswordView(fn () => view('auth.passwords.confirm'));
|
||||
|
||||
Fortify::twoFactorChallengeView(fn () => view('auth.two-factor-challenge'));
|
||||
|
||||
$this->authenticate();
|
||||
}
|
||||
|
||||
private function authenticate()
|
||||
{
|
||||
Fortify::authenticateThrough(fn () => array_filter([
|
||||
config('fortify.limiters.login') ? null : EnsureLoginIsNotThrottled::class,
|
||||
|
||||
Features::enabled(Features::twoFactorAuthentication()) ? RedirectIfTwoFactorConfirmed::class : null,
|
||||
AttemptToAuthenticate::class,
|
||||
PrepareAuthenticatedSession::class,
|
||||
]));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Cache\RateLimiting\Limit;
|
||||
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\RateLimiter;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
||||
class RouteServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* The path to the "home" route for your application.
|
||||
*
|
||||
* Typically, users are redirected here after authentication.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public const HOME = '/user/me';
|
||||
|
||||
/**
|
||||
* Define your route model bindings, pattern filters, and other route configuration.
|
||||
*/
|
||||
#[\Override]
|
||||
public function boot(): void
|
||||
{
|
||||
$this->configureRateLimiting();
|
||||
|
||||
$this->routes(function (): void {
|
||||
Route::middleware('api')
|
||||
->prefix('api')
|
||||
->group(base_path('routes/api.php'));
|
||||
|
||||
Route::middleware('web')
|
||||
->group(base_path('routes/web.php'));
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Configure the rate limiters for the application.
|
||||
*/
|
||||
protected function configureRateLimiting(): void
|
||||
{
|
||||
RateLimiter::for('api', fn (Request $request) => Limit::perMinute(60)->by($request->user()?->id ?: $request->ip()));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user