Tailserve
Small utility to generate a Tailscale serve config from a yaml file supporting TCP ports and http to https forwarding.
This is very small and probably only useful to me, but basically, it turns this tailserve.yml file:
tailnet: example.ts.net
output: serve.json
services:
git:
https: http://forgejo-forgejo-1:3000
ports:
- 22:forgejo-forgejo-1
Into this serve.json file:
{
"Services": {
"svc:git": {
"TCP": {
"22": { "TCPForward": "forgejo-forgejo-1:22" },
"443": { "HTTPS": true }
},
"Web": {
"git.example.ts.net:443": {
"Handlers": {
"/": { "Proxy": "http://forgejo-forgejo-1:3000" }
}
}
}
}
}
}
Use tailserve --init to generate a boilerplate tailserve.yml.
Install
go install codeberg.org/codecat/tailserve@latest
Advertise
As an additional note, to advertise to your Tailnet that the services are available, you would have to run:
tailscale serve advertise svc:git
Or, if Tailscale is running in a Docker container:
docker exec -it my-container tailscale serve advertise svc:git