mirror of
https://github.com/gravitl/netmaker.git
synced 2025-10-08 02:06:06 +08:00
fixing extclient controller
This commit is contained in:
@@ -68,7 +68,7 @@ func GetExtPeersList(networkName string, macaddress string) ([]models.ExtPeersRe
|
|||||||
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
|
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
|
||||||
|
|
||||||
//Get all nodes in the relevant network which are NOT in pending state
|
//Get all nodes in the relevant network which are NOT in pending state
|
||||||
filter := bson.M{"network": networkName, "gatewayid": macaddress}
|
filter := bson.M{"network": networkName, "ingressgatewayid": macaddress}
|
||||||
cur, err := collection.Find(ctx, filter)
|
cur, err := collection.Find(ctx, filter)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@@ -207,19 +207,19 @@ func getExtClientConf(w http.ResponseWriter, r *http.Request) {
|
|||||||
config := fmt.Sprintf(`[Interface]
|
config := fmt.Sprintf(`[Interface]
|
||||||
Address = %s
|
Address = %s
|
||||||
PrivateKey = %s
|
PrivateKey = %s
|
||||||
%s
|
|
||||||
|
|
||||||
[Peer]
|
[Peer]
|
||||||
PublicKey = %s
|
PublicKey = %s
|
||||||
AllowedIPs = %s
|
AllowedIPs = %s
|
||||||
Endpoint = %s
|
Endpoint = %s
|
||||||
|
%s
|
||||||
|
|
||||||
`, extclient.Address + "/32",
|
`, extclient.Address + "/32",
|
||||||
extclient.PrivateKey,
|
extclient.PrivateKey,
|
||||||
keepalive,
|
|
||||||
gwnode.PublicKey,
|
gwnode.PublicKey,
|
||||||
network.AddressRange,
|
network.AddressRange,
|
||||||
gwendpoint)
|
gwendpoint,
|
||||||
|
keepalive)
|
||||||
|
|
||||||
if params["type"] == "qr" {
|
if params["type"] == "qr" {
|
||||||
bytes, err := qrcode.Encode(config, qrcode.Medium, 220)
|
bytes, err := qrcode.Encode(config, qrcode.Medium, 220)
|
||||||
|
Reference in New Issue
Block a user