Giter Club home page Giter Club logo

wgcf's Introduction

I forked this repository for personal use and added additional steps from other sources to make it easier to use it on Linux.

wgcf

wgcf is an unofficial, cross-platform CLI for Cloudflare Warp

Features

  • Register new account
  • Change license key to use existing Warp+ subscription
  • Generate WireGuard profile
  • Check account status
  • Print trace information to debug Warp/Warp+ status

Download

You can find pre-compiled binaries on the releases page.

Usage

Run these commands in a terminal

sudo apt update
sudo apt install wireguard

use wg-quickto see if wireguard installed or not

Download the Linux AMD64 binary(wgcf_x.x.x_linux_amd640) from release page

Open the terminal and go to the downloads folder:

cd /Downloads

Make a new directory:

mkdir cloudflare

Move the binary into the cloudflare folder and make it executable

mv wgcf_2.1.4_linux_amd64 ./cloudflare/wgcf
cd ./cloudflare
chmod +x wgcf

Register new account

Make sure you're in cloudflare directory and run the following command in a terminal:

./wgcf register

Accept Cloudflare’s Terms and conditions The new account will be saved under wgcf-account.toml

Generate WireGuard profile

Run the following command in a terminal:

./wgcf generate

The WireGuard profile will be saved under wgcf-profile.conf. Now, copy the file wgcf-profile.conf into the wireguard configuration folder:

sudo cp wgcf-profile.conf /etc/wireguard/

To connect VPN open the terminal and run

sudo wg-quick up wgcf-profile

and to disconnect run

sudo wg-quick down wgcf-profile

install resolvconf if you found any problem and try again

sudo apt install resolvconf

and you're good to go!! For more information on how to use it, please check the official WireGuard Quick Start.

Maximum transmission unit (MTU)

To ensure maximum compatibility, the generated profile will have a MTU of 1280, just like the official Android app. If you are experiencing performance issues, you may be able to improve your speed by increasing this value. For more information, please check #40.

Change license key

If you have an existing Warp+ subscription, for an example on your phone, you can bind the account generated by this tool to your phone's account, sharing its Warp+ status. Please note that there is a current limit of maximum 5 linked devices active at a time.

⚠️ This device's private key will be changed!

First, get your Warp+ account license key. To view it on Android:

  1. Open the 1.1.1.1 app
  2. Click on the hamburger menu button on the top-right corner
  3. Navigate to: Account > Key

Edit wgcf-account.toml directly with the new license key and run:

./wgcf update

or, using an environment variable:

WGCF_LICENSE_KEY="123412341234" wgcf update

The license will be applied, and a new private key will be created for your account. Regenerate your WireGuard configuration and use the new private key.

Check device status

Run the following command in a terminal:

./wgcf status

Verify Warp/Warp+ works

Connect to the WireGuard profile generated by this tool, then run:

./wgcf trace

If you look at the last line, it should say warp=on or warp=plus, depending on whether you have Warp or Warp+ respectively.

Development

Sub-packages

  • api_tests - Tests for API documentation generation
  • spec_format - OpenAPI3 specification formatter to post-process the spec generated by Optic

API

This project uses Optic to automatically generate API documentation using the tests defined in api_tests. These tests cover all endpoints used by wgcf. The documentation is exported as an OpenAPI3 specification, which is then used with openapi-generator to generate the Go client API code under wgcf/openapi.

To update the API documentation, install Optic, then run:

api start

Resolve and save all the differences in the Web UI.

To regenerate the Go client API code, install openapi-generator, then run:

bash generate-api.sh

This script supports both Linux and WSL.

Credits

https://www.techzim.co.zw/2020/12/how-to-use-cloudflares-warp-vpn-on-ubuntu-linux/

Notice of Non-Affiliation and Disclaimer

We are not affiliated, associated, authorized, endorsed by, or in any way officially connected with Cloudflare, or any of its subsidiaries or its affiliates. The official Cloudflare website can be found at https://www.cloudflare.com/.

The names Cloudflare Warp and Cloudflare as well as related names, marks, emblems and images are registered trademarks of their respective owners.

wgcf's People

Contributors

virb3 avatar dependabot[bot] avatar piyushbaria avatar k4yt3x avatar pccr10001 avatar valentineus avatar ourgta avatar

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.