@@ -21,16 +21,40 @@ import (
21
21
"github.com/mudler/edgevpn/pkg/protocol"
22
22
"github.com/mudler/edgevpn/pkg/services"
23
23
"github.com/mudler/edgevpn/pkg/types"
24
+ eutils "github.com/mudler/edgevpn/pkg/utils"
24
25
"github.com/phayes/freeport"
25
26
zlog "github.com/rs/zerolog/log"
26
27
27
28
"github.com/mudler/edgevpn/pkg/logger"
28
29
)
29
30
31
+ func generateNewConnectionData () * node.YAMLConnectionConfig {
32
+ maxMessSize := 20 << 20 // 20MB
33
+ keyLength := 43
34
+
35
+ return & node.YAMLConnectionConfig {
36
+ MaxMessageSize : maxMessSize ,
37
+ RoomName : eutils .RandStringRunes (keyLength ),
38
+ Rendezvous : eutils .RandStringRunes (keyLength ),
39
+ MDNS : eutils .RandStringRunes (keyLength ),
40
+ OTP : node.OTP {
41
+ DHT : node.OTPConfig {
42
+ Key : eutils .RandStringRunes (keyLength ),
43
+ Interval : 120 ,
44
+ Length : keyLength ,
45
+ },
46
+ Crypto : node.OTPConfig {
47
+ Key : eutils .RandStringRunes (keyLength ),
48
+ Interval : 9000 ,
49
+ Length : keyLength ,
50
+ },
51
+ },
52
+ }
53
+ }
54
+
30
55
func GenerateToken () string {
31
56
// Generates a new config and exit
32
- newData := node .GenerateNewConnectionData (120 )
33
- return newData .Base64 ()
57
+ return generateNewConnectionData ().Base64 ()
34
58
}
35
59
36
60
func IsP2PEnabled () bool {
0 commit comments