Commit Graph

4558 Commits (8fa2ff442355787fd565cf8ba8eb892a99a90e31)
 

Author SHA1 Message Date
johnnyjoygh 8fa2ff4423 fix(mcp): allow reverse-proxied instances to serve /mcp
The go-sdk Streamable HTTP handler enables DNS-rebinding protection that
rejects any request whose Host header is non-loopback while the server is
bound to a loopback address. memos is commonly run bound to loopback behind a
reverse proxy (e.g. the public demo), so every /mcp request was rejected with
"403 Forbidden: invalid Host header" before authentication ran.

Disable the SDK's localhost protection and rely on memos' own Origin/Host
allowlist (isAllowedMCPOrigin) for CSRF / DNS-rebinding protection. Add a
regression test covering the proxied shape and confirming disallowed origins
are still rejected.
3 weeks ago
johnnyjoygh 96cb65320b fix(instance): add needs_setup so admin-less instances aren't treated as fresh
The frontend keyed first-run setup off a null InstanceProfile.admin, but a
null admin only means "no admin-role user exists" — which also happens on a
populated instance that has lost all its admins. Such an instance was wrongly
redirected to signup, where the new account is created as a normal user (the
first-user promotion only triggers when there are zero users), leaving the
instance permanently admin-less.

Add an explicit InstanceProfile.needs_setup derived from user count == 0, and
switch the signup redirect and host tip to use it. admin stays for display only.
3 weeks ago
johnnyjoygh 6eb17864df feat: surface newly created memo above pinned list 3 weeks ago
johnnyjoygh deddf71d7b feat(editor): add focus-mode formatting toolbar
Add a rich-text formatting toolbar as the focus-mode header when the
WYSIWYG editor is active: heading dropdown, bold/italic/code, lists, and
link, with a priority+overflow responsive layout and live active-state
highlighting. The toolbar is a self-contained component driven through a
new FormattingController surface routed via EditorContent.

Remove the now-redundant slash-command feature (/todo, /code, /link,
/table) and its "Type / for commands" hint, since the toolbar covers
those actions; the shared suggestion renderer stays for #tag.
3 weeks ago
johnnyjoygh f727ad217c fix(comments): list all memo comments via pagination
Memo detail only showed the first 10 comments: the frontend requested
pageSize=0, which the backend normalizes to DefaultPageSize (10), and the
returned nextPageToken was never followed.

Add useInfiniteMemoComments (mirrors useInfiniteMemos) so the detail page
paginates through every comment, with a "Load more" control in
MemoCommentSection. Page size defaults to DEFAULT_LIST_MEMOS_PAGE_SIZE to
match the memo list convention.
3 weeks ago
johnnyjoygh f5a60263b2 chore(ui): align frontend on shadcn kit
Design system:
- add semantic --success/--warning OKLCH tokens across themes; replace
  hardcoded green/amber feedback colors and their manual dark: overrides
- drop the unused @emotion dependency

Kit usage:
- migrate raw <button>/<input> to ui-kit components (actions) or
  <div>/<span> (non-action surfaces); keep genuinely custom looks as
  raw HTML with their own styles
- make kit usage prop-only (no className overrides): add Button
  size="icon-sm", Badge "warning" variant + "pill" shape
- extract a shared Tabs primitive (segmented/underline) and migrate
  Inboxes + UserProfile onto it
- tokenize z-index tiers as z-overlay/z-dropdown/z-tooltip
- export variant types (ButtonVariant/Size, BadgeVariant/Shape, TabsVariant)
- document the kit and its policy in components/ui/README.md
3 weeks ago
boojack 3b07f78fd8 chore: tweak demo data
- Trim sponsor memo to CodeRabbit + SSD Nodes, concise single-tier layout
- Add a demo personal access token (Bearer memos_pat_demo) for the admin user
- Stagger memo created_ts relative to seed time so the demo timeline always
  looks recent; lead the pinned section with the Welcome memo
- Unpin the Scratchpad promo and drop the fixed "June" movie-marathon label
3 weeks ago
boojack f0e4a5624f feat(filter): expand CEL filter surface with startsWith/endsWith, matches(), and all()
Let users write three more CEL constructs in the filter field, each compiled to
SQL across SQLite/MySQL/Postgres:

- Scalar startsWith()/endsWith() on content/filename/mime_type (case-insensitive)
- matches() regex: PG ~, MySQL/SQLite REGEXP (Go-backed SQLite fn), validated at
  compile time via cel.ValidateRegexLiterals()
- all() comprehension over tags via per-element subqueries, non-empty required

