services -> domains
This commit is contained in:
@@ -30,9 +30,9 @@ type Config struct {
|
||||
CredentialsDir string `yaml:"credentialsDir" json:"credentialsDir"`
|
||||
}
|
||||
|
||||
// PublicService describes a service that should be exposed through the tunnel.
|
||||
type PublicService struct {
|
||||
Name string // service name (used as subdomain)
|
||||
// PublicDomain describes a domain that should be exposed through the tunnel.
|
||||
type PublicDomain struct {
|
||||
Name string // domain name (used as subdomain)
|
||||
Subdomain string // explicit subdomain override (defaults to Name)
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ type cloudflaredConfig struct {
|
||||
|
||||
// GenerateConfig renders the cloudflared config.yml for the given public services.
|
||||
// Returns the YAML string, or empty string if tunnel is not configured or no services are public.
|
||||
func (m *Manager) GenerateConfig(cfg Config, services []PublicService) string {
|
||||
func (m *Manager) GenerateConfig(cfg Config, services []PublicDomain) string {
|
||||
if !cfg.Enabled || cfg.TunnelID == "" || cfg.PublicDomain == "" || cfg.GatewayDomain == "" {
|
||||
return ""
|
||||
}
|
||||
@@ -131,7 +131,7 @@ func (m *Manager) GenerateConfig(cfg Config, services []PublicService) string {
|
||||
}
|
||||
|
||||
// WriteConfig generates and writes the cloudflared config to disk.
|
||||
func (m *Manager) WriteConfig(cfg Config, services []PublicService) error {
|
||||
func (m *Manager) WriteConfig(cfg Config, services []PublicDomain) error {
|
||||
content := m.GenerateConfig(cfg, services)
|
||||
if content == "" {
|
||||
// Remove config if tunnel is disabled or no public services
|
||||
|
||||
Reference in New Issue
Block a user