From ba2f5e1c24d01ba459d0171749e42c395fd7c7d1 Mon Sep 17 00:00:00 2001 From: Adeel Ahmad Date: Sun, 11 Oct 2026 06:50:04 +0000 Subject: [PATCH] docs: add landing page and docs site on GitHub Pages MkDocs Material site built from docs/ with a custom landing page, plus getting-started, proxy and configuration pages. Root SECURITY, CONTRIBUTING and CHANGELOG are pulled in by a small hook that also rewrites repo-relative links. A Pages workflow builds with --strict on PRs and deploys on push to main. Adds make docs / docs-serve. Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_011Da3omLMubz5WPXbMRK7r2 --- .github/workflows/pages.yml | 63 ++++++++++++++++++ .gitignore | 2 + CHANGELOG.md | 3 + Makefile | 10 ++- README.md | 1 + docs/assets/extra.css | 86 +++++++++++++++++++++++++ docs/assets/logo.svg | 6 ++ docs/changelog.md | 2 + docs/configuration.md | 51 +++++++++++++++ docs/contributing.md | 2 + docs/getting-started.md | 94 +++++++++++++++++++++++++++ docs/index.md | 125 ++++++++++++++++++++++++++++++++++++ docs/proxy.md | 70 ++++++++++++++++++++ docs/security.md | 2 + mkdocs.yml | 95 +++++++++++++++++++++++++++ website/hooks.py | 45 +++++++++++++ website/overrides/home.html | 30 +++++++++ website/requirements.txt | 2 + 18 files changed, 687 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/pages.yml create mode 100644 docs/assets/extra.css create mode 100644 docs/assets/logo.svg create mode 100644 docs/changelog.md create mode 100644 docs/configuration.md create mode 100644 docs/contributing.md create mode 100644 docs/getting-started.md create mode 100644 docs/index.md create mode 100644 docs/proxy.md create mode 100644 docs/security.md create mode 100644 mkdocs.yml create mode 100644 website/hooks.py create mode 100644 website/overrides/home.html create mode 100644 website/requirements.txt diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml new file mode 100644 index 0000000..672f576 --- /dev/null +++ b/.github/workflows/pages.yml @@ -0,0 +1,63 @@ +name: Docs site + +on: + push: + branches: [main] + paths: + - docs/** + - website/** + - mkdocs.yml + - README.md + - SECURITY.md + - CONTRIBUTING.md + - CHANGELOG.md + - .github/workflows/pages.yml + pull_request: + paths: + - docs/** + - website/** + - mkdocs.yml + - SECURITY.md + - CONTRIBUTING.md + - CHANGELOG.md + - .github/workflows/pages.yml + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: pages-${{ github.ref }} + cancel-in-progress: true + +jobs: + build: + name: Build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v5 + - uses: actions/setup-python@v6 + with: + python-version: "3.13" + cache: pip + cache-dependency-path: website/requirements.txt + - run: pip install -r website/requirements.txt + - run: mkdocs build --strict + - uses: actions/upload-pages-artifact@v4 + with: + path: site + + deploy: + name: Deploy + if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main' + needs: build + runs-on: ubuntu-latest + permissions: + pages: write + id-token: write + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - id: deployment + uses: actions/deploy-pages@v4 diff --git a/.gitignore b/.gitignore index 380c7e7..5fd0d2a 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,5 @@ Thumbs.db # Go workspaces go.work go.work.sum +/site/ +__pycache__/ diff --git a/CHANGELOG.md b/CHANGELOG.md index 69dc622..0892016 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added +- Docs site and landing page at , built + from `docs/` with MkDocs Material and deployed to GitHub Pages on every push + to `main` (`make docs`, `make docs-serve`). - Per-token and per-session domain policies (`docs/POLICIES.md`): a `--policy-file` defines named tokens, each with allow/deny rules, an `admin` flag and a `scripts` permission; `--deny-domains` adds a global diff --git a/Makefile b/Makefile index a7ffa37..27311d9 100644 --- a/Makefile +++ b/Makefile @@ -19,7 +19,7 @@ GO ?= go GOLANGCI ?= golangci-lint .DEFAULT_GOAL := build -.PHONY: help build run test test-integration lint fmt vet tidy cover clean cross vuln check +.PHONY: help build run test test-integration lint fmt vet tidy cover clean cross vuln check docs docs-serve help: ## Show this help @awk 'BEGIN {FS = ":.*##"} /^[a-zA-Z_-]+:.*##/ {printf " \033[36m%-18s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) @@ -68,5 +68,11 @@ cross: ## Static release builds for all platforms into ./dist -o $(DIST)/$(BINARY)_$${os}_$${arch}$$ext $(CMD) || exit 1; \ done +docs: ## Build the docs site into ./site (pip install -r website/requirements.txt) + mkdocs build --strict + +docs-serve: ## Preview the docs site at http://127.0.0.1:8000 + mkdocs serve + clean: ## Remove build output - rm -rf bin $(DIST) coverage.out + rm -rf bin $(DIST) coverage.out site diff --git a/README.md b/README.md index cdb76de..019e5f3 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ One self-contained binary. Speaks MCP, plain HTTP proxy and WebDriver. Drives Ch [![CI](https://github.com/adeelahmad/tether/actions/workflows/ci.yml/badge.svg)](https://github.com/adeelahmad/tether/actions/workflows/ci.yml) [![Go Report Card](https://goreportcard.com/badge/github.com/adeelahmad/tether)](https://goreportcard.com/report/github.com/adeelahmad/tether) [![Latest release](https://img.shields.io/github/v/release/adeelahmad/tether?sort=semver)](https://github.com/adeelahmad/tether/releases) +[![Docs](https://img.shields.io/badge/docs-adeelahmad.github.io%2FTether-blue)](https://adeelahmad.github.io/Tether/) [![License: GPL v3](https://img.shields.io/github/license/adeelahmad/tether)](LICENSE) Tether driving a real Chrome tab: curl through the proxy returns a logged-in page diff --git a/docs/assets/extra.css b/docs/assets/extra.css new file mode 100644 index 0000000..bbc9830 --- /dev/null +++ b/docs/assets/extra.css @@ -0,0 +1,86 @@ +/* Landing page hero (website/overrides/home.html). */ +.tx-hero { + background: linear-gradient(135deg, var(--md-primary-fg-color) 0%, #1a237e 60%, #00695c 100%); + color: var(--md-primary-bg-color); +} + +.tx-hero__inner { + display: flex; + flex-wrap: wrap; + align-items: center; + gap: 2.4rem; + padding: 3.2rem 0.8rem 3.6rem; +} + +.tx-hero__copy { + flex: 1 1 22rem; + min-width: 0; +} + +.tx-hero__demo { + flex: 1 1 22rem; + min-width: 0; +} + +.tx-hero__demo img { + display: block; + width: 100%; + border-radius: 0.4rem; + box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, 0.35); +} + +.tx-hero .md-typeset h1 { + color: inherit; + font-weight: 700; + font-size: 2.2rem; + line-height: 1.2; + margin: 0 0 1rem; +} + +.tx-hero__eyebrow { + margin: 0 0 0.6rem; + font-size: 0.7rem; + font-weight: 600; + letter-spacing: 0.08em; + text-transform: uppercase; + opacity: 0.8; +} + +.tx-hero__lead { + font-size: 0.95rem; + opacity: 0.92; +} + +.md-typeset .tx-hero__actions .md-button { + margin: 0.4rem 0.6rem 0.4rem 0; + color: var(--md-primary-bg-color); + border-color: var(--md-primary-bg-color); +} + +.md-typeset .tx-hero__actions .md-button--primary { + background-color: var(--md-accent-fg-color); + border-color: var(--md-accent-fg-color); + color: #fff; +} + +.md-typeset .tx-hero__install { + margin-top: 1.2rem; +} + +.md-typeset .tx-hero__install code { + background: rgba(0, 0, 0, 0.3); + color: #e0f2f1; + font-size: 0.7rem; + white-space: pre-wrap; + word-break: break-all; +} + +@media screen and (max-width: 44.9375em) { + .tx-hero .md-typeset h1 { + font-size: 1.6rem; + } + + .tx-hero__inner { + padding: 2rem 0.8rem 2.4rem; + } +} diff --git a/docs/assets/logo.svg b/docs/assets/logo.svg new file mode 100644 index 0000000..c33b124 --- /dev/null +++ b/docs/assets/logo.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/docs/changelog.md b/docs/changelog.md new file mode 100644 index 0000000..b81a863 --- /dev/null +++ b/docs/changelog.md @@ -0,0 +1,2 @@ + +This page is published from [CHANGELOG.md](../CHANGELOG.md) on the docs site. diff --git a/docs/configuration.md b/docs/configuration.md new file mode 100644 index 0000000..811196f --- /dev/null +++ b/docs/configuration.md @@ -0,0 +1,51 @@ +# Configuration + +Every flag has a `TETHER_*` environment variable; flags win. + +| Flag | Default | | +|---|---|---| +| `--addr` | `127.0.0.1:8787` | Listen address | +| `--token` / `--token-file` | — | Bearer token (≥16 chars); required off-loopback | +| `--insecure-allow-public` | `false` | Allow off-loopback with no token (don't) | +| `--chrome` | `auto` | `auto`, a port, `host:port`, `http://…`, `ws://…`, or a `DevToolsActivePort` path | +| `--launch` / `--headless` | `false` | Launch a dedicated Chrome (persistent profile under `--data-dir`) | +| `--chrome-bin`, `--chrome-args`, `--profile-dir` | auto | With `--launch` | +| `--idle-timeout` | `15m` | Close tabs Tether opened after inactivity (`0` = never) | +| `--timeout` | `60s` | Default per-request timeout | +| `--console-buffer` | `1000` | Console/log entries kept per tab (`0` = no capture) | +| `--allow-domains` | all | Comma-separated navigation allowlist (applies to every face) | +| `--deny-domains` | none | Comma-separated denylist; deny beats allow | +| `--policy-file` | — | JSON file with per-token rules and tokens, see [Policies](POLICIES.md) | +| `--data-dir` | user config dir | Local CA and launched profile | +| `--no-mitm` | `false` | Refuse HTTPS `CONNECT` instead of intercepting | +| `--mcp` | `true` | Serve the MCP face at `/mcp` | +| `--no-remote` | `false` | Don't serve the remote-browser UI at `/remote/` | +| `--remote-quality` | `70` | JPEG quality of the remote UI video (1–100) | +| `--log-level`, `--log-format` | `info`, `text` | `json` for machines; secrets are always redacted | + +## From another machine (Tailscale) + +```sh +export TETHER_TOKEN="$(openssl rand -hex 32)" +tether serve --launch --addr "$(tailscale ip -4):8787" +# elsewhere on the tailnet: +curl -x "http://tether:$TETHER_TOKEN@my-laptop:8787" --cacert tether-ca.pem https://github.com/ +# or watch and drive it from your phone: http://my-laptop:8787/remote/ +``` + +Tether refuses to listen beyond loopback without a token. Read +[Security](security.md) before exposing it anywhere. + +## One token per agent + +Give every agent its own token with its own domain rules. Each token only +sees the tabs it opened, and the rules are enforced inside the browser, so +redirects, link clicks and page script can't wander off the allowlist either. + +```sh +tether serve --policy-file examples/policy.json # tokens + rules, see Policies +curl -s -H "Authorization: Bearer $TETHER_RESEARCH_TOKEN" http://127.0.0.1:8787/tether/v1/whoami +# lock a single tab tighter still +curl -s -H "Authorization: Bearer $TETHER_RESEARCH_TOKEN" -X POST http://127.0.0.1:8787/tether/v1/tabs \ + -d '{"url":"https://en.wikipedia.org/","policy":{"allow":["en.wikipedia.org"]}}' +``` diff --git a/docs/contributing.md b/docs/contributing.md new file mode 100644 index 0000000..c80daae --- /dev/null +++ b/docs/contributing.md @@ -0,0 +1,2 @@ + +This page is published from [CONTRIBUTING.md](../CONTRIBUTING.md) on the docs site. diff --git a/docs/getting-started.md b/docs/getting-started.md new file mode 100644 index 0000000..02e458d --- /dev/null +++ b/docs/getting-started.md @@ -0,0 +1,94 @@ +# Getting started + +Tether is one binary. Install it, point it at a Chrome, and every client that +speaks HTTP proxy, WebDriver or MCP can use that browser, logged-in sessions +and all. + +## 1. Install + +=== "Go" + + ```sh + go install github.com/adeelahmad/tether/cmd/tether@latest + ``` + +=== "Homebrew" + + ```sh + brew install --cask adeelahmad/tap/tether + ``` + +=== "Docker" + + Headless Chromium ships inside the image. + + ```sh + docker run --rm -p 8787:8787 \ + -e TETHER_TOKEN=$(openssl rand -hex 32) \ + -v tether:/data ghcr.io/adeelahmad/tether + ``` + +=== "Binary" + + Download an archive for your platform from + [Releases](https://github.com/adeelahmad/Tether/releases) and put + `tether` on your `PATH`. + +## 2. Start + +```sh +tether serve --launch +``` + +This opens a dedicated Chrome window with a persistent profile. Log in to a +site (say, GitHub) once; the profile remembers it. + +!!! tip "Prefer your everyday Chrome?" + Skip `--launch`. On Chrome 144+, open `chrome://inspect/#remote-debugging`, + allow remote debugging, and run `tether serve`: it finds the browser + automatically. On any Chrome you can also start it with + `--remote-debugging-port=9222 --user-data-dir=` (Chrome requires a + non-default profile directory for the debugging port). + +## 3. Prove it + +In another terminal, fetch a logged-in page through the proxy: + +```sh +curl -s http://127.0.0.1:8787/tether/v1/ca.pem -o tether-ca.pem +curl -s -x http://127.0.0.1:8787 --cacert tether-ca.pem https://github.com/settings/profile \ + | grep -o '[^<]*' +``` + +You get your profile settings page, the one that redirects to a login screen +for everyone else. + +## Next steps + +
+ +- :material-web: **[HTTP proxy](proxy.md)** + + Headers, modes, the control API and console logs. + +- :material-robot-outline: **[MCP for agents](MCP.md)** + + Connect Claude, Cursor or your own agent. + +- :material-language-python: **[WebDriver](WEBDRIVER.md)** + + Point Selenium at Tether and run your scripts. + +- :material-monitor-eye: **[Remote UI](REMOTE.md)** + + Watch and drive any tab from your phone. + +- :material-shield-lock-outline: **[Policies](POLICIES.md)** + + One token per agent, each with its own domain rules. + +- :material-tune: **[Configuration](configuration.md)** + + Every flag, environment variable and exposure option. + +
diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 0000000..4aa3646 --- /dev/null +++ b/docs/index.md @@ -0,0 +1,125 @@ +--- +template: home.html +title: Your logged-in Chrome, from anywhere +hide: + - navigation + - toc +--- + +# Your real browser, four ways in + +Agents and scripts keep hitting the same wall: the page they need is behind a +login, an SSO dance, a captcha you already solved, or a cookie banner you +already dismissed, **in your browser**. Every tool that bridges into that +browser today asks you to install an extension. **Tether doesn't.** It attaches +to Chrome over the DevTools Protocol Chrome already speaks, and turns each tab +into something any client can use. + +
+ +- :material-web:{ .lg .middle } **HTTP/HTTPS proxy** + + --- + + `curl -x`, Python `requests`, another browser, anything. Each request is + replayed inside a real tab: real cookies, real storage, real JavaScript. + + [:octicons-arrow-right-24: Proxy guide](proxy.md) + +- :material-robot-outline:{ .lg .middle } **MCP server for agents** + + --- + + Claude, Cursor or your own agent get tools to read, click, type, + screenshot and fetch in your signed-in browser. + + [:octicons-arrow-right-24: Connect an agent](MCP.md) + +- :material-language-python:{ .lg .middle } **W3C WebDriver** + + --- + + Point Selenium at Tether and most scripts just work, against your actual + profile. Frames, alerts, windows, uploads and Actions included. + + [:octicons-arrow-right-24: WebDriver support](WEBDRIVER.md) + +- :material-monitor-eye:{ .lg .middle } **Live remote UI** + + --- + + Open `/remote/` from your phone, watch any tab live, and take over with + mouse, keyboard and clipboard, even the tab your agent is driving. + + [:octicons-arrow-right-24: Remote browser](REMOTE.md) + +- :material-shield-lock-outline:{ .lg .middle } **Safe by default** + + --- + + Loopback-only unless you set a token. Per-agent tokens with domain rules + enforced inside the browser. Built for a private Tailscale tailnet. + + [:octicons-arrow-right-24: Security model](security.md) + +- :material-package-variant-closed:{ .lg .middle } **One static binary** + + --- + + No extension, no cloud service, no local bridge. macOS, Linux, Windows + and a Docker image with headless Chromium. + + [:octicons-arrow-right-24: Install](getting-started.md) + +
+ +## Try it in 30 seconds + +```sh +go install github.com/adeelahmad/tether/cmd/tether@latest +tether serve --launch # log in to GitHub once in the window it opens + +curl -s http://127.0.0.1:8787/tether/v1/ca.pem -o tether-ca.pem +curl -s -x http://127.0.0.1:8787 --cacert tether-ca.pem https://github.com/settings/profile \ + | grep -o '[^<]*' +``` + +You get your profile settings page, the one that redirects to a login screen +for everyone else. [Full quickstart :octicons-arrow-right-24:](getting-started.md) + +## How it works + +```mermaid +flowchart LR + A["curl / requests"] -- "HTTP proxy" --> T + B["Selenium"] -- "WebDriver" --> T + D["AI agent"] -- "MCP" --> T + E["You, on your phone"] -- "Remote UI" --> T + T["tether serve
sessions · policy · auth"] -- "DevTools Protocol" --> C + subgraph C["Your Chrome (logged in)"] + T1["tab: github.com"] + T2["tab: mail.google.com"] + T3["tab: WebDriver session"] + end +``` + +**One session = one real tab.** Every face shares the same tab sessions, the +same policy checks and the same auth, so a proxy client, a Selenium script and +an agent can all work in the same tab. Read the +[architecture](ARCHITECTURE.md) for the details. + +## How Tether compares + +Tether's trade-off is that HTTPS proxying needs you to trust a local CA, and it +only drives Chromium-family browsers. + +| | **Tether** | Extension-based bridges | Cloud browsers | Fresh headless automation | +|---|---|---|---|---| +| Uses your real logged-in profile | ✅ | ✅ | ❌ | ❌ | +| Needs a browser extension | **No** | Yes | No | No | +| Plain HTTP proxy (curl, any language) | ✅ | ❌ | Rarely | ❌ | +| W3C WebDriver / Selenium | ✅ | ❌ | Often | ✅ | +| MCP for agents | ✅ | Often | Often | Via wrappers | +| Runs entirely on your machine | ✅ | ✅ | ❌ | ✅ | +| Watch & take over a tab live | ✅ | ❌ | ✅ | ❌ | +| Single static binary | ✅ | ❌ | n/a | ❌ | diff --git a/docs/proxy.md b/docs/proxy.md new file mode 100644 index 0000000..5b9c44d --- /dev/null +++ b/docs/proxy.md @@ -0,0 +1,70 @@ +# HTTP proxy & control API + +Configure Tether as a plain HTTP/HTTPS forward proxy and any client gets your +real browser: `curl -x`, Python `requests`, another browser, anything. Each +request is replayed inside a real tab, with real cookies, storage and +JavaScript, and you get the rendered page back. + +## How a request picks its tab + +**One session = one real tab.** Tether picks the tab for each request by: + +1. an explicit `X-Tether-Tab-ID` header, else +2. the `tether_tab` cookie Tether set on first contact, else +3. **one default tab per site** (registrable domain via the Public Suffix + List, so `shop.example.co.uk` and `www.example.co.uk` share a tab). + +On first contact Tether opens a fresh background tab and returns its ID as +both an `X-Tether-Tab-ID` header and a `Set-Cookie`. That cookie is never +forwarded to Chrome or the site. A WebDriver session ID *is* a tab ID, so the +proxy and WebDriver can drive the same tab. + +`GET`/`HEAD` navigate the tab and return the rendered DOM (or the original +bytes with `X-Tether-Mode: raw`). `POST` and friends run as a same-origin +`fetch()` inside the tab, so the browser attaches its own cookies. HTTPS works +by terminating `CONNECT` with a local CA you trust once (`tether ca` prints +its path). + +## Examples + +```sh +P="-x http://127.0.0.1:8787 --cacert tether-ca.pem" + +curl $P https://news.ycombinator.com/ # rendered page, your session +curl $P -H 'X-Tether-Wait: networkidle' https://app.example.com/dashboard +curl $P -H 'X-Tether-Mode: raw' https://example.com/data.json +curl $P -X POST -H 'Content-Type: application/json' -d '{"q":1}' https://api.example.com/search +curl $P -i https://github.com/ | grep -i x-tether-tab-id # which tab served it +``` + +## Request headers + +| Request header | Meaning | +|---|---| +| `X-Tether-Tab-ID` | Use this tab (any open tab ID works; unknown → `410 tab_gone`) | +| `X-Tether-Mode` | `auto` (default), `rendered`, `raw`, `fetch` | +| `X-Tether-Wait` | `load` (default), `domcontentloaded`, `networkidle`, `none` | +| `X-Tether-Timeout` | Per-request timeout, e.g. `30s` | + +Responses carry `X-Tether-Tab-ID`, `X-Tether-Final-URL` (after redirects) +and, on errors, a stable `X-Tether-Error` code (`tab_gone`, `forbidden`, +`navigation_failed`, `timeout`, …). + +## Control API + +```sh +curl -s http://127.0.0.1:8787/tether/v1/tabs # list sessions +curl -s -X POST http://127.0.0.1:8787/tether/v1/tabs -d '{"url":"https://example.com"}' +curl -s -X POST http://127.0.0.1:8787/tether/v1/tabs/$TAB/eval \ + -d '{"expression":"document.title"}' # Runtime.evaluate +curl -s "http://127.0.0.1:8787/tether/v1/tabs/$TAB/logs?level=warning" # console + browser logs +curl -s -X DELETE http://127.0.0.1:8787/tether/v1/tabs/$TAB # close +``` + +## Console and browser logs + +Every tab Tether drives keeps its recent `console.*` output, uncaught +exceptions and browser log entries (failed requests, security warnings). +`GET …/logs` returns `{"entries": [...], "next": N}`; pass `?after=N` to read +only what is new, and `?level=debug|info|warning|error` to filter. The same +buffer backs WebDriver's `driver.get_log("browser")`. diff --git a/docs/security.md b/docs/security.md new file mode 100644 index 0000000..157aee4 --- /dev/null +++ b/docs/security.md @@ -0,0 +1,2 @@ + +This page is published from [SECURITY.md](../SECURITY.md) on the docs site. diff --git a/mkdocs.yml b/mkdocs.yml new file mode 100644 index 0000000..e6684a1 --- /dev/null +++ b/mkdocs.yml @@ -0,0 +1,95 @@ +site_name: Tether +site_description: Your logged-in Chrome, as a proxy, WebDriver and MCP server, from anywhere. No extension. +site_url: https://adeelahmad.github.io/Tether/ +repo_url: https://github.com/adeelahmad/Tether +repo_name: adeelahmad/Tether +edit_uri: edit/main/docs/ +copyright: GPL-3.0-or-later © Adeel Ahmad + +docs_dir: docs +site_dir: site +strict: true + +theme: + name: material + custom_dir: website/overrides + logo: assets/logo.svg + favicon: assets/logo.svg + icon: + repo: fontawesome/brands/github + palette: + - media: "(prefers-color-scheme: light)" + scheme: default + primary: indigo + accent: teal + toggle: + icon: material/weather-night + name: Switch to dark mode + - media: "(prefers-color-scheme: dark)" + scheme: slate + primary: indigo + accent: teal + toggle: + icon: material/weather-sunny + name: Switch to light mode + features: + - navigation.tabs + - navigation.sections + - navigation.top + - navigation.footer + - navigation.indexes + - toc.follow + - search.suggest + - search.highlight + - content.code.copy + - content.action.edit + +extra_css: + - assets/extra.css + +hooks: + - website/hooks.py + +markdown_extensions: + - admonition + - attr_list + - md_in_html + - tables + - toc: + permalink: true + - pymdownx.details + - pymdownx.highlight: + anchor_linenums: true + - pymdownx.inlinehilite + - pymdownx.tabbed: + alternate_style: true + - pymdownx.emoji: + emoji_index: !!python/name:material.extensions.emoji.twemoji + emoji_generator: !!python/name:material.extensions.emoji.to_svg + - pymdownx.superfences: + custom_fences: + - name: mermaid + class: mermaid + format: !!python/name:pymdownx.superfences.fence_code_format + +nav: + - Home: index.md + - Getting started: getting-started.md + - Guides: + - HTTP proxy & control API: proxy.md + - MCP for AI agents: MCP.md + - WebDriver / Selenium: WEBDRIVER.md + - Remote browser UI: REMOTE.md + - Policies: POLICIES.md + - Reference: + - Configuration: configuration.md + - Architecture: ARCHITECTURE.md + - Security: security.md + - Project: + - Contributing: contributing.md + - Changelog: changelog.md + +extra: + social: + - icon: fontawesome/brands/github + link: https://github.com/adeelahmad/Tether diff --git a/website/hooks.py b/website/hooks.py new file mode 100644 index 0000000..386de63 --- /dev/null +++ b/website/hooks.py @@ -0,0 +1,45 @@ +"""MkDocs hooks for the Tether docs site. + +The Markdown in docs/ and the root community files are written to read well on +GitHub. This hook lets the site reuse them unchanged: it pulls root files into +pages that ask for them and rewrites repo-relative links to site pages. +""" + +import os +import re + +REPO = "https://github.com/adeelahmad/Tether/blob/main/" +ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) + +INCLUDE = re.compile(r"") + +# Repo-relative link targets, as written in the root files or in docs/, +# mapped to where they live on the site. +LINKS = { + "../SECURITY.md": "security.md", + "SECURITY.md": "security.md", + "CONTRIBUTING.md": "contributing.md", + "CHANGELOG.md": "changelog.md", + "CODE_OF_CONDUCT.md": REPO + "CODE_OF_CONDUCT.md", + "LICENSE": REPO + "LICENSE", +} + +LINK = re.compile(r"\]\(([^)#\s]+)(#[^)\s]*)?\)") + + +def _rewrite(match): + target, anchor = match.group(1), match.group(2) or "" + if target.startswith("docs/"): + target = target[len("docs/"):] + target = LINKS.get(target, target) + return "](" + target + anchor + ")" + + +def on_page_markdown(markdown, page, config, files): + # A page whose first line is an include marker is replaced by that file; + # the rest of the page is a pointer for readers browsing docs/ on GitHub. + include = INCLUDE.match(markdown) + if include: + with open(os.path.join(ROOT, include.group(1)), encoding="utf-8") as f: + markdown = f.read() + return LINK.sub(_rewrite, markdown) diff --git a/website/overrides/home.html b/website/overrides/home.html new file mode 100644 index 0000000..84f507d --- /dev/null +++ b/website/overrides/home.html @@ -0,0 +1,30 @@ +{% extends "main.html" %} + +{% block tabs %} + {{ super() }} +
+
+
+

Open source · GPL-3.0 · No extension

+

Your logged-in Chrome, as a proxy, from anywhere.

+

+ Give your AI agent, your script or your other laptop your real, + signed-in browser. One binary that speaks HTTP proxy, WebDriver and + MCP, and drives Chrome over the DevTools Protocol. +

+ +
go install github.com/adeelahmad/tether/cmd/tether@latest
+
+
+ Tether driving a real Chrome tab: curl through the proxy returns a logged-in page +
+
+
+{% endblock %} + +{% block content %} + {{ page.content }} +{% endblock %} diff --git a/website/requirements.txt b/website/requirements.txt new file mode 100644 index 0000000..0c525b8 --- /dev/null +++ b/website/requirements.txt @@ -0,0 +1,2 @@ +mkdocs==1.6.1 +mkdocs-material==9.7.7