Skip to content

Commit

Permalink
chore(deps): upgrade gosettings to v0.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
qdm12 committed May 18, 2024
1 parent 156a695 commit 99f6e43
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 10 deletions.
4 changes: 3 additions & 1 deletion cmd/dns/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ func main() {
logger := log.New()
settingsSources := []reader.Source{
flag.New(os.Args),
env.New(os.Environ()),
env.New(env.Settings{
Environ: os.Environ(),
}),
}
settingsReader := reader.New(reader.Settings{
Sources: settingsSources,
Expand Down
4 changes: 3 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ require (
github.com/prometheus/client_golang v1.16.0
github.com/prometheus/client_model v0.3.0
github.com/qdm12/goservices v0.1.0
github.com/qdm12/gosettings v0.4.0-rc5
github.com/qdm12/gosettings v0.4.1
github.com/qdm12/gosplash v0.1.0
github.com/qdm12/gotree v0.2.0
github.com/qdm12/log v0.1.0
Expand Down Expand Up @@ -38,4 +38,6 @@ require (
golang.org/x/tools v0.15.0 // indirect
google.golang.org/protobuf v1.30.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
kernel.org/pub/linux/libs/security/libcap/cap v1.2.69 // indirect
kernel.org/pub/linux/libs/security/libcap/psx v1.2.69 // indirect
)
8 changes: 6 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ github.com/prometheus/procfs v0.10.1 h1:kYK1Va/YMlutzCGazswoHKo//tZVlFpKYh+Pymzi
github.com/prometheus/procfs v0.10.1/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM=
github.com/qdm12/goservices v0.1.0 h1:9sODefm/yuIGS7ynCkEnNlMTAYn9GzPhtcK4F69JWvc=
github.com/qdm12/goservices v0.1.0/go.mod h1:/JOFsAnHFiSjyoXxa5FlfX903h20K5u/3rLzCjYVMck=
github.com/qdm12/gosettings v0.4.0-rc5 h1:DZ4PjfF/Xtx0QGMbinNPr7xRf0rtLfkIg4zZNXUoypY=
github.com/qdm12/gosettings v0.4.0-rc5/go.mod h1:kZtFrO3sfWmMGG3scQB3GcawGe41LKo/4dR4h0dG104=
github.com/qdm12/gosettings v0.4.1 h1:c7+14jO1Y2kFXBCUfS2+QE2NgwTKfzcdJzGEFRItCI8=
github.com/qdm12/gosettings v0.4.1/go.mod h1:uItKwGXibJp2pQ0am6MBKilpjfvYTGiH+zXHd10jFj8=
github.com/qdm12/gosplash v0.1.0 h1:Sfl+zIjFZFP7b0iqf2l5UkmEY97XBnaKkH3FNY6Gf7g=
github.com/qdm12/gosplash v0.1.0/go.mod h1:+A3fWW4/rUeDXhY3ieBzwghKdnIPFJgD8K3qQkenJlw=
github.com/qdm12/gotree v0.2.0 h1:+58ltxkNLUyHtATFereAcOjBVfY6ETqRex8XK90Fb/c=
Expand Down Expand Up @@ -111,3 +111,7 @@ gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EV
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
kernel.org/pub/linux/libs/security/libcap/cap v1.2.69 h1:N0m3tKYbkRMmDobh/47ngz+AWeV7PcfXMDi8xu3Vrag=
kernel.org/pub/linux/libs/security/libcap/cap v1.2.69/go.mod h1:Tk5Ip2TuxaWGpccL7//rAsLRH6RQ/jfqTGxuN/+i/FQ=
kernel.org/pub/linux/libs/security/libcap/psx v1.2.69 h1:IdrOs1ZgwGw5CI+BH6GgVVlOt+LAXoPyh7enr8lfaXs=
kernel.org/pub/linux/libs/security/libcap/psx v1.2.69/go.mod h1:+l6Ee2F59XiJ2I6WR5ObpC1utCQJZ/VLsEbQCD8RG24=
3 changes: 1 addition & 2 deletions internal/config/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ func (s *Settings) Validate() (err error) {
return fmt.Errorf("upstream type: %w", err)
}

const privilegedAllowedPort = 53
err = validate.ListeningAddress(*s.ListeningAddress, os.Getuid(), privilegedAllowedPort)
err = validate.ListeningAddress(*s.ListeningAddress, os.Getuid())
if err != nil {
return fmt.Errorf("listening address: %w", err)
}
Expand Down
3 changes: 1 addition & 2 deletions pkg/doh/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,7 @@ func (s ServerSettings) Validate() (err error) {
return fmt.Errorf("resolver settings: %w", err)
}

const defaultUDPPort = 53
err = validate.ListeningAddress(*s.ListeningAddress, os.Getuid(), defaultUDPPort)
err = validate.ListeningAddress(*s.ListeningAddress, os.Getuid())
if err != nil {
return fmt.Errorf("%w: %s", ErrListeningAddressNotValid, *s.ListeningAddress)
}
Expand Down
3 changes: 1 addition & 2 deletions pkg/dot/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,7 @@ func (s ServerSettings) Validate() (err error) {
return fmt.Errorf("resolver settings: %w", err)
}

const defaultUDPPort = 53
err = validate.ListeningAddress(*s.ListeningAddress, os.Getuid(), defaultUDPPort)
err = validate.ListeningAddress(*s.ListeningAddress, os.Getuid())
if err != nil {
return fmt.Errorf("%w: %s", ErrListeningAddressNotValid, *s.ListeningAddress)
}
Expand Down

0 comments on commit 99f6e43

Please sign in to comment.