License Server Administration
Shardian solvers validate license status at initialization against a secure licensing server. This page details the database schema, administrative API endpoints, systemd services, and the CLI key management tool.
1. Database Schema
The license server uses a lightweight, transactional SQLite database (licenses.db) located in the root of the server runtime path.
erDiagram
LICENSES {
string api_key PK
string scope "both | aero | atmos"
integer active "1 = active, 0 = revoked"
datetime expires_at
datetime created_at
}
Table: licenses
api_key(TEXT, Primary Key): The cryptographically secure API key string prefixed withsk_live_shardian_.scope(TEXT): Defines the products the license is authorized to run (aero,atmos, orboth).active(INTEGER): Actively toggled status. Set to1for active,0for revoked.expires_at(DATETIME): Expiration timestamp. Pings after this time will return HTTP 401.created_at(DATETIME): Registration timestamp.
2. API Endpoints
The license server exposes two primary groups of API endpoints:
A. Solver Verification (Public)
Used by OpenFOAM and WRF during boundary-layer/turbulence model initialization.
GET /v1/verify- Headers:
Authorization: Bearer <api_key> - Response (200 OK):
- Response (401 Unauthorized):
- Headers:
B. Administrative API (Private / Internal-Only)
Protected by basic authentication and restricted to loopback (127.0.0.1) or trusted internal networks.
POST /v1/admin/keys- Description: Creates and registers a new license key.
- Body:
- Response (200 OK):
DELETE /v1/admin/keys- Description: Instantly revokes an active key.
- Body:
3. The CLI Key Management Tool
Developers can manage license keys on the VPS host using the compiled Go CLI utility license-cli:
Generating a New Key:
Output:License Key Generated Successfully!
Key: sk_live_shardian_cfd_atmos_2026_eval_4a2c91
Scope: both
Expiry: 2027-06-15 12:00:00 UTC
Status: Registered in licenses.db (active)
Revoking a Key:
Output:Success: Key sk_live_shardian_cfd_atmos_2026_eval_4a2c91 has been deactivated (active=0).
Any simulation using this key will abort immediately at the next time step.
4. Systemd Daemon Configuration
On the production VPS server, the license Go API is managed by systemd as a persistent daemon:
# /etc/systemd/system/shardian-license-server.service
[Unit]
Description=Shardian License Verification API Server
After=network.target
[Service]
Type=simple
User=shardian-admin
WorkingDirectory=/var/www/license-server
ExecStart=/var/www/license-server/server
Restart=always
RestartSec=5
Environment=PORT=8080
Environment=DB_PATH=/var/www/license-server/licenses.db
[Install]
WantedBy=multi-user.target
To reload and monitor the daemon: