Skip to content

Commit 7a9c6c7

Browse files
authored
Merge pull request #30 from coder/colin/ts-1.46
2 parents b5a9b1b + b940c19 commit 7a9c6c7

File tree

383 files changed

+26170
-7932
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

383 files changed

+26170
-7932
lines changed
+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: "Dockerfile build"
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
branches:
8+
- "*"
9+
jobs:
10+
deploy:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
- name: "Build Docker image"
15+
run: docker build .

.github/workflows/go-licenses.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@ jobs:
5050
private_key: ${{ secrets.LICENSING_APP_PRIVATE_KEY }}
5151

5252
- name: Send pull request
53-
uses: peter-evans/create-pull-request@38e0b6e68b4c852a5500a94740f0e535e0d7ba54 #v4.2.4
53+
uses: peter-evans/create-pull-request@284f54f989303d2699d373481a0cfa13ad5a6666 #v5.0.1
5454
with:
5555
token: ${{ steps.generate-token.outputs.token }}
56-
author: License Updater <noreply@tailscale.com>
57-
committer: License Updater <noreply@tailscale.com>
56+
author: License Updater <noreply+license-updater@tailscale.com>
57+
committer: License Updater <noreply+license-updater@tailscale.com>
5858
branch: licenses/cli
5959
commit-message: "licenses: update tailscale{,d} licenses"
6060
title: "licenses: update tailscale{,d} licenses"

.github/workflows/golangci-lint.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ jobs:
2525
steps:
2626
- uses: actions/checkout@v3
2727

28-
- uses: actions/setup-go@v3
28+
- uses: actions/setup-go@v4
2929
with:
3030
go-version-file: go.mod
3131
cache: false
3232

3333
- name: golangci-lint
3434
# Note: this is the 'v3' tag as of 2023-04-17
35-
uses: golangci/golangci-lint-action@08e2f20817b15149a52b5b3ebe7de50aff2ba8c5
35+
uses: golangci/golangci-lint-action@639cd343e1d3b897ff35927a75193d57cfcba299
3636
with:
3737
version: v1.52.2
3838

