From dcb86d9186a2a78611dc6eeefffea0a0a8c8faae Mon Sep 17 00:00:00 2001 From: Flashy78 <90150289+Flashy78@users.noreply.github.com> Date: Mon, 10 Jun 2024 20:11:41 -0700 Subject: [PATCH] Allow SSL cert paths to be specified in config (#4910) --- internal/manager/config/config.go | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/internal/manager/config/config.go b/internal/manager/config/config.go index 184d78494..d56d3359b 100644 --- a/internal/manager/config/config.go +++ b/internal/manager/config/config.go @@ -232,6 +232,9 @@ const ( SecurityTripwireAccessedFromPublicInternet = "security_tripwire_accessed_from_public_internet" securityTripwireAccessedFromPublicInternetDefault = "" + sslCertPath = "ssl_cert_path" + sslKeyPath = "ssl_key_path" + // DLNA options DLNAServerName = "dlna.server_name" DLNADefaultEnabled = "dlna.default_enabled" @@ -356,8 +359,17 @@ func (i *Config) InitTLS() { paths.GetStashHomeDirectory(), } - i.certFile = fsutil.FindInPaths(tlsPaths, "stash.crt") - i.keyFile = fsutil.FindInPaths(tlsPaths, "stash.key") + i.certFile = i.getString(sslCertPath) + if i.certFile == "" { + // Look for default file + i.certFile = fsutil.FindInPaths(tlsPaths, "stash.crt") + } + + i.keyFile = i.getString(sslKeyPath) + if i.keyFile == "" { + // Look for default file + i.keyFile = fsutil.FindInPaths(tlsPaths, "stash.key") + } } func (i *Config) GetTLSFiles() (certFile, keyFile string) {