feat(api): 单次上传上限改为 context_max_bytes 可配,Cloudflare 边缘后默认 95Mi,新增 GET /me/submissions/limits 供面板预检

This commit is contained in:
Lemon-miaow committed 2026-09-25 18:31:10 +08:00
1 parent e7326e6315
commit 87dee3e5a5
10 files changed
+158 -2

No files matched your search

+30 -1
View File
@@ -5278,6 +5278,31 @@ paths:
'503':
$ref: '#/components/responses/ServiceUnavailable'
/api/v1/me/submissions/limits:
get:
tags: [submissions]
operationId: submissionLimits
x-felis-face: [external]
x-felis-tier: app
security: [{ sessionCookie: [] }]
summary: The per-upload build-context cap
description: >-
The effective [registry] context_max_bytes: 1 GiB by default, 95 MiB
behind the Cloudflare edge (its proxy refuses bodies over 100 MB before
they reach the API). The panel checks a file against it before upload.
responses:
'200':
description: The cap.
content:
application/json:
schema:
type: object
additionalProperties: false
required: [max_context_bytes]
properties:
max_context_bytes: {type: integer, format: int64}
'503':
$ref: '#/components/responses/ServiceUnavailable'
/api/v1/me/submissions/{id}/context:
post:
tags: [submissions]
@@ -5290,7 +5315,11 @@ paths:
principal; a submission the caller does not own is reported as 404, so
this endpoint cannot upload to or probe another user's submission. Only a
pending_review submission accepts a context (409 otherwise); a wrong-format
or oversize body is rejected with 400, and an upload that would push the
or oversize body is rejected with 400 (the per-upload cap is [registry]
context_max_bytes: 1 GiB by default and 95 MiB behind the Cloudflare
edge, whose proxy refuses bodies over 100 MB with its own HTML 413
before they reach the API; GET /api/v1/me/submissions/limits reports
the effective cap so a client can check a file before sending it), and an upload that would push the
caller past their per-user stored-context budget is refused with 403
before the excess is persisted. Returns 503 when the deployment's context
store has no implemented upload transport.