settings.php 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <?php
  2. $settings['db_host'] = $_ENV['CHEVERETO_DB_HOST'];
  3. $settings['db_port'] = $_ENV['CHEVERETO_DB_PORT'];
  4. $settings['db_name'] = $_ENV['CHEVERETO_DB_NAME'];
  5. $settings['db_user'] = $_ENV['CHEVERETO_DB_USERNAME'];
  6. $settings['db_pass'] = $_ENV['CHEVERETO_DB_PASSWORD'];
  7. $settings['db_table_prefix'] = $_ENV['CHEVERETO_DB_PREFIX'];
  8. $settings['db_driver'] = 'mysql';
  9. $settings['db_pdo_attrs'] = [];
  10. $settings['debug_level'] = 1;
  11. // Advanced configurations
  12. $val = getenv('CHEVERETO_SESSION_SAVE_PATH');
  13. if ($val !== false ) {
  14. /*
  15. * Specify where Chevereto can save the user session. Combining this with a
  16. * shared volume/EFS/File synching, you can set up a highly available
  17. * cluster of Free Chevereto while ensure user login status are not lost if
  18. * they reconnect to another container
  19. */
  20. $settings['session.save_path'] = $val;
  21. }
  22. $val = getenv('CHEVERETO_ERROR_REPORTING');
  23. if ($val !== false) {
  24. /*
  25. * Specify whether we wish to have error reporting or not
  26. * Note that while environment variable can only be string, Chevereto expect
  27. * this to be boolean - https://github.com/Chevereto/Chevereto-Free/blob/0184f27a97daa55ec3b07560c5dd619d22abc907/lib/G/G.php#L95
  28. * so here we have to convert the string true/false to the boolean value
  29. */
  30. $settings['error_reporting'] = strtolower(trim($val)) === 'true';
  31. }
  32. $val = getenv('CHEVERETO_DEFAULT_TIMEZONE');
  33. if ($val !== false) {
  34. /*
  35. * Specify the default timezone for any newly created/registered user
  36. * Please make sure to use a PHP supported timezone - https://www.php.net/manual/en/timezones.php - eg America/New_York
  37. */
  38. $settings['default_timezone'] = $val;
  39. }
  40. $val = getenv('CHEVERETO_ENVIRONMENT');
  41. if ($val !== false) {
  42. /*
  43. * Specify the environment of G\ app
  44. * This is usually useful for debugging purpose - see https://github.com/Chevereto/G-Library/blob/da673a3abef80ad9ac1aa3f26fb7abe4973c8445/lib/G/functions.php#L1649
  45. */
  46. $settings['error_reporting'] = $val;
  47. }
  48. $val = getenv('CHEVERETO_HTTPS');
  49. if ($val !== false) {
  50. /*
  51. * Specify whether user should connect to Chevereto via HTTPS instead of HTTP
  52. * Please note that Chevereto has excellent mechanism to detect this
  53. * already - https://github.com/Chevereto/Chevereto-Free/blob/0184f27a97daa55ec3b07560c5dd619d22abc907/lib/G/G.php#L113
  54. * So 99% of the time you won't have to bother with this. The only
  55. * usecase that I can image where you need to set this is if you have
  56. * a misconfigured reverse proxy that somehow doesn't include the
  57. * `http-x-forwarded-proto` header into the forwarded requests
  58. */
  59. $settings['https'] = strtolower(trim($val)) === 'true';
  60. }
  61. $val = getenv('CHEVERETO_THEME');
  62. if ($val !== false) {
  63. /*
  64. * Specify the theme that you wish to use on your Chevereto
  65. * the default is `Peafowl` - the theme that's included by default with
  66. * Chevereto free
  67. * If you specify this environment variable, please make sure to mount
  68. * the theme directory under /var/www/html/app/themes in the container
  69. */
  70. $settings['theme'] = $val;
  71. }