mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 12:24:38 +03:00
Allow SSL cert paths to be specified in config (#4910)
This commit is contained in:
@@ -232,6 +232,9 @@ const (
|
|||||||
SecurityTripwireAccessedFromPublicInternet = "security_tripwire_accessed_from_public_internet"
|
SecurityTripwireAccessedFromPublicInternet = "security_tripwire_accessed_from_public_internet"
|
||||||
securityTripwireAccessedFromPublicInternetDefault = ""
|
securityTripwireAccessedFromPublicInternetDefault = ""
|
||||||
|
|
||||||
|
sslCertPath = "ssl_cert_path"
|
||||||
|
sslKeyPath = "ssl_key_path"
|
||||||
|
|
||||||
// DLNA options
|
// DLNA options
|
||||||
DLNAServerName = "dlna.server_name"
|
DLNAServerName = "dlna.server_name"
|
||||||
DLNADefaultEnabled = "dlna.default_enabled"
|
DLNADefaultEnabled = "dlna.default_enabled"
|
||||||
@@ -356,8 +359,17 @@ func (i *Config) InitTLS() {
|
|||||||
paths.GetStashHomeDirectory(),
|
paths.GetStashHomeDirectory(),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
i.certFile = i.getString(sslCertPath)
|
||||||
|
if i.certFile == "" {
|
||||||
|
// Look for default file
|
||||||
i.certFile = fsutil.FindInPaths(tlsPaths, "stash.crt")
|
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")
|
i.keyFile = fsutil.FindInPaths(tlsPaths, "stash.key")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i *Config) GetTLSFiles() (certFile, keyFile string) {
|
func (i *Config) GetTLSFiles() (certFile, keyFile string) {
|
||||||
|
|||||||
Reference in New Issue
Block a user