mirror of
https://github.com/usememos/memos.git
synced 2026-12-03 01:09:17 +01:00
7cb288864b
The instance-wide maximum upload size in the storage setting and the per-user UPLOAD_BYTES usage limit were two caps on the same thing, with a rule that the per-user value could only lower the instance value. The storage setting field is removed, and the all-users UPLOAD_BYTES usage limit is the only per-file cap. A user's own limit replaces the default in either direction, and no limit means any file size. - Remove upload_size_limit_mb from the API and store storage settings, the 32 MiB store default, and the deployment config check. - Drop the FILE_TOO_LARGE error; every refusal is QUOTA_EXCEEDED with metric UPLOAD_BYTES. - Split usagelimit.CheckFileSize out of CheckUpload and call it from memo import, so import is no longer a bypass. - Remove the Maximum upload size field from the Storage section and the instance-limit warning from the usage limits dialog. The old value is not carried over. Instances that relied on the default accept any file size until an admin sets a limit.
Memos API Design
This API design should follow the guidelines and best practices outlined in the Google API Improvement Proposals (AIPs).
The package is memos.api. It carries no version marker; breaking changes are recorded in CHANGELOG.md.
File Layout
- The service, then shared top-level types used by more than one group.
- One block per resource group, in service order: the resource message, then the group's request/response messages in RPC order, then helper messages used only by that group.
Within a group, order RPCs List, Get, BatchGet, Create, Update, Delete, BatchDelete, then custom methods.
Messages
- Resources:
namefirst, timestamps (create_time,update_time, others) last. - Requests:
parentorname, the payload,update_mask, thenpage_size,page_token,filter,order_by, and other options. - Responses: items, then
next_page_token. - Fields first, then nested enums, then nested messages.
- Number fields 1..N in declaration order. A new field takes the next number; never reuse or renumber a released field outside a recorded breaking change.
google.api.resourceliststype,pattern,singular,plural; omitname_field: "name".
Comments
- Every service, RPC, message, enum and field has a comment. RPC comments start with the RPC name.
- Fields with
google.api.field_behaviorstart with the matching prefix:Identifier.,Required.,Optional.,Output only., orInput only.. Fields without the annotation get no prefix. - Resource-name fields end with a
Format: memos/{memo}line. - Describe what the server does, not what it might do.