Skip to content

Commit

Permalink
remove pointers from config struct
Browse files Browse the repository at this point in the history
  • Loading branch information
almeidapaulopt committed Dec 11, 2024
1 parent d4511cc commit a641d6c
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
4 changes: 2 additions & 2 deletions internal/proxyconfig/proxyconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import (
type (
// Config struct stores all the configuration for the proxy
Config struct {
Tailscale *Tailscale `validate:"dive"`
Dashboard *Dashboard `validate:"dive"`
Tailscale Tailscale `validate:"dive"`
Dashboard Dashboard `validate:"dive"`
// Global
TargetProvider string
TargetID string
Expand Down
2 changes: 0 additions & 2 deletions internal/proxyproviders/tailscale/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ func New(log zerolog.Logger, name string, provider *config.TailscaleServerConfig
func (c *Client) NewProxy(config *proxyconfig.Config) (proxyproviders.Proxy, error) {
c.log.Debug().
Str("hostname", config.Hostname).
Bool("ephemeral", config.Tailscale.Ephemeral).
Bool("runWebClient", config.Tailscale.RunWebClient).
Msg("Setting up tailscale server")

// If the auth key is not set, use the provider auth key
Expand Down
2 changes: 1 addition & 1 deletion internal/targetproviders/docker/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ func (c *container) newProxyConfig() (*proxyconfig.Config, error) {
pcfg.ProxyURL = proxyURL
pcfg.Hostname = proxyURL.Hostname()
pcfg.TargetProvider = c.targetProviderName
pcfg.Tailscale = tailscale
pcfg.Tailscale = *tailscale
pcfg.ProxyProvider = c.getLabelString(LabelProxyProvider, proxyconfig.DefaultProxyProvider)
pcfg.ProxyAccessLog = c.getLabelBool(LabelContainerAccessLog, proxyconfig.DefaultProxyAccessLog)
pcfg.TLSValidate = c.getLabelBool(LabelTLSValidate, proxyconfig.DefaultTLSValidate)
Expand Down
4 changes: 2 additions & 2 deletions internal/targetproviders/files/files.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ type (
configProxiesList map[string]proxyConfig

proxyConfig struct {
Dashboard *proxyconfig.Dashboard
Tailscale *proxyconfig.Tailscale
Dashboard proxyconfig.Dashboard
Tailscale proxyconfig.Tailscale
URL string `validate:"required,uri"`
ProxyProvider string
TLSValidate bool `default:"true" validate:"boolean"`
Expand Down

0 comments on commit a641d6c

Please sign in to comment.