At home with Cloudflare Tunnel
Short version
Заголовок раздела «Short version»A machine at home with Squad in tunnel mode on 127.0.0.1:8080, a domain on Cloudflare, and cloudflared running a tunnel to Squad. Web traffic goes through the tunnel. Calls need ports 7881 and 7882 forwarded on your router, or a voice server elsewhere. It takes about 20 minutes.
What this changes
Заголовок раздела «What this changes»- Squad serves plain HTTP on
127.0.0.1:8080, and publishes no ports 80 or 443. cloudflaredruns as a service on the machine and connects out to Cloudflare.- A tunnel and a DNS record for your domain in your Cloudflare account.
- For calls, ports 7881 on TCP and 7882 on UDP forwarded from your router.
Before you start
Заголовок раздела «Before you start»- Check the requirements.
- Your domain’s DNS must be on Cloudflare, on any plan. The Free and Pro plans limit one request to 100 MB. The apps send a large file in parts of 10 to 64 MiB, or larger for a file over 625 GiB. A file sent in a single request has to fit in that 100 MB limit.
- Decide how calls will work, since a tunnel can’t forward them. Forward ports 7881 and 7882 from your router to the machine, add a voice server on a VPS, or turn voice off.
Install
Заголовок раздела «Install»-
Set up Squad with Docker in tunnel mode.
fluxer.env FLUXER_DOMAIN=chat.example.comFLUXER_EDGE_MODE=tunnelFLUXER_LIVEKIT_NODE_IP=203.0.113.10Set
FLUXER_LIVEKIT_NODE_IPto your home’s public IPv4 address if you forward the voice ports. Publish only port 8080 on127.0.0.1and the two voice ports.Для Squad скачайте исходники и конфигурацию сборки. Команда получения готового пакета для этой платформы отсутствует.
Wait for
healthyindocker ps. -
In the Cloudflare dashboard, under Networking, Tunnels, create a tunnel with cloudflared, and run the install command it shows on the machine.
The tunnel shows as healthy.
-
On the tunnel’s Routes tab, add a published application route for
chat.example.comthat points athttp://127.0.0.1:8080.Cloudflare’s DNS then has a
CNAMErecord for your domain that points at the tunnel. -
Print the setup token.
Окно терминала docker exec fluxer fluxerd setup-tokenOpen your domain and paste the token to create the first admin account.
If you manage tunnels from files, copy the config.yml for cloudflared. Turn Rocket Loader and Bot Fight Mode off, and change the other Cloudflare settings that break Squad.
Try it without an account
Заголовок раздела «Try it without an account»A quick tunnel gives you a random trycloudflare.com address with no account. Start it before Squad, and use the address it prints as FLUXER_DOMAIN.
cloudflared tunnel --url http://127.0.0.1:8080The address changes every time cloudflared starts, and a new address needs a new instance, so use it only for a trial. Cloudflare limits a quick tunnel to 200 requests at a time.