Skip to content

Commit

Permalink
Merge pull request #49 from telekom-mms/feature/update-dependencies
Browse files Browse the repository at this point in the history
Update TND and other dependencies
  • Loading branch information
hwipl committed Oct 16, 2023
2 parents a765b80 + c2504b1 commit bd82a37
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 20 deletions.
6 changes: 6 additions & 0 deletions configs/oc-daemon.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,11 @@
"ResolveTries": 3,
"ResolveTriesSleep": 1000000000,
"ResolveTTL": 300000000000
},
"TND": {
"WaitCheck": 1000000000,
"HTTPSTimeout": 5000000000,
"UntrustedTimer": 30000000000,
"TrustedTimer": 60000000000
}
}
10 changes: 5 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ go 1.18
require (
github.com/fsnotify/fsnotify v1.6.0
github.com/godbus/dbus/v5 v5.1.0
github.com/miekg/dns v1.1.54
github.com/sirupsen/logrus v1.9.2
github.com/telekom-mms/tnd v0.1.0
github.com/miekg/dns v1.1.56
github.com/sirupsen/logrus v1.9.3
github.com/telekom-mms/tnd v0.2.0
github.com/vishvananda/netlink v1.1.0
golang.org/x/sys v0.13.0
)

require (
github.com/vishvananda/netns v0.0.4 // indirect
golang.org/x/mod v0.10.0 // indirect
golang.org/x/mod v0.13.0 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/tools v0.9.2 // indirect
golang.org/x/tools v0.14.0 // indirect
)
22 changes: 11 additions & 11 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 +5,34 @@ github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4
github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw=
github.com/godbus/dbus/v5 v5.1.0 h1:4KLkAxT3aOY8Li4FRJe/KvhoNFFxo0m6fNuFUO8QJUk=
github.com/godbus/dbus/v5 v5.1.0/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
github.com/miekg/dns v1.1.54 h1:5jon9mWcb0sFJGpnI99tOMhCPyJ+RPVz5b63MQG0VWI=
github.com/miekg/dns v1.1.54/go.mod h1:uInx36IzPl7FYnDcMeVWxj9byh7DutNykX4G9Sj60FY=
github.com/miekg/dns v1.1.56 h1:5imZaSeoRNvpM9SzWNhEcP9QliKiz20/dA2QabIGVnE=
github.com/miekg/dns v1.1.56/go.mod h1:cRm6Oo2C8TY9ZS/TqsSrseAcncm74lfK5G+ikN2SWWY=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/sirupsen/logrus v1.9.2 h1:oxx1eChJGI6Uks2ZC4W1zpLlVgqB8ner4EuQwV4Ik1Y=
github.com/sirupsen/logrus v1.9.2/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/telekom-mms/tnd v0.1.0 h1:q/s04tAO9Lhpd1bxULAFsLYmURg3INO2wi64JHf/u3o=
github.com/telekom-mms/tnd v0.1.0/go.mod h1:sh1Fzl8msx9Wqu/V4pqK+kw5ZqPKIbG8hNZmtP+nH8I=
github.com/telekom-mms/tnd v0.2.0 h1:sPGFObbLEw2vFQsbw1WGk8UDW1MDxJBZYoUi3RHCOUw=
github.com/telekom-mms/tnd v0.2.0/go.mod h1:qcxCJ9vQZiw2ECctoY7mCCmFmbG9mE7bDvxKTARlQlk=
github.com/vishvananda/netlink v1.1.0 h1:1iyaYNBLmP6L0220aDnYQpo1QEV4t4hJ+xEEhhJH8j0=
github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE=
github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17pCcGlemwknint6hfoeCVQrEMVwxRLRjXpq+BU=
github.com/vishvananda/netns v0.0.4 h1:Oeaw1EM2JMxD51g9uhtC0D7erkIjgmj8+JZc26m1YX8=
github.com/vishvananda/netns v0.0.4/go.mod h1:SpkAiCQRtJ6TvvxPnOSyH3BMl6unz3xZlaprSwhNNJM=
golang.org/x/mod v0.10.0 h1:lFO9qtOdlre5W1jxS3r/4szv2/6iXxScdzjoBMXNhYk=
golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/mod v0.13.0 h1:I/DsJXRlw/8l/0c24sM9yb0T4z9liZTduXvdAWYiysY=
golang.org/x/mod v0.13.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM=
golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
golang.org/x/sync v0.2.0 h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI=
golang.org/x/sync v0.4.0 h1:zxkM55ReGkDlKSM+Fu41A+zmbZuaPVbGMzvvdUPznYQ=
golang.org/x/sys v0.0.0-20190606203320-7fc4e5ec1444/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE=
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/tools v0.9.2 h1:UXbndbirwCAx6TULftIfie/ygDNCwxEie+IiNP1IcNc=
golang.org/x/tools v0.9.2/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc=
golang.org/x/tools v0.14.0 h1:jvNa2pY0M4r62jkRQ6RwEZZyPcymeL9XZMLBbV7U2nc=
golang.org/x/tools v0.14.0/go.mod h1:uYBEerGOWcJyEORxN+Ek8+TT266gXkNlHdJBwexUsBg=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
6 changes: 5 additions & 1 deletion internal/daemon/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"github.com/telekom-mms/oc-daemon/internal/ocrunner"
"github.com/telekom-mms/oc-daemon/internal/splitrt"
"github.com/telekom-mms/oc-daemon/internal/trafpol"
"github.com/telekom-mms/tnd/pkg/tnd"
)

