diff --git a/src/Console/Storage.php b/src/Console/Storage.php index d0a2a6663..a048d74ff 100644 --- a/src/Console/Storage.php +++ b/src/Console/Storage.php @@ -23,6 +23,7 @@ namespace Friendica\Console; use Asika\SimpleConsole\CommandArgsException; use Friendica\Core\StorageManager; +use Friendica\Model\Storage\StorageException; /** * tool to manage storage backend and stored data from CLI @@ -165,6 +166,10 @@ HELP; $current = $this->storageManager->getBackend(); $total = 0; + if (is_null($current)) { + throw new StorageException(sprintf("Cannot move to legacy storage. Please select a storage backend.")); + } + do { $moved = $this->storageManager->move($current, $tables, $this->getOption('n', 5000)); if ($moved) { diff --git a/src/Core/StorageManager.php b/src/Core/StorageManager.php index c8385783e..6fadcb52b 100644 --- a/src/Core/StorageManager.php +++ b/src/Core/StorageManager.php @@ -305,13 +305,13 @@ class StorageManager $data = $source->get($sourceRef); } - $this->logger->info('Save data to new backend.', ['newBackend' => $destination]); + $this->logger->info('Save data to new backend.', ['newBackend' => $destination::getName()]); $destinationRef = $destination->put($data); $this->logger->info('Saved data.', ['newReference' => $destinationRef]); if ($destinationRef !== '') { $this->logger->info('update row'); - if ($this->dba->update($table, ['backend-class' => $destination, 'backend-ref' => $destinationRef, 'data' => ''], ['id' => $id])) { + if ($this->dba->update($table, ['backend-class' => $destination::getName(), 'backend-ref' => $destinationRef, 'data' => ''], ['id' => $id])) { if (!empty($source)) { $this->logger->info('Delete data from old backend.', ['oldBackend' => $source, 'oldReference' => $sourceRef]); $source->delete($sourceRef); diff --git a/src/Module/Install.php b/src/Module/Install.php index 95644ae62..2a9bab81e 100644 --- a/src/Module/Install.php +++ b/src/Module/Install.php @@ -26,6 +26,7 @@ use Friendica\BaseModule; use Friendica\Core; use Friendica\Core\Config\Cache; use Friendica\Core\Renderer; +use Friendica\Core\Theme; use Friendica\DI; use Friendica\Network\HTTPException; use Friendica\Util\BasePath; @@ -162,6 +163,16 @@ class Install extends BaseModule } self::$installer->installDatabase($configCache->get('system', 'basepath')); + + // install allowed themes to register theme hooks + // this is same as "Reload active theme" in /admin/themes + $allowed_themes = Theme::getAllowedList(); + $allowed_themes = array_unique($allowed_themes); + foreach ($allowed_themes as $theme) { + Theme::uninstall($theme); + Theme::install($theme); + } + Theme::setAllowedList($allowed_themes); break; } diff --git a/src/Module/Proxy.php b/src/Module/Proxy.php index 10ddd5633..735048a86 100644 --- a/src/Module/Proxy.php +++ b/src/Module/Proxy.php @@ -127,13 +127,16 @@ class Proxy extends BaseModule } $basepath = $a->getBasePath(); + $filepermission = DI::config()->get('system', 'proxy_file_chmod'); // Store original image if ($direct_cache) { // direct cache , store under ./proxy/ $filename = $basepath . '/proxy/' . ProxyUtils::proxifyUrl($request['url'], true); file_put_contents($filename, $image->asString()); - chmod($filename, DI::config()->get('system', 'proxy_file_chmod')); + if (!empty($filepermission)) { + chmod($filename, $filepermission); + } } elseif($cachefile !== '') { // cache file file_put_contents($cachefile, $image->asString()); @@ -153,7 +156,9 @@ class Proxy extends BaseModule if ($direct_cache && $request['sizetype'] != '') { $filename = $basepath . '/proxy/' . ProxyUtils::proxifyUrl($request['url'], true) . $request['sizetype']; file_put_contents($filename, $image->asString()); - chmod($filename, DI::config()->get('system', 'proxy_file_chmod')); + if (!empty($filepermission)) { + chmod($filename, $filepermission); + } } self::responseImageHttpCache($image); diff --git a/static/defaults.config.php b/static/defaults.config.php index b075db36a..2edb13507 100644 --- a/static/defaults.config.php +++ b/static/defaults.config.php @@ -571,9 +571,9 @@ return [ // Timeout in seconds for fetching the XRD links. 'xrd_timeout' => 20, - // proxy_file_chmod (Integer) - // Access rights for downloaded files in /proxy/ directory - 'proxy_file_chmod' => 0640, + // proxy_file_chmod (Octal Integer like 0640) + // If set, defines the files permissions for downloaded files in the /proxy/ directory, default is system-dependent + 'proxy_file_chmod' => 0, ], 'experimental' => [ // exp_themes (Boolean)