patch comkey path to fallback

This commit is contained in:
timothycarambat 2024-04-04 10:47:26 -07:00
parent 718062d033
commit 0b454016cf
2 changed files with 9 additions and 3 deletions
collector/utils/comKey
server/utils/comKey

View file

@ -1,11 +1,14 @@
const crypto = require("crypto"); const crypto = require("crypto");
const fs = require("fs"); const fs = require("fs");
const path = require("path"); const path = require("path");
const keyPath = const keyPath =
process.env.NODE_ENV === "development" process.env.NODE_ENV === "development"
? path.resolve(__dirname, `../../../server/storage/comkey`) ? path.resolve(__dirname, `../../../server/storage/comkey`)
: path.resolve(process.env.STORAGE_DIR, `comkey`); : path.resolve(
process.env.STORAGE_DIR ??
path.resolve(__dirname, `../../../server/storage`),
`comkey`
);
class CommunicationKey { class CommunicationKey {
#pubKeyName = "ipc-pub.pem"; #pubKeyName = "ipc-pub.pem";

View file

@ -4,7 +4,10 @@ const path = require("path");
const keyPath = const keyPath =
process.env.NODE_ENV === "development" process.env.NODE_ENV === "development"
? path.resolve(__dirname, `../../storage/comkey`) ? path.resolve(__dirname, `../../storage/comkey`)
: path.resolve(process.env.STORAGE_DIR, `comkey`); : path.resolve(
process.env.STORAGE_DIR ?? path.resolve(__dirname, `../../storage`),
`comkey`
);
// What does this class do? // What does this class do?
// This class generates a hashed version of some text (typically a JSON payload) using a rolling RSA key // This class generates a hashed version of some text (typically a JSON payload) using a rolling RSA key