Rename module
This commit is contained in:
@@ -18,15 +18,15 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"tailscale.com/syncs"
|
||||
"tailscale.com/types/appctype"
|
||||
"tailscale.com/types/logger"
|
||||
"tailscale.com/types/views"
|
||||
"tailscale.com/util/clientmetric"
|
||||
"tailscale.com/util/dnsname"
|
||||
"tailscale.com/util/eventbus"
|
||||
"tailscale.com/util/execqueue"
|
||||
"tailscale.com/util/slicesx"
|
||||
"github.com/sagernet/tailscale/syncs"
|
||||
"github.com/sagernet/tailscale/types/appctype"
|
||||
"github.com/sagernet/tailscale/types/logger"
|
||||
"github.com/sagernet/tailscale/types/views"
|
||||
"github.com/sagernet/tailscale/util/clientmetric"
|
||||
"github.com/sagernet/tailscale/util/dnsname"
|
||||
"github.com/sagernet/tailscale/util/eventbus"
|
||||
"github.com/sagernet/tailscale/util/execqueue"
|
||||
"github.com/sagernet/tailscale/util/slicesx"
|
||||
)
|
||||
|
||||
// rateLogger responds to calls to update by adding a count for the current period and
|
||||
|
||||
@@ -9,8 +9,8 @@ import (
|
||||
"net/netip"
|
||||
"strings"
|
||||
|
||||
"github.com/sagernet/tailscale/util/mak"
|
||||
"golang.org/x/net/dns/dnsmessage"
|
||||
"tailscale.com/util/mak"
|
||||
)
|
||||
|
||||
// ObserveDNSResponse is a callback invoked by the DNS resolver when a DNS
|
||||
|
||||
@@ -16,7 +16,7 @@ import (
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"tailscale.com/client/tailscale/apitype"
|
||||
"github.com/sagernet/tailscale/client/tailscale/apitype"
|
||||
)
|
||||
|
||||
// DebugPortmapOpts contains options for the [Client.DebugPortmap] command.
|
||||
|
||||
@@ -27,23 +27,23 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"tailscale.com/client/tailscale/apitype"
|
||||
"tailscale.com/drive"
|
||||
"tailscale.com/envknob"
|
||||
"tailscale.com/feature"
|
||||
"tailscale.com/feature/buildfeatures"
|
||||
"tailscale.com/ipn"
|
||||
"tailscale.com/ipn/ipnstate"
|
||||
"tailscale.com/net/netutil"
|
||||
"tailscale.com/net/udprelay/status"
|
||||
"tailscale.com/paths"
|
||||
"tailscale.com/safesocket"
|
||||
"tailscale.com/syncs"
|
||||
"tailscale.com/tailcfg"
|
||||
"tailscale.com/types/appctype"
|
||||
"tailscale.com/types/dnstype"
|
||||
"tailscale.com/types/key"
|
||||
"tailscale.com/util/eventbus"
|
||||
"github.com/sagernet/tailscale/client/tailscale/apitype"
|
||||
"github.com/sagernet/tailscale/drive"
|
||||
"github.com/sagernet/tailscale/envknob"
|
||||
"github.com/sagernet/tailscale/feature"
|
||||
"github.com/sagernet/tailscale/feature/buildfeatures"
|
||||
"github.com/sagernet/tailscale/ipn"
|
||||
"github.com/sagernet/tailscale/ipn/ipnstate"
|
||||
"github.com/sagernet/tailscale/net/netutil"
|
||||
"github.com/sagernet/tailscale/net/udprelay/status"
|
||||
"github.com/sagernet/tailscale/paths"
|
||||
"github.com/sagernet/tailscale/safesocket"
|
||||
"github.com/sagernet/tailscale/syncs"
|
||||
"github.com/sagernet/tailscale/tailcfg"
|
||||
"github.com/sagernet/tailscale/types/appctype"
|
||||
"github.com/sagernet/tailscale/types/dnstype"
|
||||
"github.com/sagernet/tailscale/types/key"
|
||||
"github.com/sagernet/tailscale/util/eventbus"
|
||||
)
|
||||
|
||||
// defaultClient is the default Client when using the legacy
|
||||
|
||||
@@ -11,7 +11,7 @@ import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
|
||||
"tailscale.com/ipn"
|
||||
"github.com/sagernet/tailscale/ipn"
|
||||
)
|
||||
|
||||
// GetServeConfig return the current serve config.
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
"context"
|
||||
"net/http"
|
||||
|
||||
"tailscale.com/util/syspolicy/setting"
|
||||
"github.com/sagernet/tailscale/util/syspolicy/setting"
|
||||
)
|
||||
|
||||
// GetEffectivePolicy returns the effective policy for the specified scope.
|
||||
|
||||
@@ -12,10 +12,10 @@ import (
|
||||
"fmt"
|
||||
"net/url"
|
||||
|
||||
"tailscale.com/ipn/ipnstate"
|
||||
"tailscale.com/tka"
|
||||
"tailscale.com/types/key"
|
||||
"tailscale.com/types/tkatype"
|
||||
"github.com/sagernet/tailscale/ipn/ipnstate"
|
||||
"github.com/sagernet/tailscale/tka"
|
||||
"github.com/sagernet/tailscale/types/key"
|
||||
"github.com/sagernet/tailscale/types/tkatype"
|
||||
)
|
||||
|
||||
// NetworkLockStatus fetches information about the tailnet key authority, if one is configured.
|
||||
|
||||
@@ -28,13 +28,13 @@ import (
|
||||
ico "github.com/Kodeworks/golang-image-ico"
|
||||
"github.com/atotto/clipboard"
|
||||
dbus "github.com/godbus/dbus/v5"
|
||||
"github.com/sagernet/tailscale/client/local"
|
||||
"github.com/sagernet/tailscale/ipn"
|
||||
"github.com/sagernet/tailscale/ipn/ipnstate"
|
||||
"github.com/sagernet/tailscale/tailcfg"
|
||||
"github.com/sagernet/tailscale/util/slicesx"
|
||||
"github.com/sagernet/tailscale/util/stringsx"
|
||||
"github.com/toqueteos/webbrowser"
|
||||
"tailscale.com/client/local"
|
||||
"tailscale.com/ipn"
|
||||
"tailscale.com/ipn/ipnstate"
|
||||
"tailscale.com/tailcfg"
|
||||
"tailscale.com/util/slicesx"
|
||||
"tailscale.com/util/stringsx"
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
package apitype
|
||||
|
||||
import (
|
||||
"tailscale.com/tailcfg"
|
||||
"tailscale.com/types/dnstype"
|
||||
"tailscale.com/util/ctxkey"
|
||||
"github.com/sagernet/tailscale/tailcfg"
|
||||
"github.com/sagernet/tailscale/types/dnstype"
|
||||
"github.com/sagernet/tailscale/util/ctxkey"
|
||||
)
|
||||
|
||||
// LocalAPIHost is the Host header value used by the LocalAPI.
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
"context"
|
||||
"crypto/tls"
|
||||
|
||||
"tailscale.com/client/local"
|
||||
"github.com/sagernet/tailscale/client/local"
|
||||
)
|
||||
|
||||
// GetCertificate is an alias for [tailscale.com/client/local.GetCertificate].
|
||||
|
||||
@@ -14,7 +14,7 @@ import (
|
||||
"net/http"
|
||||
"net/url"
|
||||
|
||||
"tailscale.com/types/opt"
|
||||
"github.com/sagernet/tailscale/types/opt"
|
||||
)
|
||||
|
||||
type GetDevicesResponse struct {
|
||||
|
||||
@@ -12,7 +12,7 @@ import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
|
||||
"tailscale.com/client/tailscale/apitype"
|
||||
"github.com/sagernet/tailscale/client/tailscale/apitype"
|
||||
)
|
||||
|
||||
// DNSNameServers is returned when retrieving the list of nameservers.
|
||||
|
||||
@@ -11,7 +11,7 @@ import (
|
||||
"log"
|
||||
"net/http"
|
||||
|
||||
"tailscale.com/client/local"
|
||||
"github.com/sagernet/tailscale/client/local"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
@@ -80,7 +80,6 @@ func (c *Client) CreateKey(ctx context.Context, caps KeyCapabilities) (keySecret
|
||||
//
|
||||
// The time is truncated to a whole number of seconds. If zero, that means no expiration.
|
||||
func (c *Client) CreateKeyWithExpiry(ctx context.Context, caps KeyCapabilities, expiry time.Duration) (keySecret string, keyMeta *Key, _ error) {
|
||||
|
||||
// convert expirySeconds to an int64 (seconds)
|
||||
expirySeconds := int64(expiry.Seconds())
|
||||
if expirySeconds < 0 {
|
||||
|
||||
@@ -6,9 +6,9 @@ package tailscale
|
||||
import (
|
||||
"context"
|
||||
|
||||
"tailscale.com/client/local"
|
||||
"tailscale.com/client/tailscale/apitype"
|
||||
"tailscale.com/ipn/ipnstate"
|
||||
"github.com/sagernet/tailscale/client/local"
|
||||
"github.com/sagernet/tailscale/client/tailscale/apitype"
|
||||
"github.com/sagernet/tailscale/ipn/ipnstate"
|
||||
)
|
||||
|
||||
// ErrPeerNotFound is an alias for [tailscale.com/client/local.ErrPeerNotFound].
|
||||
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
|
||||
"tailscale.com/util/httpm"
|
||||
"github.com/sagernet/tailscale/util/httpm"
|
||||
)
|
||||
|
||||
// TailnetDeleteRequest handles sending a DELETE request for a tailnet to control.
|
||||
|
||||
@@ -15,9 +15,9 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"tailscale.com/client/tailscale/apitype"
|
||||
"tailscale.com/ipn/ipnstate"
|
||||
"tailscale.com/tailcfg"
|
||||
"github.com/sagernet/tailscale/client/tailscale/apitype"
|
||||
"github.com/sagernet/tailscale/ipn/ipnstate"
|
||||
"github.com/sagernet/tailscale/tailcfg"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -13,7 +13,7 @@ import (
|
||||
"os/exec"
|
||||
"strings"
|
||||
|
||||
"tailscale.com/util/groupmember"
|
||||
"github.com/sagernet/tailscale/util/groupmember"
|
||||
)
|
||||
|
||||
// authorizeSynology authenticates the logged-in Synology user and verifies
|
||||
|
||||
@@ -22,25 +22,25 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"tailscale.com/client/local"
|
||||
"tailscale.com/client/tailscale/apitype"
|
||||
"tailscale.com/envknob"
|
||||
"tailscale.com/envknob/featureknob"
|
||||
"tailscale.com/feature"
|
||||
"tailscale.com/feature/buildfeatures"
|
||||
"tailscale.com/hostinfo"
|
||||
"tailscale.com/ipn"
|
||||
"tailscale.com/ipn/ipnstate"
|
||||
"tailscale.com/licenses"
|
||||
"tailscale.com/net/netutil"
|
||||
"tailscale.com/net/tsaddr"
|
||||
"tailscale.com/tailcfg"
|
||||
"tailscale.com/types/logger"
|
||||
"tailscale.com/types/views"
|
||||
"tailscale.com/util/httpm"
|
||||
"tailscale.com/util/syspolicy/policyclient"
|
||||
"tailscale.com/version"
|
||||
"tailscale.com/version/distro"
|
||||
"github.com/sagernet/tailscale/client/local"
|
||||
"github.com/sagernet/tailscale/client/tailscale/apitype"
|
||||
"github.com/sagernet/tailscale/envknob"
|
||||
"github.com/sagernet/tailscale/envknob/featureknob"
|
||||
"github.com/sagernet/tailscale/feature"
|
||||
"github.com/sagernet/tailscale/feature/buildfeatures"
|
||||
"github.com/sagernet/tailscale/hostinfo"
|
||||
"github.com/sagernet/tailscale/ipn"
|
||||
"github.com/sagernet/tailscale/ipn/ipnstate"
|
||||
"github.com/sagernet/tailscale/licenses"
|
||||
"github.com/sagernet/tailscale/net/netutil"
|
||||
"github.com/sagernet/tailscale/net/tsaddr"
|
||||
"github.com/sagernet/tailscale/tailcfg"
|
||||
"github.com/sagernet/tailscale/types/logger"
|
||||
"github.com/sagernet/tailscale/types/views"
|
||||
"github.com/sagernet/tailscale/util/httpm"
|
||||
"github.com/sagernet/tailscale/util/syspolicy/policyclient"
|
||||
"github.com/sagernet/tailscale/version"
|
||||
"github.com/sagernet/tailscale/version/distro"
|
||||
)
|
||||
|
||||
// ListenPort is the static port used for the web client when run inside tailscaled.
|
||||
@@ -292,7 +292,6 @@ func (s *Server) csrfProtect(h http.Handler) http.Handler {
|
||||
}
|
||||
|
||||
h.ServeHTTP(w, r)
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -27,13 +27,13 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"tailscale.com/feature"
|
||||
"tailscale.com/hostinfo"
|
||||
"tailscale.com/types/lazy"
|
||||
"tailscale.com/types/logger"
|
||||
"tailscale.com/util/cmpver"
|
||||
"tailscale.com/version"
|
||||
"tailscale.com/version/distro"
|
||||
"github.com/sagernet/tailscale/feature"
|
||||
"github.com/sagernet/tailscale/hostinfo"
|
||||
"github.com/sagernet/tailscale/types/lazy"
|
||||
"github.com/sagernet/tailscale/types/logger"
|
||||
"github.com/sagernet/tailscale/util/cmpver"
|
||||
"github.com/sagernet/tailscale/version"
|
||||
"github.com/sagernet/tailscale/version/distro"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -507,7 +507,7 @@ func updateDebianAptSourcesList(dstTrack string) (rewrote bool, err error) {
|
||||
if bytes.Equal(was, newContent) {
|
||||
return false, nil
|
||||
}
|
||||
return true, os.WriteFile(aptSourcesFile, newContent, 0644)
|
||||
return true, os.WriteFile(aptSourcesFile, newContent, 0o644)
|
||||
}
|
||||
|
||||
func updateDebianAptSourcesListBytes(was []byte, dstTrack string) (newContent []byte, err error) {
|
||||
@@ -648,7 +648,7 @@ func updateYUMRepoTrack(repoFile, dstTrack string) (rewrote bool, err error) {
|
||||
if bytes.Equal(was, newContent.Bytes()) {
|
||||
return false, nil
|
||||
}
|
||||
return true, os.WriteFile(repoFile, newContent.Bytes(), 0644)
|
||||
return true, os.WriteFile(repoFile, newContent.Bytes(), 0o644)
|
||||
}
|
||||
|
||||
func (up *Updater) updateAlpineLike() (err error) {
|
||||
@@ -898,7 +898,7 @@ func (up *Updater) downloadLinuxTarball(ver string) (string, error) {
|
||||
dlDir = os.TempDir()
|
||||
}
|
||||
dlDir = filepath.Join(dlDir, "tailscale-update")
|
||||
if err := os.MkdirAll(dlDir, 0700); err != nil {
|
||||
if err := os.MkdirAll(dlDir, 0o700); err != nil {
|
||||
return "", err
|
||||
}
|
||||
pkgsPath := fmt.Sprintf("%s/tailscale_%s_%s.tgz", up.Track, ver, runtime.GOARCH)
|
||||
@@ -945,12 +945,12 @@ func (up *Updater) unpackLinuxTarball(path string) error {
|
||||
switch filepath.Base(th.Name) {
|
||||
case "tailscale":
|
||||
files["tailscale"]++
|
||||
if err := writeFile(tr, tailscale+".new", 0755); err != nil {
|
||||
if err := writeFile(tr, tailscale+".new", 0o755); err != nil {
|
||||
return fmt.Errorf("failed extracting the new tailscale binary from %q: %w", path, err)
|
||||
}
|
||||
case "tailscaled":
|
||||
files["tailscaled"]++
|
||||
if err := writeFile(tr, tailscaled+".new", 0755); err != nil {
|
||||
if err := writeFile(tr, tailscaled+".new", 0o755); err != nil {
|
||||
return fmt.Errorf("failed extracting the new tailscaled binary from %q: %w", path, err)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ package clientupdate
|
||||
import (
|
||||
"context"
|
||||
|
||||
"tailscale.com/clientupdate/distsign"
|
||||
"github.com/sagernet/tailscale/clientupdate/distsign"
|
||||
)
|
||||
|
||||
func (up *Updater) downloadURLToFile(pathSrc, fileDst string) (ret error) {
|
||||
|
||||
@@ -19,9 +19,9 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/sagernet/tailscale/util/winutil"
|
||||
"github.com/sagernet/tailscale/util/winutil/authenticode"
|
||||
"golang.org/x/sys/windows"
|
||||
"tailscale.com/util/winutil"
|
||||
"tailscale.com/util/winutil/authenticode"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -133,7 +133,7 @@ you can run the command prompt as Administrator one of these ways:
|
||||
} else if !fi.IsDir() {
|
||||
return fmt.Errorf("expected %s to be a directory; got %v", tsDir, fi.Mode())
|
||||
}
|
||||
if err := os.MkdirAll(msiDir, 0700); err != nil {
|
||||
if err := os.MkdirAll(msiDir, 0o700); err != nil {
|
||||
return err
|
||||
}
|
||||
up.cleanupOldDownloads(filepath.Join(msiDir, "*.msi"))
|
||||
@@ -293,7 +293,7 @@ func (up *Updater) startNewLogFile(baseNamePrefix, baseNameSuffix string) string
|
||||
time.Now().Format("20060102T150405"), baseNameSuffix)
|
||||
|
||||
dir := filepath.Join(os.Getenv("ProgramData"), "Tailscale", "Logs")
|
||||
if err := os.MkdirAll(dir, 0700); err != nil {
|
||||
if err := os.MkdirAll(dir, 0o700); err != nil {
|
||||
up.Logf("failed to create log directory: %v", err)
|
||||
return filepath.Join(os.TempDir(), baseName)
|
||||
}
|
||||
|
||||
@@ -54,11 +54,11 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/hdevalence/ed25519consensus"
|
||||
"github.com/sagernet/tailscale/feature"
|
||||
"github.com/sagernet/tailscale/types/logger"
|
||||
"github.com/sagernet/tailscale/util/httpm"
|
||||
"github.com/sagernet/tailscale/util/must"
|
||||
"golang.org/x/crypto/blake2s"
|
||||
"tailscale.com/feature"
|
||||
"tailscale.com/types/logger"
|
||||
"tailscale.com/util/httpm"
|
||||
"tailscale.com/util/must"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -16,10 +16,10 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/sagernet/tailscale/syncs"
|
||||
"github.com/sagernet/tailscale/types/key"
|
||||
"golang.org/x/crypto/blake2s"
|
||||
chp "golang.org/x/crypto/chacha20poly1305"
|
||||
"tailscale.com/syncs"
|
||||
"tailscale.com/types/key"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -375,6 +375,7 @@ type errReadTooBig struct {
|
||||
func (e errReadTooBig) Error() string {
|
||||
return fmt.Sprintf("requested read of %d bytes exceeds max allowed Noise frame size", e.requested)
|
||||
}
|
||||
|
||||
func (e errReadTooBig) Temporary() bool {
|
||||
// permanent error because this error only occurs when our peer
|
||||
// sends us a frame so large we're unwilling to ever decode it.
|
||||
|
||||
@@ -15,12 +15,12 @@ import (
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"github.com/sagernet/tailscale/types/key"
|
||||
"go4.org/mem"
|
||||
"golang.org/x/crypto/blake2s"
|
||||
chp "golang.org/x/crypto/chacha20poly1305"
|
||||
"golang.org/x/crypto/curve25519"
|
||||
"golang.org/x/crypto/hkdf"
|
||||
"tailscale.com/types/key"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -56,6 +56,7 @@ func (m *initiationMessage) Length() int { return int(binary.BigEndian.Uint1
|
||||
func (m *initiationMessage) EphemeralPub() []byte {
|
||||
return m[initiationHeaderLen : initiationHeaderLen+32]
|
||||
}
|
||||
|
||||
func (m *initiationMessage) MachinePub() []byte {
|
||||
return m[initiationHeaderLen+32 : initiationHeaderLen+32+48]
|
||||
}
|
||||
|
||||
@@ -12,18 +12,18 @@ import (
|
||||
"sync/atomic"
|
||||
"time"
|
||||
|
||||
"tailscale.com/net/sockstats"
|
||||
"tailscale.com/tailcfg"
|
||||
"tailscale.com/tstime"
|
||||
"tailscale.com/types/key"
|
||||
"tailscale.com/types/logger"
|
||||
"tailscale.com/types/netmap"
|
||||
"tailscale.com/types/persist"
|
||||
"tailscale.com/types/structs"
|
||||
"tailscale.com/util/backoff"
|
||||
"tailscale.com/util/clientmetric"
|
||||
"tailscale.com/util/execqueue"
|
||||
"tailscale.com/util/testenv"
|
||||
"github.com/sagernet/tailscale/net/sockstats"
|
||||
"github.com/sagernet/tailscale/tailcfg"
|
||||
"github.com/sagernet/tailscale/tstime"
|
||||
"github.com/sagernet/tailscale/types/key"
|
||||
"github.com/sagernet/tailscale/types/logger"
|
||||
"github.com/sagernet/tailscale/types/netmap"
|
||||
"github.com/sagernet/tailscale/types/persist"
|
||||
"github.com/sagernet/tailscale/types/structs"
|
||||
"github.com/sagernet/tailscale/util/backoff"
|
||||
"github.com/sagernet/tailscale/util/clientmetric"
|
||||
"github.com/sagernet/tailscale/util/execqueue"
|
||||
"github.com/sagernet/tailscale/util/testenv"
|
||||
)
|
||||
|
||||
type LoginGoal struct {
|
||||
|
||||
@@ -11,8 +11,8 @@ package controlclient
|
||||
import (
|
||||
"context"
|
||||
|
||||
"tailscale.com/tailcfg"
|
||||
"tailscale.com/types/key"
|
||||
"github.com/sagernet/tailscale/tailcfg"
|
||||
"github.com/sagernet/tailscale/types/key"
|
||||
)
|
||||
|
||||
// LoginFlags is a bitmask of options to change the behavior of Client.Login
|
||||
|
||||
@@ -26,40 +26,40 @@ import (
|
||||
"sync/atomic"
|
||||
"time"
|
||||
|
||||
"github.com/sagernet/tailscale/control/controlknobs"
|
||||
"github.com/sagernet/tailscale/control/ts2021"
|
||||
"github.com/sagernet/tailscale/envknob"
|
||||
"github.com/sagernet/tailscale/feature"
|
||||
"github.com/sagernet/tailscale/feature/buildfeatures"
|
||||
"github.com/sagernet/tailscale/health"
|
||||
"github.com/sagernet/tailscale/hostinfo"
|
||||
"github.com/sagernet/tailscale/ipn/ipnstate"
|
||||
"github.com/sagernet/tailscale/logtail"
|
||||
"github.com/sagernet/tailscale/net/dnscache"
|
||||
"github.com/sagernet/tailscale/net/dnsfallback"
|
||||
"github.com/sagernet/tailscale/net/netmon"
|
||||
"github.com/sagernet/tailscale/net/netutil"
|
||||
"github.com/sagernet/tailscale/net/netx"
|
||||
"github.com/sagernet/tailscale/net/tlsdial"
|
||||
"github.com/sagernet/tailscale/net/tsdial"
|
||||
"github.com/sagernet/tailscale/syncs"
|
||||
"github.com/sagernet/tailscale/tailcfg"
|
||||
"github.com/sagernet/tailscale/tka"
|
||||
"github.com/sagernet/tailscale/tstime"
|
||||
"github.com/sagernet/tailscale/types/key"
|
||||
"github.com/sagernet/tailscale/types/logger"
|
||||
"github.com/sagernet/tailscale/types/netmap"
|
||||
"github.com/sagernet/tailscale/types/persist"
|
||||
"github.com/sagernet/tailscale/types/ptr"
|
||||
"github.com/sagernet/tailscale/types/tkatype"
|
||||
"github.com/sagernet/tailscale/util/clientmetric"
|
||||
"github.com/sagernet/tailscale/util/eventbus"
|
||||
"github.com/sagernet/tailscale/util/singleflight"
|
||||
"github.com/sagernet/tailscale/util/syspolicy/pkey"
|
||||
"github.com/sagernet/tailscale/util/syspolicy/policyclient"
|
||||
"github.com/sagernet/tailscale/util/testenv"
|
||||
"github.com/sagernet/tailscale/util/zstdframe"
|
||||
"go4.org/mem"
|
||||
"tailscale.com/control/controlknobs"
|
||||
"tailscale.com/control/ts2021"
|
||||
"tailscale.com/envknob"
|
||||
"tailscale.com/feature"
|
||||
"tailscale.com/feature/buildfeatures"
|
||||
"tailscale.com/health"
|
||||
"tailscale.com/hostinfo"
|
||||
"tailscale.com/ipn/ipnstate"
|
||||
"tailscale.com/logtail"
|
||||
"tailscale.com/net/dnscache"
|
||||
"tailscale.com/net/dnsfallback"
|
||||
"tailscale.com/net/netmon"
|
||||
"tailscale.com/net/netutil"
|
||||
"tailscale.com/net/netx"
|
||||
"tailscale.com/net/tlsdial"
|
||||
"tailscale.com/net/tsdial"
|
||||
"tailscale.com/syncs"
|
||||
"tailscale.com/tailcfg"
|
||||
"tailscale.com/tka"
|
||||
"tailscale.com/tstime"
|
||||
"tailscale.com/types/key"
|
||||
"tailscale.com/types/logger"
|
||||
"tailscale.com/types/netmap"
|
||||
"tailscale.com/types/persist"
|
||||
"tailscale.com/types/ptr"
|
||||
"tailscale.com/types/tkatype"
|
||||
"tailscale.com/util/clientmetric"
|
||||
"tailscale.com/util/eventbus"
|
||||
"tailscale.com/util/singleflight"
|
||||
"tailscale.com/util/syspolicy/pkey"
|
||||
"tailscale.com/util/syspolicy/policyclient"
|
||||
"tailscale.com/util/testenv"
|
||||
"tailscale.com/util/zstdframe"
|
||||
)
|
||||
|
||||
// Direct is the client that connects to a tailcontrol server for a node.
|
||||
|
||||
@@ -20,21 +20,21 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"tailscale.com/control/controlknobs"
|
||||
"tailscale.com/envknob"
|
||||
"tailscale.com/hostinfo"
|
||||
"tailscale.com/tailcfg"
|
||||
"tailscale.com/tstime"
|
||||
"tailscale.com/types/key"
|
||||
"tailscale.com/types/logger"
|
||||
"tailscale.com/types/netmap"
|
||||
"tailscale.com/types/ptr"
|
||||
"tailscale.com/types/views"
|
||||
"tailscale.com/util/clientmetric"
|
||||
"tailscale.com/util/mak"
|
||||
"tailscale.com/util/set"
|
||||
"tailscale.com/util/slicesx"
|
||||
"tailscale.com/wgengine/filter"
|
||||
"github.com/sagernet/tailscale/control/controlknobs"
|
||||
"github.com/sagernet/tailscale/envknob"
|
||||
"github.com/sagernet/tailscale/hostinfo"
|
||||
"github.com/sagernet/tailscale/tailcfg"
|
||||
"github.com/sagernet/tailscale/tstime"
|
||||
"github.com/sagernet/tailscale/types/key"
|
||||
"github.com/sagernet/tailscale/types/logger"
|
||||
"github.com/sagernet/tailscale/types/netmap"
|
||||
"github.com/sagernet/tailscale/types/ptr"
|
||||
"github.com/sagernet/tailscale/types/views"
|
||||
"github.com/sagernet/tailscale/util/clientmetric"
|
||||
"github.com/sagernet/tailscale/util/mak"
|
||||
"github.com/sagernet/tailscale/util/set"
|
||||
"github.com/sagernet/tailscale/util/slicesx"
|
||||
"github.com/sagernet/tailscale/wgengine/filter"
|
||||
)
|
||||
|
||||
// mapSession holds the state over a long-polled "map" request to the
|
||||
|
||||
@@ -9,8 +9,8 @@ import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"tailscale.com/tailcfg"
|
||||
"tailscale.com/types/key"
|
||||
"github.com/sagernet/tailscale/tailcfg"
|
||||
"github.com/sagernet/tailscale/types/key"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -23,7 +23,8 @@ var (
|
||||
// tailcfg.RegisterRequest.
|
||||
func HashRegisterRequest(
|
||||
version tailcfg.SignatureType, ts time.Time, serverURL string, deviceCert []byte,
|
||||
serverPubKey, machinePubKey key.MachinePublic) ([]byte, error) {
|
||||
serverPubKey, machinePubKey key.MachinePublic,
|
||||
) ([]byte, error) {
|
||||
h := crypto.SHA256.New()
|
||||
|
||||
// hash.Hash.Write never returns an error, so we don't check for one here.
|
||||
|
||||
@@ -15,11 +15,11 @@ import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/sagernet/tailscale/tailcfg"
|
||||
"github.com/sagernet/tailscale/types/key"
|
||||
"github.com/sagernet/tailscale/util/syspolicy/pkey"
|
||||
"github.com/sagernet/tailscale/util/syspolicy/policyclient"
|
||||
"github.com/tailscale/certstore"
|
||||
"tailscale.com/tailcfg"
|
||||
"tailscale.com/types/key"
|
||||
"tailscale.com/util/syspolicy/pkey"
|
||||
"tailscale.com/util/syspolicy/policyclient"
|
||||
)
|
||||
|
||||
// getMachineCertificateSubject returns the exact name of a Subject that needs
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
package controlclient
|
||||
|
||||
import (
|
||||
"tailscale.com/tailcfg"
|
||||
"tailscale.com/types/key"
|
||||
"tailscale.com/util/syspolicy/policyclient"
|
||||
"github.com/sagernet/tailscale/tailcfg"
|
||||
"github.com/sagernet/tailscale/types/key"
|
||||
"github.com/sagernet/tailscale/util/syspolicy/policyclient"
|
||||
)
|
||||
|
||||
// signRegisterRequest on non-supported platforms always returns errNoCertStore.
|
||||
|
||||
@@ -6,9 +6,9 @@ package controlclient
|
||||
import (
|
||||
"reflect"
|
||||
|
||||
"tailscale.com/types/netmap"
|
||||
"tailscale.com/types/persist"
|
||||
"tailscale.com/types/structs"
|
||||
"github.com/sagernet/tailscale/types/netmap"
|
||||
"github.com/sagernet/tailscale/types/persist"
|
||||
"github.com/sagernet/tailscale/types/structs"
|
||||
)
|
||||
|
||||
type Status struct {
|
||||
|
||||
@@ -36,21 +36,21 @@ import (
|
||||
"sync/atomic"
|
||||
"time"
|
||||
|
||||
"tailscale.com/control/controlbase"
|
||||
"tailscale.com/control/controlhttp/controlhttpcommon"
|
||||
"tailscale.com/envknob"
|
||||
"tailscale.com/feature"
|
||||
"tailscale.com/feature/buildfeatures"
|
||||
"tailscale.com/health"
|
||||
"tailscale.com/net/dnscache"
|
||||
"tailscale.com/net/dnsfallback"
|
||||
"tailscale.com/net/netutil"
|
||||
"tailscale.com/net/netx"
|
||||
"tailscale.com/net/sockstats"
|
||||
"tailscale.com/net/tlsdial"
|
||||
"tailscale.com/syncs"
|
||||
"tailscale.com/tailcfg"
|
||||
"tailscale.com/tstime"
|
||||
"github.com/sagernet/tailscale/control/controlbase"
|
||||
"github.com/sagernet/tailscale/control/controlhttp/controlhttpcommon"
|
||||
"github.com/sagernet/tailscale/envknob"
|
||||
"github.com/sagernet/tailscale/feature"
|
||||
"github.com/sagernet/tailscale/feature/buildfeatures"
|
||||
"github.com/sagernet/tailscale/health"
|
||||
"github.com/sagernet/tailscale/net/dnscache"
|
||||
"github.com/sagernet/tailscale/net/dnsfallback"
|
||||
"github.com/sagernet/tailscale/net/netutil"
|
||||
"github.com/sagernet/tailscale/net/netx"
|
||||
"github.com/sagernet/tailscale/net/sockstats"
|
||||
"github.com/sagernet/tailscale/net/tlsdial"
|
||||
"github.com/sagernet/tailscale/syncs"
|
||||
"github.com/sagernet/tailscale/tailcfg"
|
||||
"github.com/sagernet/tailscale/tstime"
|
||||
)
|
||||
|
||||
var stdDialer net.Dialer
|
||||
@@ -96,7 +96,6 @@ func (a *Dialer) httpsFallbackDelay() time.Duration {
|
||||
var _ = envknob.RegisterBool("TS_USE_CONTROL_DIAL_PLAN") // to record at init time whether it's in use
|
||||
|
||||
func (a *Dialer) dial(ctx context.Context) (*ClientConn, error) {
|
||||
|
||||
a.logPort80Failure.Store(true)
|
||||
|
||||
// If we don't have a dial plan, just fall back to dialing the single
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
package controlhttp
|
||||
|
||||
import (
|
||||
"tailscale.com/control/controlbase"
|
||||
"github.com/sagernet/tailscale/control/controlbase"
|
||||
)
|
||||
|
||||
// ClientConn is a Tailscale control client as returned by the Dialer.
|
||||
|
||||
@@ -11,9 +11,9 @@ import (
|
||||
"net/url"
|
||||
|
||||
"github.com/coder/websocket"
|
||||
"tailscale.com/control/controlbase"
|
||||
"tailscale.com/control/controlhttp/controlhttpcommon"
|
||||
"tailscale.com/net/wsconn"
|
||||
"github.com/sagernet/tailscale/control/controlbase"
|
||||
"github.com/sagernet/tailscale/control/controlhttp/controlhttpcommon"
|
||||
"github.com/sagernet/tailscale/net/wsconn"
|
||||
)
|
||||
|
||||
// Variant of Dial that tunnels the request over WebSockets, since we cannot do
|
||||
|
||||
@@ -9,14 +9,14 @@ import (
|
||||
"sync/atomic"
|
||||
"time"
|
||||
|
||||
"tailscale.com/health"
|
||||
"tailscale.com/net/dnscache"
|
||||
"tailscale.com/net/netmon"
|
||||
"tailscale.com/net/netx"
|
||||
"tailscale.com/tailcfg"
|
||||
"tailscale.com/tstime"
|
||||
"tailscale.com/types/key"
|
||||
"tailscale.com/types/logger"
|
||||
"github.com/sagernet/tailscale/health"
|
||||
"github.com/sagernet/tailscale/net/dnscache"
|
||||
"github.com/sagernet/tailscale/net/netmon"
|
||||
"github.com/sagernet/tailscale/net/netx"
|
||||
"github.com/sagernet/tailscale/tailcfg"
|
||||
"github.com/sagernet/tailscale/tstime"
|
||||
"github.com/sagernet/tailscale/types/key"
|
||||
"github.com/sagernet/tailscale/types/logger"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -18,11 +18,11 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/coder/websocket"
|
||||
"tailscale.com/control/controlbase"
|
||||
"tailscale.com/control/controlhttp/controlhttpcommon"
|
||||
"tailscale.com/net/netutil"
|
||||
"tailscale.com/net/wsconn"
|
||||
"tailscale.com/types/key"
|
||||
"github.com/sagernet/tailscale/control/controlbase"
|
||||
"github.com/sagernet/tailscale/control/controlhttp/controlhttpcommon"
|
||||
"github.com/sagernet/tailscale/net/netutil"
|
||||
"github.com/sagernet/tailscale/net/wsconn"
|
||||
"github.com/sagernet/tailscale/types/key"
|
||||
)
|
||||
|
||||
// AcceptHTTP upgrades the HTTP request given by w and r into a Tailscale
|
||||
|
||||
@@ -10,9 +10,9 @@ import (
|
||||
"reflect"
|
||||
"sync/atomic"
|
||||
|
||||
"tailscale.com/syncs"
|
||||
"tailscale.com/tailcfg"
|
||||
"tailscale.com/types/opt"
|
||||
"github.com/sagernet/tailscale/syncs"
|
||||
"github.com/sagernet/tailscale/tailcfg"
|
||||
"github.com/sagernet/tailscale/types/opt"
|
||||
)
|
||||
|
||||
// Knobs is the set of knobs that the control plane's coordination server can
|
||||
|
||||
@@ -19,17 +19,17 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"tailscale.com/control/controlhttp"
|
||||
"tailscale.com/health"
|
||||
"tailscale.com/net/dnscache"
|
||||
"tailscale.com/net/netmon"
|
||||
"tailscale.com/net/tsdial"
|
||||
"tailscale.com/tailcfg"
|
||||
"tailscale.com/tstime"
|
||||
"tailscale.com/types/key"
|
||||
"tailscale.com/types/logger"
|
||||
"tailscale.com/util/mak"
|
||||
"tailscale.com/util/set"
|
||||
"github.com/sagernet/tailscale/control/controlhttp"
|
||||
"github.com/sagernet/tailscale/health"
|
||||
"github.com/sagernet/tailscale/net/dnscache"
|
||||
"github.com/sagernet/tailscale/net/netmon"
|
||||
"github.com/sagernet/tailscale/net/tsdial"
|
||||
"github.com/sagernet/tailscale/tailcfg"
|
||||
"github.com/sagernet/tailscale/tstime"
|
||||
"github.com/sagernet/tailscale/types/key"
|
||||
"github.com/sagernet/tailscale/types/logger"
|
||||
"github.com/sagernet/tailscale/util/mak"
|
||||
"github.com/sagernet/tailscale/util/set"
|
||||
)
|
||||
|
||||
// Client provides a http.Client to connect to tailcontrol over
|
||||
|
||||
@@ -15,8 +15,8 @@ import (
|
||||
"io"
|
||||
"sync"
|
||||
|
||||
"tailscale.com/control/controlbase"
|
||||
"tailscale.com/tailcfg"
|
||||
"github.com/sagernet/tailscale/control/controlbase"
|
||||
"github.com/sagernet/tailscale/tailcfg"
|
||||
)
|
||||
|
||||
// Conn is a wrapper around controlbase.Conn.
|
||||
|
||||
@@ -14,12 +14,12 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/sagernet/tailscale/syncs"
|
||||
"github.com/sagernet/tailscale/tstime"
|
||||
"github.com/sagernet/tailscale/types/key"
|
||||
"github.com/sagernet/tailscale/types/logger"
|
||||
"go4.org/mem"
|
||||
"golang.org/x/time/rate"
|
||||
"tailscale.com/syncs"
|
||||
"tailscale.com/tstime"
|
||||
"tailscale.com/types/key"
|
||||
"tailscale.com/types/logger"
|
||||
)
|
||||
|
||||
// Client is a DERP client.
|
||||
|
||||
@@ -28,24 +28,24 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/sagernet/tailscale/derp"
|
||||
"github.com/sagernet/tailscale/derp/derpconst"
|
||||
"github.com/sagernet/tailscale/envknob"
|
||||
"github.com/sagernet/tailscale/feature"
|
||||
"github.com/sagernet/tailscale/feature/buildfeatures"
|
||||
"github.com/sagernet/tailscale/health"
|
||||
"github.com/sagernet/tailscale/net/dnscache"
|
||||
"github.com/sagernet/tailscale/net/netmon"
|
||||
"github.com/sagernet/tailscale/net/netns"
|
||||
"github.com/sagernet/tailscale/net/netx"
|
||||
"github.com/sagernet/tailscale/net/sockstats"
|
||||
"github.com/sagernet/tailscale/net/tlsdial"
|
||||
"github.com/sagernet/tailscale/syncs"
|
||||
"github.com/sagernet/tailscale/tailcfg"
|
||||
"github.com/sagernet/tailscale/tstime"
|
||||
"github.com/sagernet/tailscale/types/key"
|
||||
"github.com/sagernet/tailscale/types/logger"
|
||||
"go4.org/mem"
|
||||
"tailscale.com/derp"
|
||||
"tailscale.com/derp/derpconst"
|
||||
"tailscale.com/envknob"
|
||||
"tailscale.com/feature"
|
||||
"tailscale.com/feature/buildfeatures"
|
||||
"tailscale.com/health"
|
||||
"tailscale.com/net/dnscache"
|
||||
"tailscale.com/net/netmon"
|
||||
"tailscale.com/net/netns"
|
||||
"tailscale.com/net/netx"
|
||||
"tailscale.com/net/sockstats"
|
||||
"tailscale.com/net/tlsdial"
|
||||
"tailscale.com/syncs"
|
||||
"tailscale.com/tailcfg"
|
||||
"tailscale.com/tstime"
|
||||
"tailscale.com/types/key"
|
||||
"tailscale.com/types/logger"
|
||||
)
|
||||
|
||||
// Client is a DERP-over-HTTP client.
|
||||
|
||||
@@ -8,9 +8,9 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"tailscale.com/derp"
|
||||
"tailscale.com/types/key"
|
||||
"tailscale.com/types/logger"
|
||||
"github.com/sagernet/tailscale/derp"
|
||||
"github.com/sagernet/tailscale/types/key"
|
||||
"github.com/sagernet/tailscale/types/logger"
|
||||
)
|
||||
|
||||
var retryInterval = 5 * time.Second
|
||||
@@ -49,7 +49,8 @@ var testHookWatchLookConnectResult func(connectError error, wasSelfConnect bool)
|
||||
// clients are likely still connected and their add message will appear after
|
||||
// reconnect.
|
||||
func (c *Client) RunWatchConnectionLoop(ctx context.Context, ignoreServerKey key.NodePublic, infoLogf logger.Logf,
|
||||
add func(derp.PeerPresentMessage), remove func(derp.PeerGoneMessage), notifyError func(error)) {
|
||||
add func(derp.PeerPresentMessage), remove func(derp.PeerGoneMessage), notifyError func(error),
|
||||
) {
|
||||
if !c.WatchConnectionChanges {
|
||||
if c.isStarted() {
|
||||
panic("invalid use of RunWatchConnectionLoop on already-started Client without setting Client.RunWatchConnectionLoop")
|
||||
|
||||
@@ -11,7 +11,7 @@ import (
|
||||
"net"
|
||||
|
||||
"github.com/coder/websocket"
|
||||
"tailscale.com/net/wsconn"
|
||||
"github.com/sagernet/tailscale/net/wsconn"
|
||||
)
|
||||
|
||||
const canWebsockets = true
|
||||
|
||||
@@ -36,25 +36,25 @@ import (
|
||||
"sync/atomic"
|
||||
"time"
|
||||
|
||||
"github.com/sagernet/tailscale/client/local"
|
||||
"github.com/sagernet/tailscale/derp"
|
||||
"github.com/sagernet/tailscale/derp/derpconst"
|
||||
"github.com/sagernet/tailscale/disco"
|
||||
"github.com/sagernet/tailscale/envknob"
|
||||
"github.com/sagernet/tailscale/metrics"
|
||||
"github.com/sagernet/tailscale/syncs"
|
||||
"github.com/sagernet/tailscale/tailcfg"
|
||||
"github.com/sagernet/tailscale/tstime"
|
||||
"github.com/sagernet/tailscale/tstime/rate"
|
||||
"github.com/sagernet/tailscale/types/key"
|
||||
"github.com/sagernet/tailscale/types/logger"
|
||||
"github.com/sagernet/tailscale/util/ctxkey"
|
||||
"github.com/sagernet/tailscale/util/mak"
|
||||
"github.com/sagernet/tailscale/util/set"
|
||||
"github.com/sagernet/tailscale/util/slicesx"
|
||||
"github.com/sagernet/tailscale/version"
|
||||
"go4.org/mem"
|
||||
"golang.org/x/sync/errgroup"
|
||||
"tailscale.com/client/local"
|
||||
"tailscale.com/derp"
|
||||
"tailscale.com/derp/derpconst"
|
||||
"tailscale.com/disco"
|
||||
"tailscale.com/envknob"
|
||||
"tailscale.com/metrics"
|
||||
"tailscale.com/syncs"
|
||||
"tailscale.com/tailcfg"
|
||||
"tailscale.com/tstime"
|
||||
"tailscale.com/tstime/rate"
|
||||
"tailscale.com/types/key"
|
||||
"tailscale.com/types/logger"
|
||||
"tailscale.com/util/ctxkey"
|
||||
"tailscale.com/util/mak"
|
||||
"tailscale.com/util/set"
|
||||
"tailscale.com/util/slicesx"
|
||||
"tailscale.com/version"
|
||||
)
|
||||
|
||||
// verboseDropKeys is the set of destination public keys that should
|
||||
@@ -1772,7 +1772,6 @@ func (c *sclient) onSendLoopDone() {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func (c *sclient) sendLoop(ctx context.Context) error {
|
||||
|
||||
@@ -11,7 +11,7 @@ import (
|
||||
"net"
|
||||
"time"
|
||||
|
||||
"tailscale.com/net/tcpinfo"
|
||||
"github.com/sagernet/tailscale/net/tcpinfo"
|
||||
)
|
||||
|
||||
func (c *sclient) startStatsLoop(ctx context.Context) {
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
"tailscale.com/derp"
|
||||
"github.com/sagernet/tailscale/derp"
|
||||
)
|
||||
|
||||
// Handler returns an http.Handler to be mounted at /derp, serving s.
|
||||
|
||||
@@ -23,19 +23,15 @@ const (
|
||||
prefix = "libbpf-" + libbpfVersion
|
||||
)
|
||||
|
||||
var (
|
||||
filesToExtract = map[string]struct{}{
|
||||
prefix + "/LICENSE.BSD-2-Clause": {},
|
||||
prefix + "/src/bpf_endian.h": {},
|
||||
prefix + "/src/bpf_helper_defs.h": {},
|
||||
prefix + "/src/bpf_helpers.h": {},
|
||||
prefix + "/src/bpf_tracing.h": {},
|
||||
}
|
||||
)
|
||||
var filesToExtract = map[string]struct{}{
|
||||
prefix + "/LICENSE.BSD-2-Clause": {},
|
||||
prefix + "/src/bpf_endian.h": {},
|
||||
prefix + "/src/bpf_helper_defs.h": {},
|
||||
prefix + "/src/bpf_helpers.h": {},
|
||||
prefix + "/src/bpf_tracing.h": {},
|
||||
}
|
||||
|
||||
var (
|
||||
flagDest = flag.String("dest", ".", "destination directory")
|
||||
)
|
||||
var flagDest = flag.String("dest", ".", "destination directory")
|
||||
|
||||
// TODO(jwhited): go generate strategy for derp/xdp
|
||||
func main() {
|
||||
|
||||
@@ -12,8 +12,7 @@ import (
|
||||
)
|
||||
|
||||
// STUNServer is unimplemented on these platforms, see xdp_linux.go.
|
||||
type STUNServer struct {
|
||||
}
|
||||
type STUNServer struct{}
|
||||
|
||||
func NewSTUNServer(config *STUNServerConfig, opts ...STUNServerOption) (*STUNServer, error) {
|
||||
return nil, errors.New("unimplemented on this GOOS")
|
||||
|
||||
@@ -27,8 +27,8 @@ import (
|
||||
"net/netip"
|
||||
"time"
|
||||
|
||||
"github.com/sagernet/tailscale/types/key"
|
||||
"go4.org/mem"
|
||||
"tailscale.com/types/key"
|
||||
)
|
||||
|
||||
// Magic is the 6 byte header of all discovery messages.
|
||||
|
||||
@@ -8,8 +8,8 @@ import (
|
||||
"encoding/binary"
|
||||
"net/netip"
|
||||
|
||||
"tailscale.com/tailcfg"
|
||||
"tailscale.com/types/key"
|
||||
"github.com/sagernet/tailscale/tailcfg"
|
||||
"github.com/sagernet/tailscale/types/key"
|
||||
)
|
||||
|
||||
// ToPCAPFrame marshals the bytes for a pcap record that describe a disco frame.
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
"context"
|
||||
"sync"
|
||||
|
||||
"tailscale.com/types/logger"
|
||||
"github.com/sagernet/tailscale/types/logger"
|
||||
)
|
||||
|
||||
// Check is the interface defining a singular check.
|
||||
|
||||
@@ -8,7 +8,7 @@ package ethtool
|
||||
import (
|
||||
"context"
|
||||
|
||||
"tailscale.com/types/logger"
|
||||
"github.com/sagernet/tailscale/types/logger"
|
||||
)
|
||||
|
||||
// Check implements the doctor.Check interface.
|
||||
|
||||
@@ -10,9 +10,9 @@ import (
|
||||
"sort"
|
||||
|
||||
"github.com/safchain/ethtool"
|
||||
"tailscale.com/net/netmon"
|
||||
"tailscale.com/types/logger"
|
||||
"tailscale.com/util/set"
|
||||
"github.com/sagernet/tailscale/net/netmon"
|
||||
"github.com/sagernet/tailscale/types/logger"
|
||||
"github.com/sagernet/tailscale/util/set"
|
||||
)
|
||||
|
||||
func ethtoolImpl(logf logger.Logf) error {
|
||||
|
||||
@@ -8,7 +8,7 @@ package ethtool
|
||||
import (
|
||||
"runtime"
|
||||
|
||||
"tailscale.com/types/logger"
|
||||
"github.com/sagernet/tailscale/types/logger"
|
||||
)
|
||||
|
||||
func ethtoolImpl(logf logger.Logf) error {
|
||||
|
||||
@@ -11,8 +11,8 @@ import (
|
||||
"os/user"
|
||||
"strings"
|
||||
|
||||
"github.com/sagernet/tailscale/types/logger"
|
||||
"golang.org/x/exp/constraints"
|
||||
"tailscale.com/types/logger"
|
||||
)
|
||||
|
||||
// Check implements the doctor.Check interface.
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
package permissions
|
||||
|
||||
import (
|
||||
"github.com/sagernet/tailscale/types/logger"
|
||||
"golang.org/x/sys/unix"
|
||||
"tailscale.com/types/logger"
|
||||
)
|
||||
|
||||
func permissionsImpl(logf logger.Logf) error {
|
||||
|
||||
@@ -10,8 +10,8 @@ import (
|
||||
"strings"
|
||||
"unsafe"
|
||||
|
||||
"github.com/sagernet/tailscale/types/logger"
|
||||
"golang.org/x/sys/unix"
|
||||
"tailscale.com/types/logger"
|
||||
)
|
||||
|
||||
func permissionsImpl(logf logger.Logf) error {
|
||||
|
||||
@@ -8,7 +8,7 @@ package permissions
|
||||
import (
|
||||
"runtime"
|
||||
|
||||
"tailscale.com/types/logger"
|
||||
"github.com/sagernet/tailscale/types/logger"
|
||||
)
|
||||
|
||||
func permissionsImpl(logf logger.Logf) error {
|
||||
|
||||
@@ -8,8 +8,8 @@ package routetable
|
||||
import (
|
||||
"context"
|
||||
|
||||
"tailscale.com/net/routetable"
|
||||
"tailscale.com/types/logger"
|
||||
"github.com/sagernet/tailscale/net/routetable"
|
||||
"github.com/sagernet/tailscale/types/logger"
|
||||
)
|
||||
|
||||
// MaxRoutes is the maximum number of routes that will be displayed.
|
||||
|
||||
@@ -11,7 +11,7 @@ import (
|
||||
|
||||
jsonv2 "github.com/go-json-experiment/json"
|
||||
"github.com/go-json-experiment/json/jsontext"
|
||||
"tailscale.com/types/views"
|
||||
"github.com/sagernet/tailscale/types/views"
|
||||
)
|
||||
|
||||
//go:generate go run tailscale.com/cmd/cloner -clonefunc=true -type=Share
|
||||
|
||||
@@ -16,11 +16,11 @@ import (
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
"github.com/sagernet/tailscale/drive/driveimpl/dirfs"
|
||||
"github.com/sagernet/tailscale/drive/driveimpl/shared"
|
||||
"github.com/sagernet/tailscale/tstime"
|
||||
"github.com/sagernet/tailscale/types/logger"
|
||||
"github.com/tailscale/xnet/webdav"
|
||||
"tailscale.com/drive/driveimpl/dirfs"
|
||||
"tailscale.com/drive/driveimpl/shared"
|
||||
"tailscale.com/tstime"
|
||||
"tailscale.com/types/logger"
|
||||
)
|
||||
|
||||
// Child is a child folder of this compositedav.
|
||||
|
||||
@@ -11,7 +11,7 @@ import (
|
||||
"regexp"
|
||||
"strings"
|
||||
|
||||
"tailscale.com/drive/driveimpl/shared"
|
||||
"github.com/sagernet/tailscale/drive/driveimpl/shared"
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
@@ -13,12 +13,10 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/jellydator/ttlcache/v3"
|
||||
"tailscale.com/drive/driveimpl/shared"
|
||||
"github.com/sagernet/tailscale/drive/driveimpl/shared"
|
||||
)
|
||||
|
||||
var (
|
||||
notFound = newCacheEntry(http.StatusNotFound, nil)
|
||||
)
|
||||
var notFound = newCacheEntry(http.StatusNotFound, nil)
|
||||
|
||||
// StatCache provides a cache for directory listings and file metadata.
|
||||
// Especially when used from the command-line, mapped WebDAV drives can
|
||||
|
||||
@@ -10,8 +10,8 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"tailscale.com/drive/driveimpl/shared"
|
||||
"tailscale.com/tstime"
|
||||
"github.com/sagernet/tailscale/drive/driveimpl/shared"
|
||||
"github.com/sagernet/tailscale/tstime"
|
||||
)
|
||||
|
||||
// Child is subdirectory of an FS.
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"context"
|
||||
"os"
|
||||
|
||||
"tailscale.com/drive/driveimpl/shared"
|
||||
"github.com/sagernet/tailscale/drive/driveimpl/shared"
|
||||
)
|
||||
|
||||
// Mkdir implements webdav.FileSystem. All attempts to Mkdir a directory that
|
||||
|
||||
@@ -8,8 +8,8 @@ import (
|
||||
"io/fs"
|
||||
"os"
|
||||
|
||||
"github.com/sagernet/tailscale/drive/driveimpl/shared"
|
||||
"github.com/tailscale/xnet/webdav"
|
||||
"tailscale.com/drive/driveimpl/shared"
|
||||
)
|
||||
|
||||
// OpenFile implements interface webdav.Filesystem.
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"io/fs"
|
||||
"os"
|
||||
|
||||
"tailscale.com/drive/driveimpl/shared"
|
||||
"github.com/sagernet/tailscale/drive/driveimpl/shared"
|
||||
)
|
||||
|
||||
// Stat implements webdav.FileSystem.
|
||||
|
||||
@@ -12,8 +12,8 @@ import (
|
||||
"net/http"
|
||||
"sync"
|
||||
|
||||
"github.com/sagernet/tailscale/drive/driveimpl/shared"
|
||||
"github.com/tailscale/xnet/webdav"
|
||||
"tailscale.com/drive/driveimpl/shared"
|
||||
)
|
||||
|
||||
// FileServer is a standalone WebDAV server that dynamically serves up shares.
|
||||
|
||||
@@ -10,10 +10,10 @@ import (
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"tailscale.com/drive"
|
||||
"tailscale.com/drive/driveimpl/compositedav"
|
||||
"tailscale.com/drive/driveimpl/dirfs"
|
||||
"tailscale.com/types/logger"
|
||||
"github.com/sagernet/tailscale/drive"
|
||||
"github.com/sagernet/tailscale/drive/driveimpl/compositedav"
|
||||
"github.com/sagernet/tailscale/drive/driveimpl/dirfs"
|
||||
"github.com/sagernet/tailscale/types/logger"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -22,13 +22,13 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/sagernet/tailscale/drive"
|
||||
"github.com/sagernet/tailscale/drive/driveimpl/compositedav"
|
||||
"github.com/sagernet/tailscale/drive/driveimpl/dirfs"
|
||||
"github.com/sagernet/tailscale/drive/driveimpl/shared"
|
||||
"github.com/sagernet/tailscale/safesocket"
|
||||
"github.com/sagernet/tailscale/types/logger"
|
||||
"github.com/tailscale/xnet/webdav"
|
||||
"tailscale.com/drive"
|
||||
"tailscale.com/drive/driveimpl/compositedav"
|
||||
"tailscale.com/drive/driveimpl/dirfs"
|
||||
"tailscale.com/drive/driveimpl/shared"
|
||||
"tailscale.com/safesocket"
|
||||
"tailscale.com/types/logger"
|
||||
)
|
||||
|
||||
func NewFileSystemForRemote(logf logger.Logf) *FileSystemForRemote {
|
||||
|
||||
@@ -65,7 +65,7 @@ func ReadOnlyDirInfo(name string, ts time.Time) *StaticFileInfo {
|
||||
return &StaticFileInfo{
|
||||
Named: Base(name),
|
||||
Sized: 0,
|
||||
Moded: 0555,
|
||||
Moded: 0o555,
|
||||
BirthedTime: ts,
|
||||
ModdedTime: ts,
|
||||
Dir: true,
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
package drive
|
||||
|
||||
import "tailscale.com/version"
|
||||
import "github.com/sagernet/tailscale/version"
|
||||
|
||||
func doAllowShareAs() bool {
|
||||
// All UNIX platforms use user servers (sub-processes) to access the OS
|
||||
|
||||
@@ -31,12 +31,12 @@ import (
|
||||
"sync/atomic"
|
||||
"time"
|
||||
|
||||
"tailscale.com/feature/buildfeatures"
|
||||
"tailscale.com/kube/kubetypes"
|
||||
"tailscale.com/syncs"
|
||||
"tailscale.com/types/opt"
|
||||
"tailscale.com/version"
|
||||
"tailscale.com/version/distro"
|
||||
"github.com/sagernet/tailscale/feature/buildfeatures"
|
||||
"github.com/sagernet/tailscale/kube/kubetypes"
|
||||
"github.com/sagernet/tailscale/syncs"
|
||||
"github.com/sagernet/tailscale/types/opt"
|
||||
"github.com/sagernet/tailscale/version"
|
||||
"github.com/sagernet/tailscale/version/distro"
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
@@ -9,9 +9,9 @@ import (
|
||||
"errors"
|
||||
"runtime"
|
||||
|
||||
"tailscale.com/envknob"
|
||||
"tailscale.com/version"
|
||||
"tailscale.com/version/distro"
|
||||
"github.com/sagernet/tailscale/envknob"
|
||||
"github.com/sagernet/tailscale/version"
|
||||
"github.com/sagernet/tailscale/version/distro"
|
||||
)
|
||||
|
||||
// CanRunTailscaleSSH reports whether serving a Tailscale SSH server is
|
||||
|
||||
@@ -8,9 +8,9 @@ package logknob
|
||||
import (
|
||||
"sync/atomic"
|
||||
|
||||
"tailscale.com/envknob"
|
||||
"tailscale.com/tailcfg"
|
||||
"tailscale.com/types/logger"
|
||||
"github.com/sagernet/tailscale/envknob"
|
||||
"github.com/sagernet/tailscale/tailcfg"
|
||||
"github.com/sagernet/tailscale/types/logger"
|
||||
)
|
||||
|
||||
// TODO(andrew-d): should we have a package-global registry of logknobs? It
|
||||
|
||||
@@ -7,9 +7,9 @@ package ace
|
||||
import (
|
||||
"net/netip"
|
||||
|
||||
"tailscale.com/control/controlhttp"
|
||||
"tailscale.com/net/ace"
|
||||
"tailscale.com/net/netx"
|
||||
"github.com/sagernet/tailscale/control/controlhttp"
|
||||
"github.com/sagernet/tailscale/net/ace"
|
||||
"github.com/sagernet/tailscale/net/netx"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
||||
@@ -8,8 +8,8 @@ import (
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
|
||||
"tailscale.com/ipn/ipnlocal"
|
||||
"tailscale.com/tailcfg"
|
||||
"github.com/sagernet/tailscale/ipn/ipnlocal"
|
||||
"github.com/sagernet/tailscale/tailcfg"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
||||
@@ -13,8 +13,8 @@ import (
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"tailscale.com/feature/featuretags"
|
||||
"tailscale.com/util/must"
|
||||
"github.com/sagernet/tailscale/feature/featuretags"
|
||||
"github.com/sagernet/tailscale/util/must"
|
||||
)
|
||||
|
||||
const header = `// Copyright (c) Tailscale Inc & AUTHORS
|
||||
@@ -42,7 +42,7 @@ func main() {
|
||||
"// Specifically, it's whether the binary was NOT built with the %q build tag.\n"+
|
||||
"// It's a const so it can be used for dead code elimination.\n"+
|
||||
"const %s = %t\n",
|
||||
header, bang, k.OmitTag(), sym, m.Desc, k.OmitTag(), sym, suf == "enabled"), 0644))
|
||||
header, bang, k.OmitTag(), sym, m.Desc, k.OmitTag(), sym, suf == "enabled"), 0o644))
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,10 +11,10 @@ import (
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"tailscale.com/control/controlclient"
|
||||
"tailscale.com/tailcfg"
|
||||
"tailscale.com/tempfork/httprec"
|
||||
"tailscale.com/types/logger"
|
||||
"github.com/sagernet/tailscale/control/controlclient"
|
||||
"github.com/sagernet/tailscale/tailcfg"
|
||||
"github.com/sagernet/tailscale/tempfork/httprec"
|
||||
"github.com/sagernet/tailscale/types/logger"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
||||
@@ -13,10 +13,10 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"tailscale.com/feature"
|
||||
"tailscale.com/ipn/localapi"
|
||||
"tailscale.com/net/packet"
|
||||
"tailscale.com/util/set"
|
||||
"github.com/sagernet/tailscale/feature"
|
||||
"github.com/sagernet/tailscale/ipn/localapi"
|
||||
"github.com/sagernet/tailscale/net/packet"
|
||||
"github.com/sagernet/tailscale/util/set"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
||||
@@ -20,19 +20,19 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"tailscale.com/clientupdate"
|
||||
"tailscale.com/envknob"
|
||||
"tailscale.com/feature"
|
||||
"tailscale.com/ipn"
|
||||
"tailscale.com/ipn/ipnext"
|
||||
"tailscale.com/ipn/ipnlocal"
|
||||
"tailscale.com/ipn/ipnstate"
|
||||
"tailscale.com/ipn/localapi"
|
||||
"tailscale.com/tailcfg"
|
||||
"tailscale.com/types/logger"
|
||||
"tailscale.com/util/httpm"
|
||||
"tailscale.com/version"
|
||||
"tailscale.com/version/distro"
|
||||
"github.com/sagernet/tailscale/clientupdate"
|
||||
"github.com/sagernet/tailscale/envknob"
|
||||
"github.com/sagernet/tailscale/feature"
|
||||
"github.com/sagernet/tailscale/ipn"
|
||||
"github.com/sagernet/tailscale/ipn/ipnext"
|
||||
"github.com/sagernet/tailscale/ipn/ipnlocal"
|
||||
"github.com/sagernet/tailscale/ipn/ipnstate"
|
||||
"github.com/sagernet/tailscale/ipn/localapi"
|
||||
"github.com/sagernet/tailscale/tailcfg"
|
||||
"github.com/sagernet/tailscale/types/logger"
|
||||
"github.com/sagernet/tailscale/util/httpm"
|
||||
"github.com/sagernet/tailscale/version"
|
||||
"github.com/sagernet/tailscale/version/distro"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -82,7 +82,6 @@ type extension struct {
|
||||
func (e *extension) Name() string { return "clientupdate" }
|
||||
|
||||
func (e *extension) Init(h ipnext.Host) error {
|
||||
|
||||
h.Hooks().ProfileStateChange.Add(e.onChangeProfile)
|
||||
h.Hooks().BackendStateChange.Add(e.onBackendStateChange)
|
||||
|
||||
|
||||
@@ -10,9 +10,8 @@ import (
|
||||
// Portmapper is special in that the CLI also needs to link it in,
|
||||
// so it's pulled out into its own package, rather than using a maybe_*.go
|
||||
// file in condregister.
|
||||
_ "tailscale.com/feature/condregister/portmapper"
|
||||
|
||||
_ "github.com/sagernet/tailscale/feature/condregister/portmapper"
|
||||
// HTTP proxy support is also needed by the CLI, and tsnet, so it's its
|
||||
// own package too.
|
||||
_ "tailscale.com/feature/condregister/useproxy"
|
||||
_ "github.com/sagernet/tailscale/feature/condregister/useproxy"
|
||||
)
|
||||
|
||||
@@ -5,4 +5,4 @@
|
||||
|
||||
package identityfederation
|
||||
|
||||
import _ "tailscale.com/feature/identityfederation"
|
||||
import _ "github.com/sagernet/tailscale/feature/identityfederation"
|
||||
|
||||
@@ -5,4 +5,4 @@
|
||||
|
||||
package condregister
|
||||
|
||||
import _ "tailscale.com/feature/ace"
|
||||
import _ "github.com/sagernet/tailscale/feature/ace"
|
||||
|
||||
@@ -5,4 +5,4 @@
|
||||
|
||||
package condregister
|
||||
|
||||
import _ "tailscale.com/feature/appconnectors"
|
||||
import _ "github.com/sagernet/tailscale/feature/appconnectors"
|
||||
|
||||
@@ -5,4 +5,4 @@
|
||||
|
||||
package condregister
|
||||
|
||||
import _ "tailscale.com/feature/c2n"
|
||||
import _ "github.com/sagernet/tailscale/feature/c2n"
|
||||
|
||||
@@ -5,4 +5,4 @@
|
||||
|
||||
package condregister
|
||||
|
||||
import _ "tailscale.com/feature/capture"
|
||||
import _ "github.com/sagernet/tailscale/feature/capture"
|
||||
|
||||
@@ -5,4 +5,4 @@
|
||||
|
||||
package condregister
|
||||
|
||||
import _ "tailscale.com/feature/clientupdate"
|
||||
import _ "github.com/sagernet/tailscale/feature/clientupdate"
|
||||
|
||||
@@ -5,4 +5,4 @@
|
||||
|
||||
package condregister
|
||||
|
||||
import _ "tailscale.com/feature/debugportmapper"
|
||||
import _ "github.com/sagernet/tailscale/feature/debugportmapper"
|
||||
|
||||
@@ -5,4 +5,4 @@
|
||||
|
||||
package condregister
|
||||
|
||||
import _ "tailscale.com/feature/doctor"
|
||||
import _ "github.com/sagernet/tailscale/feature/doctor"
|
||||
|
||||
@@ -5,4 +5,4 @@
|
||||
|
||||
package condregister
|
||||
|
||||
import _ "tailscale.com/feature/drive"
|
||||
import _ "github.com/sagernet/tailscale/feature/drive"
|
||||
|
||||
@@ -5,4 +5,4 @@
|
||||
|
||||
package condregister
|
||||
|
||||
import _ "tailscale.com/feature/linkspeed"
|
||||
import _ "github.com/sagernet/tailscale/feature/linkspeed"
|
||||
|
||||
@@ -5,4 +5,4 @@
|
||||
|
||||
package condregister
|
||||
|
||||
import _ "tailscale.com/feature/linuxdnsfight"
|
||||
import _ "github.com/sagernet/tailscale/feature/linuxdnsfight"
|
||||
|
||||
@@ -5,4 +5,4 @@
|
||||
|
||||
package condregister
|
||||
|
||||
import _ "tailscale.com/wgengine/router/osrouter"
|
||||
import _ "github.com/sagernet/tailscale/wgengine/router/osrouter"
|
||||
|
||||
@@ -5,4 +5,4 @@
|
||||
|
||||
package condregister
|
||||
|
||||
import _ "tailscale.com/feature/portlist"
|
||||
import _ "github.com/sagernet/tailscale/feature/portlist"
|
||||
|
||||
@@ -5,4 +5,4 @@
|
||||
|
||||
package condregister
|
||||
|
||||
import _ "tailscale.com/feature/posture"
|
||||
import _ "github.com/sagernet/tailscale/feature/posture"
|
||||
|
||||
@@ -5,4 +5,4 @@
|
||||
|
||||
package condregister
|
||||
|
||||
import _ "tailscale.com/feature/relayserver"
|
||||
import _ "github.com/sagernet/tailscale/feature/relayserver"
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user