added cert path option changes
This commit is contained in:
@@ -84,4 +84,11 @@ SECURE_COOKIES=
|
||||
# SSL=true
|
||||
# Place your SSL certificate files in the root directory of the project
|
||||
# With the names: certificate.crt, certificate.key, and certificate.ca-bundle;
|
||||
SSL=
|
||||
SSL=
|
||||
|
||||
# HTTPS cert paths (optional): If you need to change the paths of the https certs
|
||||
# You can do so with these env variables.
|
||||
# By default myDrive looks for certificate.crt, certificate.ca-bundle and certificate.key on the root of the project
|
||||
HTTPS_KEY_PATH=
|
||||
HTTPS_CA_PATH=
|
||||
HTTPS_CRT_PATH=
|
||||
@@ -84,4 +84,11 @@ SECURE_COOKIES=
|
||||
# SSL=true
|
||||
# Place your SSL certificate files in the root directory of the project
|
||||
# With the names: certificate.crt, certificate.key, and certificate.ca-bundle;
|
||||
SSL=
|
||||
SSL=
|
||||
|
||||
# HTTPS cert paths (optional): If you need to change the paths of the https certs
|
||||
# You can do so with these env variables.
|
||||
# By default myDrive looks for certificate.crt, certificate.ca-bundle and certificate.key on the root of the project
|
||||
HTTPS_KEY_PATH=
|
||||
HTTPS_CA_PATH=
|
||||
HTTPS_CRT_PATH=
|
||||
@@ -84,4 +84,11 @@ SECURE_COOKIES=
|
||||
# SSL=true
|
||||
# Place your SSL certificate files in the root directory of the project
|
||||
# With the names: certificate.crt, certificate.key, and certificate.ca-bundle;
|
||||
SSL=
|
||||
SSL=
|
||||
|
||||
# HTTPS cert paths (optional): If you need to change the paths of the https certs
|
||||
# You can do so with these env variables.
|
||||
# By default myDrive looks for certificate.crt, certificate.ca-bundle and certificate.key on the root of the project
|
||||
HTTPS_KEY_PATH=
|
||||
HTTPS_CA_PATH=
|
||||
HTTPS_CRT_PATH=
|
||||
@@ -31,6 +31,9 @@ export default {
|
||||
? +process.env.TEMP_VIDEO_THUMBNAIL_LIMIT
|
||||
: 0,
|
||||
docker: process.env.DOCKER === "true",
|
||||
httpsKeyPath: process.env.HTTPS_KEY_PATH,
|
||||
httpsCaPath: process.env.HTTPS_CA_PATH,
|
||||
httpsCrtPath: process.env.HTTPS_CRT_PATH,
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
@@ -66,4 +69,7 @@ module.exports = {
|
||||
? +process.env.TEMP_VIDEO_THUMBNAIL_LIMIT
|
||||
: 0,
|
||||
docker: process.env.DOCKER === "true",
|
||||
httpsKeyPath: process.env.HTTPS_KEY_PATH,
|
||||
httpsCaPath: process.env.HTTPS_CA_PATH,
|
||||
httpsCrtPath: process.env.HTTPS_CRT_PATH,
|
||||
};
|
||||
|
||||
@@ -23,9 +23,12 @@ let server: any;
|
||||
let serverHttps: any;
|
||||
|
||||
if (process.env.SSL === "true") {
|
||||
const cert = fs.readFileSync("certificate.crt");
|
||||
const ca = fs.readFileSync("certificate.ca-bundle");
|
||||
const key = fs.readFileSync("certificate.key");
|
||||
const certPath = env.httpsCrtPath || "certificate.crt"
|
||||
const caPath = env.httpsCaPath || "certificate.ca-bundle"
|
||||
const keyPath = env.httpsKeyPath || "certificate.key"
|
||||
const cert = fs.readFileSync(certPath);
|
||||
const ca = fs.readFileSync(caPath);
|
||||
const key = fs.readFileSync(keyPath);
|
||||
|
||||
const options = {
|
||||
cert,
|
||||
|
||||
Reference in New Issue
Block a user