ViRb3 / wgcf

🚤 Cross-platform, unofficial CLI for Cloudflare Warp
MIT License
6.24k stars 693 forks source link

API update required #68

Closed ViRb3 closed 3 years ago

ViRb3 commented 3 years ago

As clear from #64 and #67, the API has changed, and some people are getting rate limited. I will do my best to investigate and release an update before the weekend.

zkanda commented 3 years ago

Any update here? Would love to help if I can.

ViRb3 commented 3 years ago

Finishing another project by the end of today and then starting this. Will keep you updated.

ViRb3 commented 3 years ago

I took a quick look at the situation. The API version has been bumped, but the endpoints and paths haven't changed the slightest. I tested the current latest version of wgcf locally: registration and generation work perfectly, no rate limits or other problems. Nevertheless, I will push an update with the new API endpoints and some other refinements tomorrow. If that still doesn't help, perhaps I will add a customizable delay between requests for those getting rate limited.

ViRb3 commented 3 years ago

Well, here we are - I vastly overhauled the API generation, cleaned up a lot of code, and fixed some minor reported issues. We are now at the latest API version.

Throughout the entire development process, which includes running dozens of API call tests without delay, I did not get a single rate limit issue. Just as I was about to publish, running my final tests, I finally got rate limited: 429 Too Many Requests. I did abuse the API to get here, though: I was running a significant amount of tests. It seems like this is an IP rate limit, since even the original 1.1.1.1 app on my phone can't connect to the API.

That being said, no user should ever encounter this rate limit with regular usage. My guess is that this system is put in place to prevent mass registrations for free WARP+ quota abuse, and I fully support that. DO NOT risk this project's existence by abusing it for such purposes. Be nice and pay for WARP+ if you need it.

I will go ahead and publish this release, please test it out. If you do get rate limited, please refer to #70. I am happy to add a delay between the API requests, but I don't currently know if that will help.

pverghese commented 3 years ago

2021/02/22 15:23:15 Using config file: wgcf-account.toml 2021/02/22 15:23:16 Updated license key detected, re-binding device to new account 2021/02/22 15:23:18 400 Bad Request

Getting this error, when trying to use my warp unlimited key

ViRb3 commented 3 years ago

From @Pisswine:

hey m'dude, I constantly get error 400 bad request when trying to use my premium license key, Works on mobile and ... I'd appreciate help on this, cheers

ViRb3 commented 3 years ago

I'm looking into this.

ViRb3 commented 3 years ago

@pverghese @Pisswine what exactly are you doing when you get the 400 bad request error? I just tried the following sequence and it worked without issues:

  1. wgcf register
  2. rename wgcf-profile.toml to wgcf-profile2.toml
  3. wgcf register
  4. copy license_key from wgcf-profile2.toml and replace in wgcf-profile.toml
  5. wgcf update

Are you sure you copied the key correctly?

pverghese commented 3 years ago

@pverghese @Pisswine what exactly are you doing when you get the 400 bad request error? I just tried the following sequence and it worked without issues:

  1. wgcf register
  2. rename wgcf-profile.toml to wgcf-profile2.toml
  3. wgcf register
  4. copy license_key from wgcf-profile2.toml and replace in wgcf-profile.toml
  5. wgcf update

Are you sure you copied the key correctly?

I'm assuming the license key has to be pasted into wgcf-account.toml not wgcf-profile.toml

So Steps I have taken

  1. wgcf register
  2. wgcf generate
  3. Copy license key from my warp premium account into wgcf-account.toml
  4. wgcf update I get the 400 Bad request when I run the update command
ViRb3 commented 3 years ago

@pverghese Yes, sorry, I meant wgcf-account.toml, not wgcf-profile.toml. Can you please try the exact steps that I wrote in my previous comment and let me know if it works, just so we know if the problem is with the key specifically or something else?

pverghese commented 3 years ago

@pverghese Yes, sorry, I meant wgcf-account.toml, not wgcf-profile.toml. Can you please try the exact steps that I wrote in my previous comment and let me know if it works, just so we know if the problem is with the key specifically or something else?

I redid your steps. The license key rebinding works with the free account. It doesn't work when I use the license key from my warp premium account.

pverghese commented 3 years ago

@pverghese Yes, sorry, I meant wgcf-account.toml, not wgcf-profile.toml. Can you please try the exact steps that I wrote in my previous comment and let me know if it works, just so we know if the problem is with the key specifically or something else?

I redid your steps. The license key rebinding works with the free account. It doesn't work when I use the license key from my warp premium account.

I figured out the issue. Warp premium has a maximum of 5 devices linked to the account. I was already running at the maximum. So after I deleted a device, the linking with the premium account worked.

Thanks

ViRb3 commented 3 years ago

@pverghese Thanks a lot for testing and figuring this out. I have created an issue to track the non-helpful error message here: #76. @Pisswine please read above to fix your error.