Code Monkey home page Code Monkey logo

tailscale-router's Introduction

tailscale-router

How to use

  1. Clone this app locally
  2. Create an app flyctl apps create my-unique-tailscale-router-app-name
  3. Get a secret from the tailscale admin console: tailscale admin console > settings > keys > generate auth key (you probably want to choose the reusable and ephemeral options)
  4. Set the token you get as a secret flyctl secrets set TAILSCALE_AUTHKEY=thekeyyougot -a my-unique-tailscale-router-app-name
  5. Build this repo docker build -t registry.fly.io/my-unique-tailscale-router-app-name:latest .
  6. Push the image docker push registry.fly.io/my-unique-tailscale-router-app-name:latest
  7. Deploy a machine flyctl m run registry.fly.io/my-unique-tailscale-router-app-name:latest -a my-unique-tailscale-router-app-name --cpus 1 --memory 256
  8. Follow steps 3 and 5 of https://tailscale.com/kb/1019/subnets/ to enable subnets for the machine that got automatically configured
  9. Enjoy

Test it Out

You can test if it's working by finding the IP address of your new Fly.io app and using dig:

# Get the IP address of your app:
flyctl m list -a my-unique-tailscale-router-app-name

# Use dig to test DNS queries the DNS proxy setup in this repository
dig @<your-app-ip-address-here> aaaa my-unique-tailscale-router-app-name.internal

DNS Setup

You can enable split DNS in your Tailscale settings to automatically resolve *.internal addresses through the DNS proxy setup in your new Fly.io app.

Tailscale documentation for that is found here.

  1. Add a nameserver
  2. Use the IP address of your new Fly.io app
  3. Restrict to search domains, and use search domain internal

Then addresses should resolve! Maybe use curl to make an HTTP request to one of your apps. Be sure to use the internal_port of your application:

curl http://some-fly-app.internal:8080

tailscale-router's People

Contributors

dalperin avatar fideloper avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.