|
@@ -7,32 +7,33 @@ import (
|
|
|
|
|
|
// ApiHost - the host struct for API usage
|
|
|
type ApiHost struct {
|
|
|
- ID string `json:"id"`
|
|
|
- Verbosity int `json:"verbosity"`
|
|
|
- FirewallInUse string `json:"firewallinuse"`
|
|
|
- Version string `json:"version"`
|
|
|
- Name string `json:"name"`
|
|
|
- OS string `json:"os"`
|
|
|
- Debug bool `json:"debug"`
|
|
|
- IsStatic bool `json:"isstatic"`
|
|
|
- ListenPort int `json:"listenport"`
|
|
|
- LocalListenPort int `json:"locallistenport"`
|
|
|
- ProxyListenPort int `json:"proxy_listen_port"`
|
|
|
- PublicListenPort int `json:"public_listen_port" yaml:"public_listen_port"`
|
|
|
- MTU int `json:"mtu" yaml:"mtu"`
|
|
|
- Interfaces []Iface `json:"interfaces" yaml:"interfaces"`
|
|
|
- DefaultInterface string `json:"defaultinterface" yaml:"defautlinterface"`
|
|
|
- EndpointIP string `json:"endpointip" yaml:"endpointip"`
|
|
|
- PublicKey string `json:"publickey"`
|
|
|
- MacAddress string `json:"macaddress"`
|
|
|
- InternetGateway string `json:"internetgateway"`
|
|
|
- Nodes []string `json:"nodes"`
|
|
|
- ProxyEnabled bool `json:"proxy_enabled" yaml:"proxy_enabled"`
|
|
|
- IsDefault bool `json:"isdefault" yaml:"isdefault"`
|
|
|
- IsRelayed bool `json:"isrelayed" bson:"isrelayed" yaml:"isrelayed"`
|
|
|
- RelayedBy string `json:"relayed_by" bson:"relayed_by" yaml:"relayed_by"`
|
|
|
- IsRelay bool `json:"isrelay" bson:"isrelay" yaml:"isrelay"`
|
|
|
- RelayedHosts []string `json:"relay_hosts" bson:"relay_hosts" yaml:"relay_hosts"`
|
|
|
+ ID string `json:"id"`
|
|
|
+ Verbosity int `json:"verbosity"`
|
|
|
+ FirewallInUse string `json:"firewallinuse"`
|
|
|
+ Version string `json:"version"`
|
|
|
+ Name string `json:"name"`
|
|
|
+ OS string `json:"os"`
|
|
|
+ Debug bool `json:"debug"`
|
|
|
+ IsStatic bool `json:"isstatic"`
|
|
|
+ ListenPort int `json:"listenport"`
|
|
|
+ LocalListenPort int `json:"locallistenport"`
|
|
|
+ ProxyListenPort int `json:"proxy_listen_port"`
|
|
|
+ PublicListenPort int `json:"public_listen_port" yaml:"public_listen_port"`
|
|
|
+ WgPublicListenPort int `json:"wg_public_listen_port" yaml:"wg_public_listen_port"`
|
|
|
+ MTU int `json:"mtu" yaml:"mtu"`
|
|
|
+ Interfaces []Iface `json:"interfaces" yaml:"interfaces"`
|
|
|
+ DefaultInterface string `json:"defaultinterface" yaml:"defautlinterface"`
|
|
|
+ EndpointIP string `json:"endpointip" yaml:"endpointip"`
|
|
|
+ PublicKey string `json:"publickey"`
|
|
|
+ MacAddress string `json:"macaddress"`
|
|
|
+ InternetGateway string `json:"internetgateway"`
|
|
|
+ Nodes []string `json:"nodes"`
|
|
|
+ ProxyEnabled bool `json:"proxy_enabled" yaml:"proxy_enabled"`
|
|
|
+ IsDefault bool `json:"isdefault" yaml:"isdefault"`
|
|
|
+ IsRelayed bool `json:"isrelayed" bson:"isrelayed" yaml:"isrelayed"`
|
|
|
+ RelayedBy string `json:"relayed_by" bson:"relayed_by" yaml:"relayed_by"`
|
|
|
+ IsRelay bool `json:"isrelay" bson:"isrelay" yaml:"isrelay"`
|
|
|
+ RelayedHosts []string `json:"relay_hosts" bson:"relay_hosts" yaml:"relay_hosts"`
|
|
|
}
|
|
|
|
|
|
// Host.ConvertNMHostToAPI - converts a Netmaker host to an API editable host
|
|
@@ -60,6 +61,7 @@ func (h *Host) ConvertNMHostToAPI() *ApiHost {
|
|
|
a.Nodes = h.Nodes
|
|
|
a.ProxyEnabled = h.ProxyEnabled
|
|
|
a.PublicListenPort = h.PublicListenPort
|
|
|
+ a.WgPublicListenPort = h.WgPublicListenPort
|
|
|
a.ProxyListenPort = h.ProxyListenPort
|
|
|
a.PublicKey = h.PublicKey.String()
|
|
|
a.Verbosity = h.Verbosity
|