Skip to content

Creating an API Checkpoint

tago edited this page Apr 21, 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. Create a python virtual environment
    sudo python3 -m venv api
  2. Start the venv
    source /api/bin/activate
  3. Install the necessary modules
    pip install Flask
    pip install requests
  4. Create the main python file
    sudo nano main.py
  5. Copy the contents of the AKoDAuth API source code into the file then modify the service to be "webdav"
    svtype = "webdav"
  6. Save the file and run the environment
    sudo python3 main.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