* Remove the autoupdater #1133 * Remove self-updater package * Package still needed :|
This commit is contained in:
@@ -7,9 +7,6 @@ use App\Events\CronNightly;
|
||||
use App\Services\VersionService;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
/**
|
||||
* Determine if any pilots should be set to ON LEAVE status
|
||||
*/
|
||||
class NewVersionCheck extends Listener
|
||||
{
|
||||
private $versionSvc;
|
||||
|
||||
@@ -7,29 +7,24 @@ use App\Repositories\KvpRepository;
|
||||
use App\Services\CronService;
|
||||
use App\Services\VersionService;
|
||||
use App\Support\Utils;
|
||||
use Codedge\Updater\UpdaterManager;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Artisan;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Laracasts\Flash\Flash;
|
||||
use Nwidart\Modules\Facades\Module;
|
||||
|
||||
class MaintenanceController extends Controller
|
||||
{
|
||||
private $cronSvc;
|
||||
private $kvpRepo;
|
||||
private $updateManager;
|
||||
private $versionSvc;
|
||||
|
||||
public function __construct(
|
||||
CronService $cronSvc,
|
||||
KvpRepository $kvpRepo,
|
||||
UpdaterManager $updateManager,
|
||||
VersionService $versionSvc
|
||||
) {
|
||||
$this->cronSvc = $cronSvc;
|
||||
$this->kvpRepo = $kvpRepo;
|
||||
$this->updateManager = $updateManager;
|
||||
$this->versionSvc = $versionSvc;
|
||||
}
|
||||
|
||||
@@ -106,24 +101,6 @@ class MaintenanceController extends Controller
|
||||
return redirect(route('admin.maintenance.index'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the phpVMS install
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function update(Request $request)
|
||||
{
|
||||
$new_version_tag = $this->kvpRepo->get('latest_version_tag');
|
||||
Log::info('Attempting to update to '.$new_version_tag);
|
||||
|
||||
$module = Module::find('updater');
|
||||
$module->enable();
|
||||
|
||||
return redirect('/update/downloader');
|
||||
}
|
||||
|
||||
/**
|
||||
* Enable the cron, or if it's enabled, change the ID that is used
|
||||
*
|
||||
|
||||
@@ -3,49 +3,32 @@
|
||||
namespace App\Http\Controllers\System;
|
||||
|
||||
use App\Contracts\Controller;
|
||||
use App\Repositories\KvpRepository;
|
||||
use App\Services\AnalyticsService;
|
||||
use App\Services\Installer\InstallerService;
|
||||
use App\Services\Installer\MigrationService;
|
||||
use App\Services\Installer\SeederService;
|
||||
use Codedge\Updater\UpdaterManager;
|
||||
use function count;
|
||||
use Illuminate\Contracts\View\Factory;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\View\View;
|
||||
|
||||
class UpdateController extends Controller
|
||||
{
|
||||
private $analyticsSvc;
|
||||
private $installerSvc;
|
||||
private $kvpRepo;
|
||||
private $migrationSvc;
|
||||
private $seederSvc;
|
||||
private $updateManager;
|
||||
|
||||
/**
|
||||
* @param AnalyticsService $analyticsSvc
|
||||
* @param InstallerService $installerSvc
|
||||
* @param KvpRepository $kvpRepo
|
||||
* @param MigrationService $migrationSvc
|
||||
* @param SeederService $seederSvc
|
||||
* @param UpdaterManager $updateManager
|
||||
*/
|
||||
public function __construct(
|
||||
AnalyticsService $analyticsSvc,
|
||||
InstallerService $installerSvc,
|
||||
KvpRepository $kvpRepo,
|
||||
MigrationService $migrationSvc,
|
||||
SeederService $seederSvc,
|
||||
UpdaterManager $updateManager
|
||||
SeederService $seederSvc
|
||||
) {
|
||||
$this->analyticsSvc = $analyticsSvc;
|
||||
$this->migrationSvc = $migrationSvc;
|
||||
$this->seederSvc = $seederSvc;
|
||||
$this->installerSvc = $installerSvc;
|
||||
$this->kvpRepo = $kvpRepo;
|
||||
$this->updateManager = $updateManager;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -107,38 +90,4 @@ class UpdateController extends Controller
|
||||
{
|
||||
return redirect('/admin');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the update page with the latest version
|
||||
*
|
||||
* @return Factory|View
|
||||
*/
|
||||
public function updater()
|
||||
{
|
||||
$version = $this->kvpRepo->get('latest_version_tag');
|
||||
|
||||
return view('system.updater.downloader/downloader', [
|
||||
'version' => $version,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Download the actual update and then forward the user to the updater page
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function update_download()
|
||||
{
|
||||
$version = $this->kvpRepo->get('latest_version_tag');
|
||||
if (empty($version)) {
|
||||
return view('system.updater.steps.step1-no-update');
|
||||
}
|
||||
|
||||
$release = $this->updateManager->source('github')->fetch($version);
|
||||
$this->updateManager->source('github')->update($release);
|
||||
$this->analyticsSvc->sendUpdate();
|
||||
|
||||
Log::info('Update completed to '.$version.', redirecting');
|
||||
return redirect('/update');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,10 +90,6 @@ class RouteServiceProvider extends ServiceProvider
|
||||
|
||||
Route::post('/run-migrations', 'UpdateController@run_migrations')->name('run_migrations');
|
||||
Route::get('/complete', 'UpdateController@complete')->name('complete');
|
||||
|
||||
// Routes for the update downloader
|
||||
Route::get('/downloader', 'UpdateController@updater')->name('updater');
|
||||
Route::post('/downloader', 'UpdateController@update_download')->name('update_download');
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
26
composer.lock
generated
26
composer.lock
generated
@@ -4,20 +4,20 @@
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "882504a81fb8c4daf946022b51b73f93",
|
||||
"content-hash": "9306757768b0fad9102766b70d4e18d8",
|
||||
"packages": [
|
||||
{
|
||||
"name": "akaunting/money",
|
||||
"version": "1.2.1",
|
||||
"version": "1.2.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/akaunting/laravel-money.git",
|
||||
"reference": "38e3af880653700d7e67ca028d6d5f422eda96b5"
|
||||
"reference": "a60cd786ac85e290ff1fa62b104ae04df2dcbd30"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/akaunting/laravel-money/zipball/38e3af880653700d7e67ca028d6d5f422eda96b5",
|
||||
"reference": "38e3af880653700d7e67ca028d6d5f422eda96b5",
|
||||
"url": "https://api.github.com/repos/akaunting/laravel-money/zipball/a60cd786ac85e290ff1fa62b104ae04df2dcbd30",
|
||||
"reference": "a60cd786ac85e290ff1fa62b104ae04df2dcbd30",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -67,10 +67,10 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/akaunting/laravel-money/issues",
|
||||
"source": "https://github.com/akaunting/laravel-money/tree/1.2.1"
|
||||
"source": "https://github.com/akaunting/laravel-money/tree/1.2.2"
|
||||
},
|
||||
"abandoned": "akaunting/laravel-money",
|
||||
"time": "2021-03-05T12:06:16+00:00"
|
||||
"time": "2021-05-19T19:42:05+00:00"
|
||||
},
|
||||
{
|
||||
"name": "anhskohbo/no-captcha",
|
||||
@@ -1285,16 +1285,16 @@
|
||||
},
|
||||
{
|
||||
"name": "doctrine/cache",
|
||||
"version": "1.11.1",
|
||||
"version": "1.11.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/doctrine/cache.git",
|
||||
"reference": "163074496dc7c3c7b8ccbf3d4376c0187424ed81"
|
||||
"reference": "9c53086695937c50c47936ed86d96150ffbcf60d"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/doctrine/cache/zipball/163074496dc7c3c7b8ccbf3d4376c0187424ed81",
|
||||
"reference": "163074496dc7c3c7b8ccbf3d4376c0187424ed81",
|
||||
"url": "https://api.github.com/repos/doctrine/cache/zipball/9c53086695937c50c47936ed86d96150ffbcf60d",
|
||||
"reference": "9c53086695937c50c47936ed86d96150ffbcf60d",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1364,7 +1364,7 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/doctrine/cache/issues",
|
||||
"source": "https://github.com/doctrine/cache/tree/1.11.1"
|
||||
"source": "https://github.com/doctrine/cache/tree/1.11.2"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -1380,7 +1380,7 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2021-05-18T16:45:32+00:00"
|
||||
"time": "2021-05-20T14:57:29+00:00"
|
||||
},
|
||||
{
|
||||
"name": "doctrine/dbal",
|
||||
|
||||
@@ -7,22 +7,12 @@
|
||||
<div class="row" style="padding-top: 5px">
|
||||
<div class="col-sm-12">
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<div class="col-sm-12">
|
||||
<p>Force new version check</p>
|
||||
{{ Form::open(['route' => 'admin.maintenance.forcecheck']) }}
|
||||
{{ Form::button('Force update check', ['type' => 'submit', 'class' => 'btn btn-success']) }}
|
||||
{{ Form::close() }}
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
@if ($new_version)
|
||||
<p>An update to version {{ $new_version_tag }} is available.</p>
|
||||
{{ Form::open(['route' => 'admin.maintenance.update']) }}
|
||||
{{ Form::button('Update', ['type' => 'submit', 'class' => 'btn btn-success']) }}
|
||||
{{ Form::close() }}
|
||||
@else
|
||||
<p>There is no new version available</p>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -75,7 +75,7 @@
|
||||
@endability
|
||||
|
||||
@ability('admin', 'modules')
|
||||
<li><a href="{!! url('/admin/modules') !!}"><i class="pe-7s-box2"></i>Modules Manager</a></li>
|
||||
<li><a href="{!! url('/admin/modules') !!}"><i class="pe-7s-box2"></i>addons/modules</a></li>
|
||||
@endability
|
||||
|
||||
@ability('admin', 'maintenance')
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
@extends('admin.app')
|
||||
@section('title', "Modules Manager")
|
||||
@section('title', 'modules')
|
||||
@section('actions')
|
||||
<li>
|
||||
<a href="{{ route('admin.modules.create') }}">
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
@extends('system.updater.app')
|
||||
@section('title', 'Update phpVMS')
|
||||
|
||||
@section('content')
|
||||
<h2>phpvms updater</h2>
|
||||
<p>Click run to complete the update to version {{ $version }}</p>
|
||||
{{ Form::open(['route' => 'update.update_download', 'method' => 'post']) }}
|
||||
<p style="text-align: right">
|
||||
{{ Form::submit('Run >>', ['class' => 'btn btn-success']) }}
|
||||
</p>
|
||||
{{ Form::close() }}
|
||||
@endsection
|
||||
Reference in New Issue
Block a user