From 995ff893c770eb9f4ee397b9ddc197e366e7bdeb Mon Sep 17 00:00:00 2001
From: Julian Prieber <60265788+JulianPrieber@users.noreply.github.com>
Date: Fri, 2 Dec 2022 16:30:10 +0100
Subject: [PATCH] Skipping installer when instaled for docker
---
resources/views/installer/installer.blade.php | 13 +++++++++----
routes/web.php | 11 ++++++++---
2 files changed, 17 insertions(+), 7 deletions(-)
diff --git a/resources/views/installer/installer.blade.php b/resources/views/installer/installer.blade.php
index 9488545..0284c95 100644
--- a/resources/views/installer/installer.blade.php
+++ b/resources/views/installer/installer.blade.php
@@ -6,7 +6,13 @@
@if($_SERVER['QUERY_STRING'] === '')
{{-- Landing page --}}
-
+
+@if(!DB::table('users')->get()->isEmpty())
+ @php
+ if(file_exists(base_path("INSTALLING"))){unlink(base_path("INSTALLING"));}
+ header("Refresh:0");
+ @endphp
+@else
@@ -19,10 +25,9 @@
2. Setup the database
3. Create the admin user
4. Configure the app
-
-
+
-
+@endif
@endif
diff --git a/routes/web.php b/routes/web.php
index 6c37b12..d28c138 100755
--- a/routes/web.php
+++ b/routes/web.php
@@ -39,6 +39,14 @@ if(file_exists(base_path('INSTALLING'))){
Route::post('/options', [InstallerController::class, 'options'])->name('options');
Route::get('/mysql-test', [InstallerController::class, 'mysqlTest'])->name('mysqlTest');
+ Route::get('{any}', function() {
+ if(!DB::table('users')->get()->isEmpty()){
+ if(file_exists(base_path("INSTALLING"))){unlink(base_path("INSTALLING"));header("Refresh:0");}
+ } else {
+ return redirect(url(''));
+ }
+ })->where('any', '.*');
+
}else{
// Disables routes if in Maintenance Mode
@@ -101,7 +109,6 @@ Route::get('/studio/links/all', [UserController::class, 'showLinksAll'])->name('
Route::get('/studio/theme', [UserController::class, 'showTheme'])->name('showTheme');
Route::post('/studio/theme', [UserController::class, 'editTheme'])->name('editTheme');
Route::get('/deleteLink/{id}', [UserController::class, 'deleteLink'])->name('deleteLink');
-Route::get('/clearIcon/{id}', [UserController::class, 'clearIcon'])->name('clearIcon');
Route::get('/upLink/{up}/{id}', [UserController::class, 'upLink'])->name('upLink');
Route::post('/studio/edit-link/{id}', [UserController::class, 'editLink'])->name('editLink');
Route::get('/studio/button-editor/{id}', [UserController::class, 'showCSS'])->name('showCSS');
@@ -146,8 +153,6 @@ Route::group([
Route::post('/panel/env', [AdminController::class, 'editENV'])->name('editENV');
Route::get('/panel/site', [AdminController::class, 'showSite'])->name('showSite');
Route::post('/panel/site', [AdminController::class, 'editSite'])->name('editSite');
- Route::get('/panel/site/delavatar', [AdminController::class, 'delAvatar'])->name('delAvatar');
- Route::get('/panel/site/delfavicon', [AdminController::class, 'delFavicon'])->name('delFavicon');
Route::get('/panel/phpinfo', [AdminController::class, 'phpinfo'])->name('phpinfo');
Route::get('/panel/backups', [AdminController::class, 'showBackups'])->name('showBackups');
Route::post('/panel/theme', [AdminController::class, 'deleteTheme'])->name('deleteTheme');