mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-04-29 14:45:07 +03:00
Version 0.2.1 (#130)
* switch address range from fd00::/8 to the deprecated 0200::/7 range * Fix launchd script path and amend debian control file * fix address/prefix code, platform specific parts still need testing * macos * cleanup old ugly session MTU code that only mattered with lossy UDP fragments * Fix debian control file * Let's try this again * tcp/socks cleanup * comment * avoid the proxy.SOCK5 connection attempt unless we're actually going to use the dialer * Update generate.sh * prevent parent nodes from forcing coord oscillation, have dht.handleRes clean up the old request info immediately * address range changes * Update README.md Consistently remove leading zeros from addresses in the readme. * Update yggdrasil.go * Collect yggdrasilctl during CI build * Fix CircleCI after fat-fingered copypasta * Fix for Windows * clean up main yggdrasil.go imports and run gofmt
This commit is contained in:
parent
8c29f4b6dc
commit
0ec5f1c02c
15 changed files with 137 additions and 141 deletions
52
yggdrasil.go
52
yggdrasil.go
|
@ -1,24 +1,29 @@
|
|||
package main
|
||||
|
||||
import "encoding/json"
|
||||
import "encoding/hex"
|
||||
import "flag"
|
||||
import "fmt"
|
||||
import "io/ioutil"
|
||||
import "os"
|
||||
import "os/signal"
|
||||
import "syscall"
|
||||
import "time"
|
||||
import "regexp"
|
||||
import "math/rand"
|
||||
import "log"
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/hex"
|
||||
"encoding/json"
|
||||
"flag"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"math/rand"
|
||||
"os"
|
||||
"os/signal"
|
||||
"regexp"
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
import "yggdrasil"
|
||||
import "yggdrasil/config"
|
||||
"golang.org/x/text/encoding/unicode"
|
||||
|
||||
import "github.com/kardianos/minwinsvc"
|
||||
import "github.com/neilalexander/hjson-go"
|
||||
import "github.com/mitchellh/mapstructure"
|
||||
"github.com/kardianos/minwinsvc"
|
||||
"github.com/mitchellh/mapstructure"
|
||||
"github.com/neilalexander/hjson-go"
|
||||
|
||||
"yggdrasil"
|
||||
"yggdrasil/config"
|
||||
)
|
||||
|
||||
type nodeConfig = config.NodeConfig
|
||||
type Core = yggdrasil.Core
|
||||
|
@ -107,6 +112,19 @@ func main() {
|
|||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
// If there's a byte order mark - which Windows 10 is now incredibly fond of
|
||||
// throwing everywhere when it's converting things into UTF-16 for the hell
|
||||
// of it - remove it and decode back down into UTF-8. This is necessary
|
||||
// because hjson doesn't know what to do with UTF-16 and will panic
|
||||
if bytes.Compare(config[0:2], []byte{0xFF, 0xFE}) == 0 ||
|
||||
bytes.Compare(config[0:2], []byte{0xFF, 0xFF}) == 0 {
|
||||
utf := unicode.UTF16(unicode.BigEndian, unicode.UseBOM)
|
||||
decoder := utf.NewDecoder()
|
||||
config, err = decoder.Bytes(config)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
// Generate a new configuration - this gives us a set of sane defaults -
|
||||
// then parse the configuration we loaded above on top of it. The effect
|
||||
// of this is that any configuration item that is missing from the provided
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue