From 1becd033e6ef3d308af3bc460fef3926f5986c2d Mon Sep 17 00:00:00 2001 From: Pavel Sviderski Date: Sat, 29 Mar 2025 11:39:45 +1000 Subject: [PATCH] chore: rename CaddyConfigPath field --- internal/machine/machine.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/internal/machine/machine.go b/internal/machine/machine.go index 71a9ad72..93ffc743 100644 --- a/internal/machine/machine.go +++ b/internal/machine/machine.go @@ -57,9 +57,9 @@ type Config struct { // DockerClient manages system and user containers using the local Docker daemon. DockerClient *client.Client - // CaddyfilePath specifies where the machine generates the Caddy reverse proxy configuration file for routing - // external traffic to service containers across the internal network. Default is DataDir/caddy/Caddyfile. - CaddyfilePath string + // CaddyConfigPath specifies where the machine generates the Caddy reverse proxy configuration file for routing + // external traffic to service containers across the internal network. Default is DataDir/caddy/caddy.json. + CaddyConfigPath string } // SetDefaults returns a new Config with default values set where not provided. @@ -122,8 +122,8 @@ func (c *Config) SetDefaults() (*Config, error) { } } - if cfg.CaddyfilePath == "" { - cfg.CaddyfilePath = filepath.Join(cfg.DataDir, "caddy", "caddy.json") + if cfg.CaddyConfigPath == "" { + cfg.CaddyConfigPath = filepath.Join(cfg.DataDir, "caddy", "caddy.json") } return &cfg, nil @@ -360,7 +360,7 @@ func (m *Machine) Run(ctx context.Context) error { // Create a new Caddyfile controller for managing the Caddy reverse proxy configuration. // It will also serve the current machine ID at /.uncloud-verify to verify Caddy reachability. - caddyfileCtrl, err := caddyfile.NewController(m.store, m.config.CaddyfilePath, m.state.ID) + caddyfileCtrl, err := caddyfile.NewController(m.store, m.config.CaddyConfigPath, m.state.ID) if err != nil { return fmt.Errorf("create Caddyfile controller: %w", err) }