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

Configurable certificate directory #585

Open
isuldor opened this issue Jan 18, 2020 · 3 comments
Open

Configurable certificate directory #585

isuldor opened this issue Jan 18, 2020 · 3 comments

Comments

@isuldor
Copy link
Contributor

isuldor commented Jan 18, 2020

dcrstakepool doesn't have a data directory (#502), and as a side effect will always create and use a .dcrstakepool directory under the user's home directory. This is where the daemon expects stakepoold certificates to exist. Several path config variables already exist for other resources: --publicpath, --templatepath, and --configfile. Perhaps a --certpath option is in order?

An alternative to setting all of these separate path variables (when not using ~/.dcrstakepool) would be a home directory option that is comparable to the deprecated --appdata. Maybe --homedir?

@JoeGruffins
Copy link
Member

Such a setting would be useful for an operator? I can see where it would help if you were running a testnet site from the same machine, is that where you are coming from?

@isuldor
Copy link
Contributor Author

isuldor commented Jan 24, 2020

Yeah the usefulness we're talking about here is probably really mild. But I think it's wise to run dcrstakepool as a user with restricted permissions (and a false shell like /usr/bin/nologin). Personally I like to pick a home directory under under /opt, although some might prefer /var or something else. That results in the certificates needing to be in /opt/dcrstakepool/.dcrstakepool. An ugly workaround would be to specify the full cert path in the config file like:

stakepooldcerts=/opt/dcrstakepool/certs/node01.cert,/opt/dcrstakepool/certs/node02.cert,/opt/dcrstakepool/certs/node03.cert,/opt/dcrstakepool/certs/node04.cert,/opt/dcrstakepool/certs/node05.cert,/opt/dcrstakepool/certs/node06.cert

Another consideration is if this software is ever distributed via a package manager, where it would be useful to configure any of the necessary paths. A single --homedir fits nicely in that case. For reference, I think politeia uses a homedir variable.

@JoeGruffins
Copy link
Member

Sounds like good reasons to me. @jholdstock any thoughts?
I need to look how the other repo's do it, but I guess it make sense to be a command line only command? If the conf is also located in that directory.

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

2 participants