Skip to content

Commit

Permalink
Skipping installer when instaled for docker
Browse files Browse the repository at this point in the history
  • Loading branch information
JulianPrieber committed Dec 2, 2022
1 parent 4adf239 commit 995ff89
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
13 changes: 9 additions & 4 deletions resources/views/installer/installer.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
<div class="logo-container fadein">
<img class="logo-img" src="{{ asset('littlelink/images/logo.svg') }}" alt="Logo">
</div>
Expand All @@ -19,10 +25,9 @@
2. Setup the database<br>
3. Create the admin user<br>
4. Configure the app<br>
</div></p>
<div class="row">
</div></p>
&ensp;<a class="btn" href="{{url('?2')}}"><button>Next</button></a>&ensp;
</div>
@endif

@endif

Expand Down
11 changes: 8 additions & 3 deletions routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@
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
Expand Down Expand Up @@ -101,7 +109,6 @@
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');
Expand Down Expand Up @@ -146,8 +153,6 @@
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');
Expand Down

0 comments on commit 995ff89

Please sign in to comment.