mirror of
https://github.com/nextcloud/server.git
synced 2026-04-29 18:11:41 -04:00
chore: Check if apps directory is really writable in Installer
...rather than checkServer. Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
parent
12c0cfc977
commit
edf096a09f
2 changed files with 10 additions and 14 deletions
|
|
@ -171,10 +171,20 @@ class Installer {
|
|||
|
||||
/**
|
||||
* Get the path where to install apps
|
||||
*
|
||||
* @throws \RuntimeException if an app folder is marked as writable but is missing permissions
|
||||
*/
|
||||
public function getInstallPath(): ?string {
|
||||
foreach (\OC::$APPSROOTS as $dir) {
|
||||
if (isset($dir['writable']) && $dir['writable'] === true) {
|
||||
// Check if there is a writable install folder.
|
||||
if (!is_writable($dir['path'])
|
||||
|| !is_readable($dir['path'])
|
||||
) {
|
||||
throw new \RuntimeException(
|
||||
'Cannot write into "apps" directory. This can usually be fixed by giving the web server write access to the apps directory or disabling the App Store in the config file.'
|
||||
);
|
||||
}
|
||||
return $dir['path'];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -343,20 +343,6 @@ class OC_Util {
|
|||
}
|
||||
}
|
||||
|
||||
// Check if there is a writable install folder.
|
||||
if ($config->getValue('appstoreenabled', true)) {
|
||||
$installPath = \OCP\Server::get(\OC\Installer::class)->getInstallPath();
|
||||
if ($installPath === null
|
||||
|| !is_writable($installPath)
|
||||
|| !is_readable($installPath)
|
||||
) {
|
||||
$errors[] = [
|
||||
'error' => $l->t('Cannot write into "apps" directory.'),
|
||||
'hint' => $l->t('This can usually be fixed by giving the web server write access to the apps directory'
|
||||
. ' or disabling the App Store in the config file.')
|
||||
];
|
||||
}
|
||||
}
|
||||
// Create root dir.
|
||||
if ($config->getValue('installed', false)) {
|
||||
if (!is_dir($CONFIG_DATADIRECTORY)) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue