Coder Social home page Coder Social logo

warp.sh's Introduction

warp.sh

By using this you agree to Cloudflare's ToS: https://www.cloudflare.com/application/terms/

Quick Guide #1

Make sure to have jq, curl, and wireguard-tools (for wg genkey and wg pubkey) installed before using this shell script.

git clone https://github.com/rany2/warp.sh.git
cd warp.sh
./warp.sh

The generated wireguard config will be printed to stdout.

Quick Guide #2

To execute this script on GitHub Codespaces without the need to set up a local environment, follow these steps:

  1. Open the repository and locate the green buttons. Click on "Code" then select "Codespaces" and finally choose "Create codespace on master".
  2. Wait for the codespace to be created. Once it's ready, open the terminal and run the command ./warp.sh.
  3. After you've finished using the codespace, it's important to delete it to maintain cleanliness and save resources.

Please note that deleting the codespace will remove all the changes and configurations made within it, so make sure to save any important files or settings before closing.

Usage options

Usage ./warp.sh [options]
  -4  use ipv4 for curl
  -6  use ipv6 for curl
  -T  teams JWT token (default no JWT token is sent)
  -R  refresh token (format is token,device_id,wg_private_key; specify this to get a refreshed config)
  -t  show cloudflare trace and exit only
  -h  show this help page and exit only

Regarding Teams enrollment

  1. Visit https://<teams id>.cloudflareaccess.com/warp
  2. Authenticate yourself as you would with the official client
  3. Check the source code of the page for the JWT token or use the following code in the "Web Console" (Ctrl+Shift+K):
console.log(document.querySelector("meta[http-equiv='refresh']").content.split("=")[2])
  1. Pass the output as the value for the parameter -T. The final command will look like:
./warp.sh -T eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.....

Regarding -T and -R options

-T and -R both could take a file as an argument. The file should be in the same format as the command line argument. This is so that the token wouldn't be exposed in the shell history or process list.

warp.sh's People

Contributors

gbraad avatar opengg avatar rany2 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

warp.sh's Issues

Parameter not Set

Good afternoon,

Any idea what I might be doing wrong, I am trying to run the script with a cloudflare teams token, but if I run it though ./warp.sh -T TOKEN then I get ./warp.sh: 191 ./warp.sh: Token: Parameter not set.

I tried using bash, and I get warp.sh: line 191: token: unbound variable.

I have tried with and without ' and " around the token and it makes no difference.

Many thanks!

failed when using -T

./warp.sh works just fine, but ./warp.sh -T myverylongtoken don't

error note is :

curl: (22) The requested URL returned error: 401

also what is v0a2483 in BASE_URL='https://api.cloudflareclient.com/v0a2483' ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.