mirror of
https://github.com/Alvin-Zilverstand/nginx-proxy-manager.git
synced 2026-11-29 01:17:52 +01:00
- Added upstream objects
- Renamed host templates to nginx templates - Generate upstream templates - Better nginx error reporting when reloading - Use tparse for golang test reporting
This commit is contained in:
1 parent
b3ae2f4dbb
commit
5e5f0de0e2
82 files changed
+2209
-294
No files matched your search
@@ -5,7 +5,7 @@ import (
|
||||
|
||||
"npm/internal/entity/certificate"
|
||||
"npm/internal/entity/host"
|
||||
"npm/internal/entity/hosttemplate"
|
||||
"npm/internal/entity/nginxtemplate"
|
||||
)
|
||||
|
||||
// ValidateHost will check if associated objects exist and other checks
|
||||
@@ -20,13 +20,13 @@ func ValidateHost(h host.Model) error {
|
||||
}
|
||||
}
|
||||
|
||||
// Check the host template exists and has the same type.
|
||||
hostTemplate, tErr := hosttemplate.GetByID(h.HostTemplateID)
|
||||
// Check the nginx template exists and has the same type.
|
||||
nginxTemplate, tErr := nginxtemplate.GetByID(h.NginxTemplateID)
|
||||
if tErr != nil {
|
||||
return fmt.Errorf("Host Template #%d does not exist", h.HostTemplateID)
|
||||
return fmt.Errorf("Host Template #%d does not exist", h.NginxTemplateID)
|
||||
}
|
||||
if hostTemplate.Type != h.Type {
|
||||
return fmt.Errorf("Host Template #%d is not valid for this host type", h.HostTemplateID)
|
||||
if nginxTemplate.Type != h.Type {
|
||||
return fmt.Errorf("Host Template #%d is not valid for this host type", h.NginxTemplateID)
|
||||
}
|
||||
|
||||
return nil
|
||||
|
||||
Reference in new issue
Block a user