cloudflare tunnels are pretty cool

this could kind of be part 3 of the let’s make a search engine stuff earlier. but really, i just wanted to remind myself how to set up cloudflare tunnels.

it was actually not too crazy to do. there were really only one prerequisite, and that was to have a domain that’s set up in cloudflare, ie you have domain pointed at cloudflare’s name servers. after that, you can basically follow the prompts from “Zero Trust > Networks > Tunnels > Create”.

you’ll install cloudflared and it will set up a command. all it does is just set up a connection to cloudflare. the rest is configured in the cloudflare UI.

and then really, you just run your service locally. in my case, i basically ran my docker compose command.

PORT=8000 docker compose up -d

and then in cloudflare pointed my domain, tootboot.com, at the connected tunnel’s localhost:8000.

the only thing i didn’t figure out is why the * wildcard path didn’t work. i had to manually add all my endpoints (which for now, is only 2, so it’s “fine”). but otherwise, i’m pretty happy about this.

we’ll see how long this keeps working, but right now, you can go to tootboot.com to search my blog (as of now, in the future, it might be searching other content).

i like this solution because most of the other “free tier” things, usually require you to add a credit card in order to pay for overages… but i don’t want that. i would rather my little mini-pc under my desk just crashes if too many people try to request it—i don’t want to get charged hundreds of dollars because i used a ton of bandwidth or something like that.