Skip to content

Commit

Permalink
feat(panel): remove certificate env variables
Browse files Browse the repository at this point in the history
  • Loading branch information
sogehige committed Mar 29, 2024
1 parent dc9863a commit 836b10a
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 41 deletions.
9 changes: 1 addition & 8 deletions docs/_master/configuration/env.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,6 @@ Set port for listening of UI.
- `SECUREPORT=12345`
- `SECUREPORT=20443` *default*

## CA_KEY, CA_CERT

Sets your certificate and certificate key by **full path**

- `CA_KEY=/path/to/your/cert.key`
- `CA_CERT=/path/to/your/cert.cert`

## HEAP

Enables HEAP snapshot tracking and saving for a bot. In normal environment,
Expand Down Expand Up @@ -79,7 +72,7 @@ in different timezones.
### Available values

- *system* - will set timezone defined by system
- other timezones can be found at https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
- other timezones can be found at <https://en.wikipedia.org/wiki/List_of_tz_database_time_zones>
- you are interested in TZ values on wiki:
- Africa/Abidjan
- Europe/Prague
Expand Down
9 changes: 1 addition & 8 deletions docs/configuration/env.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,6 @@ Set port for listening of UI.
- `SECUREPORT=12345`
- `SECUREPORT=20443` *default*

## CA_KEY, CA_CERT

Sets your certificate and certificate key by **full path**

- `CA_KEY=/path/to/your/cert.key`
- `CA_CERT=/path/to/your/cert.cert`

## HEAP

Enables HEAP snapshot tracking and saving for a bot. In normal environment,
Expand Down Expand Up @@ -79,7 +72,7 @@ in different timezones.
### Available values

- *system* - will set timezone defined by system
- other timezones can be found at https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
- other timezones can be found at <https://en.wikipedia.org/wiki/List_of_tz_database_time_zones>
- you are interested in TZ values on wiki:
- Africa/Abidjan
- Europe/Prague
Expand Down
25 changes: 0 additions & 25 deletions src/helpers/panel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,30 +61,5 @@ export const setServer = () => {
ioServer = new io(server);
}
ioServer.sockets.setMaxListeners(200);

if (process.env.CA_CERT && process.env.CA_KEY && process.env.NODE_EXTRA_CA_CERTS) {
info(`Using ${process.env.CA_CERT} certificate for HTTPS with ${process.env.NODE_EXTRA_CA_CERTS} CA Bundle`);
serverSecure = https.createServer({
key: fs.readFileSync(normalize(process.env.CA_KEY)),
cert: fs.readFileSync(normalize(process.env.CA_CERT)),
ca: fs.readFileSync(normalize(process.env.NODE_EXTRA_CA_CERTS)),
secureOptions: constants.SSL_OP_NO_TLSv1 | constants.SSL_OP_NO_TLSv1_1,
}, app);
if (ioServer) {
ioServer.attach(serverSecure);
}
} else if (process.env.CA_CERT && process.env.CA_KEY) {
info(`Using ${process.env.CA_CERT} certificate for HTTPS`);
serverSecure = https.createServer({
key: fs.readFileSync(normalize(process.env.CA_KEY)),
cert: fs.readFileSync(normalize(process.env.CA_CERT)),
secureOptions: constants.SSL_OP_NO_TLSv1 | constants.SSL_OP_NO_TLSv1_1,
}, app);
if (ioServer) {
ioServer.attach(serverSecure);
}
} else {
info(`No certificates were provided, serving only HTTP.`);
}
}
};

0 comments on commit 836b10a

Please sign in to comment.