Skip to content
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

Merged
merged 6 commits into from
Apr 27, 2024
Merged

Conversation

RandoMan70
Copy link
Contributor

No description provided.

@@ -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 {
Copy link
Contributor

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"`
Copy link
Contributor

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

Copy link
Contributor Author

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 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

c.Schema == ""

Copy link
Contributor

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" ?

Copy link
Contributor Author

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.

@RandoMan70 RandoMan70 merged commit 20e682c into main Apr 27, 2024
1 check passed
@RandoMan70 RandoMan70 deleted the feature/support-multiple-domain-names branch April 27, 2024 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants