WriteError now logs the cause of a server error, which the public JSON
body never carries, unless the client has already gone away. The header
reset and envelope move into a shared writer the panic recoverer uses
too, so one failure logs once. The doc comment states the header contract.
A local attachment whose file is gone from disk answers a JSON 404 like
every other storage failure instead of net/http's plain-text page.
The export handler no longer strips the archive headers itself and logs
only the committed case the wrapper cannot see. The fake S3 and local
storage test setups are shared helpers, and the 416 test pins that
Content-Range survives the header reset.
The reaction upsert binding renamed its memo field from name to parent,
but the body override still stripped name, so the tool exposed a
redundant parent string beside the path argument. Omit parent instead,
and fail at startup when an override omits a property the request body
no longer has, so a binding rename cannot leave a path-bound field
exposed again.
The evals README authenticated with the demo access token the seed no
longer ships. Declare steven in a configuration directory, which the
demo seed attaches its content to, then sign in and mint a personal
access token for the harness.
Startup is now migrate, apply the configuration, then seed in demo mode,
the order in which comparable systems bootstrap identity before content.
Seed leaves store.Migrate and becomes a method the server calls after
applyConfigurationAtStartup.
The seed holds content only. The public demo access token and the
MEMO_RELATED row are gone; the reaction list belongs to the configuration.
Users are inserted without fixed ids and only when missing, their profile
fields are filled only where empty, and every memo, membership, reaction,
and attachment references its creator by username. A declared
administrator therefore keeps its row, credentials, and display name, and
the seeded content attaches to it. A bare --demo start without a
configuration seeds the same four users as before.
The seed test covers both starts and asserts the seed writes no instance
or user settings. Two stale lines of copy are fixed.
A configuration file may now declare which identity-provider subject signs
in as a declared user, as a fourth resource kind:
"linkedIdentities": [
{ "name": "users/admin/linkedIdentities/sso", "externalUid": "subject" }
]
An administrator on an SSO-only instance otherwise has no way in before the
first sign-in, which provisions a new account because the sign-in path
matches a provider and subject and nothing else. Matching an email or
username claim was rejected: neither proves ownership on this instance. A
declared subject trusts no claim, and the sign-in path is unchanged.
Rules: the user must be declared in the same configuration, a subject is
declared once, the provider must exist after apply, and a subject already
linked to a different user fails the plan rather than being taken over. A
link made by signing in with the declared subject is adopted; a different
stored subject is replaced. Links are written after users in the apply
transaction. A declared user with a declared link may be created without a
password; it gets an unusable random one, as SSO provisioning does.
The API refuses to create or delete a managed link, and to delete a
provider a declared link names. The account page hides Unlink for a
declared link. LinkedIdentity.external_uid is no longer output only.
The frontend handler served index.html for any extensionless path, so
OAuth Protected Resource Metadata probes under /.well-known/ received
HTML with status 200. MCP clients that run RFC 9728 discovery before
trusting the endpoint failed to parse it, while a 404 would have told
them the server does not advertise OAuth.
Paths with a hidden segment are never app routes: usernames, memo UIDs,
and fixed routes all begin with an alphanumeric character. Return 404
for them, following RFC 8615 for /.well-known/ and the dotfile
convention of common static servers for paths like /.git/.
Fixes#6495
Link preview was a Timeline view option, so it reset to on everywhere else.
Double-click to edit was an instance setting an admin chose for everyone.
Both are presentation choices for one browser, so they now live in a single
localStorage-backed store shared by every memo view and are toggled from
Settings > Preferences under "This device".
MemoRelatedSetting.enable_double_click_edit is removed from the API and
storage protos and reactions becomes field 1; stored rows that still carry
the old key load unchanged. The admin Memo page keeps only reactions.
Move memo content size into usage limits, with 8 KiB content and 32 MiB
upload defaults when settings are absent. Represent stored rule targets
with all_users or a positive user_id, and use that same schema for
deployment configuration.
Rename the memo count metric, remove reserved proto declarations, and
renumber fields and enums for the unreleased schema. Synchronize
enforcement, settings UI, generated clients, and tests.
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.
ListAttachments was the only list RPC whose page token was a bare decimal
offset. Switch it to the shared PageToken format used by every other
paginated handler so the token also carries the page size and stays
consistent across the API.
The MCP catalog survived the recent API changes because it is derived
from OpenAPI, but three things drifted around it, and fixing them
surfaced a fourth.
- mcp: the adapter built each in-process API request with httptest,
whose fixed peer address (192.0.2.1) overrode the caller's resolved
address on the client-address middleware's second pass. Every
anonymous MCP caller shared one rate-limit bucket. The adapter now
presents the address resolved for the /mcp request as the peer.
- mcp: the full SpaceService is curated as space_* tools. Space and
member updates drop path-bound fields and rely on the gateway's
update-mask inference; accepting and declining an invitation no
longer require an empty body for a body: "*" binding whose only
field comes from the path.
- mcp/evals: answers re-pinned to the current seed (four users,
22 top-level memos, 35 reactions, four spaces) and extended with
space questions.
- store/sqlite: transactions begin IMMEDIATE. Token authentication
records the token's last-used time asynchronously on every request,
and the space drivers read before they write in a deferred
transaction; when the background commit landed in between, SQLite
refused the upgrade with SQLITE_BUSY without consulting the busy
timeout. Roughly half of space creates over MCP failed. Taking the
write lock up front keeps the parent-delete serialization the design
relies on, so the SQLite stale-snapshot test now asserts that a
concurrent delete waits for the open transaction instead.
An active application ADMIN now passes every memo-local authorization
check on named operations: authorship, audience, Space membership and
participation, attachment and reaction ownership. Structural validity
still applies, an archived admin holds no privilege, and collection
listings keep the audience predicate so feeds never surface other users'
private memos.
- core/access: admin bypass in the read policy; CanManageMemo and
CanManageAttachment as the shared author-level predicates.
- store: drivers read the actor's role alongside its lifecycle state in
the mutation transaction; validators accept an admin where they
required the author or a member; shared attachment binding and
removal predicates.
- api: handlers use the shared predicates; admins may place memos in
any existing Space and see a memo's Space by name.
- web: one canManageMemo helper replaces the ad hoc creator checks.
- docs: multi-spaces design revised in place; share RPC comments
updated.
Drop the D1 store driver, its migrations, emulator, design doc, filter
dialect, and test-harness wiring. Memos supports SQLite, MySQL, and
PostgreSQL only.
Bound work an anonymous or low-privilege caller can force:
- Bound thumbnail decoding by declared pixel count before decoding and
remember images that cannot be thumbnailed (over the bound or not
decodable), so a small image declaring billions of pixels is served
as-is instead of decoded on every request. Transient storage read
errors are not remembered. The bound lives in internal/imagelimit and
is shared with EXIF stripping.
- Cap request bodies at 16 MiB for procedures that carry no file bytes;
only inline attachment creation, transcription, and chunked uploads
keep their larger caps.
- Digest over-long submitted usernames before using them as sign-in
limiter keys, add header and idle timeouts to the HTTP server, limit
filter expression size, and cap the SQLite regexp cache.
Close correctness gaps:
- Delete the thumbnail the file server actually writes (.v2.jpeg), its
failure marker, and the legacy name when an attachment is removed.
- Decide EXIF stripping from the sniffed content as well as the declared
type, so a mislabeled JPEG keeps no metadata.
- Revoke every other session when a password changes; an admin reset
revokes all of the target's sessions. Prune expired refresh tokens.
- Enforce the 2 MiB avatar limit the web client already applies.
- Keep S3 object keys unique when the path template has no {uuid}.
- Reject negative attachment page tokens.
- Charge memo archive imports against the write and upload budgets,
charge repeated validate-only plans, discard only attachments an
import actually stored, and refuse archives that declare far more
bytes than they hold.
- Load database-stored attachment bytes only after authorization.
- Remove the unused, unguarded linkmeta.GetImage fetcher.
Frontend: send no referrer when loading external images in memos and
link previews, and drop picture/source from the sanitizer so every
remote image goes through the https-only src rule.
Dependencies: grpc 1.83.1 and x/crypto 0.56.0 for reported advisories.
Add UploadAttachment, a unary RPC that accepts a file in bounded chunks
and streams it to a temp file instead of holding the whole blob in one
request body and in memory. A call carrying a spec starts an upload and
returns an opaque upload_id; later calls carry that id with
write_offset,
data, and finish_write, following the Cloud Storage WriteObject shape.
Retrying the last chunk after a lost response is idempotent, uploads are
bound to their owner, and they expire after 30 minutes of inactivity.
CreateAttachment and the chunked finalize now share one processing
pipeline for motion-photo detection, EXIF stripping, and storage. The
motion-photo detector works over an io.ReaderAt so large JPEGs are never
loaded whole, and the request body cap is a single per-procedure lookup.
The web editor uploads through the new RPC in 2 MiB chunks with bounded
concurrency under the server's per-user limit.