-
Notifications
You must be signed in to change notification settings - Fork 0
Step 4 Protect with Cloudflare Access
After Step 3 anybody on the Internet can reach the gateway's login page. The gateway itself is safe (nothing works without a valid Unraid API key, and brute force is rate-limited), but you can add a second lock in front of it so that only requests carrying a secret token ever reach your home. This is the same mechanism Unraid Deck uses.
The app supports it natively: choose Cloudflare Access when adding the server and paste the token.
- https://one.dash.cloudflare.com → Access controls → Service credentials (older UI: Access → Service Auth → Service Tokens).
- Create Service Token.
-
Name:
Unraid Drive. Duration: Non-expiring (or a long duration; you will have to update the app when it expires). - Click Generate token. Cloudflare shows two values once:
-
CF-Access-Client-Id— looks like1234abcd....access -
CF-Access-Client-Secret— a long hex string Copy both into a password manager.
-
- Access controls → Applications → Add an application → Self-hosted.
-
Application name:
unraid-gateway. - Session duration: any.
-
Public hostname: subdomain
unraidfile, domainexample.com(the hostname from Step 3). Leave Path empty. - Click Next to the policies.
-
Add a policy. Policy name:
Service token. - Action: Service Auth (not Allow: Service Auth means "no interactive login, just check the token").
- Under Configure rules: Selector =
Service Token, Value =Unraid Drive(the token you created). - Save the policy, then Next and Add application.
Optionally add a second policy with action Allow and rule Emails = your e‑mail, so that you can still open the gateway page in a browser through Cloudflare's login screen.
- Opening
https://unraidfile.example.com/healthzin a browser now shows the Cloudflare Access login page (or a 403): the gateway is no longer reachable without the token. Good. - From a terminal:
must answer
curl -s https://unraidfile.example.com/healthz \ -H "CF-Access-Client-Id: <id>" -H "CF-Access-Client-Secret: <secret>"{"status":"ok",...}.
In Add server choose Connection: Cloudflare Access and paste the two values. The app stores them in the Keychain and adds the two headers to every request, including the ones made by the Files app extension in the background.