Files
2026-01-04 23:00:21 +08:00

1.4 KiB

License System Backend

ASP.NET Core 8 API service for the software authorization system.

Requirements

  • .NET 8 SDK
  • PostgreSQL 16+
  • Redis 7+ (optional, for rate limiting)

Quick Start

  1. Create database and apply schema:
psql -U postgres -d license -f scripts/init.sql
  1. Update src/License.Api/appsettings.json with your connection string and JWT secret.

  2. Run the API:

dotnet restore

ASPNETCORE_URLS=http://localhost:39256 dotnet run --project src/License.Api
  1. Swagger:
http://localhost:39256/swagger

Docker Compose

  1. Copy env file:
cp .env.example .env
  1. Start services:
docker compose up -d
  1. Check health:
curl http://localhost:39256/health/ready

Notes

  • On first run, a super_admin user is seeded from Seed config in appsettings.json.
  • Files are stored under the Storage:UploadRoot path (defaults to uploads/).
  • If Storage:ClientRsaPublicKeyPem is empty, files are stored unencrypted and no key headers are returned.
  • CORS can be restricted via Cors:AllowedOrigins or env Cors__AllowedOrigins__0 (set Cors:AllowAny to true for dev).
  • When Storage:RequireHttpsForDownloadKey is true, encrypted downloads require HTTPS to return the decryption key.
  • Auth signature accepts ProjectSecret or ProjectKey (use ProjectKey for client integrations).