Commit graph

332 commits

Author SHA1 Message Date
memoclaw
a249d06e2e
feat(instance): add notification transport setting (#5737)
Co-authored-by: memoclaw <265580040+memoclaw@users.noreply.github.com>
2026-03-19 09:18:28 +08:00
boojack
65d14fbb63
feat(instance): add canonical tag metadata setting (#5736) 2026-03-19 08:54:43 +08:00
boojack
330291d4d9
feat(user): add per-user tag metadata settings (#5735) 2026-03-18 23:15:14 +08:00
boojack
04f239a2fc
fix(api): remove public activity service (#5734) 2026-03-18 22:42:57 +08:00
memoclaw
1e688b2a5d
feat: extract title from first H1 heading into memo property (#5726)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-16 11:05:03 +08:00
memoclaw
8f43e8075b
fix: correct typos in comments, error messages, and identifiers (#5704)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 18:40:17 +08:00
memoclaw
92d937b1aa
feat: replace auto-increment ID with UID for identity provider resource names (#5687)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 21:01:22 +08:00
Steven
b0558824c4 feat: update instance profile to use admin user instead of initialized flag
- Changed InstanceProfile to include admin user field
- Updated GetInstanceProfile method to retrieve admin user
- Modified related tests to reflect changes in admin user retrieval
- Removed owner cache logic and tests, introducing new admin cache tests
2026-01-28 23:27:53 +08:00
Steven
ba099b72ed feat: update InstanceProfile to include initialization status
- Removed the owner field from InstanceProfile as it is no longer needed.
- Added an initialized field to InstanceProfile to indicate if the instance has completed first-time setup.
- Updated GetInstanceProfile method to set initialized based on the existence of an admin user.
- Modified tests to reflect changes in InstanceProfile and ensure correct behavior regarding instance initialization.
- Adjusted frontend logic to redirect users based on the initialized status instead of the owner field.
2026-01-22 20:59:40 +08:00
Johnny
0f3c9a467d refactor: migrate HOST roles to ADMIN
- Updated the isSuperUser function to only check for ADMIN role.
- Added SQL migration scripts for MySQL, PostgreSQL, and SQLite to change user roles from HOST to ADMIN.
- Created a new SQLite migration to alter the user table structure and ensure data integrity during the migration process.
2026-01-20 23:38:30 +08:00
Johnny
47ebb04dc3 refactor: remove mode flag and introduce explicit demo flag 2026-01-20 22:58:33 +08:00
Johnny
dc7ec8a8ad feat: allow setting custom timestamps when creating memos and comments
Allow API users to set custom create_time, update_time, and display_time
when creating memos and comments. This enables importing historical data
with accurate timestamps.

Changes:
- Update proto definitions: change create_time and update_time from
  OUTPUT_ONLY to OPTIONAL to allow setting on creation
- Modify CreateMemo service to handle custom timestamps from request
- Update database drivers (SQLite, MySQL, PostgreSQL) to support
  inserting custom timestamps when provided
- Add comprehensive test coverage for custom timestamp functionality
- Maintain backward compatibility: auto-generated timestamps still
  work when custom values are not provided
- Fix golangci-lint issues in plugin/filter (godot and revive)

Fixes #5483
2026-01-17 12:56:03 +08:00
Johnny
d7284fe867 refactor: nest reaction resource names under memos 2025-12-30 23:29:54 +08:00
Johnny
5d677828a6 refactor: remove NSFW content settings from instance configuration 2025-12-29 20:13:54 +08:00
Johnny
78aa41336a feat: implement attachment filtering functionality 2025-12-28 18:47:59 +08:00
Steven
d0c3908168 refactor: remove deprecated Sessions and AccessTokens settings
- Remove ListSessions and RevokeSession RPC endpoints
- Remove Session message and SessionsSetting from UserSetting
- Remove ACCESS_TOKENS key and AccessTokensSetting
- Update references to use RefreshTokensUserSetting with its own ClientInfo
- Remove UserSessionsSection frontend component
- Clean up user store to remove session and access token settings
- Regenerate protobuf files

The system now uses:
- REFRESH_TOKENS for session management with sliding expiration
- PERSONAL_ACCESS_TOKENS for long-lived API tokens
2025-12-19 08:35:57 +08:00
Johnny
7932f6d0d0
refactor: user auth improvements (#5360) 2025-12-18 18:15:51 +08:00
Steven
1cf047707b refactor: migrate binary file serving from gRPC to dedicated HTTP fileserver
Migrates attachment and avatar binary serving from gRPC endpoints to a new dedicated HTTP fileserver package, fixing Safari video playback issues and improving architectural separation.

Key changes:
- Created server/router/fileserver package for all binary file serving
- Removed GetAttachmentBinary and GetUserAvatar gRPC endpoints from proto
- Implemented native HTTP handlers with full range request support
- Added authentication support (session cookies + JWT) to fileserver
- New avatar endpoint supports lookup by user ID or username
- Eliminated duplicate auth constants (imports from api/v1)

HTTP endpoints:
- Attachments: /file/attachments/:uid/:filename (unchanged URL)
- Avatars: /file/users/:identifier/avatar (new URL format)

This fixes Safari video/audio playback by using http.ServeContent() which properly handles HTTP 206 Partial Content responses and range request headers.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-09 08:53:52 +08:00
Steven
81da20c905 refactor: simplify theme/locale to user preferences and improve initialization
Remove theme and locale from instance settings to eliminate duplication and
simplify the codebase. These are user-specific preferences and should only
exist in user settings, not instance-wide settings.

Backend changes:
- Remove theme from InstanceGeneralSetting proto
- Remove locale from InstanceCustomProfile proto
- Update instance service converters to remove theme/locale handling
- Simplify RSS feed to use static locale

Frontend changes:
- Remove theme/locale from instanceStore state
- Create unified initialization flow with clear fallback priority:
  * Theme: user setting → localStorage → system preference
  * Locale: user setting → browser language
- Add applyUserPreferences() to centralize theme/locale application
- Simplify App.tsx by removing redundant state synchronization
- Update all components to use new helper functions:
  * getThemeWithFallback() for theme resolution
  * getLocaleWithFallback() for locale resolution
- Remove theme/locale selectors from instance profile dialog

Theme utilities refactor:
- Organize code into clear sections with JSDoc comments
- Extract localStorage operations into getStoredTheme/setStoredTheme helpers
- Split DOM manipulation into focused functions
- Improve type safety with Theme and ResolvedTheme types
- Reduce code duplication and improve maintainability

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 09:08:46 +08:00
Johnny
1a9bd32cf1 feat(auth): add PKCE support and enhance OAuth security
Implements critical OAuth 2.0 security improvements to protect against authorization code interception attacks and improve provider compatibility:

- Add PKCE (RFC 7636) support with SHA-256 code challenge/verifier
- Fix access token extraction to use standard field instead of Extra()
- Add OAuth error parameter handling (access_denied, invalid_scope, etc.)
- Maintain backward compatibility for non-PKCE flows

This brings the OAuth implementation up to modern security standards as recommended by Auth0, Okta, and the OAuth 2.0 Security Best Current Practice (RFC 8252).

Backend changes:
- Add code_verifier parameter to ExchangeToken with PKCE support
- Use token.AccessToken for better provider compatibility
- Update proto definition with optional code_verifier field

Frontend changes:
- Generate cryptographically secure PKCE parameters
- Include code_challenge in authorization requests
- Handle and display OAuth provider errors gracefully
- Pass code_verifier during token exchange

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-01 00:04:26 +08:00
Johnny
bb7e0cdb79 refactor: remove enable link preview setting
- Remove enable_link_preview field from proto definitions
- Remove setting UI from MemoRelatedSettings component
- Remove translations from all 33 locale files
- Regenerate proto files

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-30 10:34:22 +08:00
Johnny
5fb6f8eccf refactor: remove legacy disable markdown shortcuts setting
- Remove disable_markdown_shortcuts field from proto definitions
- Remove setting UI from MemoRelatedSettings component
- Enable markdown shortcuts permanently in MemoEditor
- Remove translations from all 32 locale files
- Fix TypeScript error in useMemoSave hook by using typed translation function

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-30 10:30:55 +08:00
Steven
4c1d1c70d1 refactor: rename workspace to instance throughout codebase
Remove work-related terminology by renaming "workspace" to "instance"
across the entire application. This change better reflects that Memos
is a self-hosted tool suitable for personal and non-work use cases.

Breaking Changes:
- API endpoints: /api/v1/workspace/* → /api/v1/instance/*
- gRPC service: WorkspaceService → InstanceService
- Proto types: WorkspaceSetting → InstanceSetting
- Frontend translation keys: workspace-section → instance-section

Backend Changes:
- Renamed proto definitions and regenerated code
- Updated all store layer methods and database drivers
- Renamed service implementations and API handlers
- Updated cache from workspaceSettingCache to instanceSettingCache

Frontend Changes:
- Renamed service client: workspaceServiceClient → instanceServiceClient
- Updated all React components and state management
- Refactored stores: workspace.ts → instance.ts
- Updated all 32 locale translation files

All tests pass and both backend and frontend build successfully.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-05 23:35:35 +08:00
boojack
d98ee36178
chore: standardize and improve API structure (#5224)
Co-authored-by: Claude <noreply@anthropic.com>
2025-11-05 22:36:51 +08:00
Steven
bc1550e926 refactor(api): migrate inbox functionality to user notifications
- Remove standalone InboxService and move functionality to UserService
- Rename inbox to user notifications for better API consistency
- Add ListUserNotifications, UpdateUserNotification, DeleteUserNotification methods
- Update frontend components to use new notification endpoints
- Update store layer to support new notification model

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-31 08:33:09 +08:00
Steven
243ecf14b0 refactor(api): remove DeleteMemoTag and RenameMemoTag endpoints
BREAKING CHANGE: Removed DeleteMemoTag and RenameMemoTag API endpoints
for better API consistency. Tags should now be managed by updating memo
content directly via UpdateMemo endpoint.

Backend changes:
- Remove RenameMemoTag and DeleteMemoTag RPC methods from proto
- Remove backend implementations in memo_service.go
- Regenerate protocol buffers (Go, TypeScript, OpenAPI)

Frontend changes:
- Remove RenameTagDialog component
- Simplify TagsSection to remove rename/delete functionality
- Improve tag styling with active state highlighting
- Add smooth transitions and better hover interactions
- Polish TagTree component for consistency
- Tags now only support click-to-filter (no inline editing)

Style improvements:
- Active tags highlighted with primary color and font-medium
- Consistent hover states across flat and tree views
- Better spacing and visual hierarchy
- Improved empty state styling

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-29 23:32:47 +08:00
Claude
739fd2cde6 refactor: update markdown parser
- Removed the `nodes` field from the `Memo` interface in `memo_service.ts`.
- Updated the `createBaseMemo` function and the `Memo` message functions to reflect the removal of `nodes`.
- Cleaned up the serialization and deserialization logic accordingly.

chore: remove code-inspector-plugin from Vite configuration

- Deleted the `codeInspectorPlugin` from the Vite configuration in `vite.config.mts`.
- Simplified the plugins array to include only `react` and `tailwindcss`.
2025-10-26 11:28:40 +08:00
Steven
9121ddbad9 feat(api): support username lookup in GetUser endpoint
- Update GetUser to accept both numeric IDs and username strings (users/{id} or users/{username})
- Implement CEL filter parsing for username-based lookups
- Update proto documentation to reflect dual lookup capability
- Simplify frontend user store to use GetUser instead of ListUsers filter
- Update ListUsers filter documentation to show current capabilities
2025-10-22 21:48:34 +08:00
Steven
b4ea7d843f feat: enhance memo sorting functionality to support multiple fields 2025-10-20 23:41:58 +08:00
github-actions[bot]
074c580214 chore: bump gomark
- Bump protoc-gen-go version from v1.36.8 to v1.36.9 in multiple generated files.
- Enhance OpenAPI descriptions for various endpoints to improve clarity and readability.
- Fix typo in the description list handling in the markdown service.
- Update HTMLElement component to handle children and self-closing tags correctly.
- Modify types in the markdown service to include children and self-closing properties for HTML elements.
2025-09-28 16:15:55 +08:00
Johnny
e93f3cbb8b refactor: unify theme and apperance 2025-08-17 11:27:59 +08:00
Liu Chao
ba7dfb7d98
fix: OpenAPI Parameter Conflict in DeleteMemoTag Endpoint (#4985)
Signed-off-by: ChaoLiu <chaoliu719@gmail.com>
2025-08-13 07:14:18 +08:00
johnnyjoy
506b477d50 fix: get user by username 2025-08-04 19:56:12 +08:00
Steven
1fcafd807e chore: enable memo comments by default 2025-07-29 22:31:18 +08:00
Johnny
8f51791da8 chore: update user setting definition 2025-07-29 09:21:51 +08:00
johnnyjoy
c5d497a1f0 chore: update user settings 2025-07-27 23:12:42 +08:00
johnnyjoy
3f56ce47d2 chore: update definition of workspace setting 2025-07-27 15:50:09 +08:00
johnnyjoy
db63b1949a chore: fix creator id format 2025-07-23 22:18:47 +08:00
johnnyjoy
ed23cbc011 refactor: memo filter 2025-07-23 22:10:16 +08:00
Steven
ac386c218d fix: workspace setting keys 2025-07-22 22:59:54 +08:00
johnnyjoy
6e45e9f8b6 refactor: deprecate old filter 2025-07-22 21:25:57 +08:00
Steven
533591af2b chore: theme in user setting 2025-07-08 19:50:04 +08:00
Johnny
1b3083b216
feat: themes (#4824) 2025-07-07 20:13:22 +08:00
Johnny
240d89fbca feat: migrate dialogs 2025-07-06 22:01:55 +08:00
johnnyjoy
1fffc41f79 feat: sliding expiration for user sessions 2025-06-26 23:03:28 +08:00
Steven
42d1650c6d chore: tweak auth service 2025-06-24 23:31:37 +08:00
johnnyjoy
976bd332fe chore: fix linter 2025-06-24 21:55:27 +08:00
johnnyjoy
d6a75bba4c refactor: webhook service 2025-06-24 21:28:21 +08:00
Johnny
9b15936873 refactor: clean unused fields 2025-06-23 22:55:14 +08:00
Steven
83febf9928 chore: clean resource definition 2025-06-23 21:08:25 +08:00
Steven
5821bb7a65 chore: update auth service 2025-06-23 20:31:18 +08:00
Johnny
4e3a4e36f6 feat: implement user sessions 2025-06-23 09:13:51 +08:00
Johnny
77b7fc4441 feat: implement user session 2025-06-22 12:46:13 +08:00
Johnny
741fe35c2a refactor: rename session methods in auth service 2025-06-21 00:00:58 +08:00
Steven
35df62a96c chore: remove duplicated prefix from enums 2025-06-18 22:40:54 +08:00
Steven
d71fd2f84a refactor: auth service 2025-06-18 20:25:46 +08:00
Steven
9972a77d9e refactor: memo service 2025-06-18 19:58:38 +08:00
Steven
91c2a4cef9 refactor: inbox service 2025-06-18 19:06:09 +08:00
Steven
bb5809cae4 refactor: attachment service 2025-06-17 22:15:19 +08:00
Steven
174b1a0361 chore: fix linter 2025-06-17 21:04:28 +08:00
Steven
f6e5da4499 refator: activity service 2025-06-17 09:00:03 +08:00
Steven
dac059a7f7 refactor: identity provider service 2025-06-16 23:56:28 +08:00
Steven
8d8e9b3b30 refactor: shortcut service 2025-06-16 23:10:50 +08:00
Steven
1ea4cc453c refactor: workspace setting service 2025-06-16 22:51:26 +08:00
Steven
da906c665c chore: tweak workspace service 2025-06-16 22:20:10 +08:00
Steven
3b0c87591f refactor: webhook service 2025-06-16 22:10:43 +08:00
Steven
c9ab03e1a0 refactor: user service 2025-06-16 21:49:38 +08:00
Steven
64b27d5a4e refactor: shortcut service 2025-05-26 21:45:14 +08:00
johnnyjoy
ee99afd7a4 chore: enable location by default 2025-05-19 21:25:51 +08:00
johnnyjoy
ca79990679 refactor: merge sign in requests 2025-05-14 22:13:52 +08:00
johnnyjoy
eb33a604b2 feat: support mapping avatar url from oauth2 2025-04-24 10:07:24 +08:00
Anubhav Singh
a63d9b471b
feat: update ItalicNode to use repeated children instead of content (#4566)
* feat: update ItalicNode to use repeated children instead of content

* chore: update gomark dependency to latest version

---------

Co-authored-by: Anubhav Singh <anubhav@mail.techindika.com>
2025-03-28 16:15:03 +08:00
Johnny
0dfcb1a7c8 feat: total memo count 2025-03-12 22:15:46 +08:00
Johnny
925e97882e feat: support pinned factor 2025-03-10 18:52:12 +08:00
Johnny
90119c1af8 refactor: move memo property 2025-03-07 22:53:35 +08:00
Johnny
16a0872972 chore: enable auto compact by default 2025-03-06 23:02:12 +08:00
Johnny
5562282822 chore: update demo site 2025-02-27 23:05:43 +08:00
Johnny
47b41bce85 refactor: move memo relation definition 2025-02-27 15:28:36 +08:00
Johnny
5bb4a300db chore: bump gomark 2025-02-27 15:10:39 +08:00
MHZ
174b8b048a
feat: support blur processing for NSFW content with customizable NSFW tags (#4407) 2025-02-16 23:35:31 +08:00
Johnny
0a429a899f chore: remove version update activity 2025-02-09 11:48:53 +08:00
johnnyjoy
13f6fa7b37 refactor: remove default visibility in workspace setting 2025-02-08 11:40:31 +08:00
johnnyjoy
6682917931 chore: add validate only to create shortcut 2025-02-03 11:45:05 +08:00
johnnyjoy
be5e24c0eb refactor: renovate list memos endpoint 2025-02-02 18:43:26 +08:00
johnnyjoy
14c72fa7df feat: implement shortcuts 2025-02-02 17:11:52 +08:00
johnnyjoy
57014e392f feat: get user by username 2025-02-01 18:00:22 +08:00
johnnyjoy
0dcd0904e8 refactor: remove resource uid 2025-02-01 12:50:15 +08:00
johnnyjoy
97d12db3d5 refactor: renovate create memo 2025-02-01 11:48:22 +08:00
johnnyjoy
98aa0b73c5 refactor: retire memo uid 2025-02-01 11:28:07 +08:00
johnnyjoy
5e770dda52 refactor: memo name 2025-02-01 11:17:36 +08:00
Comix
d9a92b2ef8
feat: support path style of s3 url (#4304)
Signed-off-by: ComixHe <ComixHe1895@outlook.com>
2025-01-21 18:02:21 +08:00
johnnyjoy
409d64b839 chore: update memo comment in activity 2025-01-20 19:34:23 +08:00
johnnyjoy
f1308ddd27 refactor: update part of resource identifier 2025-01-19 23:03:22 +08:00
Steven
edc3f1d9d9 chore: retire unused memo view 2025-01-16 09:20:01 +08:00
johnnyjoy
c76ab87a0a refactor: update list user stats 2025-01-15 19:25:36 +08:00
johnnyjoy
ee96465be0 feat: list user stats 2025-01-13 23:14:44 +08:00
johnnyjoy
d050a6fd46 chore: update user stats 2025-01-11 20:12:02 +08:00
johnnyjoy
34c26a394a feat: implement user stats endpoint 2025-01-11 16:59:22 +08:00
Steven
5ff8ab9a61 chore: polish creator definition 2025-01-10 23:39:50 +08:00
Steven
8b7e9f5443 chore: remove unused user id 2025-01-10 23:35:00 +08:00