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

Discussion regarding key generation #114

Open
YashKumarVerma opened this issue Jul 2, 2021 · 1 comment
Open

Discussion regarding key generation #114

YashKumarVerma opened this issue Jul 2, 2021 · 1 comment

Comments

@YashKumarVerma
Copy link
Contributor

if (!fs.existsSync('./keys/key') && !fs.existsSync('./keys/key.pub') && GENERATE_KEY_IF_MISSING) {
try {
execSync(`${preCommand}'/CN=www.camicroscope.com/O=caMicroscope Local Instance Key./C=US'${postCommand}`);
} catch (err) {
console.log({err: err});
}
}

I had the following queries about the following lines.

  • is the sole purpose of these lines is to create the keys programmatically at runtime? afaik this should be done in the docker-compose step and not during runtime?
  • If the above is false (i.e. these have separate responsibilities), then the keys should be generated when either of the file is missing right? The code will execute only if both of the files are missing.
  • also, is there any particular reason for dividing the string into three segments, pre, mid and post?
@birm
Copy link
Member

birm commented Jul 4, 2021

  • Yes
  • I advocate for mounting in keys
  • I don't have one. I suspect it's an attempt to meet line length guidance.

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