From 411fa79d7e2437ee8b47cdac0dbfd2540e60ae72 Mon Sep 17 00:00:00 2001 From: NiekRabelink Date: Fri, 11 Sep 2026 13:01:11 +0000 Subject: [PATCH 1/5] Update config/.env --- config/{.env.example => .env} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename config/{.env.example => .env} (100%) diff --git a/config/.env.example b/config/.env similarity index 100% rename from config/.env.example rename to config/.env -- 2.52.0 From 795e41561c9eb83f1682413eeea14de48e1820e1 Mon Sep 17 00:00:00 2001 From: NiekRabelink Date: Fri, 11 Sep 2026 13:04:04 +0000 Subject: [PATCH 2/5] Update config/.env --- config/.env | 41 ++++++++++++++++++----------------------- 1 file changed, 18 insertions(+), 23 deletions(-) diff --git a/config/.env b/config/.env index b930d6c..9dadacf 100644 --- a/config/.env +++ b/config/.env @@ -1,38 +1,33 @@ # ========================================================================= -# FOCIZ OMGEVINGSCONFIGURATIE VOORBEELD (TEMPLATE) +# FOCIZ CONFIGURATIE — DEVELOPMENT OMGEVING (dev.fociz.nl) # ========================================================================= -# Alle actieve database- en applicatie-instellingen staan centraal in: -# config/config.php -# -# Indien gewenst kan een lokaal .env bestand in de hoofdmap worden geplaatst -# om specifieke variabelen lokaal te overschrijven. -DB_HOST="127.0.0.1" +# MariaDB Verbinding +DB_HOST="192.168.2.33" DB_PORT="3306" -DB_NAME="fociz" -DB_USER="fociz_user" -DB_PASS="" +DB_NAME="focizdev" +DB_USER="focizdev_user" +DB_PASS="F0c1z_Dev_Secure_2026!" -APP_ENV="live" -APP_URL="https://www.fociz.nl" -APP_SECRET="" +# Omgeving & URL +APP_ENV="development" +APP_URL="https://dev.fociz.nl" -MICROSOFT_CLIENT_ID="" -MICROSOFT_CLIENT_SECRET="" -MICROSOFT_TENANT_ID="" +# Applicatie Geheime Sleutel (voor tokenversleuteling & OAuth state) +APP_SECRET="fociz-maria-db-super-secret-key-998877" -JIRA_DOMAIN="" -JIRA_EMAIL="" -JIRA_API_TOKEN="" +# Microsoft 365 Entra ID Tenant +MICROSOFT_TENANT_ID="planningsagenda.nl" # SMTP Mail Server SMTP_HOST="mail.fociz.nl" SMTP_PORT="587" SMTP_USER="info@fociz.nl" -SMTP_PASS="" +SMTP_PASS="6swpQSBg5uWFmjar7F6a" SMTP_SECURE="tls" -SMTP_FROM_EMAIL="no-reply@fociz.nl" -SMTP_FROM_NAME="Fociz" +SMTP_FROM_EMAIL="info@fociz.nl" +SMTP_FROM_NAME="Fociz Dev" SMTP_REPLY_TO="info@fociz.nl" - +# Webhooks (optioneel) +JIRA_WEBHOOK_SECRET="fociz_webhook_dev_2026" \ No newline at end of file -- 2.52.0 From 4f7db2ec83fd10088fc65375ad97f9b39ce86f56 Mon Sep 17 00:00:00 2001 From: Niek Rabelink Date: Fri, 11 Sep 2026 15:06:27 +0200 Subject: [PATCH 3/5] feat(config): enhance .env loading to check both config/.env and root .env --- config/config.php | 39 +++++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/config/config.php b/config/config.php index 509c12c..78e441d 100644 --- a/config/config.php +++ b/config/config.php @@ -25,27 +25,30 @@ if (!headers_sent()) { } @ini_set('expose_php', 'off'); -// 1. Optionele .env inlezing uit de hoofdmap (uitsluitend .env, GEEN .env.example fallback) +// 1. .env inlezing (controleert zowel config/.env als hoofdmap .env) $envVars = []; -$envFile = __DIR__ . '/../.env'; -if (file_exists($envFile)) { - $lines = file($envFile, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); - if ($lines !== false) { - foreach ($lines as $line) { - $line = trim($line); - if ($line === '' || str_starts_with($line, '#') || str_starts_with($line, '//')) { - continue; - } - if (strpos($line, '=') !== false) { - list($name, $value) = explode('=', $line, 2); - $name = trim($name); - $value = trim($value, " \t\n\r\0\x0B\"'"); - $envVars[$name] = $value; - $_ENV[$name] = $value; - $_SERVER[$name] = $value; - @putenv("{$name}={$value}"); +$envLocations = [__DIR__ . '/.env', __DIR__ . '/../.env']; +foreach ($envLocations as $envFile) { + if (file_exists($envFile)) { + $lines = file($envFile, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); + if ($lines !== false) { + foreach ($lines as $line) { + $line = trim($line); + if ($line === '' || str_starts_with($line, '#') || str_starts_with($line, '//')) { + continue; + } + if (strpos($line, '=') !== false) { + list($name, $value) = explode('=', $line, 2); + $name = trim($name); + $value = trim($value, " \t\n\r\0\x0B\"'"); + $envVars[$name] = $value; + $_ENV[$name] = $value; + $_SERVER[$name] = $value; + @putenv("{$name}={$value}"); + } } } + break; // Eerste gevonden .env bestand is leidend } } -- 2.52.0 From 61043cd61c6e515f9a53949f2ed4208aeac26ccb Mon Sep 17 00:00:00 2001 From: Niek Rabelink Date: Fri, 11 Sep 2026 15:06:42 +0200 Subject: [PATCH 4/5] feat(gitignore): enhance environment variable section for clarity and completeness --- .gitignore | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 6b94ae6..250070a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,10 @@ -# Environment +# Environment & Secrets .env +.env.* .env*.local +*.env +config/.env +config/.env.* # Systeem & Editor .DS_Store -- 2.52.0 From b3dfbf4406ac3dab1b742b35ef5874a140d1f1fb Mon Sep 17 00:00:00 2001 From: Niek Rabelink Date: Fri, 11 Sep 2026 15:10:40 +0200 Subject: [PATCH 5/5] refactor(config): remove config/.env from git tracking, restore config/.env.example, and update .gitignore --- .gitignore | 2 ++ config/.env | 33 --------------------------------- config/.env.example | 38 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 40 insertions(+), 33 deletions(-) delete mode 100644 config/.env create mode 100644 config/.env.example diff --git a/.gitignore b/.gitignore index 250070a..c7e0bff 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,8 @@ *.env config/.env config/.env.* +!.env.example +!config/.env.example # Systeem & Editor .DS_Store diff --git a/config/.env b/config/.env deleted file mode 100644 index 9dadacf..0000000 --- a/config/.env +++ /dev/null @@ -1,33 +0,0 @@ -# ========================================================================= -# FOCIZ CONFIGURATIE — DEVELOPMENT OMGEVING (dev.fociz.nl) -# ========================================================================= - -# MariaDB Verbinding -DB_HOST="192.168.2.33" -DB_PORT="3306" -DB_NAME="focizdev" -DB_USER="focizdev_user" -DB_PASS="F0c1z_Dev_Secure_2026!" - -# Omgeving & URL -APP_ENV="development" -APP_URL="https://dev.fociz.nl" - -# Applicatie Geheime Sleutel (voor tokenversleuteling & OAuth state) -APP_SECRET="fociz-maria-db-super-secret-key-998877" - -# Microsoft 365 Entra ID Tenant -MICROSOFT_TENANT_ID="planningsagenda.nl" - -# SMTP Mail Server -SMTP_HOST="mail.fociz.nl" -SMTP_PORT="587" -SMTP_USER="info@fociz.nl" -SMTP_PASS="6swpQSBg5uWFmjar7F6a" -SMTP_SECURE="tls" -SMTP_FROM_EMAIL="info@fociz.nl" -SMTP_FROM_NAME="Fociz Dev" -SMTP_REPLY_TO="info@fociz.nl" - -# Webhooks (optioneel) -JIRA_WEBHOOK_SECRET="fociz_webhook_dev_2026" \ No newline at end of file diff --git a/config/.env.example b/config/.env.example new file mode 100644 index 0000000..b930d6c --- /dev/null +++ b/config/.env.example @@ -0,0 +1,38 @@ +# ========================================================================= +# FOCIZ OMGEVINGSCONFIGURATIE VOORBEELD (TEMPLATE) +# ========================================================================= +# Alle actieve database- en applicatie-instellingen staan centraal in: +# config/config.php +# +# Indien gewenst kan een lokaal .env bestand in de hoofdmap worden geplaatst +# om specifieke variabelen lokaal te overschrijven. + +DB_HOST="127.0.0.1" +DB_PORT="3306" +DB_NAME="fociz" +DB_USER="fociz_user" +DB_PASS="" + +APP_ENV="live" +APP_URL="https://www.fociz.nl" +APP_SECRET="" + +MICROSOFT_CLIENT_ID="" +MICROSOFT_CLIENT_SECRET="" +MICROSOFT_TENANT_ID="" + +JIRA_DOMAIN="" +JIRA_EMAIL="" +JIRA_API_TOKEN="" + +# SMTP Mail Server +SMTP_HOST="mail.fociz.nl" +SMTP_PORT="587" +SMTP_USER="info@fociz.nl" +SMTP_PASS="" +SMTP_SECURE="tls" +SMTP_FROM_EMAIL="no-reply@fociz.nl" +SMTP_FROM_NAME="Fociz" +SMTP_REPLY_TO="info@fociz.nl" + + -- 2.52.0