Skip to content

AZLicense ​

Self-hosted licensing for plugin authors. One LICENSE_KEY activates all three surfaces: a Discord bot, a small HTTP API, and a built-in web console. You manage licenses with slash commands or from the browser, and your plugin checks a license on boot against POST /v1/license/verify. Licenses bind per server (IP or hardware), expire on schedule, and keep running offline with a signed 72-hour token when the API is unreachable.

What you received ​

azlicense/
├── .env                  # your configuration
├── requirements.txt      # Python dependencies
├── run.py                # starts everything
├── app_config.py         # launcher settings (ports, log level)
├── gen_keys.py           # generates encryption keys
├── license_client.py     # validates your LICENSE_KEY at startup
├── bot/                  # Discord bot
├── api/                  # license verification API
├── app/ + static/        # web console (same key, no extra setup)
├── shared/               # shared code
├── database/             # database models
├── assets/               # bot avatar
└── sdk-java/             # Java SDK to add to your plugin

One python run.py starts the API, the web console and the bot. Every start validates your LICENSE_KEY first — no key, no start.

Install ​

  1. Upload the entire azlicense/ folder to your server or hosting panel.

  2. Your host must have Python 3.10+ installed:

    bash
    pip install -r requirements.txt
  3. Generate the signing keys — this creates private_key.pem and public_key.pem:

    bash
    python gen_keys.py
  4. Open .env and fill in the values below, pasting the whole key files into PUBLIC_KEY and PRIVATE_KEY.

  5. Start everything:

    bash
    python run.py

    You should see License OK, then the API on port 8000, the web console on port 8080, and the bot connect. Single-part flags: --api-only, --web-only, --bot-only.

Web console ​

The web console ships inside AZLicense — no separate download, no separate key. python run.py starts the API, the console and the bot together, and the console answers on WEB_PORT (8080 by default — change it in app_config.py, or run it alone with --web-only).

It serves the management portal with dedicated pages for everything:

  • Overview — live licence stats, top products and activations, read straight from the shared register.
  • All licences & Issue — the full register plus issuing from the browser: suspend, unsuspend, resize the server limit, clear bindings, transfer, delete.
  • Products — create and delete products in the browser. Deleting a product that still owns licences is refused, with an explicit force option that takes the licences with it.
  • Webhooks — add endpoints, pick events (the same set as the bot's /webhook commands), and hit Test to fire a sample payload and see the real HTTP delivery status.
  • Audit log — every admin action, from Discord and the web, in one trail.
  • Settings — proves what the server is actually running: ports, URLs, cookie policy, Discord client — with all secrets masked. Nothing sensitive is ever sent to the browser.

It reads the same database and the same .env as the bot, so changes appear on both sides instantly. Discord sign-in covers your customers too.

  • Two front doors — admin.<domain> for you (everything), and dashboard.<domain> for your customers (only their own licences). One sign-in covers both via a cookie scoped to the parent domain; leave ADMIN_URL / DASHBOARD_URL empty to run it as a single site.
  • First-run wizard — on first open the console prints a setup token and walks you through the database check, the Discord OAuth client id/secret and your hostnames; the wizard writes the values into .env. Re-open it any time at /setup, still token-gated.
  • Runtime branding — edit static/brand.json and reload: wordmark, logo letter, tagline, accent colour and support link, no rebuild.
  • Optional marketplace webhook — point BuiltByBit (or any marketplace speaking the same payload) at POST {PUBLIC_URL}/api/buildbybit/webhook and a paid order becomes a licence automatically. Leave the BUILDBYBIT_* variables empty and the endpoint is never registered.

Configuration (.env) ​

VariableWhat to put
BOT_TOKENYour bot token from https://discord.com/developers
ADMIN_DISCORD_IDSYour Discord user ID (add multiple with commas)
MEMBER_ROLE_IDRole users must have to use bot commands (leave empty to disable)
PUBLIC_KEYOpen public_key.pem, paste the whole contents here
PRIVATE_KEYOpen private_key.pem, paste the whole contents here

API endpoints ​

EndpointDescription
POST /v1/license/verifyValidate a license against a server
POST /v1/license/resetRemove a server binding
GET /v1/license/infoFetch license metadata
GET /healthHealth check

Verification failures return 400/404 with a machine-readable detail — License not found., License has been suspended., License has expired..

Rate limiting: 60 requests/min per IP across the API, and 30 requests/min per license key on verify, reset, and info. Excess requests return 429 with a Retry-After header — license clients should back off and retry instead of hammering the endpoint.

Slash commands ​

/create, /list, /info, /edit, /delete, /export, /stats, /servers, /audit, /add-server, /remove-server, /server-limit, /binding-mode, plus /license, /mylicense, /product, /avatars and /setup.

Support ​

Discord support for this system: https://discord.gg/MwjpYSA5jg

Requirements ​

  • Python 3.10+, SQLite or PostgreSQL
  • A Discord application / bot token

Released under the AzStudio license. All products are available on BuiltByBit and Modrinth.