Add SSL mode support for database backups and enhance directory creation checks
- Introduce SSL mode configuration (`ssl_mode`) for `mysqldump` to support secure database backups. - Update database backup logic to handle SSL options (`DISABLED`, `PREFERRED`, `REQUIRED`, `VERIFY_CA`, `VERIFY_IDENTITY`). - Improve directory creation checks in backup logic with additional error handling. - Update `config.example.php` to include `ssl_mode` configuration.
This commit is contained in:
+5
-2
@@ -3,7 +3,8 @@ $CONFIG_DB = [
|
||||
'host' => '', // IP address of the database server e.g. 127.0.0.1
|
||||
'user' => '', // Username of the database server e.g. root
|
||||
'password' => '', // Password of the database server e.g. password123
|
||||
'database' => '' // Name of the database e.g. my_database
|
||||
'database' => '', // Name of the database e.g. my_database
|
||||
'ssl_mode' => 'DISABLED' // SSL mode for mysqldump: DISABLED, PREFERRED, REQUIRED, VERIFY_CA, VERIFY_IDENTITY
|
||||
];
|
||||
$DEBUG = true; // Set to true to enable debugging (Error messages will be shown, and this should never be used in production)
|
||||
$USE_PROD_ECONOMIC_IN_DEBUG = true; // Set to true to use the production economic API in debug mode
|
||||
@@ -49,6 +50,7 @@ if (isset($_ENV['USE_ENV']) && $_ENV['USE_ENV'] === 'true') {
|
||||
'CONFIG_DB_USER' => 'user',
|
||||
'CONFIG_DB_PASSWORD' => 'password',
|
||||
'CONFIG_DB_DATABASE' => 'database',
|
||||
'CONFIG_DB_SSL_MODE' => 'ssl_mode',
|
||||
'DEBUG' => 'DEBUG',
|
||||
'ENCRYPTION_KEY' => 'ENCRYPTION_KEY',
|
||||
'CORS' => 'CORS',
|
||||
@@ -73,7 +75,8 @@ if (isset($_ENV['USE_ENV']) && $_ENV['USE_ENV'] === 'true') {
|
||||
'host' => $_ENV['CONFIG_DB_HOST'],
|
||||
'user' => $_ENV['CONFIG_DB_USER'],
|
||||
'password' => $_ENV['CONFIG_DB_PASSWORD'],
|
||||
'database' => $_ENV['CONFIG_DB_DATABASE']
|
||||
'database' => $_ENV['CONFIG_DB_DATABASE'],
|
||||
'ssl_mode' => $_ENV['CONFIG_DB_SSL_MODE'] ?? 'DISABLED'
|
||||
];
|
||||
/**
|
||||
* Set the debug configuration
|
||||
|
||||
Reference in New Issue
Block a user