Files
zemailnator/routes/web.php
idevakk c312ec3325 feat: Prepare Zemailnator for Dokploy deployment
- Add highly optimized Dockerfile with Nginx and PHP-FPM 8.4
- Add docker-compose.yml configured with Redis and MariaDB 10.11
- Implement entrypoint.sh and supervisord.conf for background workers
- Refactor legacy IMAP scripts into scheduled Artisan Commands
- Secure app by removing old routes with hardcoded basic auth credentials
- Configure email attachments to use Laravel Storage instead of insecure public/tmp
2026-02-28 23:17:39 +05:30

108 lines
4.6 KiB
PHP

<?php
use App\Http\Controllers\AppController;
use App\Http\Controllers\ImpersonationController;
use App\Http\Controllers\WebhookController;
use App\Http\Middleware\CheckPageSlug;
use App\Http\Middleware\CheckUserBanned;
use App\Livewire\AddOn;
use App\Livewire\Blog;
use App\Livewire\Dashboard\Bulk;
use App\Livewire\Dashboard\BulkGmail;
use App\Livewire\Dashboard\Dashboard;
use App\Livewire\Dashboard\Mailbox\Inbox;
use App\Livewire\Dashboard\Support;
use App\Livewire\Frontend\Mailbox;
use App\Livewire\Home;
use App\Livewire\ListBlog;
use App\Livewire\Page;
use App\Livewire\Settings\Appearance;
use App\Livewire\Settings\Billing;
use App\Livewire\Settings\Password;
use App\Livewire\Settings\Profile;
use App\Models\Email;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Request;
use Illuminate\Support\Facades\Route;
Route::get('/health', function () {
return response('OK', 200);
});
Route::get('/', Home::class)->name('home');
Route::get('/mailbox', Mailbox::class)->name('mailbox');
Route::get('/mailbox/{email?}', [AppController::class, 'mailbox'])->name('mailboxFromURL');
Route::get('/switch/{email}', [AppController::class, 'switch'])->name('switch');
Route::get('/switchP/{email}', [AppController::class, 'switchP'])->name('switchP');
Route::get('/delete/{email?}', [AppController::class, 'delete'])->name('delete');
Route::get('/deleteP/{email?}', [AppController::class, 'deleteP'])->name('deleteP');
Route::get('locale/{locale}', [AppController::class, 'locale'])->name('locale');
Route::get('/blog', ListBlog::class)->name('list-blog');
Route::get('/blog/{slug}', Blog::class)->name('blog');
Route::post('/sync', function (Request $request) {
try {
if (config('app.auto_fetch_mail')) {
Email::fetchProcessStoreEmail();
}
} catch (Exception $e) {
Log::error($e->getMessage());
}
return response()->noContent();
});
Route::get('disposable-email', AddOn::class)->name('disposable-email');
Route::get('disposable-gmail', AddOn::class)->name('disposable-gmail');
Route::get('disposable-outlook', AddOn::class)->name('disposable-outlook');
Route::get('disposable-yahoo', AddOn::class)->name('disposable-yahoo');
Route::get('gmailnator', AddOn::class)->name('gmailnator');
Route::get('emailnator', AddOn::class)->name('emailnator');
Route::get('temp-gmail', AddOn::class)->name('temp-gmail');
Route::middleware(['auth', 'verified', CheckUserBanned::class])->group(function (): void {
Route::get('dashboard', Dashboard::class)->name('dashboard');
Route::get('dashboard/generate-premium-email', Inbox::class)->name('dashboard.premium');
Route::get('dashboard/generate-10minute-email', Dashboard::class)->name('dashboard.10minute');
Route::get('dashboard/bulk-email-generator', Bulk::class)->name('dashboard.bulk');
Route::get('dashboard/bulk-gmail-generator', BulkGmail::class)->name('dashboard.bulkGmail');
Route::get('dashboard/compose-email', Dashboard::class)->name('dashboard.compose');
Route::get('dashboard/support', Support::class)->name('dashboard.support');
// LEGACY: Payment status routes (used by both legacy and unified systems)
Route::get('dashboard/success', [Dashboard::class, 'paymentStatus'])->name('checkout.success')->defaults('status', 'success');
Route::get('dashboard/cancel', [Dashboard::class, 'paymentStatus'])->name('checkout.cancel')->defaults('status', 'cancel');
Route::get('dashboard/billing', fn () => auth()->user()->redirectToBillingPortal(route('dashboard')))->name('billing');
// Impersonation Routes
Route::prefix('impersonation')->name('impersonation.')->group(function (): void {
Route::post('/stop', [ImpersonationController::class, 'stop'])->name('stop');
Route::get('/status', [ImpersonationController::class, 'status'])->name('status');
Route::get('/start/{user}', [ImpersonationController::class, 'start'])->name('start');
});
});
Route::middleware(['auth'])->group(function (): void {
Route::redirect('settings', 'settings/profile');
Route::get('settings/profile', Profile::class)->name('settings.profile');
Route::get('settings/billing', Billing::class)->name('settings.billing');
Route::get('settings/password', Password::class)->name('settings.password');
Route::get('settings/appearance', Appearance::class)->name('settings.appearance');
});
Route::post('/webhook/oxapayLegacy', [WebhookController::class, 'oxapay'])->name('webhook.oxapayLegacy');
// Unified Payment System Routes
require __DIR__.'/payment.php';
require __DIR__.'/auth.php';
Route::get('{slug}', Page::class)->where('slug', '.*')->name('page')->middleware(CheckPageSlug::class);