Public tunnel
A remote development environment, such as Codespaces, DevPod, a remote Docker host or an SSH dev box, can't reach the PHP webserver on localhost. The tooling can expose it through a Cloudflare quick tunnel, a public *.trycloudflare.com HTTPS URL that needs no account, DNS or configuration.
While the tunnel is up, the site is on the public internet, and a local Drupal site usually has a known admin account and no firewall. Use disposable test data only, never real or sensitive content, and stop the tunnel with stop when you're done.
Turning it on
Install cloudflared so it's on PATH, set CLOUDFLARE_TUNNEL=1 in your shell or in .env, and build:
- Make
- Ahoy
- No wrapper
export CLOUDFLARE_TUNNEL=1
make build
export CLOUDFLARE_TUNNEL=1
ahoy build
export CLOUDFLARE_TUNNEL=1
scripts/eddy-tooling
vendor/bin/eddy-assemble
vendor/bin/eddy-start
vendor/bin/eddy-provision
An empty value, or 0, false, no or off in any letter case, keeps the tunnel off.
What happens
startstarts a tunnel, or reuses one whose URL still answers, and writes its URL to.envasTUNNEL_URL. Withoutcloudflared, it skips the tunnel with a note.provisionadds the reverse-proxy and trusted-host settings that Drupal needs behind the tunnel tosettings.php.start,provision,info,drushandloginuse the tunnel URL as the site URL.stopcloses the tunnel and removes its URL from.env, even onceCLOUDFLARE_TUNNELis unset.
cloudflared writes its output to .logs/cloudflared.log, which is the place to look when a tunnel doesn't come up.
Bringing your own tunnel
The commands treat any TUNNEL_URL in .env as the site URL, whichever tool wrote it. So a different tunnel, such as ngrok, works the same way when a lifecycle script starts it and writes its URL to .env. stop only removes a URL it created, and leaves one from another tool alone.
Opening the site on a phone
vendor/bin/eddy-qrcode <url> draws any URL as a QR code in the terminal, which is handy for opening a login link on a phone. It needs qrencode on PATH.
vendor/bin/eddy-qrcode "$(vendor/bin/eddy-info site-url)"
Set LOGIN_QRCODE=1 in .env or your shell to have make login and ahoy login draw the one-time login link as a QR code too (see Logging in).