Also: contains() now escapes LIKE metacharacters (%, _, \); cross-dialect render
tests plus behavioral tests; cel-go bumped to v0.28.1; new operators surfaced in
the frontend shortcut guide.
4 weeks ago
boojack 817561df8f fix(editor): collapse lingering select-all selection after delete
Ctrl+A creates a whole-document AllSelection; deleting it (Backspace, Delete, or Cut) maps the AllSelection onto the now-empty paragraph instead of collapsing to a caret, so the view paints a "selected" empty block. A ProseMirror appendTransaction now collapses a leftover AllSelection to a caret after any doc-changing edit.
4 weeks ago
ManJieqi 46685b1906
chore: update Chinese translations in zh-Hans.json (#6033)
Signed-off-by: ManJieqi <40858189+manjieqi@users.noreply.github.com>
4 weeks ago
boojack 385fa22056 fix(cors): open API to any origin for token auth, keep cookies same-origin
Reflect any Origin so token-authenticated clients (Access Token V2 / PAT)
can call the API cross-origin, but emit Access-Control-Allow-Credentials
only for trusted origins (same host / configured InstanceURL). This keeps
the SameSite=Lax refresh cookie unreadable by untrusted (incl. same-site
subdomain) origins. Origin: null is not reflected.

Note for operators: cross-origin token access is now open by default; if
you front memos with a caching proxy, ensure it honors `Vary: Origin`.
4 weeks ago
boojack 00225db922 refactor(web): share markdown element styles between viewer and editor
Extract the Tailwind classes for common markdown elements (paragraph,
blockquote, lists, inline code, link, hr, headings) into a single
markdownStyles.ts consumed by both the read-only MemoContent components
and the WYSIWYG editor, replacing the duplicated per-element strings and
the .memo-wysiwyg CSS block. Heading classes are precomputed per level so
the hot renderHTML path is a lookup, not a cn() merge.

Also require at least one character after `#` before opening the tag
suggestion menu so a bare `#` (or `# ` heading) no longer conflicts with
markdown headings.
4 weeks ago
boojack 2c0efeba7c refactor(web): rename editor dirs and simplify raw mode to a plain textarea 4 weeks ago
boojack 797f1ff15d
feat(web): markdown WYSIWYG editor with raw-mode toggle (#6030)
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
4 weeks ago
boojack 8080bd10e1 docs: add README for mcp 1 month ago
boojack f497f009ce fix(webhook): fail loud on malformed signing secret and add tests
Follow-up to #6013. The signing path silently fell back to using the raw
secret string as the HMAC key when a whsec_-prefixed secret had invalid
base64, producing signatures no receiver could verify with no server-side
signal.

- Extract resolveSigningKey helper that errors on invalid whsec_ base64
- Post returns that error (logged by the async dispatcher); ValidateSigningSecret
  rejects it at write time so a bad secret is never stored
- Fix stale comment referencing a nonexistent Authorization header
- Add Go tests: key derivation, secret validation, end-to-end signature
  round-trip, and the invariant that the secret never leaks into API responses
1 month ago
Yiges.M.x. 063a44498d
feat: add optional webhook signing secret (Standard Webhooks HMAC-SHA256) (#6013) 1 month ago
boojack 1052c04d33 fix(web): improve mobile control spacing 1 month ago
boojack 418398587c feat(i18n): add searchable locale picker 1 month ago
boojack 777d227eb9
feat: add OpenAPI-driven MCP support (#6026) 1 month ago
boojack a47d04954e feat(i18n): expand European locale coverage 1 month ago
boojack 6870e863de chore(github): improve issue templates with structured triage fields
Add area dropdowns, reproduction requirements, regression info, and
compatibility sections to reduce back-and-forth on bug reports and
feature requests.
1 month ago
boojack ecbe2ab797 fix(memo): preserve expanded todo list state 1 month ago
ay5399 8f1377324f
fix(editor): wire Ctrl+B and Ctrl+I markdown shortcuts to textarea (#6016)
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: boojack <stevenlgtm@gmail.com>
1 month ago
boojack 9eabb554d5
feat(settings): move tag metadata to user settings (#6017) 1 month ago
boojack a50ce09e81 fix(markdown): ignore tags inside links 1 month ago
boojack 5e71c0a737 docs: rewrite agent repository guide 1 month ago
boojack 2a4638b332 chore: remove MCP server 1 month ago
boojack 5f194da7d3
chore(main): release 0.29.1 (#5985) 1 month ago
boojack bb76949fc0 chore(server): centralize CORS policy 1 month ago
boojack d69f1aab27 chore: tweak demo data 1 month ago
boojack 0e2a9a9c0c fix(web): render video attachment posters on mobile 1 month ago
goingforstudying-ctrl e8d32e87d1
fix: support <meta name=description> in link previews (#6000)
Co-authored-by: goingforstudying-ctrl <goingforstudying-ctrl@users.noreply.github.com>
1 month ago
boojack 0d31e3c2fb chore(media): add zoom controls to preview dialog 1 month ago
boojack fadc974364 docs: consolidate agent guidance 1 month ago
boojack 53abb8020e refactor(frontend): remove react-use dependency 1 month ago
boojack 7c3bff4e98 fix(markdown): keep task item content in one grid column 2 months ago
boojack f22c4bd5c2
chore(main): release 0.29.0 (#5909) 2 months ago
boojack e0bb3a2e68 fix(editor): wrap selected text when pasting URL 2 months ago
boojack 648b3bd812
feat(memo): add task list quick actions (#5983) 2 months ago
boojack e564c1a993 chore: update about page 2 months ago
boojack e53b7d96e7
fix: delete user cleanup (#5981) 2 months ago
boojack d1208a68e9 chore: update sponsors 2 months ago
boojack 3c3382a3c6
fix: avoid update event on memo create attachments (#5961) 2 months ago
boojack 858f7419b4 chore(seed): tweak seed data 2 months ago
boojack 63d6431d3e
chore: update images in README for dark mode
Signed-off-by: boojack <stevenlgtm@gmail.com>
2 months ago
Santosh Yadav ddcaf5f25c
chore: fix coderabbit logo for light and dark theme (#5954) 2 months ago
boojack ab2b08a21e chore(seed): refresh demo memos and sponsor showcase 2 months ago
boojack 727480d49d
chore: revamp sponsors section in README
Updated the featured sponsors section to include a table layout and added new sponsor information.

Signed-off-by: boojack <stevenlgtm@gmail.com>
2 months ago
boojack 439ddaebf5 refactor(placeholder): extract tile sprite strip 2 months ago