Skip to content

Commit

Permalink
clean up certs path
Browse files Browse the repository at this point in the history
  • Loading branch information
fengtality committed Feb 6, 2023
1 parent a2f40e0 commit 9d58415
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 28 deletions.
34 changes: 21 additions & 13 deletions src/https.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,24 @@ import { ConfigManagerV2 } from './services/config-manager-v2';

export const addHttps = (app: Application) => {
const serverKey = fs.readFileSync(
ConfigManagerV2.getInstance().get('server.certificatePath') + 'server_key.pem',
{
encoding: 'utf-8',
}
addSlashToPath(
ConfigManagerV2.getInstance().get('server.certificatePath')
) + 'server_key.pem',
{ encoding: 'utf-8' }
);

const serverCert = fs.readFileSync(
ConfigManagerV2.getInstance().get('server.certificatePath') +
'server_cert.pem',
{
encoding: 'utf-8',
}
addSlashToPath(
ConfigManagerV2.getInstance().get('server.certificatePath')
) + 'server_cert.pem',
{ encoding: 'utf-8' }
);

const caCert = fs.readFileSync(
ConfigManagerV2.getInstance().get('server.certificatePath') + 'ca_cert.pem',
{
encoding: 'utf-8',
}
addSlashToPath(
ConfigManagerV2.getInstance().get('server.certificatePath')
) + 'ca_cert.pem',
{ encoding: 'utf-8' }
);

return https.createServer(
Expand All @@ -40,3 +41,10 @@ export const addHttps = (app: Application) => {
app
);
};

const addSlashToPath = (path: string) => {
if (!path.endsWith('/')) {
path += '/';
}
return path;
};
12 changes: 0 additions & 12 deletions src/services/schema/ethereum-gas-station-schema.json

This file was deleted.

2 changes: 1 addition & 1 deletion src/templates/server.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Path to folder where Hummingbot generates self-signed certificates
certificatePath: /Users/feng1/Code/hummingbot/certs/
certificatePath: /certs/

# Path to folder where logs will be stored.
logPath: './logs'
Expand Down
2 changes: 0 additions & 2 deletions src/templates/telemetry.yml

This file was deleted.

0 comments on commit 9d58415

Please sign in to comment.