Refactored config system again
All checks were successful
Build (artifact) / build (push) Successful in 27s
All checks were successful
Build (artifact) / build (push) Successful in 27s
This commit is contained in:
@@ -293,15 +293,15 @@ func MakeCredential(username, groupname string) (*syscall.Credential, error) {
|
||||
return &syscall.Credential{Uid: uid, Gid: gid}, nil
|
||||
}
|
||||
|
||||
func EffectiveDataRoot(config *AppConfig, domainConfig *DomainConfig) string {
|
||||
// EffectiveDataRoot resolves the data root for a domain. The per-domain
|
||||
// override takes precedence; otherwise the app-level data root is used; if
|
||||
// both are empty, the current working directory is used.
|
||||
func EffectiveDataRoot(config *AppConfig, domainDataRoot string) string {
|
||||
if config == nil {
|
||||
return ""
|
||||
}
|
||||
if domainConfig == nil {
|
||||
return ""
|
||||
}
|
||||
|
||||
if domainConfig.Certificates.DataRoot == "" {
|
||||
if domainDataRoot == "" {
|
||||
if config.Certificates.DataRoot == "" {
|
||||
workDir, err := os.Getwd()
|
||||
if err != nil {
|
||||
@@ -311,7 +311,7 @@ func EffectiveDataRoot(config *AppConfig, domainConfig *DomainConfig) string {
|
||||
}
|
||||
return config.Certificates.DataRoot
|
||||
}
|
||||
return domainConfig.Certificates.DataRoot
|
||||
return domainDataRoot
|
||||
}
|
||||
|
||||
var fqdnRegex = regexp.MustCompile(`^(?i:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,}$`)
|
||||
|
||||
Reference in New Issue
Block a user