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.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg5MDY0NjAsIm5iZiI6MTczODkwNjE2MCwicGF0aCI6Ii8zNzI4MzQzNy8zMTk4NDU5MTItYTJlYWU0MTEtM2M2NS00YjRhLThjNGQtMDVmODA4OGM4OTgxLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA3VDA1MjkyMFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTBiYjE0NjFmNjAwNDU2ZTgyMWM4MWFhODI3N2JhZDg1NDVjYzBlYTFkNGU1NjZkMzNlMzJhYmRlOGQwMGUyNTUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.n85YJSMwAfu8A98P7Pt7LxozYSvR-Va-IwDkSlIphn0)
- 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