Backend API for the Safeturned security scanning service. Handles plugin analysis, threat detection, and provides REST endpoints for the web interface.
This API processes Unturned plugin files (.dll) and scans them for:
- Backdoors and malicious code
- Suspicious patterns and functions
- Security vulnerabilities
- Code obfuscation attempts
- Framework: ASP.NET Core 9.0 with Aspire
- Database: PostgreSQL with dbup migrations
- Background Jobs: Hangfire
- Logging: Serilog
- Error Tracking: Sentry
- API Documentation: Swagger/OpenAPI
- Deployment: GitHub Actions builds with Aspire, pushes to GHCR, and deploys via SSH, we do not make it via GH Release for simple!
- .NET 9.0 SDK
- PostgreSQL
- Docker (optional)
- Clone and setup:
git clone https://github.com/Safeturned/Api.git
cd Api
- Run with Aspire (includes PostgreSQL and pgAdmin):
dotnet run --project Safeturned.AppHost
- Services will be available at:
- API:
http://localhost:5000
- pgAdmin:
http://localhost:5050
- Hangfire Dashboard:
http://localhost:5000/hangfire
- API:
# Build and run with Aspire (generates docker-compose.yaml)
dotnet run --project Safeturned.AppHost
# Or use the generated docker-compose.yaml directly
docker compose up -d
The API is automatically deployed when you create a version tag:
git tag v1.0.0
git push origin v1.0.0
This triggers:
- Build - Aspire publishes the application
- Container - Docker image is built and pushed to GitHub Container Registry
- Deploy - Files are copied to server and deployed via SSH
POST /v1/files
- Upload and scan a .dll plugin fileGET /v1/files/{id}
- Get scan results by file IDGET /v1/analytics
- Get analytics dataGET /health
- Health check endpoint
Note: API requires authentication via API key and origin validation. In the short/long term future, we plan to make the API publicly available for everyone.
Api/
├── src/ # Main API project
├── Safeturned.AppHost/ # Aspire host
├── Safeturned.ServiceDefaults/ # Shared services
└── FileChecker/ # Plugin analysis logic
The project uses:
- Aspire for local development and deployment
- Submodules for the FileChecker component
- GitHub Actions for CI/CD
MIT License - see LICENSE file.