From 7a328d42aa89fb779bcd50a3c4d775046ccc03fa Mon Sep 17 00:00:00 2001 From: Flashy78 <90150289+Flashy78@users.noreply.github.com> Date: Sun, 2 Jun 2024 22:22:43 -0700 Subject: [PATCH] Allow SSL cert paths to be specified in config --- 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 f677262193e..2716e38d852 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" @@ -360,8 +363,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) {