{"id":17919364,"url":"https://github.com/zombiezen/tailscale-lb","last_synced_at":"2025-03-24T00:31:41.929Z","repository":{"id":59873313,"uuid":"538208364","full_name":"zombiezen/tailscale-lb","owner":"zombiezen","description":"Basic load-balancer for forwarding Tailscale TCP traffic","archived":false,"fork":false,"pushed_at":"2024-03-25T16:08:45.000Z","size":111,"stargazers_count":55,"open_issues_count":2,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-05-01T19:45:00.809Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zombiezen.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null},"funding":{"github":"zombiezen"}},"created_at":"2022-09-18T18:48:49.000Z","updated_at":"2024-04-28T23:19:01.000Z","dependencies_parsed_at":"2024-03-25T17:40:04.628Z","dependency_job_id":"3808f386-8e74-4b75-86fa-69ef379e8c30","html_url":"https://github.com/zombiezen/tailscale-lb","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zombiezen%2Ftailscale-lb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zombiezen%2Ftailscale-lb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zombiezen%2Ftailscale-lb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zombiezen%2Ftailscale-lb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zombiezen","download_url":"https://codeload.github.com/zombiezen/tailscale-lb/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221925377,"owners_count":16902687,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-10-28T20:16:20.066Z","updated_at":"2024-10-28T20:16:20.671Z","avatar_url":"https://github.com/zombiezen.png","language":"Go","funding_links":["https://github.com/sponsors/zombiezen"],"categories":[],"sub_categories":[],"readme":"# Tailscale Load Balancer\n\nThis project is a basic load-balancer for forwarding [Tailscale][] TCP traffic.\nThis is useful for setting up [virtual IPs for services on Tailscale][].\n\n[Tailscale]: https://tailscale.com/\n[virtual IPs for services on Tailscale]: https://github.com/tailscale/tailscale/issues/465\n\n## Status\n\n**This project is largely a proof-of-concept/prototype.**\nHaving [virtual IPs for services on Tailscale][] has been discussed upstream\nand may land eventually,\nbut I had an immediate need for this on my own Tailnet.\n\nI'm sharing the code for this in the interest of\nsharing the results of my experimentation,\nbut I don't have a ton of time to spare for this particular project.\nBugfixes welcome, but don't expect huge feature development or production-readiness.\nIf you find this program useful, consider [sponsoring me][]!\n\n[sponsoring me]: https://github.com/sponsors/zombiezen\n\n## Installation\n\ntailscale-lb is distributed as a [Docker][] image:\n\n```shell\ndocker pull ghcr.io/zombiezen/tailscale-lb\n```\n\nYou can check out the available tags on [GitHub Container Registry][].\n\nAlternatively, if you're using [Nix][], you can install the binary\nby checking out the repository and running the following:\n\n```shell\nnix-env --file . --install\n```\n\nOr if you're using Nix flakes:\n\n```shell\nnix profile install github:zombiezen/tailscale-lb\n```\n\nIf you are deploying to Kubernetes, example manifests are provided in the `deploy` folder that can also be built with `kustomize`. Make sure to update the value of `TAILSCALE_AUTH_KEY` in secret.yaml to be an authentication key that you have generated from your [Tailscale Console][].\n\n```shell\nkubectl apply -k deploy\n```\n\n[Tailscale Console]: https://login.tailscale.com/admin/settings/keys\n[Docker]: https://www.docker.com/\n[GitHub Container Registry]: https://github.com/zombiezen/tailscale-lb/pkgs/container/tailscale-lb\n[Nix]: https://nixos.org/\n\n## Usage\n\nCreate a configuration file:\n\n```ini\n# This is the hostname that will show up in the Tailscale console\n# and be used by MagicDNS.\nhostname = example\n# (Optional) Use an authentication key from https://login.tailscale.com/admin/settings/keys\n# If you don't provide an auth key,\n# tailscale-lb will log a URL to visit in your browser to authenticate it.\nauth-key = tskey-foo\n# (Optional) If given, the load balancer will be non-ephemeral\n# and persist state in the given directory.\n# If the path is relative, it resolved relative to\n# the directory the configuration file is located in.\nstate-directory = /var/lib/tailscale-lb\n\n# (Optional) Specify the coordination server URL\n# control-url = https://headscale.example\n\n# For each port you want to listen on,\n# add a section like this:\n[tcp 22]\n# ... and then add one or more backends.\n# tailscale-lb will round-robin TCP connections\n# among the various IP addresses it discovers.\n# A backend can be one of:\n\n# a) An IPv4 address. If the port is omitted, then the section's port is used.\nbackend = 127.0.0.1:22\n\n# b) An IPv6 address. If the port is omitted, then the section's port is used.\nbackend = [2001:db8::1234]:22\n\n# c) A DNS name. If the port is omitted, then the section's port is used.\nbackend = example.com:22\n\n# d) SRV records. The port is obtained from the SRV record.\n# Priority and weight are ignored.\nbackend = srv _ssh._tcp.example.com\n\n# For each HTTP port you want to listen on,\n# add a section like this:\n[http 80]\n\n# Backends are specified the same as above.\nbackend = 127.0.0.1:80\n\n# Add the following request headers (default true):\n# Tailscale-User: The connecting user's email address\n# Tailscale-Name: The connecting user's display name\n# Tailscale-Profile-Picture: A URL to the connecting user's profile picture\nwhois = true\n# Use the MagicDNS HTTPS Certificates described in https://tailscale.com/kb/1153/enabling-https/\n# (default false)\ntls = false\n# Whether to use the request-supplied X-Forwarded-For (default false).\ntrust-x-forwarded-for = false\n```\n\nThen run tailscale-lb with the configuration file as its argument.\nIf you're using Docker:\n\n```shell\ndocker run --rm \\\n  --volume \"$(pwd)/foo.ini\":/etc/tailscale-lb.ini \\\n  ghcr.io/zombiezen/tailscale-lb /etc/tailscale-lb.ini\n```\n\nOr if you're using a standalone binary:\n\n```shell\ntailscale-lb foo.ini\n```\n\nYou can then see the load balancer's IP address in the logs\nor in the Tailscale admin console.\n\n## License\n\n[Apache 2.0](LICENSE)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzombiezen%2Ftailscale-lb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzombiezen%2Ftailscale-lb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzombiezen%2Ftailscale-lb/lists"}