This commit is contained in:
Rodolfo Berrios 2021-11-20 12:42:49 -03:00
parent fc94bab9d4
commit 1e38669aa0
No known key found for this signature in database
GPG Key ID: D3AAC2481DBDD9FE
2 changed files with 32 additions and 4 deletions

View File

@ -25,14 +25,18 @@ if (!defined('access') or !access) {
}
// settings.php workaround
if (!is_readable(dirname(__FILE__) . '/settings.php')) {
if (!@fopen(dirname(__FILE__) . '/settings.php', 'w')) {
if (!is_readable(__DIR__ . '/settings.php')) {
if (!@fopen(__DIR__ . '/settings.php', 'w')) {
die("Chevereto can't create the app/settings.php file. You must manually create this file.");
}
}
if(getenv('CHEVERETO_SERVICING') == 'docker') {
require_once __DIR__ . '/settings-env.php';
}
// G thing
(file_exists(dirname(dirname(__FILE__)) . '/lib/G/G.php')) ? require_once(dirname(dirname(__FILE__)) . '/lib/G/G.php') : die("Can't find lib/G/G.php");
(file_exists(dirname(__FILE__, 2) . '/lib/G/G.php'))
? require_once dirname(__FILE__, 2) . '/lib/G/G.php'
: die("Can't find lib/G/G.php");
// Require at least X memory to do the thing
$min_memory = '256M';

24
app/settings-env.php Normal file
View File

@ -0,0 +1,24 @@
<?php
$settings = [
'db_driver' => getenv('CHEVERETO_DB_DRIVER'),
'db_host' => getenv('CHEVERETO_DB_HOST'),
'db_name' => getenv('CHEVERETO_DB_NAME'),
'db_pass' => getenv('CHEVERETO_DB_PASS'),
'db_pdo_attrs' => json_decode(getenv('CHEVERETO_DB_PDO_ATTRS'), true),
'db_port' => (int) getenv('CHEVERETO_DB_PORT'),
'db_table_prefix' => getenv('CHEVERETO_DB_TABLE_PREFIX'),
'db_user' => getenv('CHEVERETO_DB_USER'),
'debug_level' => (int) getenv('CHEVERETO_DEBUG_LEVEL'),
'disable_php_pages' => (bool) getenv('CHEVERETO_DISABLE_PHP_PAGES'),
'disable_update_http' => (bool) getenv('CHEVERETO_DISABLE_UPDATE_HTTP'),
'disable_update_cli' => (bool) getenv('CHEVERETO_DISABLE_UPDATE_CLI'),
'error_log' => getenv('CHEVERETO_ERROR_LOG'),
'hostname_path' => getenv('CHEVERETO_HOSTNAME_PATH'),
'hostname' => getenv('CHEVERETO_HOSTNAME'),
'https' => (bool) getenv('CHEVERETO_HTTPS'),
'image_formats_available' => json_decode(getenv('CHEVERETO_IMAGE_FORMATS_AVAILABLE'), true),
'image_library' => getenv('CHEVERETO_IMAGE_LIBRARY'),
'session.save_handler' => getenv('CHEVERETO_SESSION_SAVE_HANDLER'),
'session.save_path' => getenv('CHEVERETO_SESSION_SAVE_PATH'),
];