wgengine, wgengine/router, cmd/tailscale: force netfilter mode off on Synology

For now. Get it working again so it's not stuck on 0.98.

Subnet relay can come later.

Updates #451

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick
2020-09-10 19:55:09 -07:00
committed by Brad Fitzpatrick
parent 31c13013ae
commit a084c44afc
6 changed files with 74 additions and 16 deletions

40
version/distro/distro.go Normal file
View File

@@ -0,0 +1,40 @@
// Copyright (c) 2020 Tailscale Inc & AUTHORS All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Package distro reports which distro we're running on.
package distro
import (
"os"
"runtime"
)
type Distro string
const (
Debian = Distro("debian")
Arch = Distro("arch")
Synology = Distro("synology")
)
// Get returns the current distro, or the empty string if unknown.
func Get() Distro {
if runtime.GOOS == "linux" {
return linuxDistro()
}
return ""
}
func linuxDistro() Distro {
if fi, err := os.Stat("/usr/syno"); err == nil && fi.IsDir() {
return Synology
}
if _, err := os.Stat("/etc/debian_version"); err == nil {
return Debian
}
if _, err := os.Stat("/etc/arch-release"); err == nil {
return Arch
}
return ""
}