forked from tagoWorks/akod
-
Notifications
You must be signed in to change notification settings - Fork 1
Creating an API Checkpoint
tago edited this page Apr 21, 2024
·
13 revisions
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.
- Create a python virtual environment
sudo python3 -m venv api
- Start the venv
source /api/bin/activate - Install the necessary modules
pip install Flask
pip install requests
- Create the main python file
sudo nano main.py
- Copy the contents of the AKoDAuth API source code into the file then modify the service to be "webdav"
svtype = "webdav"
- Save the file and run the environment
sudo python3 main.py
- Head back to Cloudflare Zerotrust dashboard
- Select "Networks" then "Tunnels"
- Click on the menu for the tunnel you have active (assuming your running the API on the same server)
- Configure, then select the "Public Hostname" tab
- Add a public host name
- Choose a name for subdomain and select your domain
- 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) - Save the hostname
- You can finally implement your license checking in your code!