var (
Expand All @@ -37,6 +38,7 @@ type Config struct {
Executables *execs.Config
SplitRouting *splitrt.Config
TrafficPolicing *trafpol.Config
TND *tnd.Config
}

// Valid returns whether config is valid
Expand All @@ -48,7 +50,8 @@ func (c *Config) Valid() bool {
!c.OpenConnect.Valid() ||
!c.Executables.Valid() ||
!c.SplitRouting.Valid() ||
!c.TrafficPolicing.Valid() {
!c.TrafficPolicing.Valid() ||
!c.TND.Valid() {
// invalid
return false
}
Expand Down Expand Up @@ -84,5 +87,6 @@ func NewConfig() *Config {
Executables: execs.NewConfig(),
SplitRouting: splitrt.NewConfig(),
TrafficPolicing: trafpol.NewConfig(),
TND: tnd.NewConfig(),
}
}
12 changes: 12 additions & 0 deletions internal/daemon/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/telekom-mms/oc-daemon/internal/ocrunner"
"github.com/telekom-mms/oc-daemon/internal/splitrt"
"github.com/telekom-mms/oc-daemon/internal/trafpol"
"github.com/telekom-mms/tnd/pkg/tnd"
)

// TestConfigValid tests Valid of Config
Expand Down Expand Up @@ -120,6 +121,12 @@ func TestConfigLoad(t *testing.T) {
"ResolveTries": 3,
"ResolveTriesSleep": 1000000000,
"ResolveTTL": 300000000000
},
"TND": {
"WaitCheck": 1000000000,
"HTTPSTimeout": 5000000000,
"UntrustedTimer": 30000000000,
"TrustedTimer": 60000000000
}
}`,
`{
Expand Down Expand Up @@ -159,6 +166,7 @@ func TestConfigLoad(t *testing.T) {
Executables: execs.NewConfig(),
SplitRouting: splitrt.NewConfig(),
TrafficPolicing: trafpol.NewConfig(),
TND: tnd.NewConfig(),
}
if !reflect.DeepEqual(want.DNSProxy, config.DNSProxy) {
t.Errorf("got %v, want %v", config.DNSProxy, want.DNSProxy)
Expand All @@ -175,6 +183,9 @@ func TestConfigLoad(t *testing.T) {
if !reflect.DeepEqual(want.TrafficPolicing, config.TrafficPolicing) {
t.Errorf("got %v, want %v", config.TrafficPolicing, want.TrafficPolicing)
}
if !reflect.DeepEqual(want.TND, config.TND) {
t.Errorf("got %v, want %v", config.TND, want.TND)
}
if !reflect.DeepEqual(want, config) {
t.Errorf("got %v, want %v", config, want)
}
Expand All @@ -193,6 +204,7 @@ func TestNewConfig(t *testing.T) {
Executables: execs.NewConfig(),
SplitRouting: splitrt.NewConfig(),
TrafficPolicing: trafpol.NewConfig(),
TND: tnd.NewConfig(),
}
got := NewConfig()
if !reflect.DeepEqual(got, want) {
Expand Down
6 changes: 3 additions & 3 deletions internal/daemon/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"github.com/telekom-mms/oc-daemon/pkg/vpnconfig"
"github.com/telekom-mms/oc-daemon/pkg/vpnstatus"
"github.com/telekom-mms/oc-daemon/pkg/xmlprofile"
"github.com/telekom-mms/tnd/pkg/trustnet"
"github.com/telekom-mms/tnd/pkg/tnd"
"golang.org/x/sys/unix"
)

Expand All @@ -34,7 +34,7 @@ type Daemon struct {
server *api.Server
dbus *dbusapi.Service

tnd *trustnet.TND
tnd tnd.TND

vpnsetup *vpnsetup.VPNSetup
trafpol *trafpol.TrafPol
Expand Down Expand Up @@ -560,7 +560,7 @@ func (d *Daemon) startTND() {
if d.tnd != nil {
return
}
d.tnd = trustnet.NewTND()
d.tnd = tnd.NewDetector(d.config.TND)
d.initTNDServers()
d.setTNDDialer()
d.tnd.Start()
Expand Down

0 comments on commit bd82a37

Please sign in to comment.