feat: add enterprise licensing and S3 storage backend

Add the enterprise package with Ed25519 license key validation and
feature gating. Enterprise code lives in the public repo under a
proprietary license (Cal.com/PostHog model), protected legally, not
by code hiding.

Implement S3-compatible storage backend as the first enterprise
feature. The file-storage module now delegates to either local
filesystem or S3 based on STORAGE_MODE env var. Works with AWS S3,
Cloudflare R2, DigitalOcean Spaces, MinIO, and any S3-compatible
provider. Workspace files remain local (ephemeral processing).

New env vars: STORAGE_MODE, S3_BUCKET, S3_REGION, S3_ENDPOINT,
S3_ACCESS_KEY_ID, S3_SECRET_ACCESS_KEY, S3_FORCE_PATH_STYLE,
S3_PREFIX, SNAPOTTER_LICENSE_KEY.

Tested against MinIO: 10 S3 integration tests + 82 existing tests
pass with zero regressions.
This commit is contained in:
SnapOtter
2026-06-06 20:17:49 +08:00
parent 06d1822491
commit 3b84fab765
15 changed files with 658 additions and 27 deletions
+2
View File
@@ -12,6 +12,7 @@
"clean": "rm -rf dist"
},
"dependencies": {
"@aws-sdk/client-s3": "^3.1063.0",
"@fastify/cookie": "^11.0.2",
"@fastify/cors": "^11.0.0",
"@fastify/multipart": "^9.0.0",
@@ -21,6 +22,7 @@
"@scalar/fastify-api-reference": "^1.57.5",
"@sentry/node": "^10.55.0",
"@snapotter/ai": "workspace:*",
"@snapotter/enterprise": "workspace:*",
"@snapotter/image-engine": "workspace:*",
"@snapotter/shared": "workspace:*",
"archiver": "^7.0.1",