Merge branch 'feature/add-ssl-support-to-mysql-database-resources-11115'

resolves #11115
This commit is contained in:
Alexander A. Klimov 2016-12-09 14:14:42 +01:00
commit 10a0c0e9d3
11 changed files with 2342 additions and 1405 deletions

View File

@ -42,22 +42,20 @@ class DbResourceForm extends Form
if (Platform::hasOciSupport()) {
$dbChoices['oci'] = 'Oracle (OCI8)';
}
$offerSsl = false;
$offerPostgres = false;
$offerMysql = false;
if (isset($formData['db'])) {
if ($formData['db'] === 'pgsql') {
$offerPostgres = true;
} elseif ($formData['db'] === 'mysql') {
$offerMysql = true;
}
} else {
$dbChoice = key($dbChoices);
if ($dbChoice === 'pgsql') {
$offerPostgres = true;
} elseif ($dbChoices === 'mysql') {
$offerMysql = true;
$dbChoice = isset($formData['db']) ? $formData['db'] : key($dbChoices);
if ($dbChoice === 'pgsql') {
$offerPostgres = true;
} elseif ($dbChoice === 'mysql') {
$offerMysql = true;
if (version_compare(Platform::getPhpVersion(), '5.4.0', '>=')) {
$offerSsl = true;
}
}
$socketInfo = '';
if ($offerPostgres) {
$socketInfo = $this->translate(
@ -68,6 +66,7 @@ class DbResourceForm extends Form
'For using unix domain sockets, specify localhost'
);
}
$this->addElement(
'text',
'name',
@ -157,6 +156,63 @@ class DbResourceForm extends Form
'label' => $this->translate('Persistent')
)
);
if ($offerSsl) {
$this->addElement(
'checkbox',
'use_ssl',
array(
'autosubmit' => true,
'label' => $this->translate('Use SSL'),
'description' => $this->translate(
'Whether to encrypt the connection or to authenticate using certificates'
)
)
);
if (isset($formData['use_ssl']) && $formData['use_ssl']) {
$this->addElement(
'text',
'ssl_key',
array(
'label' => $this->translate('SSL Key'),
'description' => $this->translate('The client key file path')
)
);
$this->addElement(
'text',
'ssl_cert',
array(
'label' => $this->translate('SSL Certificate'),
'description' => $this->translate('The certificate file path')
)
);
$this->addElement(
'text',
'ssl_ca',
array(
'label' => $this->translate('SSL CA'),
'description' => $this->translate('The CA certificate file path')
)
);
$this->addElement(
'text',
'ssl_capath',
array(
'label' => $this->translate('SSL CA Path'),
'description' => $this->translate(
'The trusted CA certificates in PEM format directory path'
)
)
);
$this->addElement(
'text',
'ssl_cipher',
array(
'label' => $this->translate('SSL Cipher'),
'description' => $this->translate('The list of permissible ciphers')
)
);
}
}
return $this;
}

File diff suppressed because it is too large Load Diff

View File

