@gabriel_somoza
Belgium-based consultant PHP Architect.
Owner @ Strategery: remote Senior PHP developers
Founder of PHP Limburg meetup
Regular speaker at meetups & conferences
// ./config/autoload/database.local.php
return [
'database' => [
'host' => 'localhost',
'dbname' => 'myapp',
'user' => 'myapp',
'password' => 'not-so-secret', // OUCH
'driver' => 'pdo_mysql',
],
];
In Production (Live) Server:
vaultproject.io
vaultproject.io/intro
consul.io
( NB: optional! )
vault.services.consul.
mysql.services.consul.
myapp.services.consul.
Consul DNS
// ./config/autoload/database.local.php
return [
'vault' => [
'host' => 'vault.service.consul',
],
'database' => [
'host' => 'mysql.service.consul',
'dbname' => 'myapp',
'user' => '', // ASK VAULT!
'password' => '', // ASK VAULT!
'driver' => 'pdo_mysql',
],
];
Cache & automatically renew MySQL leases
Use an "Auth Backend" (AppRole?) to replace vault_token.json
Degrade gracefully