Merge pull request #8102 from annando/servertest
[friendica.git/.git] / src / Module / Admin / Site.php
1 <?php
2
3 namespace Friendica\Module\Admin;
4
5 use Friendica\App;
6 use Friendica\Core\Config;
7 use Friendica\Core\L10n;
8 use Friendica\Core\Renderer;
9 use Friendica\Core\Search;
10 use Friendica\Core\StorageManager;
11 use Friendica\Core\Theme;
12 use Friendica\Core\Worker;
13 use Friendica\Database\DBA;
14 use Friendica\DI;
15 use Friendica\Module\BaseAdminModule;
16 use Friendica\Module\Register;
17 use Friendica\Protocol\PortableContact;
18 use Friendica\Util\BasePath;
19 use Friendica\Util\Strings;
20 use Friendica\Worker\Delivery;
21
22 require_once __DIR__ . '/../../../boot.php';
23
24 class Site extends BaseAdminModule
25 {
26         public static function post(array $parameters = [])
27         {
28                 parent::post($parameters);
29
30                 self::checkFormSecurityTokenRedirectOnError('/admin/site', 'admin_site');
31
32                 $a = DI::app();
33
34                 if (!empty($_POST['republish_directory'])) {
35                         Worker::add(PRIORITY_LOW, 'Directory');
36                         return;
37                 }
38
39                 if (empty($_POST['page_site'])) {
40                         return;
41                 }
42
43                 // relocate
44                 // @TODO This file could benefit from moving this feature away in a Module\Admin\Relocate class for example
45                 if (!empty($_POST['relocate']) && !empty($_POST['relocate_url']) && $_POST['relocate_url'] != "") {
46                         $new_url = $_POST['relocate_url'];
47                         $new_url = rtrim($new_url, "/");
48
49                         $parsed = @parse_url($new_url);
50                         if (!is_array($parsed) || empty($parsed['host']) || empty($parsed['scheme'])) {
51                                 notice(L10n::t("Can not parse base url. Must have at least <scheme>://<domain>"));
52                                 DI::baseUrl()->redirect('admin/site');
53                         }
54
55                         /* steps:
56                          * replace all "baseurl" to "new_url" in config, profile, term, items and contacts
57                          * send relocate for every local user
58                          * */
59
60                         $old_url = DI::baseUrl()->get(true);
61
62                         // Generate host names for relocation the addresses in the format user@address.tld
63                         $new_host = str_replace("http://", "@", Strings::normaliseLink($new_url));
64                         $old_host = str_replace("http://", "@", Strings::normaliseLink($old_url));
65
66                         function update_table(App $a, $table_name, $fields, $old_url, $new_url)
67                         {
68                                 $dbold = DBA::escape($old_url);
69                                 $dbnew = DBA::escape($new_url);
70
71                                 $upd = [];
72                                 foreach ($fields as $f) {
73                                         $upd[] = "`$f` = REPLACE(`$f`, '$dbold', '$dbnew')";
74                                 }
75
76                                 $upds = implode(", ", $upd);
77
78                                 $r = DBA::e(sprintf("UPDATE %s SET %s;", $table_name, $upds));
79                                 if (!DBA::isResult($r)) {
80                                         notice("Failed updating '$table_name': " . DBA::errorMessage());
81                                         DI::baseUrl()->redirect('admin/site');
82                                 }
83                         }
84
85                         // update tables
86                         // update profile links in the format "http://server.tld"
87                         update_table($a, "profile", ['photo', 'thumb'], $old_url, $new_url);
88                         update_table($a, "term", ['url'], $old_url, $new_url);
89                         update_table($a, "contact", ['photo', 'thumb', 'micro', 'url', 'nurl', 'alias', 'request', 'notify', 'poll', 'confirm', 'poco', 'avatar'], $old_url, $new_url);
90                         update_table($a, "gcontact", ['url', 'nurl', 'photo', 'server_url', 'notify', 'alias'], $old_url, $new_url);
91                         update_table($a, "item", ['owner-link', 'author-link', 'body', 'plink', 'tag'], $old_url, $new_url);
92
93                         // update profile addresses in the format "user@server.tld"
94                         update_table($a, "contact", ['addr'], $old_host, $new_host);
95                         update_table($a, "gcontact", ['connect', 'addr'], $old_host, $new_host);
96
97                         // update config
98                         Config::set('system', 'url', $new_url);
99                         DI::baseUrl()->saveByURL($new_url);
100
101                         // send relocate
102                         $usersStmt = DBA::select('user', ['uid'], ['account_removed' => false, 'account_expired' => false]);
103                         while ($user = DBA::fetch($usersStmt)) {
104                                 Worker::add(PRIORITY_HIGH, 'Notifier', Delivery::RELOCATION, $user['uid']);
105                         }
106
107                         info("Relocation started. Could take a while to complete.");
108
109                         DI::baseUrl()->redirect('admin/site');
110                 }
111                 // end relocate
112
113                 $sitename         = (!empty($_POST['sitename'])         ? Strings::escapeTags(trim($_POST['sitename']))      : '');
114                 $sender_email     = (!empty($_POST['sender_email'])     ? Strings::escapeTags(trim($_POST['sender_email']))  : '');
115                 $banner           = (!empty($_POST['banner'])           ? trim($_POST['banner'])                             : false);
116                 $shortcut_icon    = (!empty($_POST['shortcut_icon'])    ? Strings::escapeTags(trim($_POST['shortcut_icon'])) : '');
117                 $touch_icon       = (!empty($_POST['touch_icon'])       ? Strings::escapeTags(trim($_POST['touch_icon']))    : '');
118                 $additional_info  = (!empty($_POST['additional_info'])  ? trim($_POST['additional_info'])                    : '');
119                 $language         = (!empty($_POST['language'])         ? Strings::escapeTags(trim($_POST['language']))      : '');
120                 $theme            = (!empty($_POST['theme'])            ? Strings::escapeTags(trim($_POST['theme']))         : '');
121                 $theme_mobile     = (!empty($_POST['theme_mobile'])     ? Strings::escapeTags(trim($_POST['theme_mobile']))  : '');
122                 $maximagesize     = (!empty($_POST['maximagesize'])     ? intval(trim($_POST['maximagesize']))               : 0);
123                 $maximagelength   = (!empty($_POST['maximagelength'])   ? intval(trim($_POST['maximagelength']))             : MAX_IMAGE_LENGTH);
124                 $jpegimagequality = (!empty($_POST['jpegimagequality']) ? intval(trim($_POST['jpegimagequality']))           : JPEG_QUALITY);
125
126                 $register_policy        = (!empty($_POST['register_policy'])         ? intval(trim($_POST['register_policy']))             : 0);
127                 $daily_registrations    = (!empty($_POST['max_daily_registrations']) ? intval(trim($_POST['max_daily_registrations']))     : 0);
128                 $abandon_days           = (!empty($_POST['abandon_days'])            ? intval(trim($_POST['abandon_days']))                : 0);
129
130                 $register_text          = (!empty($_POST['register_text'])           ? strip_tags(trim($_POST['register_text']))           : '');
131
132                 $allowed_sites          = (!empty($_POST['allowed_sites'])           ? Strings::escapeTags(trim($_POST['allowed_sites']))  : '');
133                 $allowed_email          = (!empty($_POST['allowed_email'])           ? Strings::escapeTags(trim($_POST['allowed_email']))  : '');
134                 $forbidden_nicknames    = (!empty($_POST['forbidden_nicknames'])     ? strtolower(Strings::escapeTags(trim($_POST['forbidden_nicknames']))) : '');
135                 $no_oembed_rich_content = !empty($_POST['no_oembed_rich_content']);
136                 $allowed_oembed         = (!empty($_POST['allowed_oembed'])          ? Strings::escapeTags(trim($_POST['allowed_oembed'])) : '');
137                 $block_public           = !empty($_POST['block_public']);
138                 $force_publish          = !empty($_POST['publish_all']);
139                 $global_directory       = (!empty($_POST['directory'])               ? Strings::escapeTags(trim($_POST['directory']))      : '');
140                 $newuser_private        = !empty($_POST['newuser_private']);
141                 $enotify_no_content     = !empty($_POST['enotify_no_content']);
142                 $private_addons         = !empty($_POST['private_addons']);
143                 $disable_embedded       = !empty($_POST['disable_embedded']);
144                 $allow_users_remote_self = !empty($_POST['allow_users_remote_self']);
145                 $explicit_content       = !empty($_POST['explicit_content']);
146
147                 $no_multi_reg           = !empty($_POST['no_multi_reg']);
148                 $no_openid              = !empty($_POST['no_openid']);
149                 $no_regfullname         = !empty($_POST['no_regfullname']);
150                 $community_page_style   = (!empty($_POST['community_page_style']) ? intval(trim($_POST['community_page_style'])) : 0);
151                 $max_author_posts_community_page = (!empty($_POST['max_author_posts_community_page']) ? intval(trim($_POST['max_author_posts_community_page'])) : 0);
152
153                 $verifyssl              = !empty($_POST['verifyssl']);
154                 $proxyuser              = (!empty($_POST['proxyuser'])              ? Strings::escapeTags(trim($_POST['proxyuser'])) : '');
155                 $proxy                  = (!empty($_POST['proxy'])                  ? Strings::escapeTags(trim($_POST['proxy']))     : '');
156                 $timeout                = (!empty($_POST['timeout'])                ? intval(trim($_POST['timeout']))                : 60);
157                 $maxloadavg             = (!empty($_POST['maxloadavg'])             ? intval(trim($_POST['maxloadavg']))             : 20);
158                 $maxloadavg_frontend    = (!empty($_POST['maxloadavg_frontend'])    ? intval(trim($_POST['maxloadavg_frontend']))    : 50);
159                 $min_memory             = (!empty($_POST['min_memory'])             ? intval(trim($_POST['min_memory']))             : 0);
160                 $optimize_max_tablesize = (!empty($_POST['optimize_max_tablesize']) ? intval(trim($_POST['optimize_max_tablesize'])) : 100);
161                 $optimize_fragmentation = (!empty($_POST['optimize_fragmentation']) ? intval(trim($_POST['optimize_fragmentation'])) : 30);
162                 $poco_completion        = (!empty($_POST['poco_completion'])        ? intval(trim($_POST['poco_completion']))        : false);
163                 $poco_requery_days      = (!empty($_POST['poco_requery_days'])      ? intval(trim($_POST['poco_requery_days']))      : 7);
164                 $poco_discovery         = (!empty($_POST['poco_discovery'])         ? intval(trim($_POST['poco_discovery']))         : PortableContact::DISABLED);
165                 $poco_discovery_since   = (!empty($_POST['poco_discovery_since'])   ? intval(trim($_POST['poco_discovery_since']))   : 30);
166                 $poco_local_search      = !empty($_POST['poco_local_search']);
167                 $nodeinfo               = !empty($_POST['nodeinfo']);
168                 $dfrn_only              = !empty($_POST['dfrn_only']);
169                 $ostatus_disabled       = !empty($_POST['ostatus_disabled']);
170                 $diaspora_enabled       = !empty($_POST['diaspora_enabled']);
171                 $ssl_policy             = (!empty($_POST['ssl_policy'])             ? intval($_POST['ssl_policy'])                    : 0);
172                 $force_ssl              = !empty($_POST['force_ssl']);
173                 $hide_help              = !empty($_POST['hide_help']);
174                 $dbclean                = !empty($_POST['dbclean']);
175                 $dbclean_expire_days    = (!empty($_POST['dbclean_expire_days'])    ? intval($_POST['dbclean_expire_days'])           : 0);
176                 $dbclean_unclaimed      = (!empty($_POST['dbclean_unclaimed'])      ? intval($_POST['dbclean_unclaimed'])             : 0);
177                 $dbclean_expire_conv    = (!empty($_POST['dbclean_expire_conv'])    ? intval($_POST['dbclean_expire_conv'])           : 0);
178                 $suppress_tags          = !empty($_POST['suppress_tags']);
179                 $itemcache              = (!empty($_POST['itemcache'])              ? Strings::escapeTags(trim($_POST['itemcache']))  : '');
180                 $itemcache_duration     = (!empty($_POST['itemcache_duration'])     ? intval($_POST['itemcache_duration'])            : 0);
181                 $max_comments           = (!empty($_POST['max_comments'])           ? intval($_POST['max_comments'])                  : 0);
182                 $temppath               = (!empty($_POST['temppath'])               ? Strings::escapeTags(trim($_POST['temppath']))   : '');
183                 $singleuser             = (!empty($_POST['singleuser'])             ? Strings::escapeTags(trim($_POST['singleuser'])) : '');
184                 $proxy_disabled         = !empty($_POST['proxy_disabled']);
185                 $only_tag_search        = !empty($_POST['only_tag_search']);
186                 $rino                   = (!empty($_POST['rino'])                   ? intval($_POST['rino'])                          : 0);
187                 $check_new_version_url  = (!empty($_POST['check_new_version_url'])  ? Strings::escapeTags(trim($_POST['check_new_version_url'])) : 'none');
188
189                 $worker_queues    = (!empty($_POST['worker_queues'])                ? intval($_POST['worker_queues'])                 : 10);
190                 $worker_dont_fork = !empty($_POST['worker_dont_fork']);
191                 $worker_fastlane  = !empty($_POST['worker_fastlane']);
192                 $worker_frontend  = !empty($_POST['worker_frontend']);
193
194                 $relay_directly    = !empty($_POST['relay_directly']);
195                 $relay_server      = (!empty($_POST['relay_server'])      ? Strings::escapeTags(trim($_POST['relay_server']))       : '');
196                 $relay_subscribe   = !empty($_POST['relay_subscribe']);
197                 $relay_scope       = (!empty($_POST['relay_scope'])       ? Strings::escapeTags(trim($_POST['relay_scope']))        : '');
198                 $relay_server_tags = (!empty($_POST['relay_server_tags']) ? Strings::escapeTags(trim($_POST['relay_server_tags']))  : '');
199                 $relay_user_tags   = !empty($_POST['relay_user_tags']);
200                 $active_panel      = (!empty($_POST['active_panel'])      ? "#" . Strings::escapeTags(trim($_POST['active_panel'])) : '');
201
202                 $storagebackend    = Strings::escapeTags(trim($_POST['storagebackend'] ?? ''));
203
204                 // save storage backend form
205                 if (DI::storageManager()->setBackend($storagebackend)) {
206                         $storage_opts     = DI::storage()->getOptions();
207                         $storage_form_prefix = preg_replace('|[^a-zA-Z0-9]|', '', $storagebackend);
208                         $storage_opts_data   = [];
209                         foreach ($storage_opts as $name => $info) {
210                                 $fieldname = $storage_form_prefix . '_' . $name;
211                                 switch ($info[0]) { // type
212                                         case 'checkbox':
213                                         case 'yesno':
214                                                 $value = !empty($_POST[$fieldname]);
215                                                 break;
216                                         default:
217                                                 $value = $_POST[$fieldname] ?? '';
218                                 }
219                                 $storage_opts_data[$name] = $value;
220                         }
221                         unset($name);
222                         unset($info);
223
224                         $storage_form_errors = DI::storage()->saveOptions($storage_opts_data);
225                         if (count($storage_form_errors)) {
226                                 foreach ($storage_form_errors as $name => $err) {
227                                         notice('Storage backend, ' . $storage_opts[$name][1] . ': ' . $err);
228                                 }
229                                 DI::baseUrl()->redirect('admin/site' . $active_panel);
230                         }
231                 } else {
232                         info(L10n::t('Invalid storage backend setting value.'));
233                 }
234
235                 // Has the directory url changed? If yes, then resubmit the existing profiles there
236                 if ($global_directory != Config::get('system', 'directory') && ($global_directory != '')) {
237                         Config::set('system', 'directory', $global_directory);
238                         Worker::add(PRIORITY_LOW, 'Directory');
239                 }
240
241                 if (DI::baseUrl()->getUrlPath() != "") {
242                         $diaspora_enabled = false;
243                 }
244                 if ($ssl_policy != intval(Config::get('system', 'ssl_policy'))) {
245                         if ($ssl_policy == App\BaseURL::SSL_POLICY_FULL) {
246                                 DBA::e("UPDATE `contact` SET
247                                 `url`     = REPLACE(`url`    , 'http:' , 'https:'),
248                                 `photo`   = REPLACE(`photo`  , 'http:' , 'https:'),
249                                 `thumb`   = REPLACE(`thumb`  , 'http:' , 'https:'),
250                                 `micro`   = REPLACE(`micro`  , 'http:' , 'https:'),
251                                 `request` = REPLACE(`request`, 'http:' , 'https:'),
252                                 `notify`  = REPLACE(`notify` , 'http:' , 'https:'),
253                                 `poll`    = REPLACE(`poll`   , 'http:' , 'https:'),
254                                 `confirm` = REPLACE(`confirm`, 'http:' , 'https:'),
255                                 `poco`    = REPLACE(`poco`   , 'http:' , 'https:')
256                                 WHERE `self` = 1"
257                                 );
258                                 DBA::e("UPDATE `profile` SET
259                                 `photo`   = REPLACE(`photo`  , 'http:' , 'https:'),
260                                 `thumb`   = REPLACE(`thumb`  , 'http:' , 'https:')
261                                 WHERE 1 "
262                                 );
263                         } elseif ($ssl_policy == App\BaseURL::SSL_POLICY_SELFSIGN) {
264                                 DBA::e("UPDATE `contact` SET
265                                 `url`     = REPLACE(`url`    , 'https:' , 'http:'),
266                                 `photo`   = REPLACE(`photo`  , 'https:' , 'http:'),
267                                 `thumb`   = REPLACE(`thumb`  , 'https:' , 'http:'),
268                                 `micro`   = REPLACE(`micro`  , 'https:' , 'http:'),
269                                 `request` = REPLACE(`request`, 'https:' , 'http:'),
270                                 `notify`  = REPLACE(`notify` , 'https:' , 'http:'),
271                                 `poll`    = REPLACE(`poll`   , 'https:' , 'http:'),
272                                 `confirm` = REPLACE(`confirm`, 'https:' , 'http:'),
273                                 `poco`    = REPLACE(`poco`   , 'https:' , 'http:')
274                                 WHERE `self` = 1"
275                                 );
276                                 DBA::e("UPDATE `profile` SET
277                                 `photo`   = REPLACE(`photo`  , 'https:' , 'http:'),
278                                 `thumb`   = REPLACE(`thumb`  , 'https:' , 'http:')
279                                 WHERE 1 "
280                                 );
281                         }
282                 }
283                 Config::set('system', 'ssl_policy'            , $ssl_policy);
284                 Config::set('system', 'maxloadavg'            , $maxloadavg);
285                 Config::set('system', 'maxloadavg_frontend'   , $maxloadavg_frontend);
286                 Config::set('system', 'min_memory'            , $min_memory);
287                 Config::set('system', 'optimize_max_tablesize', $optimize_max_tablesize);
288                 Config::set('system', 'optimize_fragmentation', $optimize_fragmentation);
289                 Config::set('system', 'poco_completion'       , $poco_completion);
290                 Config::set('system', 'poco_requery_days'     , $poco_requery_days);
291                 Config::set('system', 'poco_discovery'        , $poco_discovery);
292                 Config::set('system', 'poco_discovery_since'  , $poco_discovery_since);
293                 Config::set('system', 'poco_local_search'     , $poco_local_search);
294                 Config::set('system', 'nodeinfo'              , $nodeinfo);
295                 Config::set('config', 'sitename'              , $sitename);
296                 Config::set('config', 'sender_email'          , $sender_email);
297                 Config::set('system', 'suppress_tags'         , $suppress_tags);
298                 Config::set('system', 'shortcut_icon'         , $shortcut_icon);
299                 Config::set('system', 'touch_icon'            , $touch_icon);
300
301                 if ($banner == "") {
302                         Config::delete('system', 'banner');
303                 } else {
304                         Config::set('system', 'banner', $banner);
305                 }
306
307                 if (empty($additional_info)) {
308                         Config::delete('config', 'info');
309                 } else {
310                         Config::set('config', 'info', $additional_info);
311                 }
312                 Config::set('system', 'language', $language);
313                 Config::set('system', 'theme', $theme);
314                 Theme::install($theme);
315
316                 if ($theme_mobile == '---') {
317                         Config::delete('system', 'mobile-theme');
318                 } else {
319                         Config::set('system', 'mobile-theme', $theme_mobile);
320                 }
321                 if ($singleuser == '---') {
322                         Config::delete('system', 'singleuser');
323                 } else {
324                         Config::set('system', 'singleuser', $singleuser);
325                 }
326                 Config::set('system', 'maximagesize'           , $maximagesize);
327                 Config::set('system', 'max_image_length'       , $maximagelength);
328                 Config::set('system', 'jpeg_quality'           , $jpegimagequality);
329
330                 Config::set('config', 'register_policy'        , $register_policy);
331                 Config::set('system', 'max_daily_registrations', $daily_registrations);
332                 Config::set('system', 'account_abandon_days'   , $abandon_days);
333                 Config::set('config', 'register_text'          , $register_text);
334                 Config::set('system', 'allowed_sites'          , $allowed_sites);
335                 Config::set('system', 'allowed_email'          , $allowed_email);
336                 Config::set('system', 'forbidden_nicknames'    , $forbidden_nicknames);
337                 Config::set('system', 'no_oembed_rich_content' , $no_oembed_rich_content);
338                 Config::set('system', 'allowed_oembed'         , $allowed_oembed);
339                 Config::set('system', 'block_public'           , $block_public);
340                 Config::set('system', 'publish_all'            , $force_publish);
341                 Config::set('system', 'newuser_private'        , $newuser_private);
342                 Config::set('system', 'enotify_no_content'     , $enotify_no_content);
343                 Config::set('system', 'disable_embedded'       , $disable_embedded);
344                 Config::set('system', 'allow_users_remote_self', $allow_users_remote_self);
345                 Config::set('system', 'explicit_content'       , $explicit_content);
346                 Config::set('system', 'check_new_version_url'  , $check_new_version_url);
347
348                 Config::set('system', 'block_extended_register', $no_multi_reg);
349                 Config::set('system', 'no_openid'              , $no_openid);
350                 Config::set('system', 'no_regfullname'         , $no_regfullname);
351                 Config::set('system', 'community_page_style'   , $community_page_style);
352                 Config::set('system', 'max_author_posts_community_page', $max_author_posts_community_page);
353                 Config::set('system', 'verifyssl'              , $verifyssl);
354                 Config::set('system', 'proxyuser'              , $proxyuser);
355                 Config::set('system', 'proxy'                  , $proxy);
356                 Config::set('system', 'curl_timeout'           , $timeout);
357                 Config::set('system', 'dfrn_only'              , $dfrn_only);
358                 Config::set('system', 'ostatus_disabled'       , $ostatus_disabled);
359                 Config::set('system', 'diaspora_enabled'       , $diaspora_enabled);
360
361                 Config::set('config', 'private_addons'         , $private_addons);
362
363                 Config::set('system', 'force_ssl'              , $force_ssl);
364                 Config::set('system', 'hide_help'              , $hide_help);
365
366                 Config::set('system', 'dbclean'                , $dbclean);
367                 Config::set('system', 'dbclean-expire-days'    , $dbclean_expire_days);
368                 Config::set('system', 'dbclean_expire_conversation', $dbclean_expire_conv);
369
370                 if ($dbclean_unclaimed == 0) {
371                         $dbclean_unclaimed = $dbclean_expire_days;
372                 }
373
374                 Config::set('system', 'dbclean-expire-unclaimed', $dbclean_unclaimed);
375
376                 if ($itemcache != '') {
377                         $itemcache = BasePath::getRealPath($itemcache);
378                 }
379
380                 Config::set('system', 'itemcache', $itemcache);
381                 Config::set('system', 'itemcache_duration', $itemcache_duration);
382                 Config::set('system', 'max_comments', $max_comments);
383
384                 if ($temppath != '') {
385                         $temppath = BasePath::getRealPath($temppath);
386                 }
387
388                 Config::set('system', 'temppath', $temppath);
389
390                 Config::set('system', 'proxy_disabled'   , $proxy_disabled);
391                 Config::set('system', 'only_tag_search'  , $only_tag_search);
392
393                 Config::set('system', 'worker_queues'    , $worker_queues);
394                 Config::set('system', 'worker_dont_fork' , $worker_dont_fork);
395                 Config::set('system', 'worker_fastlane'  , $worker_fastlane);
396                 Config::set('system', 'frontend_worker'  , $worker_frontend);
397
398                 Config::set('system', 'relay_directly'   , $relay_directly);
399                 Config::set('system', 'relay_server'     , $relay_server);
400                 Config::set('system', 'relay_subscribe'  , $relay_subscribe);
401                 Config::set('system', 'relay_scope'      , $relay_scope);
402                 Config::set('system', 'relay_server_tags', $relay_server_tags);
403                 Config::set('system', 'relay_user_tags'  , $relay_user_tags);
404
405                 Config::set('system', 'rino_encrypt'     , $rino);
406
407                 info(L10n::t('Site settings updated.') . EOL);
408
409                 DI::baseUrl()->redirect('admin/site' . $active_panel);
410         }
411
412         public static function content(array $parameters = [])
413         {
414                 parent::content($parameters);
415
416                 /* Installed langs */
417                 $lang_choices = L10n::getAvailableLanguages();
418
419                 if (strlen(Config::get('system', 'directory_submit_url')) &&
420                         !strlen(Config::get('system', 'directory'))) {
421                         Config::set('system', 'directory', dirname(Config::get('system', 'directory_submit_url')));
422                         Config::delete('system', 'directory_submit_url');
423                 }
424
425                 /* Installed themes */
426                 $theme_choices = [];
427                 $theme_choices_mobile = [];
428                 $theme_choices_mobile['---'] = L10n::t('No special theme for mobile devices');
429                 $files = glob('view/theme/*');
430                 if (is_array($files)) {
431                         $allowed_theme_list = Config::get('system', 'allowed_themes');
432
433                         foreach ($files as $file) {
434                                 if (intval(file_exists($file . '/unsupported'))) {
435                                         continue;
436                                 }
437
438                                 $f = basename($file);
439
440                                 // Only show allowed themes here
441                                 if (($allowed_theme_list != '') && !strstr($allowed_theme_list, $f)) {
442                                         continue;
443                                 }
444
445                                 $theme_name = ((file_exists($file . '/experimental')) ? L10n::t('%s - (Experimental)', $f) : $f);
446
447                                 if (file_exists($file . '/mobile')) {
448                                         $theme_choices_mobile[$f] = $theme_name;
449                                 } else {
450                                         $theme_choices[$f] = $theme_name;
451                                 }
452                         }
453                 }
454
455                 /* Community page style */
456                 $community_page_style_choices = [
457                         CP_NO_INTERNAL_COMMUNITY => L10n::t('No community page for local users'),
458                         CP_NO_COMMUNITY_PAGE => L10n::t('No community page'),
459                         CP_USERS_ON_SERVER => L10n::t('Public postings from users of this site'),
460                         CP_GLOBAL_COMMUNITY => L10n::t('Public postings from the federated network'),
461                         CP_USERS_AND_GLOBAL => L10n::t('Public postings from local users and the federated network')
462                 ];
463
464                 $poco_discovery_choices = [
465                         PortableContact::DISABLED => L10n::t('Disabled'),
466                         PortableContact::USERS => L10n::t('Users'),
467                         PortableContact::USERS_GCONTACTS => L10n::t('Users, Global Contacts'),
468                         PortableContact::USERS_GCONTACTS_FALLBACK => L10n::t('Users, Global Contacts/fallback'),
469                 ];
470
471                 $poco_discovery_since_choices = [
472                         '30' => L10n::t('One month'),
473                         '91' => L10n::t('Three months'),
474                         '182' => L10n::t('Half a year'),
475                         '365' => L10n::t('One year'),
476                 ];
477
478                 /* get user names to make the install a personal install of X */
479                 // @TODO Move to Model\User::getNames()
480                 $user_names = [];
481                 $user_names['---'] = L10n::t('Multi user instance');
482
483                 $usersStmt = DBA::select('user', ['username', 'nickname'], ['account_removed' => 0, 'account_expired' => 0]);
484                 foreach (DBA::toArray($usersStmt) as $user) {
485                         $user_names[$user['nickname']] = $user['username'];
486                 }
487
488                 /* Banner */
489                 $banner = Config::get('system', 'banner');
490
491                 if ($banner == false) {
492                         $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>';
493                 }
494
495                 $additional_info = Config::get('config', 'info');
496
497                 // Automatically create temporary paths
498                 get_temppath();
499                 get_itemcachepath();
500
501                 /* Register policy */
502                 $register_choices = [
503                         Register::CLOSED => L10n::t('Closed'),
504                         Register::APPROVE => L10n::t('Requires approval'),
505                         Register::OPEN => L10n::t('Open')
506                 ];
507
508                 $ssl_choices = [
509                         App\BaseURL::SSL_POLICY_NONE => L10n::t('No SSL policy, links will track page SSL state'),
510                         App\BaseURL::SSL_POLICY_FULL => L10n::t('Force all links to use SSL'),
511                         App\BaseURL::SSL_POLICY_SELFSIGN => L10n::t('Self-signed certificate, use SSL for local links only (discouraged)')
512                 ];
513
514                 $check_git_version_choices = [
515                         'none' => L10n::t('Don\'t check'),
516                         'master' => L10n::t('check the stable version'),
517                         'develop' => L10n::t('check the development version')
518                 ];
519
520                 $diaspora_able = (DI::baseUrl()->getUrlPath() == '');
521
522                 $optimize_max_tablesize = Config::get('system', 'optimize_max_tablesize', -1);
523
524                 if ($optimize_max_tablesize <= 0) {
525                         $optimize_max_tablesize = -1;
526                 }
527
528                 $current_storage_backend = DI::storage();
529                 $available_storage_backends = [];
530
531                 // show legacy option only if it is the current backend:
532                 // once changed can't be selected anymore
533                 if ($current_storage_backend == null) {
534                         $available_storage_backends[''] = L10n::t('Database (legacy)');
535                 }
536
537                 foreach (DI::storageManager()->listBackends() as $name => $class) {
538                         $available_storage_backends[$name] = $name;
539                 }
540
541                 // build storage config form,
542                 $storage_form_prefix = preg_replace('|[^a-zA-Z0-9]|' ,'', $current_storage_backend);
543
544                 $storage_form = [];
545                 if (!is_null($current_storage_backend) && $current_storage_backend != '') {
546                         foreach ($current_storage_backend->getOptions() as $name => $info) {
547                                 $type = $info[0];
548                                 $info[0] = $storage_form_prefix . '_' . $name;
549                                 $info['type'] = $type;
550                                 $info['field'] = 'field_' . $type . '.tpl';
551                                 $storage_form[$name] = $info;
552                         }
553                 }
554
555                 $t = Renderer::getMarkupTemplate('admin/site.tpl');
556                 return Renderer::replaceMacros($t, [
557                         '$title'             => L10n::t('Administration'),
558                         '$page'              => L10n::t('Site'),
559                         '$submit'            => L10n::t('Save Settings'),
560                         '$republish'         => L10n::t('Republish users to directory'),
561                         '$registration'      => L10n::t('Registration'),
562                         '$upload'            => L10n::t('File upload'),
563                         '$corporate'         => L10n::t('Policies'),
564                         '$advanced'          => L10n::t('Advanced'),
565                         '$portable_contacts' => L10n::t('Auto Discovered Contact Directory'),
566                         '$performance'       => L10n::t('Performance'),
567                         '$worker_title'      => L10n::t('Worker'),
568                         '$relay_title'       => L10n::t('Message Relay'),
569                         '$relocate'          => L10n::t('Relocate Instance'),
570                         '$relocate_warning'  => L10n::t('Warning! Advanced function. Could make this server unreachable.'),
571                         '$baseurl'           => DI::baseUrl()->get(true),
572
573                         // name, label, value, help string, extra data...
574                         '$sitename'         => ['sitename', L10n::t('Site name'), Config::get('config', 'sitename'), ''],
575                         '$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'],
576                         '$banner'           => ['banner', L10n::t('Banner/Logo'), $banner, ''],
577                         '$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.')],
578                         '$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.')],
579                         '$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.', Search::getGlobalDirectory())],
580                         '$language'         => ['language', L10n::t('System language'), Config::get('system', 'language'), '', $lang_choices],
581                         '$theme'            => ['theme', L10n::t('System theme'), Config::get('system', 'theme'), L10n::t('Default system theme - may be over-ridden by user profiles - <a href="/admin/themes" id="cnftheme">Change default theme settings</a>'), $theme_choices],
582                         '$theme_mobile'     => ['theme_mobile', L10n::t('Mobile system theme'), Config::get('system', 'mobile-theme', '---'), L10n::t('Theme for mobile devices'), $theme_choices_mobile],
583                         '$ssl_policy'       => ['ssl_policy', L10n::t('SSL link policy'), (string)intval(Config::get('system', 'ssl_policy')), L10n::t('Determines whether generated links should be forced to use SSL'), $ssl_choices],
584                         '$force_ssl'        => ['force_ssl', L10n::t('Force SSL'), Config::get('system', 'force_ssl'), L10n::t('Force all Non-SSL requests to SSL - Attention: on some systems it could lead to endless loops.')],
585                         '$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.')],
586                         '$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],
587
588                         '$storagebackend'   => ['storagebackend', L10n::t('File storage backend'), $current_storage_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.'), $available_storage_backends],
589                         '$storageform'      => $storage_form,
590                         '$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.')],
591                         '$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.')],
592                         '$jpegimagequality' => ['jpegimagequality', L10n::t('JPEG image quality'), Config::get('system', 'jpeg_quality'), L10n::t('Uploaded JPEGS will be saved at this quality setting [0-100]. Default is 100, which is full quality.')],
593
594                         '$register_policy'        => ['register_policy', L10n::t('Register policy'), Config::get('config', 'register_policy'), '', $register_choices],
595                         '$daily_registrations'    => ['max_daily_registrations', L10n::t('Maximum Daily Registrations'), Config::get('system', 'max_daily_registrations'), L10n::t('If registration is permitted above, this sets the maximum number of new user registrations to accept per day.  If register is set to closed, this setting has no effect.')],
596                         '$register_text'          => ['register_text', L10n::t('Register text'), Config::get('config', 'register_text'), L10n::t('Will be displayed prominently on the registration page. You can use BBCode here.')],
597                         '$forbidden_nicknames'    => ['forbidden_nicknames', L10n::t('Forbidden Nicknames'), Config::get('system', 'forbidden_nicknames'), L10n::t('Comma separated list of nicknames that are forbidden from registration. Preset is a list of role names according RFC 2142.')],
598                         '$abandon_days'           => ['abandon_days', L10n::t('Accounts abandoned after x days'), Config::get('system', 'account_abandon_days'), L10n::t('Will not waste system resources polling external sites for abandonded accounts. Enter 0 for no time limit.')],
599                         '$allowed_sites'          => ['allowed_sites', L10n::t('Allowed friend domains'), Config::get('system', 'allowed_sites'), L10n::t('Comma separated list of domains which are allowed to establish friendships with this site. Wildcards are accepted. Empty to allow any domains')],
600                         '$allowed_email'          => ['allowed_email', L10n::t('Allowed email domains'), Config::get('system', 'allowed_email'), L10n::t('Comma separated list of domains which are allowed in email addresses for registrations to this site. Wildcards are accepted. Empty to allow any domains')],
601                         '$no_oembed_rich_content' => ['no_oembed_rich_content', L10n::t('No OEmbed rich content'), Config::get('system', 'no_oembed_rich_content'), L10n::t('Don\'t show the rich content (e.g. embedded PDF), except from the domains listed below.')],
602                         '$allowed_oembed'         => ['allowed_oembed', L10n::t('Allowed OEmbed domains'), Config::get('system', 'allowed_oembed'), L10n::t('Comma separated list of domains which oembed content is allowed to be displayed. Wildcards are accepted.')],
603                         '$block_public'           => ['block_public', L10n::t('Block public'), Config::get('system', 'block_public'), L10n::t('Check to block public access to all otherwise public personal pages on this site unless you are currently logged in.')],
604                         '$force_publish'          => ['publish_all', L10n::t('Force publish'), Config::get('system', 'publish_all'), L10n::t('Check to force all profiles on this site to be listed in the site directory.') . '<strong>' . L10n::t('Enabling this may violate privacy laws like the GDPR') . '</strong>'],
605                         '$global_directory'       => ['directory', L10n::t('Global directory URL'), Config::get('system', 'directory', 'https://dir.friendica.social'), L10n::t('URL to the global directory. If this is not set, the global directory is completely unavailable to the application.')],
606                         '$newuser_private'        => ['newuser_private', L10n::t('Private posts by default for new users'), Config::get('system', 'newuser_private'), L10n::t('Set default post permissions for all new members to the default privacy group rather than public.')],
607                         '$enotify_no_content'     => ['enotify_no_content', L10n::t('Don\'t include post content in email notifications'), Config::get('system', 'enotify_no_content'), L10n::t('Don\'t include the content of a post/comment/private message/etc. in the email notifications that are sent out from this site, as a privacy measure.')],
608                         '$private_addons'         => ['private_addons', L10n::t('Disallow public access to addons listed in the apps menu.'), Config::get('config', 'private_addons'), L10n::t('Checking this box will restrict addons listed in the apps menu to members only.')],
609                         '$disable_embedded'       => ['disable_embedded', L10n::t('Don\'t embed private images in posts'), Config::get('system', 'disable_embedded'), L10n::t('Don\'t replace locally-hosted private photos in posts with an embedded copy of the image. This means that contacts who receive posts containing private photos will have to authenticate and load each image, which may take a while.')],
610                         '$explicit_content'       => ['explicit_content', L10n::t('Explicit Content'), Config::get('system', 'explicit_content', false), L10n::t('Set this to announce that your node is used mostly for explicit content that might not be suited for minors. This information will be published in the node information and might be used, e.g. by the global directory, to filter your node from listings of nodes to join. Additionally a note about this will be shown at the user registration page.')],
611                         '$allow_users_remote_self'=> ['allow_users_remote_self', L10n::t('Allow Users to set remote_self'), Config::get('system', 'allow_users_remote_self'), L10n::t('With checking this, every user is allowed to mark every contact as a remote_self in the repair contact dialog. Setting this flag on a contact causes mirroring every posting of that contact in the users stream.')],
612                         '$no_multi_reg'           => ['no_multi_reg', L10n::t('Block multiple registrations'), Config::get('system', 'block_extended_register'), L10n::t('Disallow users to register additional accounts for use as pages.')],
613                         '$no_openid'              => ['no_openid', L10n::t('Disable OpenID'), Config::get('system', 'no_openid'), L10n::t('Disable OpenID support for registration and logins.')],
614                         '$no_regfullname'         => ['no_regfullname', L10n::t('No Fullname check'), Config::get('system', 'no_regfullname'), L10n::t('Allow users to register without a space between the first name and the last name in their full name.')],
615                         '$community_page_style'   => ['community_page_style', L10n::t('Community pages for visitors'), Config::get('system', 'community_page_style'), L10n::t('Which community pages should be available for visitors. Local users always see both pages.'), $community_page_style_choices],
616                         '$max_author_posts_community_page' => ['max_author_posts_community_page', L10n::t('Posts per user on community page'), Config::get('system', 'max_author_posts_community_page'), L10n::t('The maximum number of posts per user on the community page. (Not valid for "Global Community")')],
617                         '$ostatus_disabled'       => ['ostatus_disabled', L10n::t('Disable OStatus support'), Config::get('system', 'ostatus_disabled'), L10n::t('Disable built-in OStatus (StatusNet, GNU Social etc.) compatibility. All communications in OStatus are public, so privacy warnings will be occasionally displayed.')],
618                         '$ostatus_not_able'       => L10n::t('OStatus support can only be enabled if threading is enabled.'),
619                         '$diaspora_able'          => $diaspora_able,
620                         '$diaspora_not_able'      => L10n::t('Diaspora support can\'t be enabled because Friendica was installed into a sub directory.'),
621                         '$diaspora_enabled'       => ['diaspora_enabled', L10n::t('Enable Diaspora support'), Config::get('system', 'diaspora_enabled', $diaspora_able), L10n::t('Provide built-in Diaspora network compatibility.')],
622                         '$dfrn_only'              => ['dfrn_only', L10n::t('Only allow Friendica contacts'), Config::get('system', 'dfrn_only'), L10n::t('All contacts must use Friendica protocols. All other built-in communication protocols disabled.')],
623                         '$verifyssl'              => ['verifyssl', L10n::t('Verify SSL'), Config::get('system', 'verifyssl'), L10n::t('If you wish, you can turn on strict certificate checking. This will mean you cannot connect (at all) to self-signed SSL sites.')],
624                         '$proxyuser'              => ['proxyuser', L10n::t('Proxy user'), Config::get('system', 'proxyuser'), ''],
625                         '$proxy'                  => ['proxy', L10n::t('Proxy URL'), Config::get('system', 'proxy'), ''],
626                         '$timeout'                => ['timeout', L10n::t('Network timeout'), Config::get('system', 'curl_timeout', 60), L10n::t('Value is in seconds. Set to 0 for unlimited (not recommended).')],
627                         '$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)],
628                         '$maxloadavg_frontend'    => ['maxloadavg_frontend', L10n::t('Maximum Load Average (Frontend)'), Config::get('system', 'maxloadavg_frontend', 50), L10n::t('Maximum system load before the frontend quits service - default 50.')],
629                         '$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 (deactivated).')],
630                         '$optimize_max_tablesize' => ['optimize_max_tablesize', L10n::t('Maximum table size for optimization'), $optimize_max_tablesize, L10n::t('Maximum table size (in MB) for the automatic optimization. Enter -1 to disable it.')],
631                         '$optimize_fragmentation' => ['optimize_fragmentation', L10n::t('Minimum level of fragmentation'), Config::get('system', 'optimize_fragmentation', 30), L10n::t('Minimum fragmenation level to start the automatic optimization - default value is 30%.')],
632
633                         '$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.')],
634                         '$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.')],
635                         '$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],
636                         '$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],
637                         '$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.')],
638
639                         '$nodeinfo'               => ['nodeinfo', L10n::t('Publish server information'), Config::get('system', 'nodeinfo'), L10n::t('If enabled, general server and usage data will be published. The data contains the name and version of the server, number of users with public profiles, number of posts and the activated protocols and connectors. See <a href="http://the-federation.info/">the-federation.info</a> for details.')],
640
641                         '$check_new_version_url'  => ['check_new_version_url', L10n::t('Check upstream version'), Config::get('system', 'check_new_version_url'), L10n::t('Enables checking for new Friendica versions at github. If there is a new version, you will be informed in the admin panel overview.'), $check_git_version_choices],
642                         '$suppress_tags'          => ['suppress_tags', L10n::t('Suppress Tags'), Config::get('system', 'suppress_tags'), L10n::t('Suppress showing a list of hashtags at the end of the posting.')],
643                         '$dbclean'                => ['dbclean', L10n::t('Clean database'), Config::get('system', 'dbclean', false), L10n::t('Remove old remote items, orphaned database records and old content from some other helper tables.')],
644                         '$dbclean_expire_days'    => ['dbclean_expire_days', L10n::t('Lifespan of remote items'), Config::get('system', 'dbclean-expire-days', 0), L10n::t('When the database cleanup is enabled, this defines the days after which remote items will be deleted. Own items, and marked or filed items are always kept. 0 disables this behaviour.')],
645                         '$dbclean_unclaimed'      => ['dbclean_unclaimed', L10n::t('Lifespan of unclaimed items'), Config::get('system', 'dbclean-expire-unclaimed', 90), L10n::t('When the database cleanup is enabled, this defines the days after which unclaimed remote items (mostly content from the relay) will be deleted. Default value is 90 days. Defaults to the general lifespan value of remote items if set to 0.')],
646                         '$dbclean_expire_conv'    => ['dbclean_expire_conv', L10n::t('Lifespan of raw conversation data'), Config::get('system', 'dbclean_expire_conversation', 90), L10n::t('The conversation data is used for ActivityPub and OStatus, as well as for debug purposes. It should be safe to remove it after 14 days, default is 90 days.')],
647                         '$itemcache'              => ['itemcache', L10n::t('Path to item cache'), Config::get('system', 'itemcache'), L10n::t('The item caches buffers generated bbcode and external images.')],
648                         '$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 (One day). To disable the item cache, set the value to -1.')],
649                         '$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.')],
650                         '$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.')],
651                         '$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.')],
652                         '$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.')],
653
654                         '$relocate_url'           => ['relocate_url', L10n::t('New base url'), DI::baseUrl()->get(), L10n::t('Change base url for this server. Sends relocate message to all Friendica and Diaspora* contacts of all users.')],
655
656                         '$rino'                   => ['rino', L10n::t('RINO Encryption'), intval(Config::get('system', 'rino_encrypt')), L10n::t('Encryption layer between nodes.'), [0 => L10n::t('Disabled'), 1 => L10n::t('Enabled')]],
657
658                         '$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)],
659                         '$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.')],
660                         '$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.')],
661                         '$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 (e.g. messages being delivered). 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.', DI::baseUrl()->get())],
662
663                         '$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.')],
664                         '$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')],
665                         '$relay_directly'         => ['relay_directly', L10n::t('Direct relay transfer'), Config::get('system', 'relay_directly'), L10n::t('Enables the direct transfer to other servers without using the relay servers')],
666                         '$relay_scope'            => ['relay_scope', L10n::t('Relay scope'), Config::get('system', 'relay_scope'), L10n::t('Can be "all" or "tags". "all" means that every public post should be received. "tags" means that only posts with selected tags should be received.'), ['' => L10n::t('Disabled'), 'all' => L10n::t('all'), 'tags' => L10n::t('tags')]],
667                         '$relay_server_tags'      => ['relay_server_tags', L10n::t('Server tags'), Config::get('system', 'relay_server_tags'), L10n::t('Comma separated list of tags for the "tags" subscription.')],
668                         '$relay_user_tags'        => ['relay_user_tags', L10n::t('Allow user tags'), Config::get('system', 'relay_user_tags', true), L10n::t('If enabled, the tags from the saved searches will used for the "tags" subscription in addition to the "relay_server_tags".')],
669
670                         '$form_security_token'    => parent::getFormSecurityToken('admin_site'),
671                         '$relocate_button'        => L10n::t('Start Relocation'),
672                 ]);
673         }
674 }