A universal license validation server for GhostShell instances, built with FastAPI and PostgreSQL.
- Universal License Key: Built-in universal license that works for all instances
- Individual Licenses: Create and manage individual license keys
- Machine Binding: Licenses are bound to specific machine fingerprints
- Expiration Management: Set custom expiration dates for licenses
- Validation Logging: Track all license validation attempts
- Admin API: Manage licenses and view statistics
The server includes a universal license key: GHOST-SHELL-UNIVERSAL-2024
This key will work for any GhostShell instance without requiring individual license creation.
POST /validate- Validate a license keyGET /health- Health check endpoint
POST /create- Create a new licenseGET /stats- Get license statistics
DATABASE_URL- PostgreSQL connection stringJWT_SECRET- Secret key for JWT token generationUNIVERSAL_LICENSE_KEY- The universal license key (default: GHOST-SHELL-UNIVERSAL-2024)PORT- Server port (default: 8000)
-
Create PostgreSQL Database:
- Go to Render Dashboard
- Click "New" → "PostgreSQL"
- Name:
ghostshell-licenses-db - Note the connection details
-
Deploy Web Service:
- Click "New" → "Web Service"
- Connect your Git repository
- Use the following settings:
- Build Command:
pip install -r requirements.txt - Start Command:
python main.py - Environment Variables:
DATABASE_URL: Use the PostgreSQL connection stringJWT_SECRET: Generate a secure random stringUNIVERSAL_LICENSE_KEY:GHOST-SHELL-UNIVERSAL-2024
- Build Command:
-
Alternative: Use render.yaml:
- Include the
render.yamlfile in your repository root - Render will automatically configure the database and web service
- Include the
curl -X POST "https://black-pessah.onrender.com/validate" \
-H "Content-Type: application/json" \
-d '{
"license_key": "GHOST-SHELL-UNIVERSAL-2024",
"fingerprint": {
"machine_id": "your-machine-id",
"platform": "linux",
"arch": "x64"
},
"timestamp": "2024-01-01T00:00:00Z",
"version": "1.0.0"
}'curl -X POST "https://black-pessah.onrender.com/create" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $JWT_SECRET" \
-d '{
"expires_in_days": 365,
"max_instances": 1
}'
curl -X GET "https://black-pessah.onrender.com/stats" \
-H "Authorization: Bearer $env:JWT_SECRET" `- JWT signature verification for license validation requests
- Machine fingerprint binding to prevent license sharing
- Admin endpoints protected with bearer token authentication
- Comprehensive validation logging for audit trails
- Rate limiting and request validation
The server automatically creates the following tables:
licenses- Store license keys, expiration, and machine bindingsvalidation_logs- Log all validation attempts for auditing
-
Install dependencies:
pip install -r requirements.txt
-
Set up environment variables in
.envfile -
Start the server:
python main.py
-
Access the API documentation at
http://localhost:8000/docs