mirror of
https://github.com/gravitl/netmaker.git
synced 2025-09-07 13:44:17 +08:00
log cleanup
This commit is contained in:
parent
410efbab50
commit
95b9444325
3 changed files with 2 additions and 12 deletions
|
@ -4,7 +4,6 @@ import (
|
|||
"crypto/rand"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
|
@ -223,7 +222,6 @@ func initializeUUID() error {
|
|||
return err
|
||||
}
|
||||
|
||||
fmt.Printf("Generated Keys: %v \n---\n %v \n", trafficPrivKey, trafficPubKey)
|
||||
telemetry := models.Telemetry{
|
||||
UUID: uuid.NewString(),
|
||||
TrafficKeyPriv: tPriv,
|
||||
|
|
|
@ -1,16 +1,11 @@
|
|||
package logic
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
// RetrievePrivateTrafficKey - retrieves private key of server
|
||||
func RetrievePrivateTrafficKey() ([]byte, error) {
|
||||
var telRecord, err = fetchTelemetryRecord()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
fmt.Printf("fetched priv key %v \n", string(telRecord.TrafficKeyPriv))
|
||||
|
||||
return telRecord.TrafficKeyPriv, nil
|
||||
}
|
||||
|
@ -21,7 +16,6 @@ func RetrievePublicTrafficKey() ([]byte, error) {
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
fmt.Printf("fetched pub key %v \n", string(telRecord.TrafficKeyPub))
|
||||
|
||||
return telRecord.TrafficKeyPub, nil
|
||||
}
|
||||
|
|
6
mq/mq.go
6
mq/mq.go
|
@ -41,18 +41,16 @@ var Ping mqtt.MessageHandler = func(client mqtt.Client, msg mqtt.Message) {
|
|||
logger.Log(0, record)
|
||||
return
|
||||
}
|
||||
fmt.Printf("length before ping decrypt %d ", len(msg.Payload()))
|
||||
decryptedMsg, decryptErr := decryptMsg(&node, msg.Payload())
|
||||
_, decryptErr := decryptMsg(&node, msg.Payload())
|
||||
if decryptErr != nil {
|
||||
logger.Log(0, "error updating node ", node.ID, err.Error())
|
||||
return
|
||||
}
|
||||
fmt.Printf("length after ping decrypt %d and msg: %s \n", len(decryptedMsg), string(decryptedMsg))
|
||||
node.SetLastCheckIn()
|
||||
if err := logic.UpdateNode(&node, &node); err != nil {
|
||||
logger.Log(0, "error updating node ", err.Error())
|
||||
}
|
||||
logger.Log(0, "ping processed")
|
||||
logger.Log(3, "ping processed for node", node.ID)
|
||||
// --TODO --set client version once feature is implemented.
|
||||
//node.SetClientVersion(msg.Payload())
|
||||
}()
|
||||
|
|
Loading…
Add table
Reference in a new issue