mirror of
https://github.com/AdguardTeam/AdGuardHome.git
synced 2024-11-26 15:05:50 +03:00
More platforms
This commit is contained in:
parent
aa30728cda
commit
bd31151c1f
2 changed files with 18 additions and 6 deletions
15
config.go
15
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
|
||||
|
|
|
@ -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
|
||||
GOOS=windows GOARCH=amd64 f
|
||||
GOOS=windows GOARCH=386 f
|
||||
GOOS=linux GOARCH=mipsle f
|
||||
GOOS=linux GOARCH=mips f
|
Loading…
Reference in a new issue