.github/workflows/govulncheck.yml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: govulncheck
2+
3+
on:
4+
schedule:
5+
- cron: "0 12 * * *" # 8am EST / 10am PST / 12pm UTC
6+
workflow_dispatch: # allow manual trigger for testing
7+
pull_request:
8+
paths:
9+
- ".github/workflows/govulncheck.yml"
10+
11+
jobs:
12+
source-scan:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Check out code into the Go module directory
17+
uses: actions/checkout@v3
18+
19+
- name: Install govulncheck
20+
run: ./tool/go install golang.org/x/vuln/cmd/govulncheck@latest
21+
22+
- name: Scan source code for known vulnerabilities
23+
run: PATH=$PWD/tool/:$PATH "$(./tool/go env GOPATH)/bin/govulncheck" -test ./...
24+
25+
- uses: ruby/action-slack@v3.2.1
26+
with:
27+
payload: >
28+
{
29+
"attachments": [{
30+
"text": "${{ job.status }}: ${{ github.workflow }} <https://github.com/${{ github.repository }}/commit/${{ github.sha }}/checks>
31+
(<https://github.com/${{ github.repository }}/commit/${{ github.sha }}|commit>) of ${{ github.repository }}@${{ github.ref_name }} by ${{ github.event.head_commit.committer.name }}",
32+
"color": "danger"
33+
}]
34+
}
35+
env:
36+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
37+
if: failure() && github.event_name == 'schedule'

.github/workflows/installer.yml

+102
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
name: test installer.sh
2+
3+
on:
4+
push:
5+
branches:
6+
- "main"
7+
paths:
8+
- scripts/installer.sh
9+
pull_request:
10+
branches:
11+
- "*"
12+
paths:
13+
- scripts/installer.sh
14+
15+
jobs:
16+
test:
17+
strategy:
18+
# Don't abort the entire matrix if one element fails.
19+
fail-fast: false
20+
# Don't start all of these at once, which could saturate Github workers.
21+
max-parallel: 4
22+
matrix:
23+
image:
24+
# This is a list of Docker images against which we test our installer.
25+
# If you find that some of these no longer exist, please feel free
26+
# to remove them from the list.
27+
# When adding new images, please only use official ones.
28+
- "debian:oldstable-slim"
29+
- "debian:stable-slim"
30+
- "debian:testing-slim"
31+
- "debian:sid-slim"
32+
- "ubuntu:18.04"
33+
- "ubuntu:20.04"
34+
- "ubuntu:22.04"
35+
- "ubuntu:22.10"
36+
- "ubuntu:23.04"
37+
- "elementary/docker:stable"
38+
- "elementary/docker:unstable"
39+
- "parrotsec/core:lts-amd64"
40+
- "parrotsec/core:latest"
41+
- "kalilinux/kali-rolling"
42+
- "kalilinux/kali-dev"
43+
- "oraclelinux:9"
44+
- "oraclelinux:8"
45+
- "fedora:latest"
46+
- "rockylinux:8.7"
47+
- "rockylinux:9"
48+
- "amazonlinux:latest"
49+
- "opensuse/leap:latest"
50+
- "opensuse/tumbleweed:latest"
51+
- "archlinux:latest"
52+
- "alpine:3.14"
53+
- "alpine:latest"
54+
- "alpine:edge"
55+
deps:
56+
# Run all images installing curl as a dependency.
57+
- curl
58+
include:
59+
# Check a few images with wget rather than curl.
60+
- { image: "debian:oldstable-slim", deps: "wget" }
61+
- { image: "debian:sid-slim", deps: "wget" }
62+
- { image: "ubuntu:23.04", deps: "wget" }
63+
# Ubuntu 16.04 also needs apt-transport-https installed.
64+
- { image: "ubuntu:16.04", deps: "curl apt-transport-https" }
65+
- { image: "ubuntu:16.04", deps: "wget apt-transport-https" }
66+
runs-on: ubuntu-latest
67+
container:
68+
image: ${{ matrix.image }}
69+
options: --user root
70+
steps:
71+
- name: install dependencies (yum)
72+
# tar and gzip are needed by the actions/checkout below.
73+
run: yum install -y --allowerasing tar gzip ${{ matrix.deps }}
74+
if: |
75+
contains(matrix.image, 'centos')
76+
|| contains(matrix.image, 'oraclelinux')
77+
|| contains(matrix.image, 'fedora')
78+
|| contains(matrix.image, 'amazonlinux')
79+
- name: install dependencies (zypper)
80+
# tar and gzip are needed by the actions/checkout below.
81+
run: zypper --non-interactive install tar gzip
82+
if: contains(matrix.image, 'opensuse')
83+
- name: install dependencies (apt-get)
84+
run: |
85+
apt-get update
86+
apt-get install -y ${{ matrix.deps }}
87+
if: |
88+
contains(matrix.image, 'debian')
89+
|| contains(matrix.image, 'ubuntu')
90+
|| contains(matrix.image, 'elementary')
91+
|| contains(matrix.image, 'parrotsec')
92+
|| contains(matrix.image, 'kalilinux')
93+
- name: checkout
94+
uses: actions/checkout@v3
95+
- name: run installer
96+
run: scripts/installer.sh
97+
# Package installation can fail in docker because systemd is not running
98+
# as PID 1, so ignore errors at this step. The real check is the
99+
# `tailscale --version` command below.
100+
continue-on-error: true
101+
- name: check tailscale version
102+
run: tailscale --version

.github/workflows/test.yml

+14-6
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,9 @@ jobs:
6565
~\AppData\Local\go-build
6666
# The -2- here should be incremented when the scheme of data to be
6767
# cached changes (e.g. path above changes).
68-
key: ${{ github.job }}-${{ runner.os }}-${{ matrix.goarch }}-${{ matrix.buildflags }}-go-2-${{ hashFiles('**/go.sum') }}
68+
key: ${{ github.job }}-${{ runner.os }}-${{ matrix.goarch }}-${{ matrix.buildflags }}-go-2-${{ hashFiles('**/go.sum') }}-${{ github.run_id }}
6969
restore-keys: |
70+
${{ github.job }}-${{ runner.os }}-${{ matrix.goarch }}-${{ matrix.buildflags }}-go-2-${{ hashFiles('**/go.sum') }}
7071
${{ github.job }}-${{ runner.os }}-${{ matrix.goarch }}-${{ matrix.buildflags }}-go-2-
7172
- name: build all
7273
run: ./tool/go build ${{matrix.buildflags}} ./...
@@ -89,7 +90,11 @@ jobs:
8990
- name: build test wrapper
9091
run: ./tool/go build -o /tmp/testwrapper ./cmd/testwrapper
9192
- name: test all
92-
run: ./tool/go test ${{matrix.buildflags}} -exec=/tmp/testwrapper -bench=. -benchtime=1x ./...
93+
run: PATH=$PWD/tool:$PATH /tmp/testwrapper ./... ${{matrix.buildflags}}
94+
env:
95+
GOARCH: ${{ matrix.goarch }}
96+
- name: bench all
97+
run: PATH=$PWD/tool:$PATH /tmp/testwrapper ./... ${{matrix.buildflags}} -bench=. -benchtime=1x -run=^$
9398
env:
9499
GOARCH: ${{ matrix.goarch }}
95100
- name: check that no tracked files changed
@@ -131,8 +136,9 @@ jobs:
131136
~\AppData\Local\go-build
132137
# The -2- here should be incremented when the scheme of data to be
133138
# cached changes (e.g. path above changes).
134-
key: ${{ github.job }}-${{ runner.os }}-go-2-${{ hashFiles('**/go.sum') }}
139+
key: ${{ github.job }}-${{ runner.os }}-go-2-${{ hashFiles('**/go.sum') }}-${{ github.run_id }}
135140
restore-keys: |
141+
${{ github.job }}-${{ runner.os }}-go-2-${{ hashFiles('**/go.sum') }}
136142
${{ github.job }}-${{ runner.os }}-go-2-
137143
- name: test
138144
# Don't use -bench=. -benchtime=1x.
@@ -206,8 +212,9 @@ jobs:
206212
~\AppData\Local\go-build
207213
# The -2- here should be incremented when the scheme of data to be
208214
# cached changes (e.g. path above changes).
209-
key: ${{ github.job }}-${{ runner.os }}-${{ matrix.goos }}-${{ matrix.goarch }}-go-2-${{ hashFiles('**/go.sum') }}
215+
key: ${{ github.job }}-${{ runner.os }}-${{ matrix.goos }}-${{ matrix.goarch }}-go-2-${{ hashFiles('**/go.sum') }}-${{ github.run_id }}
210216
restore-keys: |
217+
${{ github.job }}-${{ runner.os }}-${{ matrix.goos }}-${{ matrix.goarch }}-go-2-${{ hashFiles('**/go.sum') }}
211218
${{ github.job }}-${{ runner.os }}-${{ matrix.goos }}-${{ matrix.goarch }}-go-2-
212219
- name: build all
213220
run: ./tool/go build ./cmd/...
@@ -271,8 +278,9 @@ jobs:
271278
~\AppData\Local\go-build
272279
# The -2- here should be incremented when the scheme of data to be
273280
# cached changes (e.g. path above changes).
274-
key: ${{ github.job }}-${{ runner.os }}-go-2-${{ hashFiles('**/go.sum') }}
281+
key: ${{ github.job }}-${{ runner.os }}-go-2-${{ hashFiles('**/go.sum') }}-${{ github.run_id }}
275282
restore-keys: |
283+
${{ github.job }}-${{ runner.os }}-go-2-${{ hashFiles('**/go.sum') }}
276284
${{ github.job }}-${{ runner.os }}-go-2-
277285
- name: build tsconnect client
278286
run: ./tool/go build ./cmd/tsconnect/wasm ./cmd/tailscale/cli
@@ -450,7 +458,7 @@ jobs:
450458
# By having the job always run, but skipping its only step as needed, we
451459
# let the CI output collapse nicely in PRs.
452460
if: failure() && github.event_name == 'push'
453-
uses: ruby/action-slack@v3.0.0
461+
uses: ruby/action-slack@v3.2.1
454462
with:
455463
payload: |
456464
{

.github/workflows/update-flake.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ jobs:
3535
private_key: ${{ secrets.LICENSING_APP_PRIVATE_KEY }}
3636

3737
- name: Send pull request
38-
uses: peter-evans/create-pull-request@38e0b6e68b4c852a5500a94740f0e535e0d7ba54 #v4.2.4
38+
uses: peter-evans/create-pull-request@284f54f989303d2699d373481a0cfa13ad5a6666 #v5.0.1
3939
with:
4040
token: ${{ steps.generate-token.outputs.token }}
41-
author: Flakes Updater <noreply@tailscale.com>
42-
committer: Flakes Updater <noreply@tailscale.com>
41+
author: Flakes Updater <noreply+flakes-updater@tailscale.com>
42+
committer: Flakes Updater <noreply+flakes-updater@tailscale.com>
4343
branch: flakes
4444
commit-message: "go.mod.sri: update SRI hash for go.mod changes"
4545
title: "go.mod.sri: update SRI hash for go.mod changes"

.golangci.yml

+28
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@ linters:
33
# enable in the list below.
44
disable-all: true
55
enable:
6+
- bidichk
67
- gofmt
78
- goimports
89
- misspell
10+
- revive
911

1012
# Configuration for how we run golangci-lint
1113
run:
@@ -23,6 +25,9 @@ issues:
2325

2426
# Per-linter settings are contained in this top-level key
2527
linters-settings:
28+
# Enable all rules by default; we don't use invisible unicode runes.
29+
bidichk:
30+
2631
gofmt:
2732
rewrite-rules:
2833
- pattern: 'interface{}'
@@ -31,3 +36,26 @@ linters-settings:
3136
goimports:
3237

3338
misspell:
39+
40+
revive:
41+
enable-all-rules: false
42+
ignore-generated-header: true
43+
rules:
44+
- name: atomic
45+
- name: context-keys-type
46+
- name: defer
47+
arguments: [[
48+
# Calling 'recover' at the time a defer is registered (i.e. "defer recover()") has no effect.
49+
"immediate-recover",
50+
# Calling 'recover' outside of a deferred function has no effect
51+
"recover",
52+
# Returning values from a deferred function has no effect
53+
"return",
54+
]]
55+
- name: duplicated-imports
56+
- name: errorf
57+
- name: string-of-int
58+
- name: time-equal
59+
- name: unconditional-recursion
60+
- name: useless-break
61+
- name: waitgroup-by-value

Dockerfile

+2-3
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@ RUN go install \
4747
golang.org/x/crypto/ssh \
4848
golang.org/x/crypto/acme \
4949
nhooyr.io/websocket \
50-
github.com/mdlayher/netlink \
51-
golang.zx2c4.com/wireguard/device
50+
github.com/mdlayher/netlink
5251

5352
COPY . .
5453

@@ -73,4 +72,4 @@ RUN apk add --no-cache ca-certificates iptables iproute2 ip6tables
7372
COPY --from=build-env /go/bin/* /usr/local/bin/
7473
# For compat with the previous run.sh, although ideally you should be
7574
# using build_docker.sh which sets an entrypoint for the image.
76-
RUN ln -s /usr/local/bin/containerboot /tailscale/run.sh
75+
RUN mkdir /tailscale && ln -s /usr/local/bin/containerboot /tailscale/run.sh

Dockerfile.base

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
# SPDX-License-Identifier: BSD-3-Clause
33

44
FROM alpine:3.16
5-
RUN apk add --no-cache ca-certificates iptables iproute2 ip6tables
5+
RUN apk add --no-cache ca-certificates iptables iproute2 ip6tables iputils

Makefile

+2-3
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,10 @@ staticcheck: ## Run staticcheck.io checks
4848
./tool/go run honnef.co/go/tools/cmd/staticcheck -- $$(./tool/go list ./... | grep -v tempfork)
4949

5050
spk: ## Build synology package for ${SYNO_ARCH} architecture and ${SYNO_DSM} DSM version
51-
PATH="${PWD}/tool:${PATH}" ./tool/go run github.com/tailscale/tailscale-synology@main -o tailscale.spk --source=. --goarch=${SYNO_ARCH} --dsm-version=${SYNO_DSM}
51+
./tool/go run ./cmd/dist build synology/dsm${SYNO_DSM}/${SYNO_ARCH}
5252

5353
spkall: ## Build synology packages for all architectures and DSM versions
54-
mkdir -p spks
55-
PATH="${PWD}/tool:${PATH}" ./tool/go run github.com/tailscale/tailscale-synology@main -o spks --source=. --goarch=all --dsm-version=all
54+
./tool/go run ./cmd/dist build synology
5655

5756
pushspk: spk ## Push and install synology package on ${SYNO_HOST} host
5857
echo "Pushing SPK to root@${SYNO_HOST} (env var SYNO_HOST) ..."

VERSION.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.39.0
1+
1.47.0

0 commit comments

Comments
 (0)