{"id":20215999,"url":"https://github.com/pkarpovich/vpn-exit-node","last_synced_at":"2025-09-22T01:31:38.798Z","repository":{"id":164978695,"uuid":"550721585","full_name":"pkarpovich/vpn-exit-node","owner":"pkarpovich","description":"Tailscale Exit Node \u0026 OpenVPN Controller: Automate and manage your traffic exit node with Tailscale integration and easily toggle OpenVPN for enhanced privacy and security","archived":false,"fork":false,"pushed_at":"2023-06-12T16:10:46.000Z","size":370,"stargazers_count":4,"open_issues_count":6,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-11-14T06:31:06.226Z","etag":null,"topics":["appletv","exit-node","openvpn","tailscale","vpn"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/pkarpovich.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"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,"publiccode":null,"codemeta":null}},"created_at":"2022-10-13T08:10:32.000Z","updated_at":"2024-08-30T21:38:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"42ba3836-5ac8-4686-ba6b-9ffe7d35f276","html_url":"https://github.com/pkarpovich/vpn-exit-node","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pkarpovich%2Fvpn-exit-node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pkarpovich%2Fvpn-exit-node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pkarpovich%2Fvpn-exit-node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pkarpovich%2Fvpn-exit-node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pkarpovich","download_url":"https://codeload.github.com/pkarpovich/vpn-exit-node/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233814465,"owners_count":18734531,"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":["appletv","exit-node","openvpn","tailscale","vpn"],"created_at":"2024-11-14T06:25:49.582Z","updated_at":"2025-09-22T01:31:33.395Z","avatar_url":"https://github.com/pkarpovich.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# VPN Exit Node\n\nAutomated traffic exit node on the base of tailscale with the ability to turn on and control VPN through OpenVPN.\n\n## Pre-requirements\nIf you want to forward traffic through a host machine, you need to apply the following iptables rules on the host machine:\n```bash\n# For default traffic\nsudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE  \nsudo iptables -A FORWARD -i eth0 -o wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT\nsudo iptables -A FORWARD -i wlan0 -o eth0 -j ACCEPT\n\n# For VPN traffic\nsudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE  \nsudo iptables -A FORWARD -i eth0 -o wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT\nsudo iptables -A FORWARD -i wlan0 -o eth0 -j ACCEPT\n```\n\nIf you want to save these rules after reboot, you can use the following commands:\n```bash\nsudo netfilter-persistent save\n```\n\nIf you want to clear all iptables rules, you can use the following commands:\n```bash\nsudo netfilter-persistent flush\nsudo netfilter-persistent save\n```\n\n## Example of usage\n\n### Docker Compose\n```yaml\nservices:\n  vpn-exit-node:\n    container_name: ${TAILSCALE_HOSTNAME}\n    hostname: ${TAILSCALE_HOSTNAME}\n    build:\n      dockerfile: ./Dockerfile\n    environment:\n      - TAILSCALE_AUTH_KEY=${TAILSCALE_AUTH_KEY}\n      - TAILSCALE_HOSTNAME=${TAILSCALE_HOSTNAME}\n      - HTTP_PORT=${HTTP_PORT}\n      - VPN_FILES_PATH=${VPN_FILES_PATH}\n    restart: unless-stopped\n    volumes:\n      - \"/dev/net/tun:/dev/net/tun\"\n      - \"./vpn-files:/usr/app/vpn-files\"\n    ports:\n      - ${HTTP_PORT}:${HTTP_PORT}\n    privileged: true\n    network_mode: \"host\"\n    cap_add:\n      - NET_ADMIN\n      - SYS_ADMIN\n```\n\n### HTTP API\n\n```bash\n#Get all available VPN files:\ncurl -X GET http://localhost:8080/vpn/files\n\n# Start OpenVPN client with the following file:\ncurl -X POST http://localhost:8080/vpn/start -d '{\"vpnFile\": \"R4.ovpn\"}'\n\n# Stop OpenVPN client\ncurl -X POST http://localhost:8080/vpn/stop\n```\n\n## Environment variables\n- `TAILSCALE_AUTH_KEY` - tailscale auth key\n- `TAILSCALE_HOSTNAME` - name of exit node\n- `HTTP_PORT` - port for web interface for control VPN\n- `VPN_FILES_PATH` - path to directory with VPN files inside container\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpkarpovich%2Fvpn-exit-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpkarpovich%2Fvpn-exit-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpkarpovich%2Fvpn-exit-node/lists"}