Implements all remaining backend infrastructure for Corrosion platform.
Backend Services (5 new):
- license.rs: License validation, activation, check-in with NATS token generation
- map_manager.rs: Map upload/rotation with SHA-256 checksums, circular advancement
- health_checker.rs: Post-wipe verification with retry loop and backoff
- backup_manager.rs: Tar.gz backups with retention policy (last 10), recursive upload
- scheduler.rs: Tokio-cron integration for scheduled wipes with NATS events
WipeEngine Orchestration (wipe_engine.rs):
- execute_wipe(): Master orchestrator managing full lifecycle
- execute_pre_wipe(): Countdown warnings, backups, player kicks
- execute_wipe_actions(): Map/plugin deletion, seed rotation, Steam updates
- execute_post_wipe_verification(): Health checks with restart attempts
- execute_rollback(): Failure recovery with backup restore
- JSONB execution logs, NATS status events, service composition pattern
WebSocket/NATS Bridge (ws.rs):
- JWT authentication via query parameter
- License-scoped NATS subscriptions (corrosion.{license_id}.*)
- Bi-directional: NATS→WebSocket event forwarding, WebSocket→NATS publishing
- Axum 0.8 with ws feature, auto Ping/Pong handling
Panel Adapter Fixes:
- AMP/Pterodactyl/Companion adapters fully wired
- RCON command execution, file operations, Steam update triggers
Fixes:
- Added ws feature to Axum dependency
- Fixed Message::Text() type conversions (String→Utf8Bytes via .into())
- Fixed BackupInfo FromRow derive
- Fixed recursive async with Box::pin pattern
- Fixed async JobScheduler::new() constructor
- Removed manual WebSocket Ping/Pong handler
Compilation: 0 errors, 327 warnings (unused vars/functions)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
83 lines
1.8 KiB
TOML
83 lines
1.8 KiB
TOML
[package]
|
|
name = "corrosion-api"
|
|
version = "0.1.0"
|
|
edition = "2021"
|
|
description = "Corrosion — Rust Server Management Platform API"
|
|
license = "Proprietary"
|
|
|
|
[dependencies]
|
|
# Web framework
|
|
axum = { version = "0.8", features = ["macros", "multipart", "ws"] }
|
|
axum-extra = { version = "0.10", features = ["typed-header"] }
|
|
tower = "0.5"
|
|
tower-http = { version = "0.6", features = ["cors", "trace", "limit", "fs"] }
|
|
hyper = { version = "1", features = ["full"] }
|
|
|
|
# Async runtime
|
|
tokio = { version = "1", features = ["full"] }
|
|
futures = "0.3"
|
|
|
|
# Database
|
|
sqlx = { version = "0.8", features = ["runtime-tokio-rustls", "postgres", "uuid", "chrono", "json", "migrate"] }
|
|
|
|
# Messaging
|
|
async-nats = "0.38"
|
|
|
|
# Serialization
|
|
serde = { version = "1", features = ["derive"] }
|
|
serde_json = "1"
|
|
|
|
# Auth
|
|
jsonwebtoken = "9"
|
|
argon2 = "0.5"
|
|
totp-rs = { version = "5", features = ["qr", "gen_secret"] }
|
|
|
|
# Encryption
|
|
aes-gcm = "0.10"
|
|
hmac = "0.12"
|
|
sha2 = "0.10"
|
|
base64 = "0.22"
|
|
rand = "0.8"
|
|
|
|
# HTTP client (panel APIs, Cloudflare, Steam, PayPal)
|
|
reqwest = { version = "0.12", features = ["json", "rustls-tls"], default-features = false }
|
|
|
|
# Email
|
|
lettre = { version = "0.11", default-features = false, features = ["tokio1", "tokio1-rustls-tls", "builder", "hostname", "pool", "smtp-transport"] }
|
|
|
|
# Scheduling
|
|
tokio-cron-scheduler = "0.13"
|
|
cron = "0.12"
|
|
|
|
# Logging
|
|
tracing = "0.1"
|
|
tracing-subscriber = { version = "0.3", features = ["env-filter", "json"] }
|
|
|
|
# UUID
|
|
uuid = { version = "1", features = ["v4", "serde"] }
|
|
|
|
# Date/time
|
|
chrono = { version = "0.4", features = ["serde"] }
|
|
|
|
# Config
|
|
dotenvy = "0.15"
|
|
|
|
# Error handling
|
|
thiserror = "2"
|
|
anyhow = "1"
|
|
|
|
# Async trait support
|
|
async-trait = "0.1"
|
|
|
|
# Hex encoding
|
|
hex = "0.4"
|
|
|
|
# HTTP types
|
|
http = "1"
|
|
|
|
# Byte buffers (used by NATS bridge)
|
|
bytes = "1"
|
|
|
|
# URL encoding (used by Pterodactyl adapter)
|
|
urlencoding = "2"
|