From d185a26f874daf056bb7fb3b3ada023f6aec5d77 Mon Sep 17 00:00:00 2001 From: Fabian de Boer Date: Fri, 17 Jul 2026 21:58:05 +0200 Subject: [PATCH] default no debug. clever solution for api keys in git ignored local conf file. --- .gitignore | 1 + README.md | 15 ++++++++++++--- conf/conf.local.php.dist | 10 ++++++++++ conf/conf.php | 5 +++-- conf/init.php | 11 +++++++++++ 5 files changed, 37 insertions(+), 5 deletions(-) create mode 100644 conf/conf.local.php.dist diff --git a/.gitignore b/.gitignore index 54e8b97..4dfc547 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ sessions/* +conf/conf.local.php ignore kanban/ .pi-tasks diff --git a/README.md b/README.md index 36f1b16..e45046a 100644 --- a/README.md +++ b/README.md @@ -22,13 +22,22 @@ ApFab Zap Machine needs some PHP extensions: - CUrl (default installed) - Imagick (Image Magick image processing Class) -You need to acquire the following API key and put it into `conf/conf.php`: +You need to acquire the following API key: 1. **Brave Search API Key** - https://api.search.brave.com/ -See `conf/conf.php` for the exact constant names to use. +Then set up your configuration: -Adjust permission (chmod 777) for 'sessions' folder, run index.php in the www/ directory, fill in the form and voila. +```bash +# Create your local config from the template +cp conf/conf.local.php.dist conf/conf.local.php +# Edit it with your real keys +nano conf/conf.local.php +``` + +`conf/conf.local.php` is gitignored so your secrets stay safe. You can also set the `BRAVE_API_KEY` environment variable as an alternative. + +Adjust permission (chmod 777) for 'sessions' folder, then run index.php in the www/ directory, fill in the form and voila. # yet to come - Logfile also generated in imgProcess Class (0.9.2) diff --git a/conf/conf.local.php.dist b/conf/conf.local.php.dist new file mode 100644 index 0000000..a0c9fdb --- /dev/null +++ b/conf/conf.local.php.dist @@ -0,0 +1,10 @@ + environment variable > placeholder + */ +define('BRAVE_API_KEY', 'your-real-api-key-here'); \ No newline at end of file diff --git a/conf/conf.php b/conf/conf.php index f213c65..801c3e6 100755 --- a/conf/conf.php +++ b/conf/conf.php @@ -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'); diff --git a/conf/init.php b/conf/init.php index c65b349..717c6f8 100755 --- a/conf/init.php +++ b/conf/init.php @@ -1,6 +1,17 @@