{"id":28927651,"url":"https://github.com/jtdowney/tsbridge","last_synced_at":"2026-03-09T04:13:06.454Z","repository":{"id":300473849,"uuid":"1006268784","full_name":"jtdowney/tsbridge","owner":"jtdowney","description":"A lightweight proxy manager built on Tailscale's tsnet library that enables multiple HTTPS services on a Tailnet","archived":false,"fork":false,"pushed_at":"2026-01-19T04:52:42.000Z","size":1526,"stargazers_count":246,"open_issues_count":11,"forks_count":8,"subscribers_count":4,"default_branch":"main","last_synced_at":"2026-01-19T12:48:55.368Z","etag":null,"topics":["homelab","networking","proxy","tailscale"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jtdowney.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":"THREAT_MODEL.md","audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2025-06-21T21:48:44.000Z","updated_at":"2026-01-19T04:52:44.000Z","dependencies_parsed_at":"2025-06-21T23:00:47.724Z","dependency_job_id":"4a3e7e55-b8f0-4436-ad50-f6792ff554af","html_url":"https://github.com/jtdowney/tsbridge","commit_stats":null,"previous_names":["jtdowney/tsbridge"],"tags_count":25,"template":false,"template_full_name":null,"purl":"pkg:github/jtdowney/tsbridge","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jtdowney%2Ftsbridge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jtdowney%2Ftsbridge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jtdowney%2Ftsbridge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jtdowney%2Ftsbridge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jtdowney","download_url":"https://codeload.github.com/jtdowney/tsbridge/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jtdowney%2Ftsbridge/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28580267,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-19T18:29:59.827Z","status":"ssl_error","status_checked_at":"2026-01-19T18:29:40.878Z","response_time":67,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["homelab","networking","proxy","tailscale"],"created_at":"2025-06-22T14:00:30.143Z","updated_at":"2026-01-21T13:25:32.881Z","avatar_url":"https://github.com/jtdowney.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tsbridge\n\n[![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/jtdowney/tsbridge)](https://github.com/jtdowney/tsbridge/releases)\n[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/jtdowney/tsbridge/ci.yml?branch=main)](https://github.com/jtdowney/tsbridge/actions)\n[![Go Report Card](https://goreportcard.com/badge/github.com/jtdowney/tsbridge)](https://goreportcard.com/report/github.com/jtdowney/tsbridge)\n[![License](https://img.shields.io/github/license/jtdowney/tsbridge)](https://github.com/jtdowney/tsbridge/blob/main/LICENSE)\n\n\u003cimg src=\"assets/logo.png\" alt=\"tsbridge logo\" width=\"320\" /\u003e\n\ntsbridge acts as a tsnet-powered reverse proxy, letting you expose multiple backend services on your Tailnet from a single process. It's designed for homelabs and development environments where you want the magic of Tailscale without the hassle of running a separate sidecar for every service.\n\nInspired by Traefik, tsbridge can be configured with a simple TOML file or by watching Docker for container labels.\n\n## Why?\n\nI got tired of spinning up a new [tsnsrv](https://github.com/boinkor-net/tsnsrv) instance for every service I wanted to expose on my Tailnet. Each one needs its own systemd service and configuration. With tsbridge, you configure once and add services as needed - either through a config file or by just adding labels to your Docker containers.\n\n## Install\n\nGrab a binary from [releases](https://github.com/jtdowney/tsbridge/releases) or:\n\n```bash\ngo install github.com/jtdowney/tsbridge/cmd/tsbridge@latest\n```\n\n## Quick start\n\n1. Get OAuth credentials from \u003chttps://login.tailscale.com/admin/settings/oauth\u003e\n2. Create `tsbridge.toml`:\n\n```toml\n[tailscale]\noauth_client_id_env = \"TS_OAUTH_CLIENT_ID\"\noauth_client_secret_env = \"TS_OAUTH_CLIENT_SECRET\"\n\n[[services]]\nname = \"api\"\nbackend_addr = \"127.0.0.1:8080\"\n\n[[services]]\nname = \"web\"\nbackend_addr = \"unix:///var/run/web.sock\"\n```\n\n3. Run it:\n\n```bash\nexport TS_OAUTH_CLIENT_ID=your-id\nexport TS_OAUTH_CLIENT_SECRET=your-secret\ntsbridge -config tsbridge.toml\n```\n\ntsbridge will now be available on your tailnet. Thanks to MagicDNS, you can reach your services at `https://api.\u003ctailnet\u003e.ts.net` and `https://web.\u003ctailnet\u003e.ts.net`.\n\n## Configuration\n\ntsbridge is configured via `tsbridge.toml`. See [docs/quickstart.md](docs/quickstart.md) for getting started quickly, or [docs/configuration-reference.md](docs/configuration-reference.md) for all options.\n\nHere are a few common settings:\n\n- `whois_enabled`: Set to `true` to add `Tailscale-User-*` identity headers to upstream requests\n- `write_timeout`: Defaults to `30s`. Set to `\"0s\"` to support long-running connections like Server-Sent Events (SSE)\n- `metrics_addr`: Expose a Prometheus metrics endpoint (e.g., `\":9090\"`) - see [docs/metrics.md](docs/metrics.md) for available metrics (secure this endpoint in production)\n\n### Security\n\n\u003e **Security Note**: tsbridge is intended for homelabs and development environments. It hasn't been hardened or battle-tested for production workloads. See [THREAT_MODEL.md](THREAT_MODEL.md) for details.\n\nFor enhanced security using tag ownership, see [Tag Ownership and OAuth Security](docs/configuration-reference.md#tag-ownership-and-oauth-security).\n\n## Docker\n\n### Static config\n\n```bash\ndocker run -v /path/to/config:/config \\\n  -e TS_OAUTH_CLIENT_ID=... \\\n  -e TS_OAUTH_CLIENT_SECRET=... \\\n  ghcr.io/jtdowney/tsbridge:latest -config /config/tsbridge.toml\n```\n\n### Dynamic with labels (like Traefik)\n\ntsbridge can watch Docker and automatically expose containers based on their labels:\n\n```yaml\n# docker-compose.yml\nservices:\n  tsbridge:\n    image: ghcr.io/jtdowney/tsbridge:latest\n    command: [\"--provider\", \"docker\"]\n    volumes:\n      - /var/run/docker.sock:/var/run/docker.sock # Required for label discovery\n      - tsbridge-state:/var/lib/tsbridge\n    environment:\n      - TS_OAUTH_CLIENT_ID=${TS_OAUTH_CLIENT_ID}\n      - TS_OAUTH_CLIENT_SECRET=${TS_OAUTH_CLIENT_SECRET}\n    labels:\n      - \"tsbridge.tailscale.oauth_client_id_env=TS_OAUTH_CLIENT_ID\"\n      - \"tsbridge.tailscale.oauth_client_secret_env=TS_OAUTH_CLIENT_SECRET\"\n      - \"tsbridge.tailscale.state_dir=/var/lib/tsbridge\"\n      - \"tsbridge.tailscale.default_tags=tag:server\" # Must match or be owned by your OAuth client's tag\n\n  whoami:\n    image: traefik/whoami\n    labels:\n      - \"tsbridge.enabled=true\"\n      - \"tsbridge.service.name=whoami\"\n      - \"tsbridge.service.port=80\"\n\nvolumes:\n  tsbridge-state:\n```\n\nSee [docs/docker-labels.md](docs/docker-labels.md) for the full label reference.\n\n\u003e **Note**: The `default_tags` must match or be owned by your OAuth client's tag. Individual services can override this with their own `tags` label. See [Tag Ownership and OAuth Security](docs/configuration-reference.md#tag-ownership-and-oauth-security) for setup details.\n\n## Headscale\n\nWorks with [Headscale](https://headscale.net/) but requires auth keys instead of OAuth and TLS must be disabled (until [headscale issue #2137](https://github.com/juanfont/headscale/issues/2137) gets implemented):\n\n```toml\n[tailscale]\nauth_key_env = \"TS_AUTH_KEY\"\ncontrol_url = \"https://headscale.example.com\"\n\n[[services]]\nname = \"api\"\nbackend_addr = \"127.0.0.1:8080\"\ntls_mode = \"off\"  # Required for Headscale\n```\n\nSee [example/headscale/](example/headscale/) for a complete setup.\n\n## Development\n\n```bash\nmake build  # Build binary\nmake test   # Run tests\nmake lint   # Run linters\n```\n\n## Monitoring\n\nWhen `metrics_addr` is configured, tsbridge exposes Prometheus metrics at `http://\u003cmetrics_addr\u003e`:\n\n- Request counts and latencies\n- Error rates\n- Active connections\n- Service lifecycle events\n\n## Architecture\n\nEach service runs its own tsnet instance with isolated state, enabling independent lifecycle management and per-service configuration.\n\n## Prior Art\n\n- [tsnsrv](https://github.com/boinkor-net/tsnsrv) - Inspiration but single service focused\n- [tsdproxy](https://github.com/almeidapaulopt/tsdproxy) - Docker-specific\n\n## License\n\nMIT License - see [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjtdowney%2Ftsbridge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjtdowney%2Ftsbridge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjtdowney%2Ftsbridge/lists"}