Merge pull request #10609 from tobiasd/20210816-10514

Issue 10514: add TLS check to the installer
This commit is contained in:
Hypolite Petovan 2021-08-17 07:58:17 -04:00 committed by GitHub
commit 64d6df659d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 122 additions and 62 deletions

View file

@ -129,6 +129,10 @@ class Installer
$returnVal = false; $returnVal = false;
} }
if (!$this->checkTLS()) {
$returnVal = false;
}
if (!$this->checkKeys()) { if (!$this->checkKeys()) {
$returnVal = false; $returnVal = false;
} }
@ -580,6 +584,38 @@ class Installer
return $status; return $status;
} }
/**
* TLS Check
*
* Tries to determine whether the connection to the server is secured
* by TLS or not. If not the user will be warned that it is higly
* encuraged to use TLS.
*
* @return bool (true) as TLS is not mandatory
*/
public function checkTLS()
{
$tls = false;
if (isset($_SERVER['HTTPS'])) {
if (($_SERVER['HTTPS'] == 1) || ($_SERVER['HTTPS'] == 'on')) {
$tls = true;
}
}
if (!$tls) {
$help = DI::l10n()->t('The detection of TLS to secure the communication between the browser and the new Friendica server failed.');
$help .= ' ' . DI::l10n()->t('It is highly encouraged to use Friendica only over a secure connection as sensitive information like passwords will be transmitted.');
$help .= ' ' . DI::l10n()->t('Please ensure that the connection to the server is secure.');
$this->addCheck(DI::l10n()->t('No TLS detected'), $tls, false, $help);
} else {
$this->addCheck(DI::l10n()->t('TLS detected'), $tls, false, '');
}
// TLS is not required
return true;
}
/** /**
* Imagick Check * Imagick Check
* *

View file

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: 2021.09-dev\n" "Project-Id-Version: 2021.09-dev\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-08-16 23:28+0200\n" "POT-Creation-Date: 2021-08-17 08:39+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -3679,29 +3679,29 @@ msgstr ""
msgid "Connectors" msgid "Connectors"
msgstr "" msgstr ""
#: src/Core/Installer.php:179 #: src/Core/Installer.php:183
msgid "" msgid ""
"The database configuration file \"config/local.config.php\" could not be " "The database configuration file \"config/local.config.php\" could not be "
"written. Please use the enclosed text to create a configuration file in your " "written. Please use the enclosed text to create a configuration file in your "
"web server root." "web server root."
msgstr "" msgstr ""
#: src/Core/Installer.php:198 #: src/Core/Installer.php:202
msgid "" msgid ""
"You may need to import the file \"database.sql\" manually using phpmyadmin " "You may need to import the file \"database.sql\" manually using phpmyadmin "
"or mysql." "or mysql."
msgstr "" msgstr ""
#: src/Core/Installer.php:199 src/Module/Install.php:206 #: src/Core/Installer.php:203 src/Module/Install.php:206
#: src/Module/Install.php:365 #: src/Module/Install.php:365
msgid "Please see the file \"doc/INSTALL.md\"." msgid "Please see the file \"doc/INSTALL.md\"."
msgstr "" msgstr ""
#: src/Core/Installer.php:260 #: src/Core/Installer.php:264
msgid "Could not find a command line version of PHP in the web server PATH." msgid "Could not find a command line version of PHP in the web server PATH."
msgstr "" msgstr ""
#: src/Core/Installer.php:261 #: src/Core/Installer.php:265
msgid "" msgid ""
"If you don't have a command line version of PHP installed on your server, " "If you don't have a command line version of PHP installed on your server, "
"you will not be able to run the background processing. See <a href='https://" "you will not be able to run the background processing. See <a href='https://"
@ -3709,259 +3709,283 @@ msgid ""
"worker'>'Setup the worker'</a>" "worker'>'Setup the worker'</a>"
msgstr "" msgstr ""
#: src/Core/Installer.php:266 #: src/Core/Installer.php:270
msgid "PHP executable path" msgid "PHP executable path"
msgstr "" msgstr ""
#: src/Core/Installer.php:266 #: src/Core/Installer.php:270
msgid "" msgid ""
"Enter full path to php executable. You can leave this blank to continue the " "Enter full path to php executable. You can leave this blank to continue the "
"installation." "installation."
msgstr "" msgstr ""
#: src/Core/Installer.php:271 #: src/Core/Installer.php:275
msgid "Command line PHP" msgid "Command line PHP"
msgstr "" msgstr ""
#: src/Core/Installer.php:280 #: src/Core/Installer.php:284
msgid "PHP executable is not the php cli binary (could be cgi-fgci version)" msgid "PHP executable is not the php cli binary (could be cgi-fgci version)"
msgstr "" msgstr ""
#: src/Core/Installer.php:281 #: src/Core/Installer.php:285
msgid "Found PHP version: " msgid "Found PHP version: "
msgstr "" msgstr ""
#: src/Core/Installer.php:283 #: src/Core/Installer.php:287
msgid "PHP cli binary" msgid "PHP cli binary"
msgstr "" msgstr ""
#: src/Core/Installer.php:296 #: src/Core/Installer.php:300
msgid "" msgid ""
"The command line version of PHP on your system does not have " "The command line version of PHP on your system does not have "
"\"register_argc_argv\" enabled." "\"register_argc_argv\" enabled."
msgstr "" msgstr ""
#: src/Core/Installer.php:297 #: src/Core/Installer.php:301
msgid "This is required for message delivery to work." msgid "This is required for message delivery to work."
msgstr "" msgstr ""
#: src/Core/Installer.php:302 #: src/Core/Installer.php:306
msgid "PHP register_argc_argv" msgid "PHP register_argc_argv"
msgstr "" msgstr ""
#: src/Core/Installer.php:334 #: src/Core/Installer.php:338
msgid "" msgid ""
"Error: the \"openssl_pkey_new\" function on this system is not able to " "Error: the \"openssl_pkey_new\" function on this system is not able to "
"generate encryption keys" "generate encryption keys"
msgstr "" msgstr ""
#: src/Core/Installer.php:335 #: src/Core/Installer.php:339
msgid "" msgid ""
"If running under Windows, please see \"http://www.php.net/manual/en/openssl." "If running under Windows, please see \"http://www.php.net/manual/en/openssl."
"installation.php\"." "installation.php\"."
msgstr "" msgstr ""
#: src/Core/Installer.php:338 #: src/Core/Installer.php:342
msgid "Generate encryption keys" msgid "Generate encryption keys"
msgstr "" msgstr ""
#: src/Core/Installer.php:390 #: src/Core/Installer.php:394
msgid "" msgid ""
"Error: Apache webserver mod-rewrite module is required but not installed." "Error: Apache webserver mod-rewrite module is required but not installed."
msgstr "" msgstr ""
#: src/Core/Installer.php:395 #: src/Core/Installer.php:399
msgid "Apache mod_rewrite module" msgid "Apache mod_rewrite module"
msgstr "" msgstr ""
#: src/Core/Installer.php:401 #: src/Core/Installer.php:405
msgid "Error: PDO or MySQLi PHP module required but not installed." msgid "Error: PDO or MySQLi PHP module required but not installed."
msgstr "" msgstr ""
#: src/Core/Installer.php:406 #: src/Core/Installer.php:410
msgid "Error: The MySQL driver for PDO is not installed." msgid "Error: The MySQL driver for PDO is not installed."
msgstr "" msgstr ""
#: src/Core/Installer.php:410 #: src/Core/Installer.php:414
msgid "PDO or MySQLi PHP module" msgid "PDO or MySQLi PHP module"
msgstr "" msgstr ""
#: src/Core/Installer.php:418 #: src/Core/Installer.php:422
msgid "Error, XML PHP module required but not installed." msgid "Error, XML PHP module required but not installed."
msgstr "" msgstr ""
#: src/Core/Installer.php:422 #: src/Core/Installer.php:426
msgid "XML PHP module" msgid "XML PHP module"
msgstr "" msgstr ""
#: src/Core/Installer.php:425 #: src/Core/Installer.php:429
msgid "libCurl PHP module" msgid "libCurl PHP module"
msgstr "" msgstr ""
#: src/Core/Installer.php:426 #: src/Core/Installer.php:430
msgid "Error: libCURL PHP module required but not installed." msgid "Error: libCURL PHP module required but not installed."
msgstr "" msgstr ""
#: src/Core/Installer.php:432 #: src/Core/Installer.php:436
msgid "GD graphics PHP module" msgid "GD graphics PHP module"
msgstr "" msgstr ""
#: src/Core/Installer.php:433 #: src/Core/Installer.php:437
msgid "" msgid ""
"Error: GD graphics PHP module with JPEG support required but not installed." "Error: GD graphics PHP module with JPEG support required but not installed."
msgstr "" msgstr ""
#: src/Core/Installer.php:439 #: src/Core/Installer.php:443
msgid "OpenSSL PHP module" msgid "OpenSSL PHP module"
msgstr "" msgstr ""
#: src/Core/Installer.php:440 #: src/Core/Installer.php:444
msgid "Error: openssl PHP module required but not installed." msgid "Error: openssl PHP module required but not installed."
msgstr "" msgstr ""
#: src/Core/Installer.php:446 #: src/Core/Installer.php:450
msgid "mb_string PHP module" msgid "mb_string PHP module"
msgstr "" msgstr ""
#: src/Core/Installer.php:447 #: src/Core/Installer.php:451
msgid "Error: mb_string PHP module required but not installed." msgid "Error: mb_string PHP module required but not installed."
msgstr "" msgstr ""
#: src/Core/Installer.php:453 #: src/Core/Installer.php:457
msgid "iconv PHP module" msgid "iconv PHP module"
msgstr "" msgstr ""
#: src/Core/Installer.php:454 #: src/Core/Installer.php:458
msgid "Error: iconv PHP module required but not installed." msgid "Error: iconv PHP module required but not installed."
msgstr "" msgstr ""
#: src/Core/Installer.php:460 #: src/Core/Installer.php:464
msgid "POSIX PHP module" msgid "POSIX PHP module"
msgstr "" msgstr ""
#: src/Core/Installer.php:461 #: src/Core/Installer.php:465
msgid "Error: POSIX PHP module required but not installed." msgid "Error: POSIX PHP module required but not installed."
msgstr "" msgstr ""
#: src/Core/Installer.php:467 #: src/Core/Installer.php:471
msgid "Program execution functions" msgid "Program execution functions"
msgstr "" msgstr ""
#: src/Core/Installer.php:468 #: src/Core/Installer.php:472
msgid "" msgid ""
"Error: Program execution functions (proc_open) required but not enabled." "Error: Program execution functions (proc_open) required but not enabled."
msgstr "" msgstr ""
#: src/Core/Installer.php:474 #: src/Core/Installer.php:478
msgid "JSON PHP module" msgid "JSON PHP module"
msgstr "" msgstr ""
#: src/Core/Installer.php:475 #: src/Core/Installer.php:479
msgid "Error: JSON PHP module required but not installed." msgid "Error: JSON PHP module required but not installed."
msgstr "" msgstr ""
#: src/Core/Installer.php:481 #: src/Core/Installer.php:485
msgid "File Information PHP module" msgid "File Information PHP module"
msgstr "" msgstr ""
#: src/Core/Installer.php:482 #: src/Core/Installer.php:486
msgid "Error: File Information PHP module required but not installed." msgid "Error: File Information PHP module required but not installed."
msgstr "" msgstr ""
#: src/Core/Installer.php:505 #: src/Core/Installer.php:509
msgid "" msgid ""
"The web installer needs to be able to create a file called \"local.config.php" "The web installer needs to be able to create a file called \"local.config.php"
"\" in the \"config\" folder of your web server and it is unable to do so." "\" in the \"config\" folder of your web server and it is unable to do so."
msgstr "" msgstr ""
#: src/Core/Installer.php:506 #: src/Core/Installer.php:510
msgid "" msgid ""
"This is most often a permission setting, as the web server may not be able " "This is most often a permission setting, as the web server may not be able "
"to write files in your folder - even if you can." "to write files in your folder - even if you can."
msgstr "" msgstr ""
#: src/Core/Installer.php:507 #: src/Core/Installer.php:511
msgid "" msgid ""
"At the end of this procedure, we will give you a text to save in a file " "At the end of this procedure, we will give you a text to save in a file "
"named local.config.php in your Friendica \"config\" folder." "named local.config.php in your Friendica \"config\" folder."
msgstr "" msgstr ""
#: src/Core/Installer.php:508 #: src/Core/Installer.php:512
msgid "" msgid ""
"You can alternatively skip this procedure and perform a manual installation. " "You can alternatively skip this procedure and perform a manual installation. "
"Please see the file \"doc/INSTALL.md\" for instructions." "Please see the file \"doc/INSTALL.md\" for instructions."
msgstr "" msgstr ""
#: src/Core/Installer.php:511 #: src/Core/Installer.php:515
msgid "config/local.config.php is writable" msgid "config/local.config.php is writable"
msgstr "" msgstr ""
#: src/Core/Installer.php:531 #: src/Core/Installer.php:535
msgid "" msgid ""
"Friendica uses the Smarty3 template engine to render its web views. Smarty3 " "Friendica uses the Smarty3 template engine to render its web views. Smarty3 "
"compiles templates to PHP to speed up rendering." "compiles templates to PHP to speed up rendering."
msgstr "" msgstr ""
#: src/Core/Installer.php:532 #: src/Core/Installer.php:536
msgid "" msgid ""
"In order to store these compiled templates, the web server needs to have " "In order to store these compiled templates, the web server needs to have "
"write access to the directory view/smarty3/ under the Friendica top level " "write access to the directory view/smarty3/ under the Friendica top level "
"folder." "folder."
msgstr "" msgstr ""
#: src/Core/Installer.php:533 #: src/Core/Installer.php:537
msgid "" msgid ""
"Please ensure that the user that your web server runs as (e.g. www-data) has " "Please ensure that the user that your web server runs as (e.g. www-data) has "
"write access to this folder." "write access to this folder."
msgstr "" msgstr ""
#: src/Core/Installer.php:534 #: src/Core/Installer.php:538
msgid "" msgid ""
"Note: as a security measure, you should give the web server write access to " "Note: as a security measure, you should give the web server write access to "
"view/smarty3/ only--not the template files (.tpl) that it contains." "view/smarty3/ only--not the template files (.tpl) that it contains."
msgstr "" msgstr ""
#: src/Core/Installer.php:537 #: src/Core/Installer.php:541
msgid "view/smarty3 is writable" msgid "view/smarty3 is writable"
msgstr "" msgstr ""
#: src/Core/Installer.php:565 #: src/Core/Installer.php:569
msgid "" msgid ""
"Url rewrite in .htaccess seems not working. Make sure you copied .htaccess-" "Url rewrite in .htaccess seems not working. Make sure you copied .htaccess-"
"dist to .htaccess." "dist to .htaccess."
msgstr "" msgstr ""
#: src/Core/Installer.php:566 #: src/Core/Installer.php:570
msgid "" msgid ""
"In some circumstances (like running inside containers), you can skip this " "In some circumstances (like running inside containers), you can skip this "
"error." "error."
msgstr "" msgstr ""
#: src/Core/Installer.php:568 #: src/Core/Installer.php:572
msgid "Error message from Curl when fetching" msgid "Error message from Curl when fetching"
msgstr "" msgstr ""
#: src/Core/Installer.php:574 #: src/Core/Installer.php:578
msgid "Url rewrite is working" msgid "Url rewrite is working"
msgstr "" msgstr ""
#: src/Core/Installer.php:603 #: src/Core/Installer.php:607
msgid ""
"The detection of TLS to secure the communication between the browser and the "
"new Friendica server failed."
msgstr ""
#: src/Core/Installer.php:608
msgid ""
"It is highly encouraged to use Friendica only over a secure connection as "
"sensitive information like passwords will be transmitted."
msgstr ""
#: src/Core/Installer.php:609
msgid "Please ensure that the connection to the server is secure."
msgstr ""
#: src/Core/Installer.php:610
msgid "No TLS detected"
msgstr ""
#: src/Core/Installer.php:612
msgid "TLS detected"
msgstr ""
#: src/Core/Installer.php:639
msgid "ImageMagick PHP extension is not installed" msgid "ImageMagick PHP extension is not installed"
msgstr "" msgstr ""
#: src/Core/Installer.php:605 #: src/Core/Installer.php:641
msgid "ImageMagick PHP extension is installed" msgid "ImageMagick PHP extension is installed"
msgstr "" msgstr ""
#: src/Core/Installer.php:607 #: src/Core/Installer.php:643
msgid "ImageMagick supports GIF" msgid "ImageMagick supports GIF"
msgstr "" msgstr ""
#: src/Core/Installer.php:629 #: src/Core/Installer.php:665
msgid "Database already in use." msgid "Database already in use."
msgstr "" msgstr ""
#: src/Core/Installer.php:634 #: src/Core/Installer.php:670
msgid "Could not connect to database." msgid "Could not connect to database."
msgstr "" msgstr ""