Skip to content

Discussion regarding key generation #114

@YashKumarVerma

Description

@YashKumarVerma

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions