diff --git a/cmd/api/main.go b/cmd/api/main.go index 76fcab1..b4e757d 100644 --- a/cmd/api/main.go +++ b/cmd/api/main.go @@ -13,5 +13,5 @@ func main() { log.Fatal(err.Error()) } - apiServer.Run(":40000") + apiServer.Run(":8080") } diff --git a/pkg/api/types.go b/pkg/api/types.go index 11d26a2..6eb4bf9 100644 --- a/pkg/api/types.go +++ b/pkg/api/types.go @@ -18,11 +18,11 @@ type SmegMesh struct { } type CreateMeshRequest struct { - WgPort int `json:"port" binding:"gte=1024,lt=65535"` + WgPort int `json:"port" binding:"omitempty,gte=1024,lt=65535"` } type JoinMeshRequest struct { - WgPort int `json:"port" binding:"gte=1024,lt=65535"` + WgPort int `json:"port" binding:"omitempty,gte=1024,lt=65535"` Bootstrap string `json:"bootstrap" binding:"required"` MeshId string `json:"meshid" binding:"required"` } diff --git a/pkg/conf/conf.go b/pkg/conf/conf.go index ad68721..ae07339 100644 --- a/pkg/conf/conf.go +++ b/pkg/conf/conf.go @@ -53,6 +53,8 @@ type WgMeshConfiguration struct { Profile bool `yaml:"profile"` // StubWg whether or not to stub the WireGuard types StubWg bool `yaml:"stubWg"` + // What8Words file path for the what 8 words word list. + What8Words string `yaml:"what8Words"` } func ValidateConfiguration(c *WgMeshConfiguration) error { diff --git a/pkg/what8words/what8words.go b/pkg/what8words/what8words.go new file mode 100644 index 0000000..355f98d --- /dev/null +++ b/pkg/what8words/what8words.go @@ -0,0 +1,2 @@ +// Package to convert an IPV6 addres into 8 words +package what8words