Sync your Tailscale devices to Cloudflare DNS.
The functionality is based on this documentation on Tailscale: https://tailscale.com/kb/1054/dns?q=subdomain#using-a-public-dns-subdomain
It is basically taking the Tailscale IP addresses and put them under a subdomain A record on the DNS provider, which is Cloudflare in our case.
![image](https://private-user-images.githubusercontent.com/37283437/319845912-a2eae411-3c65-4b4a-8c4d-05f8088c8981.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE2MTIzMjcsIm5iZiI6MTcyMTYxMjAyNywicGF0aCI6Ii8zNzI4MzQzNy8zMTk4NDU5MTItYTJlYWU0MTEtM2M2NS00YjRhLThjNGQtMDVmODA4OGM4OTgxLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MjIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzIyVDAxMzM0N1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTdmOTlmZTY4MDMyZjIwNTE2NjUxOWI0ZjdkYTIzNTBmMmQ2NjZjNWY3MjEwMDQ3Njg2NDhkYTBkYWRjOTg0ZWUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.8w8uyrYlj_D30xqgptl5gtTyEUhqSVfbfyy7prNcMu8)
- Cloudflare API key: https://developers.cloudflare.com/fundamentals/api/get-started/create-token/
- Create with permission to modify zones
- Tailscale API key: https://login.tailscale.com/login?next_url=%2Fadmin%%2Fsettings%2Fkeys
https://developers.cloudflare.com/fundamentals/setup/find-account-and-zone-ids/
cp .env.example .env
Add the environment variables gathered in the previous steps.
- Prerequisites:
go
>= v1.21make
- Clone this repository
git clone https://github.com/aaanh/tailflare
- Go would hopefully install the needed dependencies on first run
- Run
make run