]> git.mxchange.org Git - friendica.git/blobdiff - mod/admin.php
Storing the protocol while following a contact
[friendica.git] / mod / admin.php
index cc2256b73dd37ba36585f1cb78c4a16e0fa0e963..22bb66265b32c63776b49b89c44fefda6c094da7 100644 (file)
@@ -15,11 +15,11 @@ use Friendica\Core\Config;
 use Friendica\Core\L10n;
 use Friendica\Core\Logger;
 use Friendica\Core\Renderer;
+use Friendica\Core\StorageManager;
 use Friendica\Core\System;
 use Friendica\Core\Theme;
 use Friendica\Core\Update;
 use Friendica\Core\Worker;
-use Friendica\Core\StorageManager;
 use Friendica\Database\DBA;
 use Friendica\Database\DBStructure;
 use Friendica\Model\Contact;
@@ -29,7 +29,10 @@ use Friendica\Model\User;
 use Friendica\Module;
 use Friendica\Module\Login;
 use Friendica\Module\Tos;
+use Friendica\Protocol\PortableContact;
 use Friendica\Util\Arrays;
+use Friendica\Util\BasePath;
+use Friendica\Util\BaseURL;
 use Friendica\Util\DateTimeFormat;
 use Friendica\Util\Network;
 use Friendica\Util\Strings;
