From bd31151c1f77ef7016ddbf3edfac5fd5fc03538c Mon Sep 17 00:00:00 2001 From: Andrey Meshkov Date: Wed, 27 Feb 2019 12:41:37 +0300 Subject: [PATCH] More platforms --- config.go | 15 +++++++++++++-- release.sh | 9 +++++---- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/config.go b/config.go index 87e5c6a8..4a9e45ed 100644 --- a/config.go +++ b/config.go @@ -4,6 +4,7 @@ import ( "io/ioutil" "os" "path/filepath" + "runtime" "sync" "time" @@ -60,8 +61,6 @@ type dnsConfig struct { UpstreamDNS []string `yaml:"upstream_dns"` } -var defaultDNS = []string{"tls://1.1.1.1", "tls://1.0.0.1"} - type tlsConfigSettings struct { Enabled bool `yaml:"enabled" json:"enabled"` // Enabled is the encryption (DOT/DOH/HTTPS) status ServerName string `yaml:"server_name" json:"server_name,omitempty"` // ServerName is the hostname of your HTTPS/TLS server @@ -99,6 +98,8 @@ type tlsConfig struct { tlsConfigStatus `yaml:"-" json:",inline"` } +var defaultDNS = []string{"tls://1.1.1.1", "tls://1.0.0.1"} + // initialize to default values, will be changed later when reading config or parsing command line var config = configuration{ ourConfigFilename: "AdGuardHome.yaml", @@ -133,6 +134,16 @@ var config = configuration{ SchemaVersion: currentSchemaVersion, } +// init initializes default configuration for the current OS&ARCH +func init() { + if runtime.GOARCH == "mips" || runtime.GOARCH == "mipsle" { + // Use plain DNS on MIPS, encryption is too slow + defaultDNS = []string{"1.1.1.1", "1.0.0.1"} + // also change the default config + config.DNS.UpstreamDNS = defaultDNS + } +} + // getConfigFilename returns path to the current config file func (c *configuration) getConfigFilename() string { configFile := config.ourConfigFilename diff --git a/release.sh b/release.sh index e6370fc4..5f635272 100755 --- a/release.sh +++ b/release.sh @@ -9,11 +9,9 @@ version=`git describe --abbrev=4 --dirty --always --tags` f() { make cleanfast; CGO_DISABLED=1 make if [[ $GOOS == darwin ]]; then - rm -f dist/AdGuardHome_"$version"_MacOS.zip zip dist/AdGuardHome_"$version"_MacOS.zip AdGuardHome README.md LICENSE.txt elif [[ $GOOS == windows ]]; then - rm -f dist/AdGuardHome_"$version"_Windows.zip - zip dist/AdGuardHome_"$version"_Windows.zip AdGuardHome.exe README.md LICENSE.txt + zip dist/AdGuardHome_"$version"_Windows_"$GOARCH".zip AdGuardHome.exe README.md LICENSE.txt else rm -rf dist/AdguardHome mkdir -p dist/AdGuardHome @@ -38,4 +36,7 @@ GOOS=linux GOARCH=amd64 f GOOS=linux GOARCH=386 f GOOS=linux GOARCH=arm GOARM=6 f GOOS=linux GOARCH=arm64 GOARM=6 f -GOOS=windows GOARCH=amd64 f \ No newline at end of file +GOOS=windows GOARCH=amd64 f +GOOS=windows GOARCH=386 f +GOOS=linux GOARCH=mipsle f +GOOS=linux GOARCH=mips f \ No newline at end of file