added cert path option changes

This commit is contained in:
kyle hoell
2025-02-28 15:49:31 -05:00
parent 7203567fc7
commit 2938d83fd4
5 changed files with 36 additions and 6 deletions
+8 -1
View File
@@ -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=
+8 -1
View File
@@ -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=
+8 -1
View File
@@ -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=
+6
View File
@@ -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,
};
+6 -3
View File
@@ -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,