dokku / dokku-mariadb

a mariadb plugin for dokku
MIT License
73 stars 26 forks source link

How to override plugin alias #59

Closed jessedobbelaere closed 7 years ago

jessedobbelaere commented 7 years ago

Currently my env variables in my app look like DOKKU_MARIADB_APP_NAME_DB_PORT. I'm looking to override the prefixed alias DOKKU_MARIADB, because Symfony framework only listens to env variables prefixed with SYMFONY__.

Is it the case that this prefix comes from PLUGIN_ALT_ALIAS in the config? I'm struggling a bit to override the PLUGIN_ALT_ALIAS env variable from the config. How would you do that? With dokku config:set ?

josegonzalez commented 7 years ago

You can't do that at this time, and the only way to do it is via https://github.com/dokku/dokku-redis/issues/64, which isn't being s on at this time due to monetary constraints.

Why not just read the DATABASE_URL like any other framework?

jessedobbelaere commented 7 years ago

Hmm ok no problem! For now I can just extract the credentials from the database_url and fill in the user & password in my app's parameters.yml file. It's a bit less secure.

I'm using a CMS based on Symfony framework. It uses a parameters.yml file with fields for host, user, password, port, etc. So no database_url can be used. Besides, Symfony is only able to use the env variables that start with SYMFONY__. Only in the most recent version, they added env variables support: https://symfony.com/blog/new-in-symfony-3-2-runtime-environment-variables