digitalfondue / lavagna

Lavagna: issue tracker/project management tool
http://lavagna.io
GNU General Public License v3.0
636 stars 110 forks source link

Read configuration keys from file, if present #108

Closed SlytherinCz closed 6 years ago

SlytherinCz commented 6 years ago

This is an enhancement proposal.

Would you consider adding an option to configure "keys" (auth provider details, admin user uid and so on) to an external file? First run of Lavagna would look whether the file exists, and if so, use values from the file rather than ask for setup process.

This would allow for versioned configuration, and repetitive deployment of testing instances with cleared database wouldn't require the setup step.

I see two sorts of people benefiting from this: Admins who maintain production instance, and developers who wipe the db often.

I originally wanted to create a PR with this feature, but I'm noobish in Java and I couldn't figure out where the data is being loaded

syjer commented 6 years ago

Hi @SlytherinCz , yes, it should be easy. As we already can configure the database configuration in a configuration file (https://help.lavagna.io/02-install/02-02-configuration.html#configuration) , I guess we can read some additional keys.

syjer commented 6 years ago

Should be done.

Implementation note:

In the environment (could be the external configuration or a system property (see for an example https://github.com/digitalfondue/lavagna/commit/8bf1b2a4fdf20125c2bcbf5c3d58c98b43295eca#diff-600376dffeb79835ede4a0b285078036R721 )) some key must be present:

Additionally, for oauth and ldap, some additional key must be provided (see https://github.com/digitalfondue/lavagna/commit/8bf1b2a4fdf20125c2bcbf5c3d58c98b43295eca#diff-8e2b6021e19120a5e16c4c60e36777d8R56 ).

Note: for oauth it's a json, the format is not documented at the moment. You could extract it from the database though.