summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrédéric Guillot <fred@kanboard.net>2018-01-11 14:01:32 -0800
committerFrédéric Guillot <fred@kanboard.net>2018-01-11 14:01:32 -0800
commitd35d5beee216ea0a092dac88e9b7556faa95372e (patch)
tree30098b2b885a445240e628894ceb7021d0fb02f6
parentf7c6cbd0f41434afd8940bc54498b85d6d19e31c (diff)
Add option to disable Mysql SSL server verification
-rw-r--r--app/ServiceProvider/DatabaseProvider.php1
-rw-r--r--app/constants.php1
-rw-r--r--composer.json2
-rw-r--r--composer.lock22
-rw-r--r--config.default.php3
-rw-r--r--vendor/composer/installed.json186
-rw-r--r--vendor/fguillot/picodb/lib/PicoDb/Driver/Mysql.php8
-rw-r--r--vendor/fguillot/picodb/lib/PicoDb/Driver/Postgres.php19
-rw-r--r--vendor/fguillot/picodb/lib/PicoDb/Table.php8
-rw-r--r--vendor/symfony/finder/LICENSE2
10 files changed, 141 insertions, 111 deletions
diff --git a/app/ServiceProvider/DatabaseProvider.php b/app/ServiceProvider/DatabaseProvider.php
index 9998ac43..ccd5a7b9 100644
--- a/app/ServiceProvider/DatabaseProvider.php
+++ b/app/ServiceProvider/DatabaseProvider.php
@@ -135,6 +135,7 @@ class DatabaseProvider implements ServiceProviderInterface
'ssl_key' => DB_SSL_KEY,
'ssl_ca' => DB_SSL_CA,
'ssl_cert' => DB_SSL_CERT,
+ 'verify_server_cert' => DB_VERIFY_SERVER_CERT,
));
}
diff --git a/app/constants.php b/app/constants.php
index 7029ce03..4b87d18e 100644
--- a/app/constants.php
+++ b/app/constants.php
@@ -53,6 +53,7 @@ defined('DB_PORT') or define('DB_PORT', null);
defined('DB_SSL_KEY') or define('DB_SSL_KEY', null);
defined('DB_SSL_CERT') or define('DB_SSL_CERT', null);
defined('DB_SSL_CA') or define('DB_SSL_CA', null);
+defined('DB_VERIFY_SERVER_CERT') or define('DB_VERIFY_SERVER_CERT', null);
// Database backend group provider
defined('DB_GROUP_PROVIDER') or define('DB_GROUP_PROVIDER', true);
diff --git a/composer.json b/composer.json
index d7be156e..16149b22 100644
--- a/composer.json
+++ b/composer.json
@@ -30,7 +30,7 @@
"eluceo/ical": "0.10.1",
"erusev/parsedown" : "1.6.0",
"fguillot/json-rpc" : "1.2.1",
- "fguillot/picodb" : "1.0.14",
+ "fguillot/picodb" : "1.0.15",
"miniflux/picofeed": "0.1.34",
"fguillot/simpleLogger" : "1.0.1",
"fguillot/simple-validator" : "1.0.1",
diff --git a/composer.lock b/composer.lock
index b4fc9976..c0cb3580 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
- "content-hash": "55f5db0718c2a102000edeebf460165e",
+ "content-hash": "fa5e1f971060c305f81531da883b01ad",
"packages": [
{
"name": "aferrandini/phpqrcode",
@@ -288,16 +288,16 @@
},
{
"name": "fguillot/picodb",
- "version": "v1.0.14",
+ "version": "v1.0.15",
"source": {
"type": "git",
"url": "https://github.com/fguillot/picoDb.git",
- "reference": "86a831302ab10af800c83dbe4b3b01c88d5433f1"
+ "reference": "1dccdf9e1309545e68d7161668cfcb084f0f5e09"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/fguillot/picoDb/zipball/86a831302ab10af800c83dbe4b3b01c88d5433f1",
- "reference": "86a831302ab10af800c83dbe4b3b01c88d5433f1",
+ "url": "https://api.github.com/repos/fguillot/picoDb/zipball/1dccdf9e1309545e68d7161668cfcb084f0f5e09",
+ "reference": "1dccdf9e1309545e68d7161668cfcb084f0f5e09",
"shasum": ""
},
"require": {
@@ -324,7 +324,7 @@
],
"description": "Minimalist database query builder",
"homepage": "https://github.com/fguillot/picoDb",
- "time": "2016-07-16T22:59:59+00:00"
+ "time": "2018-01-11T21:47:49+00:00"
},
{
"name": "fguillot/simple-queue",
@@ -992,16 +992,16 @@
},
{
"name": "symfony/finder",
- "version": "v3.4.2",
+ "version": "v3.4.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/finder.git",
- "reference": "dac8d7db537bac7ad8143eb11360a8c2231f251a"
+ "reference": "613e26310776f49a1773b6737c6bd554b8bc8c6f"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/finder/zipball/dac8d7db537bac7ad8143eb11360a8c2231f251a",
- "reference": "dac8d7db537bac7ad8143eb11360a8c2231f251a",
+ "url": "https://api.github.com/repos/symfony/finder/zipball/613e26310776f49a1773b6737c6bd554b8bc8c6f",
+ "reference": "613e26310776f49a1773b6737c6bd554b8bc8c6f",
"shasum": ""
},
"require": {
@@ -1037,7 +1037,7 @@
],
"description": "Symfony Finder Component",
"homepage": "https://symfony.com",
- "time": "2017-11-05T16:10:10+00:00"
+ "time": "2018-01-03T07:37:34+00:00"
},
{
"name": "symfony/polyfill-mbstring",
diff --git a/config.default.php b/config.default.php
index cc706306..a9e315e9 100644
--- a/config.default.php
+++ b/config.default.php
@@ -85,6 +85,9 @@ define('DB_SSL_CERT', null);
// Mysql SSL CA
define('DB_SSL_CA', null);
+// Mysql SSL server verification, set to false if you don't want the Mysql driver to validate the certificate CN
+define('DB_VERIFY_SERVER_CERT', null);
+
// Enable LDAP authentication (false by default)
define('LDAP_AUTH', false);
diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json
index 9b5d4902..d2c37f4a 100644
--- a/vendor/composer/installed.json
+++ b/vendor/composer/installed.json
@@ -292,48 +292,6 @@
"homepage": "https://github.com/fguillot/JsonRPC"
},
{
- "name": "fguillot/picodb",
- "version": "v1.0.14",
- "version_normalized": "1.0.14.0",
- "source": {
- "type": "git",
- "url": "https://github.com/fguillot/picoDb.git",
- "reference": "86a831302ab10af800c83dbe4b3b01c88d5433f1"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/fguillot/picoDb/zipball/86a831302ab10af800c83dbe4b3b01c88d5433f1",
- "reference": "86a831302ab10af800c83dbe4b3b01c88d5433f1",
- "shasum": ""
- },
- "require": {
- "php": ">=5.3.0"
- },
- "require-dev": {
- "phpunit/phpunit": "4.8.*"
- },
- "time": "2016-07-16T22:59:59+00:00",
- "type": "library",
- "installation-source": "dist",
- "autoload": {
- "psr-0": {
- "PicoDb": "lib/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Frédéric Guillot",
- "homepage": "https://github.com/fguillot/"
- }
- ],
- "description": "Minimalist database query builder",
- "homepage": "https://github.com/fguillot/picoDb"
- },
- {
"name": "fguillot/simple-queue",
"version": "v1.0.1",
"version_normalized": "1.0.1.0",
@@ -1077,57 +1035,6 @@
]
},
{
- "name": "symfony/finder",
- "version": "v3.4.2",
- "version_normalized": "3.4.2.0",
- "source": {
- "type": "git",
- "url": "https://github.com/symfony/finder.git",
- "reference": "dac8d7db537bac7ad8143eb11360a8c2231f251a"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/symfony/finder/zipball/dac8d7db537bac7ad8143eb11360a8c2231f251a",
- "reference": "dac8d7db537bac7ad8143eb11360a8c2231f251a",
- "shasum": ""
- },
- "require": {
- "php": "^5.5.9|>=7.0.8"
- },
- "time": "2017-11-05T16:10:10+00:00",
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "3.4-dev"
- }
- },
- "installation-source": "dist",
- "autoload": {
- "psr-4": {
- "Symfony\\Component\\Finder\\": ""
- },
- "exclude-from-classmap": [
- "/Tests/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Fabien Potencier",
- "email": "fabien@symfony.com"
- },
- {
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
- }
- ],
- "description": "Symfony Finder Component",
- "homepage": "https://symfony.com"
- },
- {
"name": "gregwar/captcha",
"version": "v1.1.4",
"version_normalized": "1.1.4.0",
@@ -1181,5 +1088,98 @@
"captcha",
"spam"
]
+ },
+ {
+ "name": "fguillot/picodb",
+ "version": "v1.0.15",
+ "version_normalized": "1.0.15.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/fguillot/picoDb.git",
+ "reference": "1dccdf9e1309545e68d7161668cfcb084f0f5e09"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/fguillot/picoDb/zipball/1dccdf9e1309545e68d7161668cfcb084f0f5e09",
+ "reference": "1dccdf9e1309545e68d7161668cfcb084f0f5e09",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "4.8.*"
+ },
+ "time": "2018-01-11T21:47:49+00:00",
+ "type": "library",
+ "installation-source": "dist",
+ "autoload": {
+ "psr-0": {
+ "PicoDb": "lib/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Frédéric Guillot",
+ "homepage": "https://github.com/fguillot/"
+ }
+ ],
+ "description": "Minimalist database query builder",
+ "homepage": "https://github.com/fguillot/picoDb"
+ },
+ {
+ "name": "symfony/finder",
+ "version": "v3.4.3",
+ "version_normalized": "3.4.3.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/finder.git",
+ "reference": "613e26310776f49a1773b6737c6bd554b8bc8c6f"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/finder/zipball/613e26310776f49a1773b6737c6bd554b8bc8c6f",
+ "reference": "613e26310776f49a1773b6737c6bd554b8bc8c6f",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^5.5.9|>=7.0.8"
+ },
+ "time": "2018-01-03T07:37:34+00:00",
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.4-dev"
+ }
+ },
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\Finder\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony Finder Component",
+ "homepage": "https://symfony.com"
}
]
diff --git a/vendor/fguillot/picodb/lib/PicoDb/Driver/Mysql.php b/vendor/fguillot/picodb/lib/PicoDb/Driver/Mysql.php
index 4f3ca64e..147be816 100644
--- a/vendor/fguillot/picodb/lib/PicoDb/Driver/Mysql.php
+++ b/vendor/fguillot/picodb/lib/PicoDb/Driver/Mysql.php
@@ -98,6 +98,14 @@ class Mysql extends Base
$options[PDO::MYSQL_ATTR_SSL_CA] = $settings['ssl_ca'];
}
+ if (! empty($settings['persistent'])) {
+ $options[PDO::ATTR_PERSISTENT] = $settings['persistent'];
+ }
+
+ if (isset($settings['verify_server_cert'])) {
+ $options[PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT] = $settings['verify_server_cert'];
+ }
+
return $options;
}
diff --git a/vendor/fguillot/picodb/lib/PicoDb/Driver/Postgres.php b/vendor/fguillot/picodb/lib/PicoDb/Driver/Postgres.php
index a494cdca..4a589e87 100644
--- a/vendor/fguillot/picodb/lib/PicoDb/Driver/Postgres.php
+++ b/vendor/fguillot/picodb/lib/PicoDb/Driver/Postgres.php
@@ -20,9 +20,6 @@ class Postgres extends Base
* @var array
*/
protected $requiredAttributes = array(
- 'hostname',
- 'username',
- 'password',
'database',
);
@@ -42,13 +39,25 @@ class Postgres extends Base
*/
public function createConnection(array $settings)
{
- $dsn = 'pgsql:host='.$settings['hostname'].';dbname='.$settings['database'];
+ $dsn = 'pgsql:dbname='.$settings['database'];
+
+ if (! empty($settings['username'])) {
+ $dsn .= ';user='.$settings['username'];
+ }
+
+ if (! empty($settings['password'])) {
+ $dsn .= ';password='.$settings['password'];
+ }
+
+ if (! empty($settings['hostname'])) {
+ $dsn .= ';host='.$settings['hostname'];
+ }
if (! empty($settings['port'])) {
$dsn .= ';port='.$settings['port'];
}
- $this->pdo = new PDO($dsn, $settings['username'], $settings['password']);
+ $this->pdo = new PDO($dsn);
if (isset($settings['schema_table'])) {
$this->schemaTable = $settings['schema_table'];
diff --git a/vendor/fguillot/picodb/lib/PicoDb/Table.php b/vendor/fguillot/picodb/lib/PicoDb/Table.php
index 09eb928e..404b5cbe 100644
--- a/vendor/fguillot/picodb/lib/PicoDb/Table.php
+++ b/vendor/fguillot/picodb/lib/PicoDb/Table.php
@@ -718,4 +718,12 @@ class Table
call_user_func_array(array($this->conditionBuilder, $name), $arguments);
return $this;
}
+
+ /**
+ * Clone function ensures that cloned objects are really clones
+ */
+ public function __clone()
+ {
+ $this->conditionBuilder = clone $this->conditionBuilder;
+ }
}
diff --git a/vendor/symfony/finder/LICENSE b/vendor/symfony/finder/LICENSE
index 17d16a13..21d7fb9e 100644
--- a/vendor/symfony/finder/LICENSE
+++ b/vendor/symfony/finder/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2004-2017 Fabien Potencier
+Copyright (c) 2004-2018 Fabien Potencier
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal