extclient.go 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. package models
  2. import (
  3. "go.mongodb.org/mongo-driver/bson/primitive"
  4. )
  5. //What the client needs to get
  6. /*
  7. [Interface]
  8. # The address their computer will use on the network
  9. Address = 10.0.0.8/32 # The Address they'll use on the network
  10. PrivateKey = XXXXXXXXXXXXXXXX # The private key they'll use
  11. # All of this info can come from the node!!
  12. [Peer]
  13. # Ingress Gateway's wireguard public key
  14. PublicKey = CcZHeaO08z55/x3FXdsSGmOQvZG32SvHlrwHnsWlGTs=
  15. # Public IP address of the Ingress Gateway
  16. # Use the floating IP address if you created one for your VPN server
  17. Endpoint = 123.123.123.123:51820
  18. # 10.0.0.0/24 is the VPN sub
  19. */
  20. // External Struct
  21. // == BACKEND FIELDS ==
  22. // PrivateKey, PublicKey, Address (Private), LastModified, IngressEndpoint
  23. // == FRONTEND FIELDS ==
  24. // ClientID, Network, IngressGateway
  25. type ExtClient struct {
  26. ID primitive.ObjectID `json:"_id,omitempty" bson:"_id,omitempty"`
  27. ClientID string `json:"clientid" bson:"clientid"`
  28. Description string `json:"description" bson:"description"`
  29. PrivateKey string `json:"privatekey" bson:"privatekey"`
  30. PublicKey string `json:"publickey" bson:"publickey"`
  31. Network string `json:"network" bson:"network"`
  32. Address string `json:"address" bson:"address"`
  33. LastModified int64 `json:"lastmodified" bson:"lastmodified"`
  34. IngressGatewayID string `json:"ingressgatewayid" bson:"ingressgatewayid"`
  35. IngressGatewayEndpoint string `json:"ingressgatewayendpoint" bson:"ingressgatewayendpoint"`
  36. }