Problem/Motivation
I want to use ENV variables to store API Keys to avoid putting those to the git repo.
Steps to reproduce
Use settings.php to override API Keys, like such:
// Set Typesense keys from env vars if available.
$typesense_read_key = getenv('TYPESENSE_READ_KEY');
$typesense_api_key = getenv('TYPESENSE_API_KEY');
if ($typesense_read_key) {
$config['search_api.server.typesense_server']['backend_config']['ro_api_key'] = $typesense_read_key;
}
if ($typesense_api_key) {
$config['search_api.server.typesense_server']['backend_config']['rw_api_key'] = $typesense_api_key;
}
This can be verified to work by doing `drush cget search_api.server.typesense_server --include-overridden`
But this module is using the non-overriden version of API keys in some places. I'm unable to deploy this server from configuration to staging environment because it is telling me that API key is missing.
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Comments
Comment #2
mikran commentedComment #3
bedlamThanks for this @mikran.
I swear I'll stop ****ing around with the project's default branch, but can I ask you to recreate this against the
1.0.xbranch?The fix is the right one, and should be incorporated while other api-key issue gets sorted out.
Comment #4
mikran commentedComment #7
bedlamThanks again @mikran, these changes have been super helpful. Merged.