8000 feat: Tether v1 — logged-in Chrome as HTTP proxy + WebDriver by adeelahmad · Pull Request #1 · adeelahmad/Tether · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.go]
indent_style = tab

[{Makefile,*.mk}]
indent_style = tab

[*.{yml,yaml,md,json}]
indent_style = space
indent_size = 2
48 changes: 48 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Bug report
description: Something in Tether doesn't work as documented
labels: [bug]
body:
- type: markdown
attributes:
value: |
Thanks for the report! **Never paste tokens, cookies or the contents of
your CA key.** For security issues, see SECURITY.md instead.
- type: textarea
id: what
attributes:
label: What happened?
description: What did you run, what did you expect, what happened instead?
validations:
required: true
- type: textarea
id: repro
attributes:
label: Steps to reproduce
placeholder: |
1. tether serve --launch
2. curl -x http://127.0.0.1:8787 ...
validations:
required: true
- type: input
id: version
attributes:
label: tether version
description: Output of `tether version`
validations:
required: true
- type: input
id: chrome
attributes:
label: Chrome version and how Tether connects
placeholder: "Chrome 141, --launch / --chrome 9222 / chrome://inspect toggle"
- type: input
id: os
attributes:
label: OS
placeholder: macOS 15 (arm64)
- type: textarea
id: logs
attributes:
label: Logs
description: Run with `--log-level debug`. Tether redacts secrets, but please double-check.
render: text
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
blank_issues_enabled: false
contact_links:
- name: Security vulnerability
url: https://github.com/adeelahmad/tether/security/advisories/new
about: Please report security issues privately.
- name: Questions and ideas
url: https://github.com/adeelahmad/tether/discussions
about: Ask and discuss in GitHub Discussions.
25 changes: 25 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Feature request
description: Suggest an idea for Tether
labels: [enhancement]
body:
- type: textarea
id: problem
attributes:
label: What problem would this solve?
validations:
required: true
- type: textarea
id: proposal
attributes:
label: What would you like Tether to do?
- type: dropdown
id: face
attributes:
label: Which face does this touch?
options:
- HTTP proxy
- WebDriver
- MCP (planned)
- Remote UI (planned)
- Core / sessions
- Docs / tooling
20 changes: 20 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
version: 2
updates:
- package-ecosystem: gomod
directory: /
schedule:
interval: weekly
groups:
go-deps:
patterns: ["*"]
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
groups:
actions:
patterns: ["*"]
- package-ecosystem: docker
directory: /
schedule:
interval: weekly
17 changes: 17 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
## What

<!-- What does this change do, from a user's point of view? -->

## Why

<!-- Link the issue if there is one: Fixes #123 -->

## How tested

- [ ] `make check` (fmt, vet, lint, unit tests)
- [ ] `make test-integration` (if the CDP, proxy or WebDriver path changed)
- [ ] Docs updated (README, docs/, CHANGELOG `[Unreleased]`)

## Security

- [ ] No new way to reach the browser without auth, and nothing new is logged that could hold a cookie or token.
116 changes: 116 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
name: CI

on:
push:
branches: [main, master]
pull_request:
workflow_dispatch:

permissions:
contents: read

concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
check-latest: true
- name: go mod tidy is clean
run: go mod tidy && git diff --exit-code go.mod go.sum
- name: go vet
run: go vet ./... && go vet -tags integration ./...
- uses: golangci/golangci-lint-action@v8
with:
version: v2.5.0

test:
name: Test (${{ matrix.os }}, Go ${{ matrix.go }})
needs: lint
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
go: ["1.23.x", "stable"]
include:
- os: macos-latest
go: stable
- os: windows-latest
go: stable
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
go-version: ${{ matrix.go }}
- name: Unit + integration tests (race, coverage, real headless Chrome)
if: runner.os == 'Linux'
env:
# Ubuntu 24.04 runners block Chrome's user-namespace sandbox.
TETHER_CHROME_ARGS: --no-sandbox
TETHER_REQUIRE_CHROME: "1"
run: >-
go test -race -count=1 -tags integration
-covermode=atomic -coverpkg=./... -coverprofile=coverage.out ./...
- name: Unit tests
if: runner.os != 'Linux'
run: go test -count=1 ./...
- name: Coverage summary
if: runner.os == 'Linux' && matrix.go == 'stable'
run: |
total=$(go tool cover -func=coverage.out | awk '/^total:/ {print $3}')
echo "Total coverage: **${total}**" >> "$GITHUB_STEP_SUMMARY"
echo '```' >> "$GITHUB_STEP_SUMMARY"
go tool cover -func=coverage.out >> "$GITHUB_STEP_SUMMARY"
echo '```' >> "$GITHUB_STEP_SUMMARY"
- uses: actions/upload-artifact@v4
if: runner.os == 'Linux' && matrix.go == 'stable'
with:
name: coverage
path: coverage.out

build:
name: Build ${{ matrix.goos }}/${{ matrix.goarch }}
needs: test
runs-on: ubuntu-latest
strategy:
matrix:
include:
- { goos: darwin, goarch: arm64 }
- { goos: darwin, goarch: amd64 }
- { goos: linux, goarch: arm64 }
- { goos: linux, goarch: amd64 }
- { goos: windows, goarch: amd64 }
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- uses: actions/setup-go@v6
with:
go-version: stable
- name: Build static binary
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
run: make build
- name: Smoke test
if: matrix.goos == 'linux' && matrix.goarch == 'amd64'
run: ./bin/tether version

govulncheck:
name: govulncheck
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
go-version: stable
- run: go run golang.org/x/vuln/cmd/govulncheck@latest ./...
30 changes: 30 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: CodeQL

on:
push:
branches: [main, master]
pull_request:
schedule:
- cron: "23 4 * * 1"

permissions:
contents: read

jobs:
analyze:
runs-on: ubuntu-latest
permissions:
security-events: write
contents: read
actions: read
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
- uses: github/codeql-action/init@v3
with:
languages: go
queries: security-and-quality
- uses: github/codeql-action/autobuild@v3
- uses: github/codeql-action/analyze@v3
37 changes: 37 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Release

on:
push:
tags: ["v*"]

permissions:
contents: write # GitHub release + assets
packages: write # ghcr.io image

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- uses: actions/setup-go@v6
with:
go-version: stable
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: "~> v2"
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# A PAT with write access to adeelahmad/homebrew-tap. Without it the
# tap update is skipped and the rest of the release still ships.
HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }}
24 changes: 24 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Build output
/bin/
/dist/
/tether
*.exe
*.test
*.out
coverage.*

# Local Tether state (CA key, launched Chrome profile)
/.tether/
*.pem
!docs/**/*.pem

# Editors / OS
.idea/
.vscode/
*.swp
.DS_Store
Thumbs.db

# Go workspaces
go.work
go.work.sum
Loading
Loading
0