wrangler-legacy icon indicating copy to clipboard operation
wrangler-legacy copied to clipboard

Support Cloudflare Access with `wrangler dev`

Open tillkruss opened this issue 3 years ago • 6 comments

💡 Feature request

Describe the feature

I'm using wrangler dev for development, but all URLs protected by Cloudflare Access get redirected to the login page and after a successful login I'm redirected from http://127.0.0.1:8787 to my production domain.

Describe the alternatives

I'm not aware of any alternatives or ways to bypass the login screen and redirect.

tillkruss avatar Aug 31 '21 17:08 tillkruss

Hey @tillkruss, mind providing some more context here about your setup? If I understand correctly: you have a domain that is using Cloudflare Access, you also have a Worker that has a route on that domain, you attempt to run wrangler dev on that Worker, and it takes you to the Access login screen? Is that correct?

Electroid avatar Sep 01 '21 00:09 Electroid

Correct the Worker is attached to the domain root and handle website, admin and API requests.

The /admin route is protected with Access and when I request http://127.0.0.1:8787/admin I get redirected to the CF Access login page, which I'd like to bypass or get working when using wrangler dev.

tillkruss avatar Sep 01 '21 00:09 tillkruss

@tillkruss - would you mind sharing the full wrangler dev command you're using, including all the args/params (ensuring nothing private/secret is exposed)

Thanks!

nilslice avatar Sep 01 '21 01:09 nilslice

I just run the plain wrangler dev. Should I be adding anything?

This is my toml file:

name = "..."
type = "webpack"
route = "...com/*"
zone_id = ""
account_id = ""
usage_model = "unbound"

kv-namespaces = [
	 { binding = "app", id = "", preview_id = "" },
	 { binding = "metrics", id = "", preview_id = "" },
	 { binding = "leads", id = "", preview_id = "" },
]

[site]
bucket = "./public"

[triggers]
crons = ["*/3 * * * *", "*/10 * * * *"]

[vars]
ENVIRONMENT = "production"
SENTRY_DSN = ""
SENTRY_CLIENT_ID = ""
SENTRY_CLIENT_SECRET = ""

tillkruss avatar Sep 01 '21 02:09 tillkruss

This issue has been automatically marked as stale because it has not had recent activity in the last 180 days. It will be closed if no further activity occurs in the next week. Please feel free to comment if you'd like it to remain open, and thank you for your contributions.

stale[bot] avatar Mar 02 '22 09:03 stale[bot]

Same issue here

dlueth avatar Apr 28 '22 13:04 dlueth

Thanks for reporting this issue! Wrangler v1 is now deprecated and support is only being provided for critical updates or security concerns. As such, we are closing this issue.

New versions of Wrangler are maintained in the workers-sdk repo. If you are running into a similar issue with wrangler v2, please report it in the workers-sdk repo. For more info about wrangler v1 deprecation, please check out our blog post.

admah avatar Feb 27 '23 16:02 admah