-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support multiple domain names #153
Conversation
@@ -319,8 +319,8 @@ func (s *Config) validate() error { | |||
return xerror.EInternalError("ssl.listen_addr is required", nil) | |||
} | |||
|
|||
if s.Domain == nil || len(s.Domain.Name) == 0 { | |||
return xerror.EInternalError("SSL server is enabled, but no domain name is set", nil) | |||
if s.Domain == nil || len(s.Domain.PrimaryName) == 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better
s.Domain.PrimaryName == ""
// DomainConfig is the YAML version of the `adminAPI.DomainConfig` struct. | ||
type DomainConfig struct { | ||
Mode string `yaml:"mode" valid:"required"` | ||
PrimaryName string `yaml:"name" valid:"dns,required"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why it's named as PrimaryName
Can it be simple Name
as yaml defines it's the name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PrimaryName is better for reading code. "name" in yaml is left for backward compatibility.
} | ||
|
||
if c.Mode == string(adminAPI.DomainConfigModeReverseProxy) { | ||
if len(c.Schema) == 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
c.Schema == ""
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Worth to have check with c.Schema == "http" || c.Schema == "https" ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't change this code, just moved to appropriate place. Let leave as is for now.
No description provided.