All admin endpoints require authentication using the admin key configured in your environment variables.
# Using Firestore Authentication curl -X GET https://your-domain.com/admin/cleanup/status \ -H "X-Request-ID: a35905f9c363f8be3e297a5b59d8cf29" \ -H "X-Valid-Until: 1755734576000" # Using Firestore headers for POST requests curl -X POST https://your-domain.com/admin/cleanup \ -H "X-Request-ID: a35905f9c363f8be3e297a5b59d8cf29" \ -H "X-Valid-Until: 1755734576000" \ -H "Content-Type: application/json" \ -d '{ "operations": ["logs"] }'
Execute cleanup operations with fine-grained control
logs
- Remove old log filesdatabase
- Clean old user_links recordscredentials
- Clear secure memory storagefirestore
- Remove old cloud documentsall
- Execute all cleanup operationsheaders
- Firestore authentication headersoperations
- Array of operationsretention_days
- Keep data newer than N daysdry_run
- Preview mode (optional)POST /admin/cleanup Content-Type: application/json { "operations": ["logs", "database"], "retention_days": 30, "dry_run": false } Response: { "success": true, "operations": { "logs": { "success": true, "items_removed": 15, "size_freed": 2048576, "details": "Processed 20 log files" }, "database": { "success": true, "items_removed": 150, "size_freed": 15000, "details": "Found 150 old records for cleanup" } }, "total_size_freed": 2063576, "message": "Cleanup completed. Freed 2.0 MB across 2 operations", "timestamp": "2024-01-15T10:30:00Z" }
Get current system status and cleanup statistics
GET /admin/cleanup/status X-Admin-Key: your_admin_key_here Response: { "database": { "user_links": 1250, "config": 1, "banned_ips": 45 }, "logs": { "total_files": 12, "total_size": "15.2 MB" }, "timestamp": "2024-01-15T10:30:00Z" }
Customer risk analysis and threat detection endpoint
POST /admin/risk Content-Type: application/json { "action": "analyze", "customer_id": "optional_customer_id" } Response: { "success": true, "risk_analysis": { "threat_level": "medium", "suspicious_patterns": ["high_frequency_requests", "unusual_geo_locations"], "recommendations": ["enable_rate_limiting", "geo_blocking"] }, "timestamp": "2024-01-15T10:30:00Z" }
Get comprehensive customer metrics and analytics
GET /admin/metrics X-Admin-Key: your_admin_key_here Response: { "success": true, "metrics": { "total_customers": 150, "active_sessions": 23, "total_requests_24h": 15000, "avg_response_time": "120ms", "error_rate": "0.5%" }, "timestamp": "2024-01-15T10:30:00Z" }
⚠️ CRITICAL: Emergency kill switch for immediate system destruction
1
- Memory purge only2
- Memory + data obliteration3
- System corruption4
- Hardware-level destruction5
- Stealth exit simulationadmin_key
- Admin authenticationconfirmation_code
- Must be "OMEGA-DESTROY"destruction_level
- Level 1-5reason
- Audit trail reasonPOST /admin/killswitch Content-Type: application/json { "vps_id": "", // Empty = all VPS instances "destruction_level": 3, "delay_seconds": 30, "reason": "Law enforcement detected", "confirmation_code": "OMEGA-DESTROY" } Response: { "success": true, "vps_id": "", "stage": "INITIATION", "message": "Kill switch activated - destruction imminent", "timestamp": "2024-01-15T10:30:00Z", "time_to_live": 30 }
⚠️ WARNING: This endpoint permanently destroys data and systems. Use only in emergency situations.
List all registered VPS instances in the fleet
GET /fleet/register X-Admin-Key: your_admin_key_here Response: { "success": true, "instances": [ { "vps_id": "vps-abc123", "ip": "192.168.1.100", "domain": "secure.company.com", "admin_domain": "admin.company.com", "status": "active", "last_seen": "2024-01-15T10:29:00Z", "version": "v2.1.0", "location": "US-East", "registered_at": "2024-01-10T08:00:00Z" } ], "fleet_stats": { "total_vps": 5, "active_vps": 4 }, "timestamp": "2024-01-15T10:30:00Z" }
Register or update a VPS instance in the fleet
POST /fleet/register Content-Type: application/json X-VPS-ID: vps-abc123 { "ip": "192.168.1.100", "domain": "secure.company.com", "admin_domain": "admin.company.com", "version": "v2.1.0", "location": "US-East" } Response: { "success": true, "vps_id": "vps-abc123", "status": "registered", "next_heartbeat": 300, "timestamp": "2024-01-15T10:30:00Z" }
Send commands to specific VPS instances
script
- Deploy/update injection scriptsconfig
- Update configurationrestart
- Restart servicesstatus
- Get system statusheaders
- Firestore authentication headersvps_id
- Target VPS IDcommand
- Command typepayload
- Command dataPOST /fleet/command Content-Type: application/json { "vps_id": "vps-abc123", "command": "script", "payload": { "script_type": "injection", "content": "updated_script_content" }, "timeout": 30 } Response: { "success": true, "vps_id": "vps-abc123", "command": "script", "result": { "message": "Script updated successfully", "status": "deployed" }, "duration": "2.5s", "timestamp": "2024-01-15T10:30:00Z" }
VPS agent endpoint for receiving commands from fleet master
POST /vps/command Content-Type: application/json { "command": "script", "payload": { "script_type": "injection", "content": "updated_script_content" }, "source": "fleet-master" } Response: { "success": true, "vps_id": "vps-abc123", "command": "script", "result": { "message": "Command executed successfully", "status": "completed" }, "timestamp": "2024-01-15T10:30:00Z" }
💡 Note: This endpoint is used by VPS agents to receive commands from the fleet master. It's automatically called when commands are distributed via /fleet/command.
VPS agent kill switch endpoint for receiving destruction commands
POST /vps/killswitch Content-Type: application/json { "destruction_level": 3, "delay_seconds": 0, "reason": "Emergency destruction command" } Response: { "success": true, "vps_id": "vps-abc123", "stage": "RECEIVED", "message": "Kill switch command received", "timestamp": "2024-01-15T10:30:00Z" }
⚠️ WARNING: This endpoint executes immediate destruction upon receiving valid commands. Used by fleet-wide kill switch operations.
List available scripts with categories and status
GET /admin/scripts?category=build X-Admin-Key: your_admin_key_here Response: { "scripts": [ { "name": "build-release.sh", "description": "Build and package release", "category": "build", "available": true, "path": "./scripts/build-release.sh" } ], "count": 14, "categories": ["build", "install", "test", "deployment", "management", "maintenance", "security", "documentation", "update"], "timestamp": "2024-01-15T10:30:00Z" }
Execute shell scripts remotely with proper validation
build-release.sh
- Build and package releaseverify-installation.sh
- Verify installation statusconfigure-env.sh
- Interactive configuration wizardfleet-master.sh
- Fleet master controller setupfleet-agent.sh
- Fleet agent configurationtest-firebase.sh
- Test Firebase integrationmanage-sauron-pro.sh
- Main management interfacebuild
- Build and packaging scriptsinstall
- Installation and setuptest
- Testing and validationdeployment
- Deployment automationmanagement
- System managementPOST /admin/scripts Content-Type: application/json { "script": "verify-installation.sh", "arguments": ["--verbose", "--check-dependencies"], "working_dir": "/opt/sauron", "environment": { "NODE_ENV": "production", "DEBUG": "true" }, "dry_run": false } Response: { "success": true, "script": "verify-installation.sh", "exit_code": 0, "output": "Installation verified successfully\nAll dependencies found\nConfiguration valid", "duration": "2.34s", "timestamp": "2024-01-15T10:30:00Z", "dry_run": false }
Get current dead man's switch configuration and status
GET /admin/deadmans Authorization: Bearer your_admin_key_here Response: { "enabled": true, "check_interval": "5m0s", "master_timeout": "15m0s", "last_heartbeat": "2024-01-15T10:25:00Z", "auto_destruct": false, "destruction_level": 3 }
Configure automated kill switch based on operator activity
enabled
- Enable/disable the dead man's switchcheck_interval
- How often to check (duration)master_timeout
- Timeout before activationauto_destruct
- Auto-activate kill switchdestruction_level
- Kill switch level (1-5)"5m"
- 5 minutes"1h"
- 1 hour"30s"
- 30 seconds"24h"
- 24 hoursPOST /admin/deadmans Authorization: Bearer your_admin_key_here Content-Type: application/json { "enabled": true, "check_interval": "5m", "master_timeout": "15m", "auto_destruct": false, "destruction_level": 3 } Response: { "success": true }
Send heartbeat signal to reset the dead man's switch timer
POST /admin/deadmans/heartbeat Authorization: Bearer your_admin_key_here Response: { "success": true, "timestamp": "2024-01-15T10:30:00Z", "status": "heartbeat_acknowledged" }
💡 Note: Regular heartbeat signals prevent automatic destruction. If no heartbeat is received within the configured timeout, the system will automatically activate the kill switch if auto_destruct is enabled.
Send heartbeat to prevent dead man's switch activation
POST /admin/deadmans/heartbeat Content-Type: application/json { } Response: { "success": true, "heartbeat_recorded": "2024-01-15T10:30:00Z", "next_required": "2024-01-16T10:30:00Z", "time_remaining": "23h 59m 30s" }
Control the intelligent decoy traffic generation system
start
- Start decoy traffic generationstop
- Stop decoy traffic generationconfigure
- Update decoy settingsreset
- Reset decoy systemintensity
- Traffic intensity level (1-10)pattern
- Traffic pattern typetargets
- Target endpointsschedule
- Timing configurationPOST /admin/decoy Content-Type: application/json { "action": "configure", "config": { "intensity": 5, "pattern": "random", "enabled": true } } Response: { "success": true, "decoy_status": "configured", "current_config": { "intensity": 5, "pattern": "random", "enabled": true, "last_updated": "2024-01-15T10:30:00Z" } }
Get current decoy system status and statistics
GET /admin/decoy/status X-Admin-Key: your_admin_key_here Response: { "success": true, "decoy_system": { "status": "active", "intensity": 5, "pattern": "random", "requests_generated_24h": 12500, "effectiveness_score": 85, "last_activity": "2024-01-15T10:29:45Z" }, "statistics": { "total_decoy_requests": 125000, "detection_evasion_rate": "94%", "system_load_impact": "minimal" } }
Cloudflare Turnstile verification for enhanced security
POST /admin/turnstile Content-Type: application/json { "token": "0.turnstile_token_here" } Response: { "success": true, "verified": true, "challenge_ts": "2024-01-15T10:30:00Z", "hostname": "your-domain.com" }
Configure automatic log cleanup and retention policies
GET /admin/cleanup/config X-Admin-Key: your_admin_key_here Response: { "enabled": true, "cleanup_interval": "1h", "retention_days": 7, "last_cleanup": "2024-01-15T09:30:00Z", "cleanup_targets": ["logs", "temp", "cache"] } POST /admin/cleanup/config Content-Type: application/json { "enabled": true, "cleanup_interval": "2h", "retention_days": 14 } Response: { "success": true, "config_updated": true, "next_cleanup": "2024-01-15T12:30:00Z" }
Get statistics for a specific slug (requires slug parameter)
GET /stats?slug=your-slug-here Response: { "visits": 150, "logs": 89, "valid": 23, "invalid": 12 }
Invalid admin key or malformed request
Missing or invalid authentication
Requested slug or resource does not exist
Server error - check system logs
Convenient shell script for common admin operations:
# Preview log cleanup (30 days retention) ./scripts/admin_cleanup.sh logs 30 --dry-run # Clean database records older than 7 days ./scripts/admin_cleanup.sh database 7 # Emergency cleanup - delete all cleanable data ./scripts/admin_cleanup.sh all 0 # Get current system status ./scripts/admin_cleanup.sh status # Configure decoy system ./scripts/admin_cleanup.sh decoy start --intensity 7
Note: The CLI scripts automatically handle authentication using environment variables.