diff --git a/public_html/index.php b/public_html/index.php index 54758f5..49d1be4 100644 --- a/public_html/index.php +++ b/public_html/index.php @@ -31,8 +31,22 @@ $allowed_urls = [ ]; // cnfig file -$config_file = '/home/yasen/work/code/git/lindeas-code/jilo-web/jilo-web.conf.php'; -if (file_exists($config_file)) { +// possible locations, in order of preference +$config_file_locations = [ + __DIR__ . '/../jilo-web.conf.php', + '/srv/jilo-web/jilo-web.conf.php', + '/opt/jilo-web/jilo-web.conf.php' +]; +$config_file = null; +// try to find the config file +foreach ($config_file_locations as $location) { + if (file_exists($location)) { + $config_file = $location; + break; + } +} +// if found, use it +if ($config_file) { require_once $config_file; } else { die('Config file not found');