11 Commits

Author SHA1 Message Date
Johnny 7afb4f3681 fix(mysql): improve MariaDB compatibility and test coverage (#6572) 2026-11-16 23:03:15 +08:00
Johnny 9576bd53ac feat: filter memos by attachments and images (#6492) 2026-10-22 18:58:45 +08:00
johnnyjoygh 008dded234 fix(filter): drop the bind arguments of folded operands
The renderer discarded the SQL of an operand that folded to a constant,
such as the left side of `x || true`, but kept the arguments it had already
added. Callers append their own predicates after the filter fragment and
bind positionally, so each leftover argument bound to a later placeholder.

Fold boolean constants out of the condition tree before rendering, so a
subtree either renders with its arguments or not at all, and reject any
rendered fragment whose placeholders and arguments disagree.
2026-10-22 09:17:23 +08:00
Johnny d775160283 fix: harden instance admin, health, and mail header handling (#6454) 2026-10-11 10:52:03 +08:00
johnnyjoygh a316e7935b chore(go): modernize source and enforce go fix in CI 2026-10-09 22:07:23 +08:00
Suliman Abdulrazzaq 0c53b775ce fix(filter): match memos without the flag in JSON bool comparisons (#6382)
Co-authored-by: johnnyjoygh <johnnyjoygg@gmail.com>
2026-09-27 08:58:02 +08:00
boojack 26be2a9663 feat(navigation): unify creator and space browsing scopes (#6378) 2026-09-26 11:36:31 +08:00
johnnyjoygh f32d367c7f chore: update database drivers
Drop the D1 store driver, its migrations, emulator, design doc, filter
dialect, and test-harness wiring. Memos supports SQLite, MySQL, and
PostgreSQL only.
2026-09-17 09:31:42 +08:00
bluedbird 471745b431 fix: harden attachment, auth, and import paths for public deployment
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.
2026-09-17 08:47:44 +08:00
Johnny 2e3db14741 feat(store): add Cloudflare D1 database driver (#6330) 2026-09-16 01:43:17 +08:00
ABird 45519accd3 refactor: name packages by role and enforce import direction (#6317) 2026-09-13 18:22:54 +08:00