3302e0dc16c821dd76ed857dbc41e799412346aa
[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                 /**
203                  * @var $storagebackend \Friendica\Model\Storage\IStorage
204                  */
205                 $storagebackend    = Strings::escapeTags(trim($_POST['storagebackend'] ?? ''));
206
207                 // save storage backend form
208                 if (!is_null($storagebackend) && $storagebackend != "") {
209                         if (StorageManager::setBackend($storagebackend)) {
210                                 $storage_opts = $storagebackend::getOptions();
211                                 $storage_form_prefix = preg_replace('|[^a-zA-Z0-9]|', '', $storagebackend);
212                                 $storage_opts_data = [];
213                                 foreach ($storage_opts as $name => $info) {
214                                         $fieldname = $storage_form_prefix . '_' . $name;
215                                         switch ($info[0]) { // type
216                                                 case 'checkbox':
217                                                 case 'yesno':
218                                                         $value = !empty($_POST[$fieldname]);
219                                                         break;
220                                                 default:
221                                                         $value = $_POST[$fieldname] ?? '';
222                                         }
223                                         $storage_opts_data[$name] = $value;
224                                 }
225                                 unset($name);
226                                 unset($info);
227
228                                 $storage_form_errors = $storagebackend::saveOptions($storage_opts_data);
229                                 if (count($storage_form_errors)) {
230                                         foreach ($storage_form_errors as $name => $err) {
231                                                 notice('Storage backend, ' . $storage_opts[$name][1] . ': ' . $err);
232                                         }
233                                         DI::baseUrl()->redirect('admin/site' . $active_panel);
234                                 }
235                         } else {
236                                 info(L10n::t('Invalid storage backend setting value.'));
237                         }
238                 }
239
240                 // Has the directory url changed? If yes, then resubmit the existing profiles there
241                 if ($global_directory != Config::get('system', 'directory') && ($global_directory != '')) {
242                         Config::set('system', 'directory', $global_directory);
243                         Worker::add(PRIORITY_LOW, 'Directory');
244                 }
245
246                 if (DI::baseUrl()->getUrlPath() != "") {
247                         $diaspora_enabled = false;
248                 }
249                 if ($ssl_policy != intval(Config::get('system', 'ssl_policy'))) {
250                         if ($ssl_policy == App\BaseURL::SSL_POLICY_FULL) {
251                                 DBA::e("UPDATE `contact` SET
252                                 `url`     = REPLACE(`url`    , 'http:' , 'https:'),
253                                 `photo`   = REPLACE(`photo`  , 'http:' , 'https:'),
254                                 `thumb`   = REPLACE(`thumb`  , 'http:' , 'https:'),
255                                 `micro`   = REPLACE(`micro`  , 'http:' , 'https:'),
256                                 `request` = REPLACE(`request`, 'http:' , 'https:'),
257                                 `notify`  = REPLACE(`notify` , 'http:' , 'https:'),
258                                 `poll`    = REPLACE(`poll`   , 'http:' , 'https:'),
259                                 `confirm` = REPLACE(`confirm`, 'http:' , 'https:'),
260                                 `poco`    = REPLACE(`poco`   , 'http:' , 'https:')
261                                 WHERE `self` = 1"
262                                 );
263                                 DBA::e("UPDATE `profile` SET
264                                 `photo`   = REPLACE(`photo`  , 'http:' , 'https:'),
265                                 `thumb`   = REPLACE(`thumb`  , 'http:' , 'https:')
266                                 WHERE 1 "
267                                 );
268                         } elseif ($ssl_policy == App\BaseURL::SSL_POLICY_SELFSIGN) {
269                                 DBA::e("UPDATE `contact` SET
270                                 `url`     = REPLACE(`url`    , 'https:' , 'http:'),
271                                 `photo`   = REPLACE(`photo`  , 'https:' , 'http:'),
272                                 `thumb`   = REPLACE(`thumb`  , 'https:' , 'http:'),
273                                 `micro`   = REPLACE(`micro`  , 'https:' , 'http:'),
274                                 `request` = REPLACE(`request`, 'https:' , 'http:'),
275                                 `notify`  = REPLACE(`notify` , 'https:' , 'http:'),
276                                 `poll`    = REPLACE(`poll`   , 'https:' , 'http:'),
277                                 `confirm` = REPLACE(`confirm`, 'https:' , 'http:'),
278                                 `poco`    = REPLACE(`poco`   , 'https:' , 'http:')
279                                 WHERE `self` = 1"
280                                 );
281                                 DBA::e("UPDATE `profile` SET
282                                 `photo`   = REPLACE(`photo`  , 'https:' , 'http:'),
283                                 `thumb`   = REPLACE(`thumb`  , 'https:' , 'http:')
284                                 WHERE 1 "
285                                 );
286                         }
287                 }
288                 Config::set('system', 'ssl_policy'            , $ssl_policy);
289                 Config::set('system', 'maxloadavg'            , $maxloadavg);
290                 Config::set('system', 'maxloadavg_frontend'   , $maxloadavg_frontend);
291                 Config::set('system', 'min_memory'            , $min_memory);
292                 Config::set('system', 'optimize_max_tablesize', $optimize_max_tablesize);
293                 Config::set('system', 'optimize_fragmentation', $optimize_fragmentation);
294                 Config::set('system', 'poco_completion'       , $poco_completion);
295                 Config::set('system', 'poco_requery_days'     , $poco_requery_days);
296                 Config::set('system', 'poco_discovery'        , $poco_discovery);
297                 Config::set('system', 'poco_discovery_since'  , $poco_discovery_since);
298                 Config::set('system', 'poco_local_search'     , $poco_local_search);
299                 Config::set('system', 'nodeinfo'              , $nodeinfo);
300                 Config::set('config', 'sitename'              , $sitename);
301                 Config::set('config', 'sender_email'          , $sender_email);
302                 Config::set('system', 'suppress_tags'         , $suppress_tags);
303                 Config::set('system', 'shortcut_icon'         , $shortcut_icon);
304                 Config::set('system', 'touch_icon'            , $touch_icon);
305
306                 if ($banner == "") {
307                         Config::delete('system', 'banner');
308                 } else {
309                         Config::set('system', 'banner', $banner);
310                 }
311
312                 if (empty($additional_info)) {
313                         Config::delete('config', 'info');
314                 } else {
315                         Config::set('config', 'info', $additional_info);
316                 }
317                 Config::set('system', 'language', $language);
318                 Config::set('system', 'theme', $theme);
319                 Theme::install($theme);
320
321                 if ($theme_mobile == '---') {
322                         Config::delete('system', 'mobile-theme');
323                 } else {
324                         Config::set('system', 'mobile-theme', $theme_mobile);
325                 }
326                 if ($singleuser == '---') {
327                         Config::delete('system', 'singleuser');
328                 } else {
329                         Config::set('system', 'singleuser', $singleuser);
330                 }
331                 Config::set('system', 'maximagesize'           , $maximagesize);
332                 Config::set('system', 'max_image_length'       , $maximagelength);
333                 Config::set('system', 'jpeg_quality'           , $jpegimagequality);
334
335                 Config::set('config', 'register_policy'        , $register_policy);
336                 Config::set('system', 'max_daily_registrations', $daily_registrations);
337                 Config::set('system', 'account_abandon_days'   , $abandon_days);
338                 Config::set('config', 'register_text'          , $register_text);
339                 Config::set('system', 'allowed_sites'          , $allowed_sites);
340                 Config::set('system', 'allowed_email'          , $allowed_email);
341                 Config::set('system', 'forbidden_nicknames'    , $forbidden_nicknames);
342                 Config::set('system', 'no_oembed_rich_content' , $no_oembed_rich_content);
343                 Config::set('system', 'allowed_oembed'         , $allowed_oembed);
344                 Config::set('system', 'block_public'           , $block_public);
345                 Config::set('system', 'publish_all'            , $force_publish);
346                 Config::set('system', 'newuser_private'        , $newuser_private);
347                 Config::set('system', 'enotify_no_content'     , $enotify_no_content);
348                 Config::set('system', 'disable_embedded'       , $disable_embedded);
349                 Config::set('system', 'allow_users_remote_self', $allow_users_remote_self);
350                 Config::set('system', 'explicit_content'       , $explicit_content);
351                 Config::set('system', 'check_new_version_url'  , $check_new_version_url);
352
353                 Config::set('system', 'block_extended_register', $no_multi_reg);
354                 Config::set('system', 'no_openid'              , $no_openid);
355                 Config::set('system', 'no_regfullname'         , $no_regfullname);
356                 Config::set('system', 'community_page_style'   , $community_page_style);
357                 Config::set('system', 'max_author_posts_community_page', $max_author_posts_community_page);
358                 Config::set('system', 'verifyssl'              , $verifyssl);
359                 Config::set('system', 'proxyuser'              , $proxyuser);
360                 Config::set('system', 'proxy'                  , $proxy);
361                 Config::set('system', 'curl_timeout'           , $timeout);
362                 Config::set('system', 'dfrn_only'              , $dfrn_only);
363                 Config::set('system', 'ostatus_disabled'       , $ostatus_disabled);
364                 Config::set('system', 'diaspora_enabled'       , $diaspora_enabled);
365
366                 Config::set('config', 'private_addons'         , $private_addons);
367
368                 Config::set('system', 'force_ssl'              , $force_ssl);
369                 Config::set('system', 'hide_help'              , $hide_help);
370
371                 Config::set('system', 'dbclean'                , $dbclean);
372                 Config::set('system', 'dbclean-expire-days'    , $dbclean_expire_days);
373                 Config::set('system', 'dbclean_expire_conversation', $dbclean_expire_conv);
374
375                 if ($dbclean_unclaimed == 0) {
376                         $dbclean_unclaimed = $dbclean_expire_days;
377                 }
378
379                 Config::set('system', 'dbclean-expire-unclaimed', $dbclean_unclaimed);
380
381                 if ($itemcache != '') {
382                         $itemcache = BasePath::getRealPath($itemcache);
383                 }
384
385                 Config::set('system', 'itemcache', $itemcache);
386                 Config::set('system', 'itemcache_duration', $itemcache_duration);
387                 Config::set('system', 'max_comments', $max_comments);
388
389                 if ($temppath != '') {
390                         $temppath = BasePath::getRealPath($temppath);
391                 }
392
393                 Config::set('system', 'temppath', $temppath);
394
395                 Config::set('system', 'proxy_disabled'   , $proxy_disabled);
396                 Config::set('system', 'only_tag_search'  , $only_tag_search);
397
398                 Config::set('system', 'worker_queues'    , $worker_queues);
399                 Config::set('system', 'worker_dont_fork' , $worker_dont_fork);
400                 Config::set('system', 'worker_fastlane'  , $worker_fastlane);
401                 Config::set('system', 'frontend_worker'  , $worker_frontend);
402
403                 Config::set('system', 'relay_directly'   , $relay_directly);
404                 Config::set('system', 'relay_server'     , $relay_server);
405                 Config::set('system', 'relay_subscribe'  , $relay_subscribe);
406                 Config::set('system', 'relay_scope'      , $relay_scope);
407                 Config::set('system', 'relay_server_tags', $relay_server_tags);
408                 Config::set('system', 'relay_user_tags'  , $relay_user_tags);
409
410                 Config::set('system', 'rino_encrypt'     , $rino);
411
412                 info(L10n::t('Site settings updated.') . EOL);
413
414                 DI::baseUrl()->redirect('admin/site' . $active_panel);
415         }
416
417         public static function content(array $parameters = [])
418         {
419                 parent::content($parameters);
420
421                 /* Installed langs */
422                 $lang_choices = L10n::getAvailableLanguages();
423
424                 if (strlen(Config::get('system', 'directory_submit_url')) &&
425                         !strlen(Config::get('system', 'directory'))) {
426                         Config::set('system', 'directory', dirname(Config::get('system', 'directory_submit_url')));
427                         Config::delete('system', 'directory_submit_url');
428                 }
429
430                 /* Installed themes */
431                 $theme_choices = [];
432                 $theme_choices_mobile = [];
433                 $theme_choices_mobile['---'] = L10n::t('No special theme for mobile devices');
434                 $files = glob('view/theme/*');
435                 if (is_array($files)) {
436                         $allowed_theme_list = Config::get('system', 'allowed_themes');
437
438                         foreach ($files as $file) {
439                                 if (intval(file_exists($file . '/unsupported'))) {
440                                         continue;
441                                 }
442
443                                 $f = basename($file);
444
445                                 // Only show allowed themes here
446                                 if (($allowed_theme_list != '') && !strstr($allowed_theme_list, $f)) {
447                                         continue;
448                                 }
449
450                                 $theme_name = ((file_exists($file . '/experimental')) ? L10n::t('%s - (Experimental)', $f) : $f);
451
452                                 if (file_exists($file . '/mobile')) {
453                                         $theme_choices_mobile[$f] = $theme_name;
454                                 } else {
455                                         $theme_choices[$f] = $theme_name;
456                                 }
457                         }
458                 }
459
460                 /* Community page style */
461                 $community_page_style_choices = [
462                         CP_NO_INTERNAL_COMMUNITY => L10n::t('No community page for local users'),
463                         CP_NO_COMMUNITY_PAGE => L10n::t('No community page'),
464                         CP_USERS_ON_SERVER => L10n::t('Public postings from users of this site'),
465                         CP_GLOBAL_COMMUNITY => L10n::t('Public postings from the federated network'),
466                         CP_USERS_AND_GLOBAL => L10n::t('Public postings from local users and the federated network')
467                 ];
468
469                 $poco_discovery_choices = [
470                         PortableContact::DISABLED => L10n::t('Disabled'),
471                         PortableContact::USERS => L10n::t('Users'),
472                         PortableContact::USERS_GCONTACTS => L10n::t('Users, Global Contacts'),
473                         PortableContact::USERS_GCONTACTS_FALLBACK => L10n::t('Users, Global Contacts/fallback'),
474                 ];
475
476                 $poco_discovery_since_choices = [
477                         '30' => L10n::t('One month'),
478                         '91' => L10n::t('Three months'),
479                         '182' => L10n::t('Half a year'),
480                         '365' => L10n::t('One year'),
481                 ];
482
483                 /* get user names to make the install a personal install of X */
484                 // @TODO Move to Model\User::getNames()
485                 $user_names = [];
486                 $user_names['---'] = L10n::t('Multi user instance');
487
488                 $usersStmt = DBA::select('user', ['username', 'nickname'], ['account_removed' => 0, 'account_expired' => 0]);
489                 foreach (DBA::toArray($usersStmt) as $user) {
490                         $user_names[$user['nickname']] = $user['username'];
491                 }
492
493                 /* Banner */
494                 $banner = Config::get('system', 'banner');
495
496                 if ($banner == false) {
497                         $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>';
498                 }
499
500                 $additional_info = Config::get('config', 'info');
501
502                 // Automatically create temporary paths
503                 get_temppath();
504                 get_itemcachepath();
505
506                 /* Register policy */
507                 $register_choices = [
508                         Register::CLOSED => L10n::t('Closed'),
509                         Register::APPROVE => L10n::t('Requires approval'),
510                         Register::OPEN => L10n::t('Open')
511                 ];
512
513                 $ssl_choices = [
514                         App\BaseURL::SSL_POLICY_NONE => L10n::t('No SSL policy, links will track page SSL state'),
515                         App\BaseURL::SSL_POLICY_FULL => L10n::t('Force all links to use SSL'),
516                         App\BaseURL::SSL_POLICY_SELFSIGN => L10n::t('Self-signed certificate, use SSL for local links only (discouraged)')
517                 ];
518
519                 $check_git_version_choices = [
520                         'none' => L10n::t('Don\'t check'),
521                         'master' => L10n::t('check the stable version'),
522                         'develop' => L10n::t('check the development version')
523                 ];
524
525                 $diaspora_able = (DI::baseUrl()->getUrlPath() == '');
526
527                 $optimize_max_tablesize = Config::get('system', 'optimize_max_tablesize', -1);
528
529                 if ($optimize_max_tablesize <= 0) {
530                         $optimize_max_tablesize = -1;
531                 }
532
533                 $storage_backends = StorageManager::listBackends();
534                 /** @var $current_storage_backend \Friendica\Model\Storage\IStorage */
535                 $current_storage_backend = StorageManager::getBackend();
536
537                 $available_storage_backends = [];
538
539                 // show legacy option only if it is the current backend:
540                 // once changed can't be selected anymore
541                 if ($current_storage_backend == '') {
542                         $available_storage_backends[''] = L10n::t('Database (legacy)');
543                 }
544
545                 foreach ($storage_backends as $name => $class) {
546                         $available_storage_backends[$class] = $name;
547                 }
548                 unset($storage_backends);
549
550                 // build storage config form,
551                 $storage_form_prefix = preg_replace('|[^a-zA-Z0-9]|' ,'', $current_storage_backend);
552
553                 $storage_form = [];
554                 if (!is_null($current_storage_backend) && $current_storage_backend != '') {
555                         foreach ($current_storage_backend::getOptions() as $name => $info) {
556                                 $type = $info[0];
557                                 $info[0] = $storage_form_prefix . '_' . $name;
558                                 $info['type'] = $type;
559                                 $info['field'] = 'field_' . $type . '.tpl';
560                                 $storage_form[$name] = $info;
561                         }
562                 }
563
564                 $t = Renderer::getMarkupTemplate('admin/site.tpl');
565                 return Renderer::replaceMacros($t, [
566                         '$title'             => L10n::t('Administration'),
567                         '$page'              => L10n::t('Site'),
568                         '$submit'            => L10n::t('Save Settings'),
569                         '$republish'         => L10n::t('Republish users to directory'),
570                         '$registration'      => L10n::t('Registration'),
571                         '$upload'            => L10n::t('File upload'),
572                         '$corporate'         => L10n::t('Policies'),
573                         '$advanced'          => L10n::t('Advanced'),
574                         '$portable_contacts' => L10n::t('Auto Discovered Contact Directory'),
575                         '$performance'       => L10n::t('Performance'),
576                         '$worker_title'      => L10n::t('Worker'),
577                         '$relay_title'       => L10n::t('Message Relay'),
578                         '$relocate'          => L10n::t('Relocate Instance'),
579                         '$relocate_warning'  => L10n::t('Warning! Advanced function. Could make this server unreachable.'),
580                         '$baseurl'           => DI::baseUrl()->get(true),
581
582                         // name, label, value, help string, extra data...
583                         '$sitename'         => ['sitename', L10n::t('Site name'), Config::get('config', 'sitename'), ''],
584                         '$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'],
585                         '$banner'           => ['banner', L10n::t('Banner/Logo'), $banner, ''],
586                         '$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.')],
587                         '$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.')],
588                         '$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())],
589                         '$language'         => ['language', L10n::t('System language'), Config::get('system', 'language'), '', $lang_choices],
590                         '$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],
591                         '$theme_mobile'     => ['theme_mobile', L10n::t('Mobile system theme'), Config::get('system', 'mobile-theme', '---'), L10n::t('Theme for mobile devices'), $theme_choices_mobile],
592                         '$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],
593                         '$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.')],
594                         '$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.')],
595                         '$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],
596
597                         '$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],
598                         '$storageform'      => $storage_form,
599                         '$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.')],
600                         '$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.')],
601                         '$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.')],
602
603                         '$register_policy'        => ['register_policy', L10n::t('Register policy'), Config::get('config', 'register_policy'), '', $register_choices],
604                         '$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.')],
605                         '$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.')],
606                         '$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.')],
607                         '$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.')],
608                         '$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')],
609                         '$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')],
610                         '$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.')],
611                         '$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.')],
612                         '$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.')],
613                         '$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>'],
614                         '$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.')],
615                         '$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.')],
616                         '$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.')],
617                         '$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.')],
618                         '$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.')],
619                         '$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.')],
620                         '$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.')],
621                         '$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.')],
622                         '$no_openid'              => ['no_openid', L10n::t('Disable OpenID'), Config::get('system', 'no_openid'), L10n::t('Disable OpenID support for registration and logins.')],
623                         '$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.')],
624                         '$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],
625                         '$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")')],
626                         '$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.')],
627                         '$ostatus_not_able'       => L10n::t('OStatus support can only be enabled if threading is enabled.'),
628                         '$diaspora_able'          => $diaspora_able,
629                         '$diaspora_not_able'      => L10n::t('Diaspora support can\'t be enabled because Friendica was installed into a sub directory.'),
630                         '$diaspora_enabled'       => ['diaspora_enabled', L10n::t('Enable Diaspora support'), Config::get('system', 'diaspora_enabled', $diaspora_able), L10n::t('Provide built-in Diaspora network compatibility.')],
631                         '$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.')],
632                         '$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.')],
633                         '$proxyuser'              => ['proxyuser', L10n::t('Proxy user'), Config::get('system', 'proxyuser'), ''],
634                         '$proxy'                  => ['proxy', L10n::t('Proxy URL'), Config::get('system', 'proxy'), ''],
635                         '$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).')],
636                         '$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)],
637                         '$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.')],
638                         '$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).')],
639                         '$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.')],
640                         '$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%.')],
641
642                         '$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.')],
643                         '$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.')],
644                         '$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],
645                         '$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],
646                         '$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.')],
647
648                         '$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.')],
649
650                         '$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],
651                         '$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.')],
652                         '$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.')],
653                         '$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.')],
654                         '$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.')],
655                         '$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.')],
656                         '$itemcache'              => ['itemcache', L10n::t('Path to item cache'), Config::get('system', 'itemcache'), L10n::t('The item caches buffers generated bbcode and external images.')],
657                         '$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.')],
658                         '$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.')],
659                         '$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.')],
660                         '$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.')],
661                         '$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.')],
662
663                         '$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.')],
664
665                         '$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')]],
666
667                         '$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)],
668                         '$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.')],
669                         '$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.')],
670                         '$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())],
671
672                         '$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.')],
673                         '$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')],
674                         '$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')],
675                         '$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')]],
676                         '$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.')],
677                         '$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".')],
678
679                         '$form_security_token'    => parent::getFormSecurityToken('admin_site'),
680                         '$relocate_button'        => L10n::t('Start Relocation'),
681                 ]);
682         }
683 }