Skip to content

Commit fd7f6f3

Browse files
committed
init
0 parents  commit fd7f6f3

File tree

8 files changed

+687
-0
lines changed

8 files changed

+687
-0
lines changed

.github/scripts/check-tailscale.sh

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
echo "======================================"
6+
echo "🔍 Tailscale Connection Check"
7+
echo "======================================"
8+
echo ""
9+
10+
echo "📊 Tailscale Status:"
11+
echo "-------------------"
12+
tailscale status --json | jq -r '
13+
"✓ Backend State: \(.BackendState)",
14+
"✓ Tailnet: \(.CurrentTailnet.Name // "Not connected")",
15+
"✓ Self Hostname: \(.Self.HostName // "Unknown")",
16+
"✓ Online: \(.Self.Online)",
17+
""
18+
' 2>/dev/null || {
19+
tailscale status
20+
echo ""
21+
}
22+
23+
echo "🌐 Network Information:"
24+
echo "----------------------"
25+
IP=$(tailscale ip -4 2>/dev/null || echo "Not available")
26+
echo "✓ Tailscale IPv4: $IP"
27+
28+
IP6=$(tailscale ip -6 2>/dev/null || echo "Not available")
29+
echo "✓ Tailscale IPv6: $IP6"
30+
echo ""
31+
32+
echo "👥 Connected Peers:"
33+
echo "------------------"
34+
PEER_COUNT=$(tailscale status --json 2>/dev/null | jq '.Peer | length' 2>/dev/null || echo "0")
35+
echo "✓ Number of peers: $PEER_COUNT"
36+
37+
if [ "$PEER_COUNT" != "0" ] && command -v jq >/dev/null 2>&1; then
38+
tailscale status --json | jq -r '.Peer | to_entries[:3] | .[] | " - \(.value.HostName) (\(.value.TailscaleIPs[0]))"' 2>/dev/null
39+
fi
40+
echo ""
41+
42+
echo "✅ Tailscale connectivity check complete!"
43+
echo "======================================"

.github/workflows/test.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Test tshello with Tailscale
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
workflow_dispatch:
9+
10+
jobs:
11+
test:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
18+
- name: Set up Go
19+
uses: actions/setup-go@v5
20+
with:
21+
go-version: '1.23'
22+
23+
- name: Connect to Tailscale
24+
uses: tailscale/github-action@v3
25+
with:
26+
oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }}
27+
oauth-secret: ${{ secrets.TS_OAUTH_SECRET }}
28+
tags: tag:ci
29+
version: latest
30+
31+
- name: Build tshello
32+
run: |
33+
cd tshello
34+
go mod download
35+
go build -v ./...
36+
37+
- name: Run tests
38+
run: |
39+
cd tshello
40+
go test -v -timeout 30s ./...
41+
42+
- name: Test connectivity
43+
run: |
44+
# Test that we can reach the Tailscale network
45+
tailscale status
46+
47+
# Show our IP address
48+
tailscale ip -4

