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

Implement ENV secrets for PostgreSQL user accounts #27

Closed
jberkus opened this issue Sep 5, 2015 · 8 comments
Closed

Implement ENV secrets for PostgreSQL user accounts #27

jberkus opened this issue Sep 5, 2015 · 8 comments

Comments

@jberkus
Copy link
Contributor

jberkus commented Sep 5, 2015

We need a better way to set passwords for the three PostgreSQL accounts we need to use than keeping them in a configuration file which may be in poorly secured CMS repo. I suggest that we use envdir, as several other Python projects (like WAL-E) do.

Other ideas?

@CyberDem0n
Copy link
Member

What other parameters should it be possible to set via environment variables (except passwords)?
I'm thinking about:

  • NAME (node name)
  • SCOPE (cluster name)
  • NAMESPACE (path inside DCS where cluster is stored, /service by default)
  • RESTAPI_AUTH ('username:password' for accessing some of the endpoints)
  • RESTAPI_CERTFILE
  • RESTAPI_KEYFILE
  • RESTAPI_LISTEN
  • RESTAPI_CONNECT_ADDRESS
  • POSTGRESQL_LISTEN
  • POSTGRESQL_CONNECT_ADDRESS
  • POSTGRESQL_DATA_DIR ?
  • POSTGRESQL_PGPASS ?
  • (ETCD|CONSUL|ZOOKEEPER)_HOST(S) ?

What about order of precedence? I think config file should have a priority.

@feikesteenbergen
Copy link
Contributor

feikesteenbergen commented Jun 6, 2016

What about PATRONI_CONFIGURATION? As since 9744019 In that way you can run patroni totally with an envdir.

@CyberDem0n
Copy link
Member

Yeah, but with PATRONI_CONFIG it's not possible to change config and reload it...

@alexeyklyukin
Copy link
Contributor

It is actually called 'PATRONI_CONFIGURATION' and it's mutually exclusive with the actual configuration files, so you cannot read from both.

I think we only move the actual secrets to the envdir, obviously, the passwords, but also RESTAPI_AUTH, RESTAPI_CERTFILE and RESTAPI_KEYFILE.

@CyberDem0n
Copy link
Member

It is not only about passwords, but about running Patroni in a docker. For example it's not always possible to figure out your "connect_address" from inside docker.

@jberkus
Copy link
Contributor Author

jberkus commented Jun 6, 2016

Exactly. For example, when starting Patroni in Kubernetes, I can pass the Pod IP address as an ENV; it's not visible inside the container.

@lasomethingsomething
Copy link
Contributor

@CyberDem0n @alexeyklyukin @feikesteenbergen @jberkus What's the next step to take for this issue?

@CyberDem0n
Copy link
Member

I believe #211 covers most of the use-cases. Closing this issue. If something is missing we will create a new one.

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

5 participants