Skip to content

Commit

Permalink
Allow SSL cert paths to be specified in config (#4910)
Browse files Browse the repository at this point in the history
  • Loading branch information
Flashy78 authored Jun 11, 2024
1 parent 62bdff3 commit dcb86d9
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions internal/manager/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit dcb86d9

Please sign in to comment.