@ -143,6 +143,24 @@ class DbConnection implements Selectable, Extensible, Updatable, Reducible, Insp
break;
case 'mysql':
$adapter = 'Pdo_Mysql';
if ($this->config->use_ssl) {
# The presence of these keys as empty strings or null cause non-ssl connections to fail
if ($this->config->ssl_key) {
$adapterParamaters['driver_options'][PDO::MYSQL_ATTR_SSL_KEY] = $this->config->ssl_key;
}
if ($this->config->ssl_cert) {
$adapterParamaters['driver_options'][PDO::MYSQL_ATTR_SSL_CERT] = $this->config->ssl_cert;
}
if ($this->config->ssl_ca) {
$adapterParamaters['driver_options'][PDO::MYSQL_ATTR_SSL_CA] = $this->config->ssl_ca;
}
if ($this->config->ssl_capath) {
$adapterParamaters['driver_options'][PDO::MYSQL_ATTR_SSL_CAPATH] = $this->config->ssl_capath;
}
if ($this->config->ssl_cipher) {
$adapterParamaters['driver_options'][PDO::MYSQL_ATTR_SSL_CIPHER] = $this->config->ssl_cipher;
}
}
/*
* Set MySQL server SQL modes to behave as closely as possible to Oracle and PostgreSQL. Note that the
* ONLY_FULL_GROUP_BY mode is left on purpose because MySQL requires you to specify all non-aggregate
@ -496,11 +514,24 @@ class DbConnection implements Selectable, Extensible, Updatable, Reducible, Insp
case 'mysql':
$rows = $this->dbAdapter->query(
'SHOW VARIABLES WHERE variable_name ' .
'IN (\'version\', \'protocol_version\', \'version_compile_os\');'
'IN (\'version\', \'protocol_version\', \'version_compile_os\', \'have_ssl\');'
)->fetchAll();
$sqlinsp = new Inspection('MySQL');
$hasSsl = false;
foreach ($rows as $row) {
$sqlinsp->write($row->variable_name . ': ' . $row->value);
if ($row->variable_name === 'have_ssl' && $row->value === 'YES') {
$hasSsl = true;
}
}
if ($hasSsl) {
$ssl_rows = $this->dbAdapter->query(
'SHOW STATUS WHERE variable_name ' .
'IN (\'Ssl_Cipher\');'
)->fetchAll();
foreach ($ssl_rows as $ssl_row) {
$sqlinsp->write($ssl_row->variable_name . ': ' . $ssl_row->value);
}
}
$insp->write($sqlinsp);
break;

View File

@ -112,7 +112,45 @@ class BackendStep extends Step
. '<tr>'
. '<td><strong>' . t('Password') . '</strong></td>'
. '<td>' . str_repeat('*', strlen($this->data['resourceConfig']['password'])) . '</td>'
. '</tr>'
. '</tr>';
if (isset($this->data['resourceConfig']['ssl_key']) && $this->data['resourceConfig']['ssl_key']) {
$resourceHtml .= ''
.'<tr>'
. '<td><strong>' . t('SSL Key') . '</strong></td>'
. '<td>' . $this->data['resourceConfig']['ssl_key'] . '</td>'
. '</tr>';
}
if (isset($this->data['resourceConfig']['ssl_cert']) && $this->data['resourceConfig']['ssl_cert']) {
$resourceHtml .= ''
. '<tr>'
. '<td><strong>' . t('SSL Cert') . '</strong></td>'
. '<td>' . $this->data['resourceConfig']['ssl_cert'] . '</td>'
. '</tr>';
}
if (isset($this->data['resourceConfig']['ssl_ca']) && $this->data['resourceConfig']['ssl_ca']) {
$resourceHtml .= ''
. '<tr>'
. '<td><strong>' . t('CA') . '</strong></td>'
. '<td>' . $this->data['resourceConfig']['ssl_ca'] . '</td>'
. '</tr>';
}
if (isset($this->data['resourceConfig']['ssl_capath']) && $this->data['resourceConfig']['ssl_capath']) {
$resourceHtml .= ''
. '<tr>'
. '<td><strong>' . t('CA Path') . '</strong></td>'
. '<td>' . $this->data['resourceConfig']['ssl_capath'] . '</td>'
. '</tr>';
}
if (isset($this->data['resourceConfig']['ssl_cipher']) && $this->data['resourceConfig']['ssl_cipher']) {
$resourceHtml .= ''
. '<tr>'
. '<td><strong>' . t('Cipher') . '</strong></td>'
. '<td>' . $this->data['resourceConfig']['ssl_cipher'] . '</td>'
. '</tr>';
}
$resourceHtml .= ''
. '</tbody>'
. '</table>';
} else { // $this->data['resourceConfig']['type'] === 'livestatus'

View File

@ -1,33 +1,33 @@
# Icinga Web 2 - Head for multiple monitoring backends.
# Copyright (C) 2015 Icinga Development Team
# Copyright (C) 2016 Icinga Development Team
# This file is distributed under the same license as Setup Module.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
#
msgid ""
msgstr ""
"Project-Id-Version: Setup Module (2.0.0)\n"
"Project-Id-Version: Setup Module (2.3.4)\n"
"Report-Msgid-Bugs-To: dev@icinga.org\n"
"POT-Creation-Date: 2015-10-02 10:00+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2016-12-08 17:19+0000\n"
"PO-Revision-Date: 2016-12-08 18:22+0100\n"
"Language: de_DE\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"Last-Translator: \n"
"Language-Team: \n"
"X-Generator: Poedit 1.8.11\n"
#: /vagrant/modules/setup/library/Setup/Requirement/OSRequirement.php:15
#, php-format
msgid "%s Platform"
msgstr ""
#: /vagrant/modules/setup/application/views/scripts/form/setup-welcome.phtml:98
#: /vagrant/modules/setup/application/views/scripts/form/setup-welcome.phtml:104
msgid "<your-webserver-user>"
msgstr ""
#: /vagrant/modules/setup/application/views/scripts/form/setup-welcome.phtml:78
#: /vagrant/modules/setup/application/views/scripts/form/setup-welcome.phtml:84
msgid "A system group called \"icingaweb2\" exists"
msgstr ""
@ -52,11 +52,8 @@ msgstr ""
msgid "Account \"%s\" has been successfully defined as initial administrator."
msgstr ""
#: /vagrant/modules/setup/application/forms/AdminAccountPage.php:52
#: /vagrant/modules/setup/library/Setup/Steps/AuthenticationStep.php:122
msgid "Administration"
msgstr ""
#: /vagrant/modules/setup/application/forms/AdminAccountPage.php:51
msgctxt "setup.page.title"
msgid "Administration"
msgstr ""
@ -82,14 +79,15 @@ msgid ""
"\"%s\"."
msgstr ""
#: /vagrant/modules/setup/library/Setup/Steps/AuthenticationStep.php:73
#: /vagrant/modules/setup/library/Setup/Steps/AuthenticationStep.php:83
#: /vagrant/modules/setup/library/Setup/Steps/UserGroupStep.php:83
#: /vagrant/modules/setup/library/Setup/Steps/UserGroupStep.php:105
#: /vagrant/modules/setup/library/Setup/Steps/UserGroupStep.php:186
#: /vagrant/modules/setup/library/Setup/Steps/UserGroupStep.php:191
#: /vagrant/modules/setup/library/Setup/Steps/UserGroupStep.php:200
#: /vagrant/modules/setup/library/Setup/Steps/UserGroupStep.php:206
#: /vagrant/modules/setup/library/Setup/Steps/AuthenticationStep.php:73
#: /vagrant/modules/setup/library/Setup/Steps/AuthenticationStep.php:83
msgctxt "setup.role.name"
msgid "Administrators"
msgstr ""
@ -101,11 +99,8 @@ msgstr ""
msgid "An exception's stacktrace is shown to every user by default."
msgstr ""
#: /vagrant/modules/setup/library/Setup/Steps/GeneralConfigStep.php:50
msgid "Application Configuration"
msgstr ""
#: /vagrant/modules/setup/application/forms/GeneralConfigPage.php:21
#: /vagrant/modules/setup/library/Setup/Steps/GeneralConfigStep.php:50
msgctxt "setup.page.title"
msgid "Application Configuration"
msgstr ""
@ -124,25 +119,19 @@ msgid ""
"is defining a name for your first authentication backend."
msgstr ""
#: /vagrant/modules/setup/application/forms/AuthenticationPage.php:22
#: /vagrant/modules/setup/library/Setup/Steps/AuthenticationStep.php:120
msgid "Authentication"
msgstr ""
#: /vagrant/modules/setup/application/forms/AuthenticationPage.php:21
msgctxt "setup.page.title"
msgid "Authentication"
msgstr ""
#: /vagrant/modules/setup/library/Setup/Steps/AuthenticationStep.php:121
msgid "Authentication Backend"
msgstr ""
#: /vagrant/modules/setup/application/forms/AuthBackendPage.php:32
#: /vagrant/modules/setup/library/Setup/Steps/AuthenticationStep.php:121
msgctxt "setup.page.title"
msgid "Authentication Backend"
msgstr ""
#: /vagrant/modules/setup/application/forms/AuthenticationPage.php:59
#: /vagrant/modules/setup/application/forms/AuthenticationPage.php:63
msgid "Authentication Type"
msgstr ""
@ -161,8 +150,8 @@ msgstr ""
msgid "Back"
msgstr ""
#: /vagrant/modules/setup/library/Setup/Steps/UserGroupStep.php:141
#: /vagrant/modules/setup/library/Setup/Steps/AuthenticationStep.php:138
#: /vagrant/modules/setup/library/Setup/Steps/UserGroupStep.php:141
msgid "Backend Name"
msgstr ""
@ -177,19 +166,27 @@ msgid ""
"able to locate account details."
msgstr ""
#: /vagrant/modules/setup/library/Setup/Steps/ResourceStep.php:119
#: /vagrant/modules/setup/library/Setup/Steps/ResourceStep.php:157
msgid "Bind DN"
msgstr ""
#: /vagrant/modules/setup/library/Setup/Steps/ResourceStep.php:123
#: /vagrant/modules/setup/library/Setup/Steps/ResourceStep.php:161
msgid "Bind Password"
msgstr ""
#: /vagrant/modules/setup/application/forms/AdminAccountPage.php:103
#: /vagrant/modules/setup/application/forms/AdminAccountPage.php:104
msgctxt "setup.admin"
msgid "By Name"
msgstr ""
#: /vagrant/modules/setup/library/Setup/Steps/ResourceStep.php:111
msgid "CA"
msgstr "CA"
#: /vagrant/modules/setup/library/Setup/Steps/ResourceStep.php:118
msgid "CA Path"
msgstr "CA-Pfad"
#: /vagrant/modules/setup/application/clicommands/ConfigCommand.php:78
#, php-format
msgid "Can't change the group of %s to %s: %s"
@ -243,14 +240,14 @@ msgstr ""
msgid "Check this to not to validate the configuration"
msgstr ""
#: /vagrant/modules/setup/application/forms/AdminAccountPage.php:172
#: /vagrant/modules/setup/application/forms/AdminAccountPage.php:173
msgctxt "setup.admin"
msgid ""
"Choose a user group reported by the LDAP backend to permit its members "
"administrative access."
msgstr ""
#: /vagrant/modules/setup/application/forms/AdminAccountPage.php:190
#: /vagrant/modules/setup/application/forms/AdminAccountPage.php:191
#, php-format
msgctxt "setup.admin"
msgid ""
@ -258,10 +255,14 @@ msgid ""
"account."
msgstr ""
#: /vagrant/modules/setup/application/forms/AdminAccountPage.php:132
#: /vagrant/modules/setup/application/forms/AdminAccountPage.php:133
msgid "Choose how to define the desired account."
msgstr ""
#: /vagrant/modules/setup/library/Setup/Steps/ResourceStep.php:125
msgid "Cipher"
msgstr "Verschlüsselung"
#: /vagrant/modules/setup/application/views/scripts/index/index.phtml:70
msgctxt "setup.progress"
msgid "Configuration"
@ -271,9 +272,10 @@ msgstr ""
msgid "Congratulations! Icinga Web 2 has been successfully set up."
msgstr ""
#: /vagrant/modules/setup/application/forms/LdapDiscoveryPage.php:81
#: /vagrant/modules/setup/application/forms/LdapDiscoveryPage.php:80
#, php-format
msgid "Could not find any LDAP servers on the domain \"%s\"."
msgid ""
"Could not find any LDAP servers on the domain \"%s\". An error occurred: %s"
msgstr ""
#: /vagrant/modules/setup/application/clicommands/ConfigCommand.php:155
@ -297,13 +299,17 @@ msgstr ""
msgid "Creating new database \"%s\"..."
msgstr ""
#: /vagrant/modules/setup/library/Setup/Steps/UserGroupStep.php:149
#: /vagrant/modules/setup/library/Setup/Steps/AuthenticationStep.php:147
#: /vagrant/modules/setup/library/Setup/Steps/UserGroupStep.php:149
msgid "Custom Filter"
msgstr ""
#: /vagrant/modules/setup/application/forms/AuthenticationPage.php:50
msgid "Database"
msgstr ""
#: /vagrant/modules/setup/library/Setup/Steps/ResourceStep.php:61
#: /vagrant/modules/setup/application/forms/AuthenticationPage.php:46
msgctxt "setup.page.title"
msgid "Database"
msgstr ""
@ -316,11 +322,8 @@ msgctxt "setup.page.title"
msgid "Database Resource"
msgstr ""
#: /vagrant/modules/setup/library/Setup/Steps/DatabaseStep.php:245
msgid "Database Setup"
msgstr ""
#: /vagrant/modules/setup/application/forms/DatabaseCreationPage.php:41
#: /vagrant/modules/setup/library/Setup/Steps/DatabaseStep.php:245
msgctxt "setup.page.title"
msgid "Database Setup"
msgstr ""
@ -343,42 +346,36 @@ msgstr ""
msgid "Default Timezone"
msgstr ""
#: /vagrant/modules/setup/application/forms/AdminAccountPage.php:157
#: /vagrant/modules/setup/application/forms/AdminAccountPage.php:158
msgid ""
"Define the initial administrative account by providing a username that "
"reflects a user created later or one that is authenticated using external "
"mechanisms."
msgstr ""
#: /vagrant/modules/setup/library/Setup/Utils/MakeDirStep.php:53
#, php-format
msgid "Directory \"%s\" in \"%s\" has been successfully created."
msgstr ""
#: /vagrant/modules/setup/application/forms/LdapDiscoveryPage.php:50
#: /vagrant/modules/setup/application/forms/LdapDiscoveryPage.php:51
msgid "Do not discover LDAP servers and enter all settings manually."
msgstr ""
#: /vagrant/modules/setup/library/Setup/Utils/EnableModuleStep.php:61
#: /vagrant/modules/setup/library/Setup/Utils/MakeDirStep.php:61
#: /vagrant/modules/setup/library/Setup/Steps/UserGroupStep.php:180
#: /vagrant/modules/setup/library/Setup/Steps/UserGroupStep.php:193
#: /vagrant/modules/setup/library/Setup/Steps/UserGroupStep.php:208
#: /vagrant/modules/setup/library/Setup/Steps/GeneralConfigStep.php:120
#: /vagrant/modules/setup/library/Setup/Steps/ResourceStep.php:147
#: /vagrant/modules/setup/library/Setup/Steps/DatabaseStep.php:257
#: /vagrant/modules/setup/library/Setup/Steps/ResourceStep.php:185
#: /vagrant/modules/setup/library/Setup/Steps/GeneralConfigStep.php:120
#: /vagrant/modules/setup/library/Setup/Steps/AuthenticationStep.php:198
#: /vagrant/modules/setup/library/Setup/Steps/AuthenticationStep.php:211
#: /vagrant/modules/setup/library/Setup/Steps/AuthenticationStep.php:233
#: /vagrant/modules/setup/library/Setup/Steps/UserGroupStep.php:180
#: /vagrant/modules/setup/library/Setup/Steps/UserGroupStep.php:193
#: /vagrant/modules/setup/library/Setup/Steps/UserGroupStep.php:208
#: /vagrant/modules/setup/library/Setup/Utils/EnableModuleStep.php:61
#, php-format
msgid "ERROR: %s"
msgstr ""
#: /vagrant/modules/setup/application/forms/AdminAccountPage.php:222
#: /vagrant/modules/setup/application/forms/AdminAccountPage.php:223
msgid "Enter the password to assign to the newly created account."
msgstr ""
#: /vagrant/modules/setup/application/forms/AdminAccountPage.php:210
#: /vagrant/modules/setup/application/forms/AdminAccountPage.php:211
msgid ""
"Enter the username to be used when creating an initial administrative "
"account."
@ -389,12 +386,12 @@ msgctxt "app.config.logging.level"
msgid "Error"
msgstr ""
#: /vagrant/modules/setup/application/forms/AdminAccountPage.php:120
#: /vagrant/modules/setup/application/forms/AdminAccountPage.php:121
msgctxt "setup.admin"
msgid "Existing User"
msgstr ""
#: /vagrant/modules/setup/application/forms/AuthenticationPage.php:51
#: /vagrant/modules/setup/application/forms/AuthenticationPage.php:55
msgid "External"
msgstr ""
@ -402,8 +399,8 @@ msgstr ""
msgid "Failed to fully setup the database. An error occured:"
msgstr ""
#: /vagrant/modules/setup/application/forms/AuthBackendPage.php:199
#: /vagrant/modules/setup/application/forms/LdapResourcePage.php:119
#: /vagrant/modules/setup/application/forms/AuthBackendPage.php:199
#: /vagrant/modules/setup/application/forms/DbResourcePage.php:117
#, php-format
msgid "Failed to successfully validate the configuration: %s"
@ -432,7 +429,7 @@ msgctxt "setup.progress"
msgid "Finish"
msgstr ""
#: /vagrant/modules/setup/application/forms/WelcomePage.php:37
#: /vagrant/modules/setup/application/forms/WelcomePage.php:38
msgid ""
"For security reasons we need to ensure that you are permitted to run this "
"wizard. Please provide a token by following the instructions below."
@ -463,7 +460,7 @@ msgstr ""
msgid "Group Member Attribute"
msgstr ""
#: /vagrant/modules/setup/application/forms/AdminAccountPage.php:170
#: /vagrant/modules/setup/application/forms/AdminAccountPage.php:171
msgid "Group Name"
msgstr ""
@ -476,11 +473,11 @@ msgid "Group Object Class"
msgstr ""
#: /vagrant/modules/setup/library/Setup/Steps/ResourceStep.php:74
#: /vagrant/modules/setup/library/Setup/Steps/ResourceStep.php:107
#: /vagrant/modules/setup/library/Setup/Steps/ResourceStep.php:145
msgid "Host"
msgstr ""
#: /vagrant/modules/setup/application/views/scripts/form/setup-welcome.phtml:102
#: /vagrant/modules/setup/application/views/scripts/form/setup-welcome.phtml:108
msgid "Icinga Web 2 documentation"
msgstr ""
@ -502,16 +499,16 @@ msgid ""
"is required."
msgstr ""
#: /vagrant/modules/setup/application/views/scripts/form/setup-welcome.phtml:91
#: /vagrant/modules/setup/application/views/scripts/form/setup-welcome.phtml:97
msgid "If you've got the IcingaCLI installed you can do the following:"
msgstr ""
#: /vagrant/modules/setup/application/views/scripts/form/setup-welcome.phtml:76
#: /vagrant/modules/setup/application/views/scripts/form/setup-welcome.phtml:82
msgid ""
"In any case, make sure that all of the following applies to your environment:"
msgstr ""
#: /vagrant/modules/setup/application/views/scripts/form/setup-welcome.phtml:96
#: /vagrant/modules/setup/application/views/scripts/form/setup-welcome.phtml:102
msgid "In case the IcingaCLI is missing you can create the token manually:"
msgstr ""
@ -552,7 +549,7 @@ msgid ""
"database. Please provide appropriate access credentials to solve this."
msgstr ""
#: /vagrant/modules/setup/application/forms/LdapDiscoveryPage.php:30
#: /vagrant/modules/setup/application/forms/LdapDiscoveryPage.php:31
msgctxt "setup.page.title"
msgid "LDAP Discovery"
msgstr ""
@ -610,7 +607,7 @@ msgctxt "setup.progress"
msgid "Modules"
msgstr ""
#: /vagrant/modules/setup/application/forms/AdminAccountPage.php:113
#: /vagrant/modules/setup/application/forms/AdminAccountPage.php:114
msgctxt "setup.admin"
msgid "New User"
msgstr ""
@ -621,8 +618,8 @@ msgid ""
"with the schema required by Icinga Web 2 manually."
msgstr ""
#: /vagrant/modules/setup/library/Setup/Steps/UserGroupStep.php:150
#: /vagrant/modules/setup/library/Setup/Steps/AuthenticationStep.php:148
#: /vagrant/modules/setup/library/Setup/Steps/UserGroupStep.php:150
msgctxt "auth.ldap.filter"
msgid "None"
msgstr ""
@ -646,7 +643,7 @@ msgid ""
"action."
msgstr ""
#: /vagrant/modules/setup/application/forms/AdminAccountPage.php:53
#: /vagrant/modules/setup/application/forms/AdminAccountPage.php:54
msgid ""
"Now it's time to configure your first administrative account or group for "
"Icinga Web 2."
@ -684,23 +681,23 @@ msgstr ""
msgid "PHP Version"
msgstr ""
#: /vagrant/modules/setup/library/Setup/Steps/ResourceStep.php:90
#: /vagrant/modules/setup/application/forms/AdminAccountPage.php:220
#: /vagrant/modules/setup/application/forms/AdminAccountPage.php:221
#: /vagrant/modules/setup/application/forms/DatabaseCreationPage.php:111
#: /vagrant/modules/setup/library/Setup/Steps/ResourceStep.php:90
msgid "Password"
msgstr ""
#: /vagrant/modules/setup/application/forms/AuthenticationPage.php:23
#: /vagrant/modules/setup/application/forms/AuthenticationPage.php:24
msgid ""
"Please choose how you want to authenticate when accessing Icinga Web 2. "
"Configuring backend specific details follows in a later step."
msgstr ""
#: /vagrant/modules/setup/application/forms/AdminAccountPage.php:234
#: /vagrant/modules/setup/application/forms/AdminAccountPage.php:235
msgid "Please repeat the password given above to avoid typing errors."
msgstr ""
#: /vagrant/modules/setup/application/views/scripts/form/setup-welcome.phtml:101
#: /vagrant/modules/setup/application/views/scripts/form/setup-welcome.phtml:107
#, php-format
msgid ""
"Please see the %s for an extensive description on how to access and use this "
@ -708,7 +705,7 @@ msgid ""
msgstr ""
#: /vagrant/modules/setup/library/Setup/Steps/ResourceStep.php:78
#: /vagrant/modules/setup/library/Setup/Steps/ResourceStep.php:111
#: /vagrant/modules/setup/library/Setup/Steps/ResourceStep.php:149
msgid "Port"
msgstr ""
@ -734,7 +731,7 @@ msgstr ""
msgid "Refresh the page; %s"
msgstr ""
#: /vagrant/modules/setup/application/forms/AdminAccountPage.php:232
#: /vagrant/modules/setup/application/forms/AdminAccountPage.php:233
msgid "Repeat password"
msgstr ""
@ -750,29 +747,31 @@ msgid "Requirements"
msgstr ""
#: /vagrant/modules/setup/library/Setup/Steps/ResourceStep.php:57
msgctxt "setup.page.title"
msgid "Resource"
msgstr ""
#: /vagrant/modules/setup/library/Setup/Steps/ResourceStep.php:66
#: /vagrant/modules/setup/library/Setup/Steps/ResourceStep.php:103
#: /vagrant/modules/setup/library/Setup/Steps/ResourceStep.php:141
msgid "Resource Name"
msgstr ""
#: /vagrant/modules/setup/library/Setup/Steps/ResourceStep.php:144
#: /vagrant/modules/setup/library/Setup/Steps/ResourceStep.php:182
#, php-format
msgid "Resource configuration could not be written to: %s. An error occured:"
msgstr ""
#: /vagrant/modules/setup/library/Setup/Steps/ResourceStep.php:138
#: /vagrant/modules/setup/library/Setup/Steps/ResourceStep.php:176
#, php-format
msgid "Resource configuration has been successfully written to: %s"
msgstr ""
#: /vagrant/modules/setup/library/Setup/Steps/ResourceStep.php:55
msgctxt "setup.page.title"
msgid "Resources"
msgstr ""
#: /vagrant/modules/setup/library/Setup/Steps/ResourceStep.php:115
#: /vagrant/modules/setup/library/Setup/Steps/ResourceStep.php:153
msgid "Root DN"
msgstr ""
@ -782,11 +781,20 @@ msgid ""
"built-in web server require PHP version 5.4."
msgstr ""
#: /vagrant/modules/setup/library/Setup/Steps/ResourceStep.php:104
msgid "SSL Cert"
msgstr "SSL-Zertifikat"
#: /vagrant/modules/setup/library/Setup/Steps/ResourceStep.php:97
msgid "SSL Key"
msgstr "SSL-Schlüssel"
#: /vagrant/modules/setup/library/Setup/WebWizard.php:356
msgctxt "setup.summary.btn.finish"
msgid "Setup Icinga Web 2"
msgstr ""
#: /vagrant/modules/setup/application/forms/WelcomePage.php:35
#: /vagrant/modules/setup/application/forms/WelcomePage.php:36
msgid "Setup Token"
msgstr ""
@ -798,13 +806,13 @@ msgstr ""
msgid "Show the login page of Icinga Web 2"
msgstr ""
#: /vagrant/modules/setup/application/forms/LdapDiscoveryPage.php:49
#: /vagrant/modules/setup/application/forms/LdapDiscoveryPage.php:50
msgid "Skip"
msgstr ""
#: /vagrant/modules/setup/application/forms/DatabaseCreationPage.php:201
#: /vagrant/modules/setup/application/forms/AuthBackendPage.php:227
#: /vagrant/modules/setup/application/forms/LdapResourcePage.php:145
#: /vagrant/modules/setup/application/forms/AuthBackendPage.php:227
#: /vagrant/modules/setup/application/forms/DbResourcePage.php:178
msgid "Skip Validation"
msgstr ""
@ -814,6 +822,7 @@ msgid "Sorry! Failed to set up Icinga Web 2 successfully."
msgstr ""
#: /vagrant/modules/setup/library/Setup/WebWizard.php:354
msgctxt "setup.welcome.btn.next"
msgid "Start"
msgstr ""
@ -835,11 +844,13 @@ msgstr ""
#: /vagrant/modules/setup/library/Setup/Requirement/ClassRequirement.php:16
#, php-format
msgctxt "setup.requirement.class"
msgid "The %s is available."
msgstr ""
#: /vagrant/modules/setup/library/Setup/Requirement/ClassRequirement.php:22
#, php-format
msgctxt "setup.requirement.class"
msgid "The %s is missing."
msgstr ""
@ -892,10 +903,10 @@ msgid ""
"database."
msgstr ""
#: /vagrant/modules/setup/application/clicommands/TokenCommand.php:35
#: /vagrant/modules/setup/application/clicommands/TokenCommand.php:67
#: /vagrant/modules/setup/application/clicommands/ConfigCommand.php:39
#: /vagrant/modules/setup/application/clicommands/ConfigCommand.php:140
#: /vagrant/modules/setup/application/clicommands/TokenCommand.php:35
#: /vagrant/modules/setup/application/clicommands/TokenCommand.php:67
msgid ""
"The argument --config expects a path to Icinga Web 2's configuration files"
msgstr ""
@ -920,8 +931,8 @@ msgid ""
"webserver will serve files"
msgstr ""
#: /vagrant/modules/setup/application/forms/AuthBackendPage.php:206
#: /vagrant/modules/setup/application/forms/LdapResourcePage.php:126
#: /vagrant/modules/setup/application/forms/AuthBackendPage.php:206
#: /vagrant/modules/setup/application/forms/DbResourcePage.php:96
msgid "The configuration has been successfully validated."
msgstr ""
@ -987,8 +998,9 @@ msgid ""
"to not mix different schemas in the same database. If this is intentional, "
"you can skip the validation and ignore this warning. If not, please provide "
"a different database."
msgstr "Es scheint so, als wäre die von dir konfigurierte Datenbank jene von "
"Icinga. Bitte beachte, dass diese Datenbank-Konfiguration für die alleinige "
msgstr ""
"Es scheint so, als wäre die von dir konfigurierte Datenbank jene von Icinga. "
"Bitte beachte, dass diese Datenbank-Konfiguration für die alleinige "
"Verwendung durch Icinga Web 2 vorgesehen und dass es empfehlenswert ist, "
"keine unterschiedlichen Schemas in der selben Datenbank einzusetzen. Falls "
"dies Absicht ist, kannst du die Validierung überspringen und diese Warnung "
@ -1055,7 +1067,7 @@ msgid ""
"the login \"%s\"."
msgstr ""
#: /vagrant/modules/setup/application/forms/AuthenticationPage.php:60
#: /vagrant/modules/setup/application/forms/AuthenticationPage.php:64
msgid "The type of authentication to use when accessing Icinga Web 2"
msgstr ""
@ -1063,12 +1075,12 @@ msgstr ""
msgid "The type of the resource being used for this authenticaton provider"
msgstr ""
#: /vagrant/modules/setup/application/views/scripts/form/setup-welcome.phtml:80
#: /vagrant/modules/setup/application/views/scripts/form/setup-welcome.phtml:86
#, php-format
msgid "The user \"%s\" is a member of the system group \"icingaweb2\""
msgstr ""
#: /vagrant/modules/setup/application/views/scripts/form/setup-welcome.phtml:56
#: /vagrant/modules/setup/application/views/scripts/form/setup-welcome.phtml:62
msgid ""
"This wizard will guide you through the configuration of Icinga Web 2. Once "
"completed and successfully finished you are able to log in and to explore "
@ -1088,7 +1100,7 @@ msgid ""
"required."
msgstr ""
#: /vagrant/modules/setup/application/views/scripts/form/setup-welcome.phtml:73
#: /vagrant/modules/setup/application/views/scripts/form/setup-welcome.phtml:79
msgid ""
"To run this wizard a user needs to authenticate using a token which is "
"usually provided to him by an administrator who'd followed the instructions "
@ -1112,7 +1124,7 @@ msgctxt "app.config.logging"
msgid "Type"
msgstr ""
#: /vagrant/modules/setup/application/forms/AdminAccountPage.php:131
#: /vagrant/modules/setup/application/forms/AdminAccountPage.php:132
msgid "Type Of Definition"
msgstr ""
@ -1128,11 +1140,6 @@ msgstr ""
msgid "Unable to create account \"%s\". An error occured:"
msgstr ""
#: /vagrant/modules/setup/library/Setup/Utils/MakeDirStep.php:54
#, php-format
msgid "Unable to create directory \"%s\" in \"%s\". An error occured:"
msgstr ""
#: /vagrant/modules/setup/library/Setup/Steps/UserGroupStep.php:190
#, php-format
msgid "Unable to create user group \"%s\". An error occured:"
@ -1155,7 +1162,7 @@ msgstr ""
msgid "Unknown type"
msgstr ""
#: /vagrant/modules/setup/application/forms/AdminAccountPage.php:109
#: /vagrant/modules/setup/application/forms/AdminAccountPage.php:110
msgctxt "setup.admin"
msgid "User Group"
msgstr ""
@ -1165,11 +1172,8 @@ msgstr ""
msgid "User Group \"%s\" has been successfully created."
msgstr ""
#: /vagrant/modules/setup/library/Setup/Steps/UserGroupStep.php:135
msgid "User Group Backend"
msgstr ""
#: /vagrant/modules/setup/application/forms/UserGroupBackendPage.php:37
#: /vagrant/modules/setup/library/Setup/Steps/UserGroupStep.php:135
msgctxt "setup.page.title"
msgid "User Group Backend"
msgstr ""
@ -1187,6 +1191,7 @@ msgid "User Group Backend configuration has been successfully written to: %s"
msgstr ""
#: /vagrant/modules/setup/library/Setup/Steps/UserGroupStep.php:134
msgctxt "setup.page.title"
msgid "User Groups"
msgstr ""
@ -1198,20 +1203,21 @@ msgstr ""
msgid "User Object Class"
msgstr ""
#: /vagrant/modules/setup/library/Setup/Steps/ResourceStep.php:86
#: /vagrant/modules/setup/application/forms/AdminAccountPage.php:155
#: /vagrant/modules/setup/application/forms/AdminAccountPage.php:187
#: /vagrant/modules/setup/application/forms/AdminAccountPage.php:208
#: /vagrant/modules/setup/application/forms/AdminAccountPage.php:156
#: /vagrant/modules/setup/application/forms/AdminAccountPage.php:188
#: /vagrant/modules/setup/application/forms/AdminAccountPage.php:209
#: /vagrant/modules/setup/application/forms/DatabaseCreationPage.php:100
#: /vagrant/modules/setup/library/Setup/Steps/ResourceStep.php:86
msgid "Username"
msgstr ""
#: /vagrant/modules/setup/application/forms/AdminAccountPage.php:258
#: /vagrant/modules/setup/application/forms/AdminAccountPage.php:259
msgid "Username already exists."
msgstr ""
#: /vagrant/modules/setup/library/Setup/Steps/AuthenticationStep.php:126
#, php-format
msgctxt "setup.summary.auth"
msgid "Users will authenticate using %s."
msgstr ""
@ -1223,8 +1229,8 @@ msgstr ""
msgid "Validation In Progress"
msgstr ""
#: /vagrant/modules/setup/application/forms/AuthBackendPage.php:188
#: /vagrant/modules/setup/application/forms/LdapResourcePage.php:108
#: /vagrant/modules/setup/application/forms/AuthBackendPage.php:188
msgid "Validation Log"
msgstr ""
@ -1238,7 +1244,7 @@ msgctxt "setup.progress"
msgid "Welcome"
msgstr ""
#: /vagrant/modules/setup/application/views/scripts/form/setup-welcome.phtml:48
#: /vagrant/modules/setup/application/views/scripts/form/setup-welcome.phtml:54
msgid "Welcome to the configuration of Icinga Web 2!"
msgstr ""
@ -1257,7 +1263,7 @@ msgstr ""
msgid "You are running PHP version %s."
msgstr ""
#: /vagrant/modules/setup/application/forms/LdapDiscoveryPage.php:32
#: /vagrant/modules/setup/application/forms/LdapDiscoveryPage.php:33
msgid ""
"You can use this page to discover LDAP or ActiveDirectory servers for "
"authentication. If you don' want to execute a discovery, just skip this step."
@ -1268,14 +1274,14 @@ msgid ""
"You may also need to restart the web-server for the changes to take effect!"
msgstr ""
#: /vagrant/modules/setup/application/forms/AuthenticationPage.php:36
#: /vagrant/modules/setup/application/forms/AuthenticationPage.php:39
msgid ""
"You're currently not authenticated using any of the web server's "
"authentication mechanisms. Make sure you'll configure such, otherwise you'll "
"not be able to log into Icinga Web 2."
msgstr ""
#: /vagrant/modules/setup/application/views/scripts/form/setup-welcome.phtml:51
#: /vagrant/modules/setup/application/views/scripts/form/setup-welcome.phtml:57
msgid ""
"You've already completed the configuration of Icinga Web 2. Note that most "
"of your configuration files will be overwritten in case you'll re-configure "
@ -1298,7 +1304,7 @@ msgid ""
"%1$s right after it has successfully been set up."
msgstr ""
#: /vagrant/modules/setup/application/views/scripts/form/setup-welcome.phtml:82
#: /vagrant/modules/setup/application/views/scripts/form/setup-welcome.phtml:88
msgid "Your webserver's user is a member of the system group \"icingaweb2\""
msgstr ""
@ -1311,19 +1317,22 @@ msgid "Zend database adapter for PostgreSQL"
msgstr ""
#: /vagrant/modules/setup/library/Setup/Steps/AuthenticationStep.php:127
msgctxt "setup.summary.auth.type"
msgid "a database"
msgstr ""
#: /vagrant/modules/setup/library/Setup/Requirement/ClassRequirement.php:17
#: /vagrant/modules/setup/library/Setup/Requirement/ClassRequirement.php:23
msgctxt "setup.requirement.class"
msgid "class"
msgstr ""
#: /vagrant/modules/setup/application/forms/AdminAccountPage.php:194
#: /vagrant/modules/setup/application/forms/AdminAccountPage.php:195
msgctxt "setup.admin.authbackend"
msgid "database"
msgstr ""
#: /vagrant/modules/setup/library/Setup/Steps/AuthenticationStep.php:129
msgctxt "setup.summary.auth.type"
msgid "webserver authentication"
msgstr ""

View File

@ -89,7 +89,45 @@ class ResourceStep extends Step
. '<tr>'
. '<td><strong>' . t('Password') . '</strong></td>'
. '<td>' . str_repeat('*', strlen($this->data['dbResourceConfig']['password'])) . '</td>'
. '</tr>'
. '</tr>';
if (isset($this->data['dbResourceConfig']['ssl_key']) && $this->data['dbResourceConfig']['ssl_key']) {
$dbHtml .= ''
.'<tr>'
. '<td><strong>' . t('SSL Key') . '</strong></td>'
. '<td>' . $this->data['dbResourceConfig']['ssl_key'] . '</td>'
. '</tr>';
}
if (isset($this->data['dbResourceConfig']['ssl_cert']) && $this->data['dbResourceConfig']['ssl_cert']) {
$dbHtml .= ''
. '<tr>'
. '<td><strong>' . t('SSL Cert') . '</strong></td>'
. '<td>' . $this->data['dbResourceConfig']['ssl_cert'] . '</td>'
. '</tr>';
}
if (isset($this->data['dbResourceConfig']['ssl_ca']) && $this->data['dbResourceConfig']['ssl_ca']) {
$dbHtml .= ''
. '<tr>'
. '<td><strong>' . t('CA') . '</strong></td>'
. '<td>' . $this->data['dbResourceConfig']['ssl_ca'] . '</td>'
. '</tr>';
}
if (isset($this->data['dbResourceConfig']['ssl_capath']) && $this->data['dbResourceConfig']['ssl_capath']) {
$dbHtml .= ''
. '<tr>'
. '<td><strong>' . t('CA Path') . '</strong></td>'
. '<td>' . $this->data['dbResourceConfig']['ssl_capath'] . '</td>'
. '</tr>';
}
if (isset($this->data['dbResourceConfig']['ssl_cipher']) && $this->data['dbResourceConfig']['ssl_cipher']) {
$dbHtml .= ''
. '<tr>'
. '<td><strong>' . t('Cipher') . '</strong></td>'
. '<td>' . $this->data['dbResourceConfig']['ssl_cipher'] . '</td>'
. '</tr>';
}
$dbHtml .= ''
. '</tbody>'
. '</table>';
}

View File

@ -262,6 +262,25 @@ class DbTool
);
if ($this->config['db'] === 'mysql') {
if (isset($this->config['use_ssl']) && $this->config['use_ssl']) {
$this->config['driver_options'] = array();
# The presence of these keys as empty strings or null cause non-ssl connections to fail
if ($this->config['ssl_key']) {
$config['driver_options'][PDO::MYSQL_ATTR_SSL_KEY] = $this->config['ssl_key'];
}
if ($this->config['ssl_cert']) {
$config['driver_options'][PDO::MYSQL_ATTR_SSL_CERT] = $this->config['ssl_cert'];
}
if ($this->config['ssl_ca']) {
$config['driver_options'][PDO::MYSQL_ATTR_SSL_CA] = $this->config['ssl_ca'];
}
if ($this->config['ssl_capath']) {
$config['driver_options'][PDO::MYSQL_ATTR_SSL_CAPATH] = $this->config['ssl_capath'];
}
if ($this->config['ssl_cipher']) {
$config['driver_options'][PDO::MYSQL_ATTR_SSL_CIPHER] = $this->config['ssl_cipher'];
}
}
$this->zendConn = new Zend_Db_Adapter_Pdo_Mysql($config);
} elseif ($this->config['db'] === 'pgsql') {
$this->zendConn = new Zend_Db_Adapter_Pdo_Pgsql($config);
@ -286,11 +305,39 @@ class DbTool
return;
}
$driverOptions = array(
PDO::ATTR_TIMEOUT => 1,
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION
);
if (
$this->config['db'] === 'mysql'
&& isset($this->config['use_ssl'])
&& $this->config['use_ssl']
) {
# The presence of these keys as empty strings or null cause non-ssl connections to fail
if ($this->config['ssl_key']) {
$driverOptions[PDO::MYSQL_ATTR_SSL_KEY] = $this->config['ssl_key'];
}
if ($this->config['ssl_cert']) {
$driverOptions[PDO::MYSQL_ATTR_SSL_CERT] = $this->config['ssl_cert'];
}
if ($this->config['ssl_ca']) {
$driverOptions[PDO::MYSQL_ATTR_SSL_CA] = $this->config['ssl_ca'];
}
if ($this->config['ssl_capath']) {
$driverOptions[PDO::MYSQL_ATTR_SSL_CAPATH] = $this->config['ssl_capath'];
}
if ($this->config['ssl_cipher']) {
$driverOptions[PDO::MYSQL_ATTR_SSL_CIPHER] = $this->config['ssl_cipher'];
}
}
$this->pdoConn = new PDO(
$this->buildDsn($this->config['db'], $dbname),
$this->config['username'],
$this->config['password'],
array(PDO::ATTR_TIMEOUT => 1, PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION)
$driverOptions
);
}