Skip to content

Commit ffe75b1

Browse files
authored
remove annoying check (#3517)
1 parent b0dc5ff commit ffe75b1

4 files changed

Lines changed: 46 additions & 49 deletions

File tree

app/Actions/Diagnostics/Pipes/Checks/BasicPermissionCheck.php

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
use App\Contracts\DiagnosticPipe;
1313
use App\DTO\DiagnosticData;
1414
use App\Enum\StorageDiskType;
15+
use App\Exceptions\ConfigurationKeyMissingException;
1516
use App\Exceptions\Handler;
1617
use App\Exceptions\Internal\InvalidConfigOption;
1718
use App\Facades\Helpers;
@@ -169,9 +170,15 @@ public function userCSS(array &$data): void
169170
}
170171
// @codeCoverageIgnoreEnd
171172
}
172-
if (Configs::getValueAsBool('disable_recursive_permission_check')) {
173-
$data[] = DiagnosticData::info('Full directory permission check is disabled', self::class);
173+
try {
174+
if (Configs::getValueAsBool('disable_recursive_permission_check')) {
175+
$data[] = DiagnosticData::info('Full directory permission check is disabled', self::class);
176+
}
177+
// @codeCoverageIgnoreStart
178+
} catch (ConfigurationKeyMissingException) {
179+
// we do nothing. Silently catch and ignore.
174180
}
181+
// @codeCoverageIgnoreEnd
175182
}
176183

177184
/**
@@ -260,9 +267,15 @@ private function checkDirectoryPermissionsRecursively(string $path, array &$data
260267
}
261268

262269
$dir = new \DirectoryIterator($path);
263-
if (Configs::getValueAsBool('disable_recursive_permission_check')) {
270+
try {
271+
if (Configs::getValueAsBool('disable_recursive_permission_check')) {
272+
return;
273+
}
274+
} catch (ConfigurationKeyMissingException) {
275+
// We skip the check, we can come back later when the config value is available.
264276
return;
265277
}
278+
266279
// @codeCoverageIgnoreStart
267280
foreach ($dir as $dir_entry) {
268281
if ($dir_entry->isDir() && !$dir_entry->isDot()) {

app/Actions/InstallUpdate/ApplyUpdate.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
namespace App\Actions\InstallUpdate;
1010

11-
use App\Actions\InstallUpdate\Pipes\AllowMigrationCheck;
1211
use App\Actions\InstallUpdate\Pipes\ArtisanMigrate;
1312
use App\Actions\InstallUpdate\Pipes\BranchCheck;
1413
use App\Actions\InstallUpdate\Pipes\ComposerCall;
@@ -23,7 +22,6 @@ class ApplyUpdate
2322
*/
2423
private array $pipes = [
2524
BranchCheck::class,
26-
AllowMigrationCheck::class,
2725
GitPull::class,
2826
ArtisanMigrate::class,
2927
ComposerCall::class,

app/Actions/InstallUpdate/Pipes/AllowMigrationCheck.php

Lines changed: 0 additions & 44 deletions
This file was deleted.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
3+
/**
4+
* SPDX-License-Identifier: MIT
5+
* Copyright (c) 2017-2018 Tobias Reich
6+
* Copyright (c) 2018-2025 LycheeOrg.
7+
*/
8+
9+
use App\Models\Extensions\BaseConfigMigrationReversed;
10+
11+
return new class() extends BaseConfigMigrationReversed {
12+
public function getConfigs(): array
13+
{
14+
return [
15+
[
16+
'key' => 'force_migration_in_production',
17+
'value' => '0',
18+
'cat' => 'Admin',
19+
'type_range' => self::BOOL,
20+
'description' => 'Force migration even if app is in production mode',
21+
'details' => '',
22+
'is_secret' => false,
23+
'level' => 0,
24+
'order' => 4,
25+
'not_on_docker' => true,
26+
'is_expert' => true,
27+
],
28+
];
29+
}
30+
};

0 commit comments

Comments
 (0)