@@ -203,7 +206,6 @@ function admin_content(App $a)
                        'tos'          => ['admin/tos/'         , L10n::t('Terms of Service')        , 'tos']]],
                'database' => [L10n::t('Database'), [
                        'dbsync'       => ['admin/dbsync/'      , L10n::t('DB updates')              , 'dbsync'],
-                       'queue'        => ['admin/queue/'       , L10n::t('Inspect Queue')           , 'queue'],
                        'deferred'     => ['admin/deferred/'    , L10n::t('Inspect Deferred Workers'), 'deferred'],
                        'workerqueue'  => ['admin/workerqueue/' , L10n::t('Inspect worker Queue')    , 'workerqueue']]],
                'tools' => [L10n::t('Tools'), [
@@ -272,9 +274,6 @@ function admin_content(App $a)
                        case 'dbsync':
                                $o = admin_page_dbsync($a);
                                break;
-                       case 'queue':
-                               $o = admin_page_queue($a);
-                               break;
                        case 'deferred':
                                $o = admin_page_workerqueue($a, true);
                                break;
@@ -678,6 +677,8 @@ function admin_page_federation(App $a)
                                do {
                                        $part = array_pop($parts);
                                } while (!empty($parts) && ((strlen($part) >= 40) || (strlen($part) <= 3)));
+                               // only take the x.x.x part of the version, not the "release" after the dash
+                               $part = array_shift(explode('-', $part));
 
                                if (!empty($part)) {
                                        if (empty($compacted[$part])) {
@@ -785,52 +786,6 @@ function admin_page_federation(App $a)
        ]);
 }
 
-/**
- * @brief Admin Inspect Queue Page
- *
- * Generates a page for the admin to have a look into the current queue of
- * postings that are not deliverable. Shown are the name and url of the
- * recipient, the delivery network and the dates when the posting was generated
- * and the last time tried to deliver the posting.
- *
- * The returned string holds the content of the page.
- *
- * @param App $a
- * @return string
- * @throws \Friendica\Network\HTTPException\InternalServerErrorException
- */
-function admin_page_queue(App $a)
-{
-       // get content from the queue table
-       $entries = DBA::p("SELECT `contact`.`name`, `contact`.`nurl`,
-                `queue`.`id`, `queue`.`network`, `queue`.`created`, `queue`.`last`
-                FROM `queue` INNER JOIN `contact` ON `contact`.`id` = `queue`.`cid`
-                ORDER BY `queue`.`cid`, `queue`.`created`");
-
-       $r = [];
-       while ($entry = DBA::fetch($entries)) {
-               $entry['created'] = DateTimeFormat::local($entry['created']);
-               $entry['last'] = DateTimeFormat::local($entry['last']);
-               $r[] = $entry;
-       }
-       DBA::close($entries);
-
-       $t = Renderer::getMarkupTemplate('admin/queue.tpl');
-       return Renderer::replaceMacros($t, [
-               '$title' => L10n::t('Administration'),
-               '$page' => L10n::t('Inspect Queue'),
-               '$count' => count($r),
-               'id_header' => L10n::t('ID'),
-               '$to_header' => L10n::t('Recipient Name'),
-               '$url_header' => L10n::t('Recipient Profile'),
-               '$network_header' => L10n::t('Network'),
-               '$created_header' => L10n::t('Created'),
-               '$last_header' => L10n::t('Last Tried'),
-               '$info' => L10n::t('This page lists the content of the queue for outgoing postings. These are postings the initial delivery failed for. They will be resend later and eventually deleted if the delivery fails permanently.'),
-               '$entries' => $r,
-       ]);
-}
-
 /**
  * @brief Admin Inspect Worker Queue Page
  *
@@ -915,12 +870,16 @@ function admin_page_summary(App $a)
        }
 
        if (Config::get('system', 'dbupdate', DBStructure::UPDATE_NOT_CHECKED) == DBStructure::UPDATE_NOT_CHECKED) {
-               DBStructure::update(false, true);
+               DBStructure::update($a->getBasePath(), false, true);
        }
        if (Config::get('system', 'dbupdate') == DBStructure::UPDATE_FAILED) {
                $showwarning = true;
                $warningtext[] = L10n::t('The database update failed. Please run "php bin/console.php dbstructure update" from the command line and have a look at the errors that might appear.');
        }
+       if (Config::get('system', 'update') == Update::FAILED) {
+               $showwarning = true;
+               $warningtext[] = L10n::t('The last update failed. Please run "php bin/console.php dbstructure update" from the command line and have a look at the errors that might appear. (Some of the errors are possibly inside the logfile.)');
+       }
 
        $last_worker_call = Config::get('system', 'last_worker_execution', false);
        if (!$last_worker_call) {
@@ -936,6 +895,10 @@ function admin_page_summary(App $a)
                $showwarning = true;
                $warningtext[] = L10n::t('Friendica\'s configuration now is stored in config/local.config.php, please copy config/local-sample.config.php and move your config from <code>.htconfig.php</code>. See <a href="%s">the Config help page</a> for help with the transition.', $a->getBaseURL() . '/help/Config');
        }
+       if (file_exists('config/local.ini.php')) {
+               $showwarning = true;
+               $warningtext[] = L10n::t('Friendica\'s configuration now is stored in config/local.config.php, please copy config/local-sample.config.php and move your config from <code>config/local.ini.php</code>. See <a href="%s">the Config help page</a> for help with the transition.', $a->getBaseURL() . '/help/Config');
+       }
 
        // Check server vitality
        if (!admin_page_server_vital()) {
@@ -965,8 +928,6 @@ function admin_page_summary(App $a)
 
        $pending = Register::getPendingCount();
 
-       $queue = DBA::count('queue', []);
-
        $deferred = DBA::count('workerqueue', ["`executed` <= ? AND NOT `done` AND `next_try` > ?",
                DBA::NULL_DATETIME, DateTimeFormat::utcNow()]);
 
@@ -975,7 +936,7 @@ function admin_page_summary(App $a)
 
        // We can do better, but this is a quick queue status
 
-       $queues = ['label' => L10n::t('Message queues'), 'queue' => $queue, 'deferred' => $deferred, 'workerq' => $workerqueue];
+       $queues = ['label' => L10n::t('Message queues'), 'deferred' => $deferred, 'workerq' => $workerqueue];
 
 
        $r = q("SHOW variables LIKE 'max_allowed_packet'");
@@ -1081,7 +1042,6 @@ function admin_page_site_post(App $a)
                update_table($a, "gcontact", ['connect', 'addr'], $old_host, $new_host);
 
                // update config
-               Config::set('system', 'hostname', parse_url($new_url, PHP_URL_HOST));
                Config::set('system', 'url', $new_url);
                $a->setBaseURL($new_url);
 
@@ -1099,12 +1059,11 @@ function admin_page_site_post(App $a)
        // end relocate
 
        $sitename         = (!empty($_POST['sitename'])         ? Strings::escapeTags(trim($_POST['sitename']))      : '');
-       $hostname         = (!empty($_POST['hostname'])         ? Strings::escapeTags(trim($_POST['hostname']))      : '');
        $sender_email     = (!empty($_POST['sender_email'])     ? Strings::escapeTags(trim($_POST['sender_email']))  : '');
        $banner           = (!empty($_POST['banner'])           ? trim($_POST['banner'])                             : false);
        $shortcut_icon    = (!empty($_POST['shortcut_icon'])    ? Strings::escapeTags(trim($_POST['shortcut_icon'])) : '');
        $touch_icon       = (!empty($_POST['touch_icon'])       ? Strings::escapeTags(trim($_POST['touch_icon']))    : '');
-       $info             = (!empty($_POST['info'])             ? trim($_POST['info'])                               : false);
+       $additional_info  = (!empty($_POST['additional_info'])  ? trim($_POST['additional_info'])                    : '');
        $language         = (!empty($_POST['language'])         ? Strings::escapeTags(trim($_POST['language']))      : '');
        $theme            = (!empty($_POST['theme'])            ? Strings::escapeTags(trim($_POST['theme']))         : '');
        $theme_mobile     = (!empty($_POST['theme_mobile'])     ? Strings::escapeTags(trim($_POST['theme_mobile']))  : '');
@@ -1143,14 +1102,14 @@ function admin_page_site_post(App $a)
        $proxyuser              = (!empty($_POST['proxyuser'])              ? Strings::escapeTags(trim($_POST['proxyuser'])) : '');
        $proxy                  = (!empty($_POST['proxy'])                  ? Strings::escapeTags(trim($_POST['proxy']))     : '');
        $timeout                = (!empty($_POST['timeout'])                ? intval(trim($_POST['timeout']))                : 60);
-       $maxloadavg             = (!empty($_POST['maxloadavg'])             ? intval(trim($_POST['maxloadavg']))             : 50);
+       $maxloadavg             = (!empty($_POST['maxloadavg'])             ? intval(trim($_POST['maxloadavg']))             : 20);
        $maxloadavg_frontend    = (!empty($_POST['maxloadavg_frontend'])    ? intval(trim($_POST['maxloadavg_frontend']))    : 50);
        $min_memory             = (!empty($_POST['min_memory'])             ? intval(trim($_POST['min_memory']))             : 0);
        $optimize_max_tablesize = (!empty($_POST['optimize_max_tablesize']) ? intval(trim($_POST['optimize_max_tablesize'])) : 100);
        $optimize_fragmentation = (!empty($_POST['optimize_fragmentation']) ? intval(trim($_POST['optimize_fragmentation'])) : 30);
        $poco_completion        = (!empty($_POST['poco_completion'])        ? intval(trim($_POST['poco_completion']))        : false);
        $poco_requery_days      = (!empty($_POST['poco_requery_days'])      ? intval(trim($_POST['poco_requery_days']))      : 7);
-       $poco_discovery         = (!empty($_POST['poco_discovery'])         ? intval(trim($_POST['poco_discovery']))         : 0);
+       $poco_discovery         = (!empty($_POST['poco_discovery'])         ? intval(trim($_POST['poco_discovery']))         : PortableContact::DISABLED);
        $poco_discovery_since   = (!empty($_POST['poco_discovery_since'])   ? intval(trim($_POST['poco_discovery_since']))   : 30);
        $poco_local_search      = !empty($_POST['poco_local_search']);
        $nodeinfo               = !empty($_POST['nodeinfo']);
@@ -1170,7 +1129,6 @@ function admin_page_site_post(App $a)
        $itemcache_duration     = (!empty($_POST['itemcache_duration'])     ? intval($_POST['itemcache_duration'])            : 0);
        $max_comments           = (!empty($_POST['max_comments'])           ? intval($_POST['max_comments'])                  : 0);
        $temppath               = (!empty($_POST['temppath'])               ? Strings::escapeTags(trim($_POST['temppath']))   : '');
-       $basepath               = (!empty($_POST['basepath'])               ? Strings::escapeTags(trim($_POST['basepath']))   : '');
        $singleuser             = (!empty($_POST['singleuser'])             ? Strings::escapeTags(trim($_POST['singleuser'])) : '');
        $proxy_disabled         = !empty($_POST['proxy_disabled']);
        $only_tag_search        = !empty($_POST['only_tag_search']);
@@ -1194,38 +1152,41 @@ function admin_page_site_post(App $a)
         * @var $storagebackend \Friendica\Model\Storage\IStorage
         */
        $storagebackend    = Strings::escapeTags(trim(defaults($_POST, 'storagebackend', '')));
-       StorageManager::setBackend($storagebackend);
 
        // save storage backend form
        if (!is_null($storagebackend) && $storagebackend != "") {
-               $storage_opts = $storagebackend::getOptions();
-               $storage_form_prefix=preg_replace('|[^a-zA-Z0-9]|' ,'', $storagebackend);
-               $storage_opts_data = [];
-               foreach($storage_opts as $name => $info) {
-                       $fieldname = $storage_form_prefix . '_' . $name;
-                       switch ($info[0]) { // type
-                               case 'checkbox':
-                               case 'yesno':
-                                       $value = !empty($_POST[$fieldname]);
-                                       break;
-                               default:
-                                       $value = defaults($_POST, $fieldname, '');
+               if (StorageManager::setBackend($storagebackend)) {
+                       $storage_opts = $storagebackend::getOptions();
+                       $storage_form_prefix = preg_replace('|[^a-zA-Z0-9]|', '', $storagebackend);
+                       $storage_opts_data = [];
+                       foreach ($storage_opts as $name => $info) {
+                               $fieldname = $storage_form_prefix . '_' . $name;
+                               switch ($info[0]) { // type
+                                       case 'checkbox':
+                                       case 'yesno':
+                                               $value = !empty($_POST[$fieldname]);
+                                               break;
+                                       default:
+                                               $value = defaults($_POST, $fieldname, '');
+                               }
+                               $storage_opts_data[$name] = $value;
                        }
-                       $storage_opts_data[$name] = $value;
-               }
-               unset($name);
-               unset($info);
-       
-               $storage_form_errors = $storagebackend::saveOptions($storage_opts_data);
-               if (count($storage_form_errors)) {
-                       foreach($storage_form_errors as $name => $err) {
-                               notice('Storage backend, ' . $storage_opts[$name][1] . ': ' . $err);
+                       unset($name);
+                       unset($info);
+
+                       $storage_form_errors = $storagebackend::saveOptions($storage_opts_data);
+                       if (count($storage_form_errors)) {
+                               foreach ($storage_form_errors as $name => $err) {
+                                       notice('Storage backend, ' . $storage_opts[$name][1] . ': ' . $err);
+                               }
+                               $a->internalRedirect('admin/site' . $active_panel);
                        }
-                       $a->internalRedirect('admin/site' . $active_panel);
+               } else {
+                       info(L10n::t('Invalid storage backend setting value.'));
                }
        }
 
-       
+
 
        // Has the directory url changed? If yes, then resubmit the existing profiles there
        if ($global_directory != Config::get('system', 'directory') && ($global_directory != '')) {
@@ -1237,7 +1198,7 @@ function admin_page_site_post(App $a)
                $diaspora_enabled = false;
        }
        if ($ssl_policy != intval(Config::get('system', 'ssl_policy'))) {
-               if ($ssl_policy == SSL_POLICY_FULL) {
+               if ($ssl_policy == BaseURL::SSL_POLICY_FULL) {
                        q("UPDATE `contact` SET
                                `url`     = REPLACE(`url`    , 'http:' , 'https:'),
                                `photo`   = REPLACE(`photo`  , 'http:' , 'https:'),
@@ -1255,7 +1216,7 @@ function admin_page_site_post(App $a)
                                `thumb`   = REPLACE(`thumb`  , 'http:' , 'https:')
                                WHERE 1 "
                        );
-               } elseif ($ssl_policy == SSL_POLICY_SELFSIGN) {
+               } elseif ($ssl_policy == BaseURL::SSL_POLICY_SELFSIGN) {
                        q("UPDATE `contact` SET
                                `url`     = REPLACE(`url`    , 'https:' , 'http:'),
                                `photo`   = REPLACE(`photo`  , 'https:' , 'http:'),
@@ -1288,7 +1249,6 @@ function admin_page_site_post(App $a)
        Config::set('system', 'poco_local_search'     , $poco_local_search);
        Config::set('system', 'nodeinfo'              , $nodeinfo);
        Config::set('config', 'sitename'              , $sitename);
-       Config::set('config', 'hostname'              , $hostname);
        Config::set('config', 'sender_email'          , $sender_email);
        Config::set('system', 'suppress_tags'         , $suppress_tags);
        Config::set('system', 'shortcut_icon'         , $shortcut_icon);
@@ -1300,10 +1260,10 @@ function admin_page_site_post(App $a)
                Config::set('system', 'banner', $banner);
        }
 
-       if (empty($info)) {
+       if (empty($additional_info)) {
                Config::delete('config', 'info');
        } else {
-               Config::set('config', 'info', $info);
+               Config::set('config', 'info', $additional_info);
        }
        Config::set('system', 'language', $language);
        Config::set('system', 'theme', $theme);
@@ -1371,7 +1331,7 @@ function admin_page_site_post(App $a)
        Config::set('system', 'dbclean-expire-unclaimed', $dbclean_unclaimed);
 
        if ($itemcache != '') {
-               $itemcache = App::getRealPath($itemcache);
+               $itemcache = BasePath::getRealPath($itemcache);
        }
 
        Config::set('system', 'itemcache', $itemcache);
@@ -1379,16 +1339,11 @@ function admin_page_site_post(App $a)
        Config::set('system', 'max_comments', $max_comments);
 
        if ($temppath != '') {
-               $temppath = App::getRealPath($temppath);
+               $temppath = BasePath::getRealPath($temppath);
        }
 
        Config::set('system', 'temppath', $temppath);
 
-       if ($basepath != '') {
-               $basepath = App::getRealPath($basepath);
-       }
-
-       Config::set('system', 'basepath'         , $basepath);
        Config::set('system', 'proxy_disabled'   , $proxy_disabled);
        Config::set('system', 'only_tag_search'  , $only_tag_search);
 
@@ -1472,10 +1427,10 @@ function admin_page_site(App $a)
        ];
 
        $poco_discovery_choices = [
-               "0" => L10n::t("Disabled"),
-               "1" => L10n::t("Users"),
-               "2" => L10n::t("Users, Global Contacts"),
-               "3" => L10n::t("Users, Global Contacts/fallback"),
+               PortableContact::DISABLED => L10n::t("Disabled"),
+               PortableContact::USERS => L10n::t("Users"),
+               PortableContact::USERS_GCONTACTS => L10n::t("Users, Global Contacts"),
+               PortableContact::USERS_GCONTACTS_FALLBACK => L10n::t("Users, Global Contacts/fallback"),
        ];
 
        $poco_discovery_since_choices = [
@@ -1501,7 +1456,7 @@ function admin_page_site(App $a)
                $banner = '<a href="https://friendi.ca"><img id="logo-img" src="images/friendica-32.png" alt="logo" /></a><span id="logo-text"><a href="https://friendi.ca">Friendica</a></span>';
        }
 
-       $info = Config::get('config', 'info');
+       $additional_info = Config::get('config', 'info');
 
        // Automatically create temporary paths
        get_temppath();
@@ -1517,9 +1472,9 @@ function admin_page_site(App $a)
        ];
 
        $ssl_choices = [
-               SSL_POLICY_NONE => L10n::t("No SSL policy, links will track page SSL state"),
-               SSL_POLICY_FULL => L10n::t("Force all links to use SSL"),
-               SSL_POLICY_SELFSIGN => L10n::t("Self-signed certificate, use SSL for local links only \x28discouraged\x29")
+               BaseURL::SSL_POLICY_NONE => L10n::t("No SSL policy, links will track page SSL state"),
+               BaseURL::SSL_POLICY_FULL => L10n::t("Force all links to use SSL"),
+               BaseURL::SSL_POLICY_SELFSIGN => L10n::t("Self-signed certificate, use SSL for local links only \x28discouraged\x29")
        ];
 
        $check_git_version_choices = [
@@ -1528,9 +1483,6 @@ function admin_page_site(App $a)
                "develop" => L10n::t("check the development version")
        ];
 
-       if (empty(Config::get('config', 'hostname'))) {
-               Config::set('config', 'hostname', $a->getHostName());
-       }
        $diaspora_able = ($a->getURLPath() == "");
 
        $optimize_max_tablesize = Config::get('system', 'optimize_max_tablesize', -1);
@@ -1546,20 +1498,25 @@ function admin_page_site(App $a)
         */
        $storage_current_backend = StorageManager::getBackend();
 
-       $storage_backends_choices = [
-               '' => L10n::t('None')
-       ];
-       foreach($storage_backends as $name=>$class) {
+       $storage_backends_choices = [];
+
+       // show legacy option only if it is the current backend:
+       // once changed can't be selected anymore
+       if ($storage_current_backend == '') {
+               $storage_backends_choices[''] = L10n::t('Database (legacy)');
+       };
+
+       foreach ($storage_backends as $name => $class) {
                $storage_backends_choices[$class] = $name;
        }
        unset($storage_backends);
 
        // build storage config form,
        $storage_form_prefix=preg_replace('|[^a-zA-Z0-9]|' ,'', $storage_current_backend);
-       
+
        $storage_form = [];
        if (!is_null($storage_current_backend) && $storage_current_backend != "") {
-               foreach($storage_current_backend::getOptions() as $name => $info) {
+               foreach ($storage_current_backend::getOptions() as $name => $info) {
                        $type = $info[0];
                        $info[0] = $storage_form_prefix . '_' . $name;
                        $info['type'] = $type;
@@ -1589,12 +1546,11 @@ function admin_page_site(App $a)
 
                // name, label, value, help string, extra data...
                '$sitename'         => ['sitename', L10n::t("Site name"), Config::get('config', 'sitename'), ''],
-               '$hostname'         => ['hostname', L10n::t("Host name"), Config::get('config', 'hostname'), ""],
                '$sender_email'     => ['sender_email', L10n::t("Sender Email"), Config::get('config', 'sender_email'), L10n::t("The email address your server shall use to send notification emails from."), "", "", "email"],
                '$banner'           => ['banner', L10n::t("Banner/Logo"), $banner, ""],
                '$shortcut_icon'    => ['shortcut_icon', L10n::t("Shortcut icon"), Config::get('system', 'shortcut_icon'), L10n::t("Link to an icon that will be used for browsers.")],
                '$touch_icon'       => ['touch_icon', L10n::t("Touch icon"), Config::get('system', 'touch_icon'), L10n::t("Link to an icon that will be used for tablets and mobiles.")],
-               '$info'             => ['info', L10n::t('Additional Info'), $info, L10n::t('For public servers: you can add additional information here that will be listed at %s/servers.', get_server())],
+               '$additional_info'  => ['additional_info', L10n::t('Additional Info'), $additional_info, L10n::t('For public servers: you can add additional information here that will be listed at %s/servers.', get_server())],
                '$language'         => ['language', L10n::t("System language"), Config::get('system', 'language'), "", $lang_choices],
                '$theme'            => ['theme', L10n::t("System theme"), Config::get('system', 'theme'), L10n::t("Default system theme - may be over-ridden by user profiles - <a href='#' id='cnftheme'>change theme settings</a>"), $theme_choices],
                '$theme_mobile'     => ['theme_mobile', L10n::t("Mobile system theme"), Config::get('system', 'mobile-theme', '---'), L10n::t("Theme for mobile devices"), $theme_choices_mobile],
@@ -1603,7 +1559,7 @@ function admin_page_site(App $a)
                '$hide_help'        => ['hide_help', L10n::t("Hide help entry from navigation menu"), Config::get('system', 'hide_help'), L10n::t("Hides the menu entry for the Help pages from the navigation menu. You can still access it calling /help directly.")],
                '$singleuser'       => ['singleuser', L10n::t("Single user instance"), Config::get('system', 'singleuser', '---'), L10n::t("Make this instance multi-user or single-user for the named user"), $user_names],
 
-               '$storagebackend'   => ['storagebackend', L10n::t("File storage backend"), $storage_current_backend, L10n::t('Backend used to store uploaded files data'), $storage_backends_choices],
+               '$storagebackend'   => ['storagebackend', L10n::t("File storage backend"), $storage_current_backend, L10n::t('The backend used to store uploaded data. If you change the storage backend, you can manually move the existing files. If you do not do so, the files uploaded before the change will still be available at the old backend. Please see <a href="/help/Settings#1_2_3_1">the settings documentation</a> for more information about the choices and the moving procedure.'), $storage_backends_choices],
                '$storageform'      => $storage_form,
                '$maximagesize'     => ['maximagesize', L10n::t("Maximum image size"), Config::get('system', 'maximagesize'), L10n::t("Maximum size in bytes of uploaded images. Default is 0, which means no limits.")],
                '$maximagelength'   => ['maximagelength', L10n::t("Maximum image length"), Config::get('system', 'max_image_length'), L10n::t("Maximum length in pixels of the longest side of uploaded images. Default is -1, which means no limits.")],
@@ -1643,7 +1599,7 @@ function admin_page_site(App $a)
                '$proxyuser'              => ['proxyuser', L10n::t("Proxy user"), Config::get('system', 'proxyuser'), ""],
                '$proxy'                  => ['proxy', L10n::t("Proxy URL"), Config::get('system', 'proxy'), ""],
                '$timeout'                => ['timeout', L10n::t("Network timeout"), Config::get('system', 'curl_timeout', 60), L10n::t("Value is in seconds. Set to 0 for unlimited \x28not recommended\x29.")],
-               '$maxloadavg'             => ['maxloadavg', L10n::t("Maximum Load Average"), Config::get('system', 'maxloadavg', 50), L10n::t("Maximum system load before delivery and poll processes are deferred - default 50.")],
+               '$maxloadavg'             => ['maxloadavg', L10n::t("Maximum Load Average"), Config::get('system', 'maxloadavg', 20), L10n::t("Maximum system load before delivery and poll processes are deferred - default %d.", 20)],
                '$maxloadavg_frontend'    => ['maxloadavg_frontend', L10n::t("Maximum Load Average \x28Frontend\x29"), Config::get('system', 'maxloadavg_frontend', 50), L10n::t("Maximum system load before the frontend quits service - default 50.")],
                '$min_memory'             => ['min_memory', L10n::t("Minimal Memory"), Config::get('system', 'min_memory', 0), L10n::t("Minimal free memory in MB for the worker. Needs access to /proc/meminfo - default 0 \x28deactivated\x29.")],
                '$optimize_max_tablesize' => ['optimize_max_tablesize', L10n::t("Maximum table size for optimization"), $optimize_max_tablesize, L10n::t("Maximum table size \x28in MB\x29 for the automatic optimization. Enter -1 to disable it.")],
@@ -1651,7 +1607,7 @@ function admin_page_site(App $a)
 
                '$poco_completion'        => ['poco_completion', L10n::t("Periodical check of global contacts"), Config::get('system', 'poco_completion'), L10n::t("If enabled, the global contacts are checked periodically for missing or outdated data and the vitality of the contacts and servers.")],
                '$poco_requery_days'      => ['poco_requery_days', L10n::t("Days between requery"), Config::get('system', 'poco_requery_days'), L10n::t("Number of days after which a server is requeried for his contacts.")],
-               '$poco_discovery'         => ['poco_discovery', L10n::t("Discover contacts from other servers"), (string)intval(Config::get('system', 'poco_discovery')), L10n::t("Periodically query other servers for contacts. You can choose between 'users': the users on the remote system, 'Global Contacts': active contacts that are known on the system. The fallback is meant for Redmatrix servers and older friendica servers, where global contacts weren't available. The fallback increases the server load, so the recommened setting is 'Users, Global Contacts'."), $poco_discovery_choices],
+               '$poco_discovery'         => ['poco_discovery', L10n::t("Discover contacts from other servers"), (string)intval(Config::get('system', 'poco_discovery')), L10n::t("Periodically query other servers for contacts. You can choose between 'users': the users on the remote system, 'Global Contacts': active contacts that are known on the system. The fallback is meant for Redmatrix servers and older friendica servers, where global contacts weren't available. The fallback increases the server load, so the recommended setting is 'Users, Global Contacts'."), $poco_discovery_choices],
                '$poco_discovery_since'   => ['poco_discovery_since', L10n::t("Timeframe for fetching global contacts"), (string)intval(Config::get('system', 'poco_discovery_since')), L10n::t("When the discovery is activated, this value defines the timeframe for the activity of the global contacts that are fetched from other servers."), $poco_discovery_since_choices],
                '$poco_local_search'      => ['poco_local_search', L10n::t("Search the local directory"), Config::get('system', 'poco_local_search'), L10n::t("Search the local directory instead of the global directory. When searching locally, every search will be executed on the global directory in the background. This improves the search results when the search is repeated.")],
 
@@ -1667,7 +1623,6 @@ function admin_page_site(App $a)
                '$itemcache_duration'     => ['itemcache_duration', L10n::t("Cache duration in seconds"), Config::get('system', 'itemcache_duration'), L10n::t("How long should the cache files be hold? Default value is 86400 seconds \x28One day\x29. To disable the item cache, set the value to -1.")],
                '$max_comments'           => ['max_comments', L10n::t("Maximum numbers of comments per post"), Config::get('system', 'max_comments'), L10n::t("How much comments should be shown for each post? Default value is 100.")],
                '$temppath'               => ['temppath', L10n::t("Temp path"), Config::get('system', 'temppath'), L10n::t("If you have a restricted system where the webserver can't access the system temp path, enter another path here.")],
-               '$basepath'               => ['basepath', L10n::t("Base path to installation"), Config::get('system', 'basepath'), L10n::t("If the system cannot detect the correct path to your installation, enter the correct path here. This setting should only be set if you are using a restricted system and symbolic links to your webroot.")],
                '$proxy_disabled'         => ['proxy_disabled', L10n::t("Disable picture proxy"), Config::get('system', 'proxy_disabled'), L10n::t("The picture proxy increases performance and privacy. It shouldn't be used on systems with very low bandwidth.")],
                '$only_tag_search'        => ['only_tag_search', L10n::t("Only search in tags"), Config::get('system', 'only_tag_search'), L10n::t("On large systems the text search can slow down the system extremely.")],
 
@@ -1678,7 +1633,7 @@ function admin_page_site(App $a)
                '$worker_queues'          => ['worker_queues', L10n::t("Maximum number of parallel workers"), Config::get('system', 'worker_queues'), L10n::t("On shared hosters set this to %d. On larger systems, values of %d are great. Default value is %d.", 5, 20, 10)],
                '$worker_dont_fork'       => ['worker_dont_fork', L10n::t("Don't use 'proc_open' with the worker"), Config::get('system', 'worker_dont_fork'), L10n::t("Enable this if your system doesn't allow the use of 'proc_open'. This can happen on shared hosters. If this is enabled you should increase the frequency of worker calls in your crontab.")],
                '$worker_fastlane'        => ['worker_fastlane', L10n::t("Enable fastlane"), Config::get('system', 'worker_fastlane'), L10n::t("When enabed, the fastlane mechanism starts an additional worker if processes with higher priority are blocked by processes of lower priority.")],
-               '$worker_frontend'        => ['worker_frontend', L10n::t('Enable frontend worker'), Config::get('system', 'frontend_worker'), L10n::t('When enabled the Worker process is triggered when backend access is performed \x28e.g. messages being delivered\x29. On smaller sites you might want to call %s/worker on a regular basis via an external cron job. You should only enable this option if you cannot utilize cron/scheduled jobs on your server.', System::baseUrl())],
+               '$worker_frontend'        => ['worker_frontend', L10n::t('Enable frontend worker'), Config::get('system', 'frontend_worker'), L10n::t("When enabled the Worker process is triggered when backend access is performed \x28e.g. messages being delivered\x29. On smaller sites you might want to call %s/worker on a regular basis via an external cron job. You should only enable this option if you cannot utilize cron/scheduled jobs on your server.", System::baseUrl())],
 
                '$relay_subscribe'        => ['relay_subscribe', L10n::t("Subscribe to relay"), Config::get('system', 'relay_subscribe'), L10n::t("Enables the receiving of public posts from the relay. They will be included in the search, subscribed tags and on the global community page.")],
                '$relay_server'           => ['relay_server', L10n::t("Relay server"), Config::get('system', 'relay_server', 'https://relay.diasp.org'), L10n::t("Address of the relay server where public posts should be send to. For example https://relay.diasp.org")],
@@ -1720,7 +1675,7 @@ function admin_page_dbsync(App $a)
        }
 
        if (($a->argc > 2) && (intval($a->argv[2]) || ($a->argv[2] === 'check'))) {
-               $retval = DBStructure::update(false, true);
+               $retval = DBStructure::update($a->getBasePath(), false, true);
                if ($retval === '') {
                        $o .= L10n::t("Database structure update %s was successfully applied.", DB_UPDATE_VERSION) . "<br />";
                        Config::set('database', 'last_successful_update', DB_UPDATE_VERSION);