125 Commits

Author SHA1 Message Date
Johnny 9a08a7334f feat: add drawings with @usememos/canvas (#6533) 2026-11-09 08:25:09 +08:00
boojack 3feb08737b fix(server): log file-serving failures and answer missing local files as JSON
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.
2026-11-01 12:30:49 +08:00
Santhi Prakash 422afea881 fix(server): answer file-serving errors as JSON, not the media type (#6516) 2026-11-01 12:16:55 +08:00
Johnny 1511fd125d refactor(server): replace Echo with net/http (#6475) 2026-10-15 09:32:02 +08:00
Johnny f9d277f6bd chore: switch release versions to YY.MM.N (#6469) 2026-10-14 19:26:59 +08:00
goingforstudying-ctrl 8120a6cee0 fix: SSRF guards still allow 100.64.0.0/10 (CGNAT) destinations (#6256)
Signed-off-by: goingforstudying-ctrl <goingforstudying@gmail.com>
Co-authored-by: goingforstudying-ctrl <258847353+goingforstudying-ctrl@users.noreply.github.com>
Co-authored-by: goingforstudying-ctrl <goingforstudying-ctrl@users.noreply.github.com>
2026-10-13 08:50:43 +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
johnnyjoygh 0b3b5a6999 fix(linkmeta): read further for missing preview metadata 2026-10-09 08:17:31 +08:00
somasoil f7a6186731 refactor: use the built-in max/min to simplify the code (#6430)
Signed-off-by: somasoil <somasoil@outlook.com>
2026-10-06 06:01:38 +08:00
boojack 8f6e6a7ae6 fix(version): derive development CalVer from HEAD commit date 2026-10-03 06:17:19 +08:00
Johnny fa12d84606 feat: adopt calendar versioning and reset the migration baseline (#6362) 2026-09-22 09:03:49 +08:00
bluedbird eab07d8081 refactor(export): rename Memo Archive to Memos Export Format
Avoid confusion with archived memos while preserving legacy ZIP imports. Move Export & Import to the end of basic settings.
2026-09-20 00:37:50 +08:00
bluedbird f4d97fafcd fix: block CGNAT SSRF and restore cross-database CI coverage 2026-09-19 22:54:43 +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
ABird 019ca26bd3 feat: export and import memos as a Memo Archive (#6334) 2026-09-16 22:23:38 +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
boojack c506f67d22 feat(server): rate limit sign-in, signup, fetches, uploads, and writes (#6315) 2026-09-13 11:58:26 +08:00
boojack 751005bc19 feat(user): make email an optional, canonical, instance-unique attribute (#6314) 2026-09-12 12:21:41 +08:00
Ruben Pari 3227748a30 fix(scheduler): correct cron calendar day matching (#6306) 2026-09-09 23:50:49 +08:00
boojack b3e67399b8 feat(attachment): upload files in resumable chunks
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.
2026-09-08 21:07:06 +08:00
ABird 34dbb83948 feat(spaces): support custom icons and emoji (#6287) 2026-09-07 23:12:18 +08:00
Abdellatif Anaflous 607dc28413 fix(webhook): block unspecified-address destinations in the SSRF guard (#6284)
Co-authored-by: hktitof <hktitof@users.noreply.github.com>
2026-09-07 20:13:10 +08:00
Johnny dfa0fda766 feat(filter): support space placement in saved views (#6267) 2026-09-04 09:29:09 +08:00
elonfliter 59541ea438 refactor(webhook): iterate hostname labels with SplitSeq (#6251) 2026-08-31 09:04:15 +08:00
boojack 5b6d8f87bf refactor(server): remove RSS feed support (#6243) 2026-08-28 23:06:25 +08:00
ABird 66b9cb49c1 feat(spaces): add space-aware UI and filtering (#6230) 2026-08-24 23:13:55 +08:00
amblued 76a7629243 feat(instance): persist access mode independently of URL (#6225) 2026-08-22 14:15:31 +08:00
amblued 79baf2eab7 chore(link-preview): remove site-specific image fallback 2026-08-21 21:22:56 +08:00
amblued 57a4b7aee6 chore(go): upgrade to Go 1.27 (#6217) 2026-08-20 23:37:02 +08:00
amblued e99ae78012 fix(markdown): avoid parsing currency as inline math (#6216) 2026-08-20 19:47:10 +08:00
amblued 38412eb75a fix(storage): proxy S3 attachments through authenticated routes (#6210) 2026-08-18 23:38:35 +08:00
Johnny 16cd3107bf feat(link-preview): support standards-based metadata (#6206) 2026-08-18 09:16:04 +08:00
questfever 011a0e8360 refactor: replace Split in loops with more efficient SplitSeq (#6187)
Signed-off-by: questfever <questfever@outlook.com>
2026-08-16 21:46:16 +08:00
Johnny 7d971b1c61 feat(storage): add named attachment storage drivers (#6184) 2026-08-13 22:37:11 +08:00
Johnny 57bfe0a70f feat(filter): support memo location filters (#6181) 2026-08-12 00:00:37 +08:00
Johnny da81b6b48f feat: persist and display client media metadata (#6180) 2026-08-11 23:47:21 +08:00
Johnny bd636a4365 feat: support memo-scoped Markdown attachment images (#6169) 2026-08-09 23:27:18 +08:00
Johnny 4e8b262d6d refactor(memo-views): replace shortcuts with saved views (#6167) 2026-08-09 20:27:27 +08:00
Johnny d617f652b0 fix(markdown): support word-internal apostrophes in tags (#6135) 2026-08-02 21:08:57 +08:00
Johnny 8648b97b9e feat(user): define username format and mention syntax (#6134) 2026-08-02 19:57:16 +08:00
Johnny c68e3d5bf9 feat(markdown): unify tag syntax and recognition (#6132) 2026-08-02 14:46:04 +08:00
johnnyjoygh c536434b81 test(release): cover 0.30.0 changelog promises 2026-07-26 22:21:19 +08:00
Johnny 7cedcc9c22 test(email): make SMTP failure test deterministic (#6113) 2026-07-25 09:33:00 +08:00
boojack b7d5d09f8a fix(api): update UID compatibility
Use the original UID format consistently across API, username, and store validation so UUID-based callers continue to work. Regenerate API documentation and add regression coverage for UUID memo IDs.
2026-07-20 19:41:55 +08:00
johnnyjoygh 84776cc106 fix(api): align resource IDs with AIP conventions
Validate new user-provided IDs using the AIP-122 format while retaining legacy UID compatibility. Correct resource annotations and canonical names returned by user stats.
2026-07-18 11:12:28 +08:00
boojack 6c17e87cf6 fix(auth): support OAuth client auth auto-detection
- support providers requiring client_secret_basic while preserving POST fallback
- stop logging user-info claims and mapped profile data
- cover both client authentication styles with PKCE
2026-07-12 23:34:33 +08:00
boojack 3fe145083f chore: reorganize backend and frontend modules
- remove the unused internal cron package
- split API service implementations by responsibility
- clarify frontend shared-module ownership
2026-07-12 17:59:12 +08:00
boojack 41ff22b0cc feat(filter): fold now.getXxx() accessors for dynamic date-part filters
Timestamp accessors previously compiled only on schema fields, so a saved
shortcut like created_ts.getMonth() == now.getMonth() && created_ts.getDate()
== now.getDate() ("on this day") failed with unknown identifier "now" and the
only workaround froze literal month/day values into the filter.

Accessors on `now` now fold to literal date parts of the frozen per-compile
clock (UTC, CEL bases: 0-based month/day-of-week), so such filters re-resolve
on every query. Comparisons are also normalized for the renderer: a folded
literal on the left swaps operands with the operator mirrored, and
literal-vs-literal comparisons fold to a constant condition.
2026-07-07 22:53:21 +08:00