This project manages license keys using the Lemon Squeezy API, allowing for key activation and validation via a command-line tool and a Flask-based web server.
-
Command-Line Interface:
- Prompt for a license key.
- Activate a license key using Lemon Squeezy API.
- Validate the license key & HWID.
- Save and load the license key from a file.
-
Flask Web Server:
- Provides an API to validate license keys via a POST request.
- Python 3.x
requests
libraryFlask
librarysqlite3
library
-
Clone the Repository:
git clone https://github.com/Popinek/lemonsqueezyLicense.git cd lemonsqueezyLicense
-
Install Dependencies:
pip install -r requirements.txt
-
Set Environment Variables: Create a
.env
file in the root directory and add your URL:URL=https://example.com/validate
-
Run the Script:
python client.py
- The script will prompt for a license key.
- It will attempt to activate and validate the key.
- HWID validation is performed after successful license activation.
- If successful, it will save the key and run the main script functionality.
-
License Key Activation:
- Enter your license key when prompted.
- Type
'quit'
to exit the program.
-
Main Script:
- Replace the placeholder
main_script
function with your actual application logic.
- Replace the placeholder
-
Run the Flask Application:
python app.py
- By default, the Flask server will run on port 5000.
-
Validate License Key via API:
- Send a POST request to
http://127.0.0.1:5000/validate
with JSON payload:{ "activation_key": "your_license_key_here" }
- Response will be in JSON format indicating whether the license key is valid or not.
- If HWID mismatch occurs, access is denied.
- Send a POST request to
-
POST /validate
Request Body:
{ "activation_key": "string" }
Response:
{ "status": "success", "message": "License key and HWID matches!" }
or
{ "status": "success", "message": "License key and HWID added successfully" }
or
{ "status": "error", "message": "HWID mismatch" }
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch
). - Commit your changes (
git commit -am 'Add new feature'
). - Push to the branch (
git push origin feature-branch
). - Create a new Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
For any questions or issues, please open an issue on the GitHub repository.