feat: implement license platform business flows and delivery tooling
Some checks failed
Check / delivery-static (push) Has been cancelled
Check / api (push) Has been cancelled
Check / web (push) Has been cancelled

Add admin and customer interfaces, orders, signed activation and leases, protected package delivery, keyring verification, migrations, security controls, tests and deployment documentation.

Co-Authored-By: Craft Agent <agents-noreply@craft.do>
This commit is contained in:
2026-10-09 15:33:22 +08:00
parent 3ab651d3a8
commit 54c318c615
142 changed files with 11105 additions and 178 deletions

View File

@@ -1,2 +1,37 @@
# API listen address (local development)
HTTP_ADDR=127.0.0.1:18080
# Empty means no trusted proxies. Explicit proxy CIDRs only, never /0.
HTTP_TRUSTED_PROXY_CIDRS=
# Set true behind managed TLS termination; forwarded headers alone are insufficient.
SESSION_COOKIE_SECURE=false
HTTP_READ_HEADER_TIMEOUT=5s
HTTP_READ_TIMEOUT=30s
HTTP_WRITE_TIMEOUT=30s
HTTP_IDLE_TIMEOUT=60s
HTTP_SHUTDOWN_TIMEOUT=10s
# Optional separate metrics listener, numeric loopback only; never publish through Web.
METRICS_ADDR=
# Required default: redis. Only controlled development may explicitly use local-dev.
ENTRY_LIMIT_MODE=redis
ENTRY_REDIS_ADDR=127.0.0.1:16379
ENTRY_REDIS_NAMESPACE=license-platform:entry:
ENTRY_REDIS_USERNAME=
ENTRY_REDIS_PASSWORD_FILE=
# Redis errors fail closed with 503; no automatic local fallback.
# Migration CLI URL. Do not reuse as MYSQL_DSN.
MIGRATION_DSN=mysql://user:password@tcp(127.0.0.1:3306)/license_platform?multiStatements=true
# Go MySQL driver DSN for API and admin-init.
MYSQL_DSN=user:password@tcp(127.0.0.1:3306)/license_platform?parseTime=true
# Optional PEM P-256 ECDSA private key, injected by secret manager; never commit a real key.
LICENSE_SIGNING_PRIVATE_KEY_PEM=
# Alternative absolute protected PEM file; never configure both key sources.
LICENSE_SIGNING_PRIVATE_KEY_FILE=
# Optional absolute public-key ring JSON; opt-in DEV license-v2/lease-v2.
# Lifecycle/rotation approval required; private key NEVER belongs in this JSON.
LICENSE_KEYRING_FILE=
# Absolute existing trusted non-public directory; hard links must be supported.
PACKAGE_STORAGE_ROOT=
# This example is documentation, not a production security profile.
# Compose external path variables (not secret values): MYSQL_APP_SECRET_FILE,
# MYSQL_ROOT_SECRET_FILE, LICENSE_SIGNING_KEY_HOST_FILE, PACKAGE_STORAGE_HOST.
# See docs/deployment-delivery.md for outstanding TLS/cookie/restore blockers.