mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-05-17 02:35:02 +00:00
latest database backups included into the admin settings
This commit is contained in:
@@ -1,15 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Users\Models\User;
|
||||
use Illuminate\Console\Command;
|
||||
use Domain\Settings\Models\Setting;
|
||||
use Illuminate\Foundation\Testing\WithFaker;
|
||||
use Domain\Pages\Actions\SeedDefaultPagesAction;
|
||||
use Domain\Settings\Actions\SeedDefaultSettingsAction;
|
||||
use Domain\Localization\Actions\SeedDefaultLanguageAction;
|
||||
use Domain\SetupWizard\Actions\CreateDiskDirectoriesAction;
|
||||
use Illuminate\Foundation\Testing\WithFaker;
|
||||
|
||||
class SetupProdEnvironment extends Command
|
||||
{
|
||||
@@ -29,11 +28,10 @@ class SetupProdEnvironment extends Command
|
||||
|
||||
public function __construct(
|
||||
private CreateDiskDirectoriesAction $createDiskDirectories,
|
||||
private SeedDefaultSettingsAction $seedDefaultSettings,
|
||||
private SeedDefaultLanguageAction $seedDefaultLanguage,
|
||||
private SeedDefaultPagesAction $seedDefaultPages,
|
||||
)
|
||||
{
|
||||
private SeedDefaultSettingsAction $seedDefaultSettings,
|
||||
private SeedDefaultLanguageAction $seedDefaultLanguage,
|
||||
private SeedDefaultPagesAction $seedDefaultPages,
|
||||
) {
|
||||
parent::__construct();
|
||||
$this->setUpFaker();
|
||||
}
|
||||
@@ -199,16 +197,16 @@ class SetupProdEnvironment extends Command
|
||||
});
|
||||
|
||||
if ($this->argument('license') === 'extended') {
|
||||
$choice = $this->choice("Choose subscription type", [
|
||||
$choice = $this->choice('Choose subscription type', [
|
||||
'metered' => 'Metered',
|
||||
'fixed' => 'Fixed',
|
||||
'none' => 'None',
|
||||
]);
|
||||
|
||||
Setting::updateOrCreate([
|
||||
'name' => 'subscription_type'
|
||||
'name' => 'subscription_type',
|
||||
], [
|
||||
'value' => $choice
|
||||
'value' => $choice,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
<?php
|
||||
namespace App\Console;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Console\Scheduling\Schedule;
|
||||
use App\Console\Commands\SetupDevEnvironment;
|
||||
use App\Console\Commands\SetupProdEnvironment;
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Users\Actions;
|
||||
|
||||
use App\Users\Models\User;
|
||||
use App\Users\DTO\CreateUserData;
|
||||
use App\Http\Controllers\Controller;
|
||||
use Domain\Teams\Models\TeamFolderInvitation;
|
||||
use Domain\Teams\Models\TeamFolderMember;
|
||||
use Illuminate\Auth\Events\Registered;
|
||||
use Domain\Teams\Models\TeamFolderMember;
|
||||
use Domain\Teams\Models\TeamFolderInvitation;
|
||||
|
||||
class CreateNewUserAction extends Controller
|
||||
{
|
||||
public function __construct(
|
||||
protected AutoSubscribeForMeteredBillingAction $autoSubscribeForMeteredBilling,
|
||||
) {}
|
||||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate and create a new user.
|
||||
@@ -61,7 +61,7 @@ class CreateNewUserAction extends Controller
|
||||
}
|
||||
|
||||
// Mark as verified if verification is disabled
|
||||
if (!$data->password || !intval($settings['user_verification'])) {
|
||||
if (! $data->password || ! intval($settings['user_verification'])) {
|
||||
$user->markEmailAsVerified();
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,8 @@ class IndexController
|
||||
{
|
||||
public function __construct(
|
||||
public GetServerSetupStatusAction $getServerSetupStatus,
|
||||
) {}
|
||||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Show index page
|
||||
@@ -34,7 +35,8 @@ class IndexController
|
||||
|
||||
// Get all settings
|
||||
$settings = get_settings_in_json();
|
||||
} catch (PDOException $e) {}
|
||||
} catch (PDOException $e) {
|
||||
}
|
||||
|
||||
if ($setup_status === 'installation-needed') {
|
||||
$status_check = ($this->getServerSetupStatus)();
|
||||
|
||||
@@ -1,21 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace Domain\Settings\Controllers;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Storage;
|
||||
use Support\Status\Actions\GetServerSetupStatusAction;
|
||||
|
||||
class GetServerStatusController
|
||||
{
|
||||
public function __construct(
|
||||
public GetServerSetupStatusAction $getServerSetupStatus,
|
||||
) {}
|
||||
) {
|
||||
}
|
||||
|
||||
public function __invoke(): array
|
||||
{
|
||||
// Get server data
|
||||
$status = ($this->getServerSetupStatus)();
|
||||
|
||||
// Add latest database backups
|
||||
$status['backups'] = collect(Storage::allFiles('app-backup'))
|
||||
->map(fn ($path) => str_replace('app-backup/', '', $path))
|
||||
->reverse()
|
||||
->values()
|
||||
->take(5);
|
||||
|
||||
// Add cron info
|
||||
$status['cron'] = [
|
||||
'running' => isRunningCron(),
|
||||
@@ -24,4 +31,4 @@ class GetServerStatusController
|
||||
|
||||
return $status;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace Domain\Settings\Controllers;
|
||||
|
||||
use Artisan;
|
||||
use Domain\Settings\Requests\StoreEmailCredentialsRequest;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
use Domain\Settings\Requests\StoreEmailCredentialsRequest;
|
||||
|
||||
class StoreEmailCredentialsController
|
||||
{
|
||||
@@ -17,8 +15,7 @@ class StoreEmailCredentialsController
|
||||
// Abort in demo mode
|
||||
abort_if(is_demo(), 204, 'Done.');
|
||||
|
||||
if (!app()->runningUnitTests()) {
|
||||
|
||||
if (! app()->runningUnitTests()) {
|
||||
$mail = [
|
||||
'log' => [
|
||||
'MAIL_DRIVER' => 'log',
|
||||
|
||||
@@ -23,10 +23,10 @@ class StoreEmailCredentialsRequest extends FormRequest
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'mailDriver' => 'required|string',
|
||||
'smtp' => 'sometimes|array',
|
||||
'ses' => 'sometimes|array',
|
||||
'mailgun' => 'sometimes|array',
|
||||
'mailDriver' => 'required|string',
|
||||
'smtp' => 'sometimes|array',
|
||||
'ses' => 'sometimes|array',
|
||||
'mailgun' => 'sometimes|array',
|
||||
'postmark' => 'sometimes|array',
|
||||
];
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
namespace Domain\SetupWizard\Controllers;
|
||||
|
||||
use App\Users\Models\User;
|
||||
use Artisan;
|
||||
use App\Users\Models\User;
|
||||
use Illuminate\Http\Response;
|
||||
use Domain\Settings\Models\Setting;
|
||||
use App\Http\Controllers\Controller;
|
||||
@@ -61,9 +61,9 @@ class CreateAdminAccountController extends Controller
|
||||
],
|
||||
])->each(function ($col) {
|
||||
Setting::updateOrCreate([
|
||||
'name' => $col['name']
|
||||
'name' => $col['name'],
|
||||
], [
|
||||
'value' => $col['value']
|
||||
'value' => $col['value'],
|
||||
]);
|
||||
});
|
||||
|
||||
|
||||
@@ -82,9 +82,9 @@ class StoreAppSettingsController extends Controller
|
||||
],
|
||||
])->each(function ($col) {
|
||||
Setting::updateOrCreate([
|
||||
'name' => $col['name']
|
||||
'name' => $col['name'],
|
||||
], [
|
||||
'value' => $col['value']
|
||||
'value' => $col['value'],
|
||||
]);
|
||||
});
|
||||
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
<?php
|
||||
namespace Domain\SetupWizard\Controllers;
|
||||
|
||||
use Artisan;
|
||||
use DB;
|
||||
use Artisan;
|
||||
use Illuminate\Http\Response;
|
||||
use Domain\Settings\Models\Setting;
|
||||
use App\Http\Controllers\Controller;
|
||||
use Doctrine\DBAL\Driver\PDOException;
|
||||
use Symfony\Component\HttpKernel\Exception\HttpException;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
namespace Domain\SetupWizard\Controllers;
|
||||
|
||||
use Artisan;
|
||||
@@ -14,9 +13,8 @@ class StoreEnvironmentSettingsController extends Controller
|
||||
*/
|
||||
public function __invoke(
|
||||
StoreEnvironmentSetupRequest $request,
|
||||
): Response
|
||||
{
|
||||
if (!app()->runningUnitTests()) {
|
||||
): Response {
|
||||
if (! app()->runningUnitTests()) {
|
||||
$drivers = [
|
||||
'local' => [
|
||||
'FILESYSTEM_DRIVER' => 'local',
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
namespace Domain\SetupWizard\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
@@ -2,10 +2,9 @@
|
||||
namespace Domain\Teams\Controllers;
|
||||
|
||||
use App\Users\Models\User;
|
||||
use Domain\Teams\Models\TeamFolderMember;
|
||||
use Illuminate\Http\Response;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use App\Http\Controllers\Controller;
|
||||
use Domain\Teams\Models\TeamFolderMember;
|
||||
use Domain\Teams\Models\TeamFolderInvitation;
|
||||
use Illuminate\Contracts\Routing\ResponseFactory;
|
||||
use Domain\Teams\Resources\TeamInvitationResource;
|
||||
|
||||
@@ -31,13 +31,15 @@ class TeamFolderInvitation extends Model
|
||||
|
||||
protected $keyType = 'string';
|
||||
|
||||
public function accept() {
|
||||
public function accept()
|
||||
{
|
||||
$this->update([
|
||||
'status' => 'accepted',
|
||||
]);
|
||||
}
|
||||
|
||||
public function reject() {
|
||||
public function reject()
|
||||
{
|
||||
$this->update([
|
||||
'status' => 'rejected',
|
||||
]);
|
||||
|
||||
@@ -13,11 +13,11 @@ class TeamInvitationResource extends JsonResource
|
||||
'id' => $this->id,
|
||||
'type' => 'invitation',
|
||||
'attributes' => [
|
||||
'parent_id' => $this->parent_id,
|
||||
'email' => $this->email,
|
||||
'color' => $this->color,
|
||||
'status' => $this->status,
|
||||
'permission' => $this->permission,
|
||||
'parent_id' => $this->parent_id,
|
||||
'email' => $this->email,
|
||||
'color' => $this->color,
|
||||
'status' => $this->status,
|
||||
'permission' => $this->permission,
|
||||
'isExistedUser' => User::where('email', $this->email)->exists(),
|
||||
],
|
||||
'relationships' => [
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
namespace Support\Status\Actions;
|
||||
|
||||
class GetServerSetupStatusAction
|
||||
@@ -58,4 +57,4 @@ class GetServerSetupStatusAction
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user