.gitignore

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# macOS
2+
.DS_Store
3+
.AppleDouble
4+
.LSOverride
5+
Icon
6+
._*
7+
.DocumentRevisions-V100
8+
.fseventsd
9+
.Spotlight-V100
10+
.TemporaryItems
11+
.Trashes
12+
.VolumeIcon.icns
13+
.com.apple.timemachine.donotpresent
14+
.AppleDB
15+
.AppleDesktop
16+
Network Trash Folder
17+
Temporary Items
18+
.apdisk
19+
20+
# Go
21+
*.exe
22+
*.exe~
23+
*.dll
24+
*.so
25+
*.dylib
26+
*.test
27+
*.out
28+
*.prof
29+
*.pprof
30+
*.cov
31+
*.coverage
32+
*.coverprofile
33+
go.work
34+
go.work.sum
35+
vendor/
36+
bin/
37+
dist/
38+
39+
# Build directories
40+
build/
41+
_build/
42+
_output/
43+
44+
# IDE
45+
.vscode/
46+
.idea/
47+
*.swp
48+
*.swo
49+
*~
50+
.project
51+
.classpath
52+
.c9/
53+
*.launch
54+
.settings/
55+
*.sublime-workspace
56+
*.sublime-project
57+
58+
# Logs
59+
*.log
60+
logs/
61+
log/
62+
63+
# Environment variables
64+
.env
65+
.env.local
66+
.env.*.local
67+
68+
# Debug
69+
debug
70+
__debug_bin
71+
*.pdb
72+
73+
# Temporary files
74+
tmp/
75+
temp/
76+
*.tmp
77+
*.bak
78+
*.backup
79+
*.orig
80+
81+
# Test results
82+
test-results/
83+
coverage/
84+
*.test
85+
*.coverprofile

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Connect GitHub CI/CD workflows to private infrastructure without public exposure
2+
3+
This repository showcases a GitHub Action that enables secure connections from GitHub CI/CD workflows to private infrastructure without exposing it to the public internet. It leverages a self-hosted runner and SSH tunneling to create a secure communication channel.
4+
5+
For more information, including step-by-step instructions, refer to the [documentation](https://tailscale.com/kb/1586/secure-github-runners).

tshello/go.mod

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
module tshello
2+
3+
go 1.25.1
4+
5+
require (
6+
filippo.io/edwards25519 v1.1.0 // indirect
7+
github.com/akutz/memconn v0.1.0 // indirect
8+
github.com/alexbrainman/sspi v0.0.0-20231016080023-1a75b4708caa // indirect
9+
github.com/aws/aws-sdk-go-v2 v1.36.0 // indirect
10+
github.com/aws/aws-sdk-go-v2/config v1.29.5 // indirect
11+
github.com/aws/aws-sdk-go-v2/credentials v1.17.58 // indirect
12+
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.27 // indirect
13+
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.31 // indirect
14+
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.31 // indirect
15+
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.2 // indirect
16+
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.2 // indirect
17+
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.12 // indirect
18+
github.com/aws/aws-sdk-go-v2/service/ssm v1.44.7 // indirect
19+
github.com/aws/aws-sdk-go-v2/service/sso v1.24.14 // indirect
20+
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.13 // indirect
21+
github.com/aws/aws-sdk-go-v2/service/sts v1.33.13 // indirect
22+
github.com/aws/smithy-go v1.22.2 // indirect
23+
github.com/coder/websocket v1.8.12 // indirect
24+
github.com/coreos/go-iptables v0.7.1-0.20240112124308-65c67c9f46e6 // indirect
25+
github.com/dblohm7/wingoes v0.0.0-20240119213807-a09d6be7affa // indirect
26+
github.com/digitalocean/go-smbios v0.0.0-20180907143718-390a4f403a8e // indirect
27+
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
28+
github.com/gaissmai/bart v0.18.0 // indirect
29+
github.com/go-json-experiment/json v0.0.0-20250223041408-d3c622f1b874 // indirect
30+
github.com/go-ole/go-ole v1.3.0 // indirect
31+
github.com/godbus/dbus/v5 v5.1.1-0.20230522191255-76236955d466 // indirect
32+
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
33+
github.com/google/btree v1.1.2 // indirect
34+
github.com/google/go-cmp v0.6.0 // indirect
35+
github.com/google/nftables v0.2.1-0.20240414091927-5e242ec57806 // indirect
36+
github.com/google/uuid v1.6.0 // indirect
37+
github.com/hdevalence/ed25519consensus v0.2.0 // indirect
38+
github.com/illarion/gonotify/v3 v3.0.2 // indirect
39+
github.com/jmespath/go-jmespath v0.4.0 // indirect
40+
github.com/jsimonetti/rtnetlink v1.4.0 // indirect
41+
github.com/klauspost/compress v1.17.11 // indirect
42+
github.com/mdlayher/genetlink v1.3.2 // indirect
43+
github.com/mdlayher/netlink v1.7.3-0.20250113171957-fbb4dce95f42 // indirect
44+
github.com/mdlayher/sdnotify v1.0.0 // indirect
45+
github.com/mdlayher/socket v0.5.0 // indirect
46+
github.com/miekg/dns v1.1.58 // indirect
47+
github.com/mitchellh/go-ps v1.0.0 // indirect
48+
github.com/prometheus-community/pro-bing v0.4.0 // indirect
49+
github.com/safchain/ethtool v0.3.0 // indirect
50+
github.com/tailscale/certstore v0.1.1-0.20231202035212-d3fa0460f47e // indirect
51+
github.com/tailscale/go-winio v0.0.0-20231025203758-c4f33415bf55 // indirect
52+
github.com/tailscale/goupnp v1.0.1-0.20210804011211-c64d0f06ea05 // indirect
53+
github.com/tailscale/hujson v0.0.0-20221223112325-20486734a56a // indirect
54+
github.com/tailscale/netlink v1.1.1-0.20240822203006-4d49adab4de7 // indirect
55+
github.com/tailscale/peercred v0.0.0-20250107143737-35a0c7bd7edc // indirect
56+
github.com/tailscale/web-client-prebuilt v0.0.0-20250124233751-d4cd19a26976 // indirect
57+
github.com/tailscale/wireguard-go v0.0.0-20250716170648-1d0488a3d7da // indirect
58+
github.com/vishvananda/netns v0.0.4 // indirect
59+
github.com/x448/float16 v0.8.4 // indirect
60+
go4.org/mem v0.0.0-20240501181205-ae6ca9944745 // indirect
61+
go4.org/netipx v0.0.0-20231129151722-fdeea329fbba // indirect
62+
golang.org/x/crypto v0.38.0 // indirect
63+
golang.org/x/exp v0.0.0-20250210185358-939b2ce775ac // indirect
64+
golang.org/x/mod v0.24.0 // indirect
65+
golang.org/x/net v0.40.0 // indirect
66+
golang.org/x/sync v0.14.0 // indirect
67+
golang.org/x/sys v0.33.0 // indirect
68+
golang.org/x/term v0.32.0 // indirect
69+
golang.org/x/text v0.25.0 // indirect
70+
golang.org/x/time v0.11.0 // indirect
71+
golang.org/x/tools v0.33.0 // indirect
72+
golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2 // indirect
73+
golang.zx2c4.com/wireguard/windows v0.5.3 // indirect
74+
gvisor.dev/gvisor v0.0.0-20250205023644-9414b50a5633 // indirect
75+
tailscale.com v1.86.5 // indirect
76+
)

0 commit comments

Comments
 (0)