{"id":22963652,"url":"https://github.com/half0wl/railtail","last_synced_at":"2025-07-13T17:40:12.977Z","repository":{"id":267499094,"uuid":"901429516","full_name":"half0wl/railtail","owner":"half0wl","description":"Connect to Tailscale nodes from Railway.","archived":false,"fork":false,"pushed_at":"2025-06-30T19:40:45.000Z","size":35,"stargazers_count":7,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-07T10:14:59.914Z","etag":null,"topics":["networking","proxy","railway","tailscale"],"latest_commit_sha":null,"homepage":"https://railway.com/template/railtail?referralCode=EPXG5z","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/half0wl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-12-10T16:36:17.000Z","updated_at":"2025-06-30T19:40:50.000Z","dependencies_parsed_at":"2025-04-22T00:01:08.070Z","dependency_job_id":null,"html_url":"https://github.com/half0wl/railtail","commit_stats":null,"previous_names":["half0wl/railtail"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/half0wl/railtail","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/half0wl%2Frailtail","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/half0wl%2Frailtail/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/half0wl%2Frailtail/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/half0wl%2Frailtail/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/half0wl","download_url":"https://codeload.github.com/half0wl/railtail/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/half0wl%2Frailtail/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265180557,"owners_count":23723710,"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":["networking","proxy","railway","tailscale"],"created_at":"2024-12-14T19:37:09.503Z","updated_at":"2025-07-13T17:40:12.966Z","avatar_url":"https://github.com/half0wl.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# \u003cimg align=\"left\" width=\"40\" height=\"40\" src=\"https://res.cloudinary.com/railway/image/upload/v1734036971/railtail_avdaue.png\" alt=\"railtail logo\"\u003e railtail\n\nrailtail is a HTTP/TCP proxy for Railway workloads connecting to Tailscale\nnodes. It listens on a local address and forwards traffic it receives on\nthe local address to a target Tailscale node address.\n\n📣 This is a workaround until there are [full VMs available in Railway](https://help.railway.com/feedback/full-unix-v-ms-44eef294). Please upvote the thread if you want this feature!\n\n## Usage\n\n1. [Install and setup Tailscale](https://tailscale.com/kb/1017/install) on the\n   machine you want to connect to. If you're using Tailscale as a subnet\n   router, ensure you advertise the correct routes and approve the subnets\n   in the Tailscale admin console.\n\n2. Deploy this template to Railway:\n\n   [![Deploy on Railway](https://railway.com/button.svg)](https://railway.com/template/railtail?referralCode=EPXG5z)\n\n3. In services that need to connect to the Tailscale node, connect to your\n   railtail service using the `RAILWAY_PRIVATE_DOMAIN` and `LISTEN_PORT`\n   variables. For example:\n\n   ```sh\n   MY_PRIVATE_TAILSCALE_SERVICE=\"http://{{railtail.RAILWAY_PRIVATE_DOMAIN}}:${{railtail.LISTEN_PORT}}\"\n   ```\n\nLook at the [Examples](#examples) section for provider-specific examples.\n\n## Configuration\n\nrailtail will forward TCP connections if you provide a `TARGET_ADDR` without\na `http://` or `https://` scheme. If you want railtail to act as an HTTP\nproxy, ensure you have a `http://` or `https://` in your `TARGET_ADDR`.\n\n| Environment Variable | CLI Argument       | Description                                                                                                                                                   |\n| -------------------- | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `TARGET_ADDR`        | `-target-addr`     | Required. Address of the Tailscale node to send traffic to.                                                                                                   |\n| `LISTEN_PORT`        | `-listen-port`     | Required. Port to listen on.                                                                                                                                  |\n| `TS_HOSTNAME`        | `-ts-hostname`     | Required. Hostname to use for Tailscale.                                                                                                                      |\n| `TS_AUTH_KEY`        | N/A                | Required. Tailscale auth key. Must be set in environment.                                                                                                     |\n| `TS_LOGIN_SERVER`    | `-ts-login-server` | Optional. Base URL of the control server. If you are using Headscale for your control server, use your Headscale instance's url. Defaults to using Tailscale. |\n| `TS_STATEDIR_PATH`   | `-ts-state-dir`    | Optional. Tailscale state dir. Defaults to `/tmp/railtail`.                                                                                                   |\n\n_CLI arguments will take precedence over environment variables._\n\n## About\n\nThis was created to work around userspace networking restrictions. Dialing a\nTailscale node from a container requires you to do it over Tailscale's\nlocal SOCKS5/HTTP proxy, which is not always ergonomical especially if\nyou're connecting to databases or other services with minimal support\nfor SOCKS5 (e.g. db connections from an application).\n\nrailtail is designed to be run as a separate service in Railway that you\nconnect to over Railway's Private Network.\n\n\u003e ⚠️ **Warning**: Do not expose this service on Railway publicly!\n\u003e\n\u003e ![Networking settings warning](https://res.cloudinary.com/railway/image/upload/v1733851092/cs-2024-12-11-01.12_f1z1xy.png)\n\u003e\n\u003e This service is intended to be used via Railway's Private Network only.\n\n## Examples\n\n### Connecting to an AWS RDS instance\n\n1. Configure Tailscale on an EC2 instance in the same VPC as your RDS instance:\n\n   ```sh\n   # In EC2\n   curl -fsSL https://tailscale.com/install.sh | sh\n\n   # Enable IP forwarding\n   echo 'net.ipv4.ip_forward = 1' | sudo tee -a /etc/sysctl.d/99-tailscale.conf\n   echo 'net.ipv6.conf.all.forwarding = 1' | sudo tee -a /etc/sysctl.d/99-tailscale.conf\n   sudo sysctl -p /etc/sysctl.d/99-tailscale.conf\n\n   # Start Tailscale. Follow instructions to authenticate the node if needed,\n   # and make sure you approve the subnet routes in the Tailscale admin console\n   sudo tailscale up --reset --advertise-routes=172.31.0.0/16\n   ```\n\n2. Deploy railtail into your pre-existing Railway project:\n\n   [![Deploy on Railway](https://railway.com/button.svg)](https://railway.com/template/railtail?referralCode=EPXG5z)\n\n3. Use your new railtail service's Private Domain to connect to your RDS instance:\n\n   ```sh\n   DATABASE_URL=\"postgresql://username:password@${{railtail.RAILWAY_PRIVATE_DOMAIN}}:${{railtail.LISTEN_PORT}}/dbname\"\n   ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhalf0wl%2Frailtail","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhalf0wl%2Frailtail","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhalf0wl%2Frailtail/lists"}