Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dependencies #36

Open
prologic opened this issue Aug 3, 2017 · 8 comments
Open

Dependencies #36

prologic opened this issue Aug 3, 2017 · 8 comments

Comments

@prologic
Copy link

prologic commented Aug 3, 2017

Why does this depend on so many heavy weight things? Etcd, Postgres? Can we lighten the dependencies at all?

@RichardKnop
Copy link
Owner

RichardKnop commented Aug 3, 2017

@prologic Yes this is an issue. Originally this project was coded against a specific stack I was working with and I haven't had time to simplify it and make it more generic.

I definitely agree it should be simplified so it can be plugged into other stacks but I haven't had time for that yet.

I think the etcd and postgres dependencies are not too tightly coupled. ORM was used so I think something like MySQL should probably work with only couple small changes. The etcd dependency could be removed altogether as config is just a struct, so it can be loaded in any other way (probably most sensible to load it from environment variables, perhaps from file).

I don't have enough bandwidth to work on this though so it would probably have to be done by somebody else.

@prologic
Copy link
Author

prologic commented Aug 3, 2017 via email

@RichardKnop
Copy link
Owner

RichardKnop commented Aug 3, 2017

It stores a JSON (with stuff like database connection details, API keys, secrets, oauth2 configuration, session configuration) which is unmarshaled into config structure when you start the application. The running application then keeps live reloading the configuration from etcd.

When I started working on this project I was deploying to a CoreOS cluster which had etcd running on it. So it was a logical place to store configuration in as it's distributed so you load it once and all nodes in the cluster can access it.

It also simplified deployment of this app as docker container via cloud init files as you only needed to set a single environment variable to point the container to etcd.

@prologic
Copy link
Author

prologic commented Aug 3, 2017 via email

@RichardKnop
Copy link
Owner

Yes I agree. Probably environment variables would be the best. Or we could support multiple ways of loading the configuration based on a command line flag (so from environment variables by default, but could be loaded from Yaml file if you pass a flag with filepath).

@prologic
Copy link
Author

prologic commented Aug 3, 2017 via email

@tommyo
Copy link

tommyo commented Mar 9, 2018

Are you against the idea of using viper for config? It supports environment variables, yaml/json configuration files, command line arguments, etcd, and any mixture of all of them.

If you're ok with that, I'm willing to put some time into it. Would make it much easier to run in kubernetes.

@RichardKnop
Copy link
Owner

@tommyo I am all for it actually. I would do it myself but am really busy with day job and some other projects. Either viper or perhaps just something simple like github.com/kelseyhightower/envconfig would be preferable to the current etc requirement. Etcd live config could be kept as optional feature but default behaviour should be to try to load configuration from environment variables or file system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants