Skip to content

Creating an API Checkpoint

tago edited this page Apr 22, 2024 · 13 revisions

How to create your own Flask API on Ubuntu/Linux

Flare and AKoD now use an API instead of pip package for security, and flexibility. Flask API is a type of web API and is designed to make it easy and quick to start building web applications. This API will be used to send a check requests to your auth servers, which should be local, and then return a valid or invalid text.

Setting up a virtual environment in Ubuntu/Linux

  1. In the main directory, CD into the "api" folder
    cd ./api
  2. Start the environment
    source env/bin/activate
  3. Install the necessary modules if they aren't already included
    sudo pip install -r requirements.txt
  4. Run the API
    sudo python3 apiauth.py

Tunnel API through Cloudflare

  1. Head back to Cloudflare Zerotrust dashboard
  2. Select "Networks" then "Tunnels"
  3. Click on the menu for the tunnel you have active (assuming your running the API on the same server)
  4. Configure, then select the "Public Hostname" tab
  5. Add a public host name
  6. Choose a name for subdomain and select your domain
  7. Select HTTP type and the internal server IP for your Ubuntu/Linux server, along with the port 5000 (it should look like HTTP://10.11.32.121:5000)
  8. Save the hostname
  9. You can finally implement your license checking in your code!

Clone this wiki locally