default no debug. clever solution for api keys in git ignored local conf file.

This commit is contained in:
Fabian de Boer 2026-07-17 21:58:05 +02:00
commit d185a26f87
5 changed files with 37 additions and 5 deletions

10
conf/conf.local.php.dist Normal file
View file

@ -0,0 +1,10 @@
<?php
/**
* Local configuration overrides — gitignored.
*
* Copy this file to conf/conf.local.php (without the .dist suffix)
* and fill in your real API keys.
*
* Priority: conf.local.php > environment variable > placeholder
*/
define('BRAVE_API_KEY', 'your-real-api-key-here');

View file

@ -13,12 +13,13 @@ define('ZAP_CANVAS_NAME', 'collage');
define('ZAP_DELETE_SOURCE', false);
define('ZAP_ADULT', false);
define('ZAP_LOG', true);
define('ZAP_DEBUG', true);
define('ZAP_DEBUG', false);
// Brave Search API
// Get your API key: https://api.search.brave.com/
define('BRAVE_API_KEY', 'your api key');
// Put your key in conf/conf.local.php (gitignored) or set BRAVE_API_KEY env var
// See conf/conf.local.php.dist for a template
define('BRAVE_BASE', 'https://api.search.brave.com/res/v1/images/search');
$search_engines = array('brave');

View file

@ -1,6 +1,17 @@
<?php
include_once 'conf.php';
// Load gitignored local overrides (API keys, debug toggle) if present
$localConf = __DIR__ . '/conf.local.php';
if (file_exists($localConf)) {
require_once $localConf;
}
// Fallback: try environment variable if still not defined
if (!defined('BRAVE_API_KEY')) {
define('BRAVE_API_KEY', getenv('BRAVE_API_KEY') ?: 'your api key');
}
/**
* Define some app-wide constants
*/