Skip to content

Commit

Permalink
feat: configurable cert path
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelTaylor3D committed Jul 21, 2023
1 parent 5184009 commit fbdadb8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
8 changes: 6 additions & 2 deletions src/datalayer/persistance.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,15 @@ const CONFIG = getConfig().APP;

const getBaseOptions = () => {
const chiaRoot = getChiaRoot();
const certificateFolderPath =
CONFIG.CERTIFICATE_FOLDER_PATH || `${chiaRoot}/config/ssl`;

const certFile = path.resolve(
`${chiaRoot}/config/ssl/data_layer/private_data_layer.crt`,
`${certificateFolderPath}/data_layer/private_data_layer.crt`,
);

const keyFile = path.resolve(
`${chiaRoot}/config/ssl/data_layer/private_data_layer.key`,
`${certificateFolderPath}/data_layer/private_data_layer.key`,
);

const baseOptions = {
Expand Down
8 changes: 6 additions & 2 deletions src/datalayer/wallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,18 @@ process.env['NODE_TLS_REJECT_UNAUTHORIZED'] = 0;

const rpcUrl = getConfig().APP.WALLET_URL;
const USE_SIMULATOR = getConfig().APP.USE_SIMULATOR;
const CONFIG = getConfig().APP;

const getBaseOptions = () => {
const chiaRoot = getChiaRoot();
const certificateFolderPath =
CONFIG.CERTIFICATE_FOLDER_PATH || `${chiaRoot}/config/ssl/wallet`;

const certFile = path.resolve(
`${chiaRoot}/config/ssl/data_layer/private_data_layer.crt`,
`${certificateFolderPath}/wallet/private_wallet.crt`,
);
const keyFile = path.resolve(
`${chiaRoot}/config/ssl/data_layer/private_data_layer.key`,
`${certificateFolderPath}/wallet/private_wallet.key`,
);

const baseOptions = {
Expand Down
1 change: 1 addition & 0 deletions src/utils/defaultConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export const defaultConfig = {
IS_GOVERNANCE_BODY: false,
DEFAULT_FEE: 300000000,
DEFAULT_COIN_AMOUNT: 300000000,
CERTIFICATE_FOLDER_PATH: null,
DATALAYER_FILE_SERVER_URL: null,
TASKS: {
AUDIT_SYNC_TASK_INTERVAL: 30,
Expand Down

0 comments on commit fbdadb8

Please sign in to comment.