Commit Graph

153 Commits

Author SHA1 Message Date
copilot-swe-agent[bot] 5e782e4044 fix: scope drawings cache by userId and add Socket.io authentication
Security fixes:
1. Drawings cache now includes userId in cache key to prevent data leakage
   between users making identical queries.
2. Socket.io connections now require JWT authentication when auth is enabled.
3. Socket.io join-room verifies drawing ownership before allowing access.
4. Frontend passes auth token when connecting to Socket.io.

Co-authored-by: ZimengXiong <83783148+ZimengXiong@users.noreply.github.com>
2026-02-06 14:52:47 -08:00
Zimeng Xiong 0253ebb6b8 admin dashboard 2026-02-06 14:27:24 -08:00
Zimeng Xiong 1e617025df Add admin password reset flow 2026-02-06 14:11:13 -08:00
Zimeng Xiong e4941ad77f fix(dev): avoid native deps in predev migrate 2026-02-06 09:56:45 -08:00
Zimeng Xiong 2e370f9821 fix(dev): reset legacy dev.db and apply migrations 2026-02-06 09:54:13 -08:00
Zimeng Xiong b075a0cf9e fix(dev): avoid auth redirect when backend/schema missing 2026-02-06 09:50:27 -08:00
Zimeng Xiong 7977a3eb09 feat(auth): default to single-user mode with enable toggle 2026-02-06 09:45:38 -08:00
Zimeng Xiong 40a645b823 chore(deps): apply dependabot updates 2026-02-06 09:22:23 -08:00
Zimeng Xiong dd966f6d01 merge(pr): record PR #51 on pre-release 2026-02-06 09:20:35 -08:00
Zimeng Xiong d832e55dfd merge(pr): record PR #52 on pre-release 2026-02-06 09:20:35 -08:00
Zimeng Xiong 887818c9b4 merge(pr): record PR #47 on pre-release 2026-02-06 09:20:35 -08:00
Zimeng Xiong bc13cc3483 merge(pr): record PR #46 on pre-release 2026-02-06 09:20:35 -08:00
Zimeng Xiong da299d00d5 merge(pr): record PR #44 on pre-release 2026-02-06 09:20:35 -08:00
Zimeng Xiong 302d9bd94b merge(pr): record PR #41 on pre-release 2026-02-06 09:17:30 -08:00
Zimeng Xiong d68fe6a2c0 fix(auth): stabilize refresh expiry and frontend URL handling 2026-02-06 09:17:24 -08:00
Zimeng Xiong 7a54123e93 fix(export): include excalidraw source/version metadata 2026-02-06 00:26:31 -08:00
Zimeng Xiong 75a1f11a96 feat(auth): consolidate multi-user auth and admin controls 2026-02-06 00:25:13 -08:00
Zimeng Xiong 700e153740 merge: pull PR48 auth and UX into pre-release 2026-02-05 23:25:56 -08:00
Zimeng Xiong fd3b97225f merge: bring main into pre-release 2026-02-05 23:20:06 -08:00
dependabot[bot] 0d1fe8e0e5 Bump lodash from 4.17.21 to 4.17.23 in /backend
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.21 to 4.17.23.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.21...4.17.23)

---
updated-dependencies:
- dependency-name: lodash
  dependency-version: 4.17.23
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-02 00:07:20 +00:00
Zimeng Xiong b6d0150d44 chore: release v0.3.2 v0.3.2 2026-02-01 16:06:19 -08:00
Zimeng Xiong 55cd816cca fix: correct test assertions for trust proxy behavior in supertest
The demonstration tests had incorrect assumptions about how Express
trust proxy works in supertest (no real socket connection). Updated
assertions to match actual behavior while preserving the test's purpose
of showing that trust proxy: true extracts the correct client IP.
2026-02-01 16:05:58 -08:00
Zimeng Xiong d67bd1daf8 fix express proxy headers 2026-02-01 16:04:52 -08:00
Zimeng Xiong 4b56d3cfc6 repro issue 2026-02-01 16:04:52 -08:00
Zimeng Xiong 88ed4360c0 docs: document comma-separated FRONTEND_URL support
Clarifies that FRONTEND_URL accepts multiple comma-separated URLs
for accessing ExcaliDash from different addresses (e.g., localhost
and LAN IP simultaneously).
2026-02-01 16:01:02 -08:00
Zimeng Xiong 7dfa69de2a fix export source and verisoning 2026-01-30 14:57:27 -08:00
Matteo 4f53b899c9 chore: add dependencies for authentication features
- Add bcrypt for password hashing
- Add jsonwebtoken for JWT tokens
- Add zod for input validation
- Update package-lock.json
2026-01-24 17:13:07 +01:00
Matteo 9fe3a2193d chore: update tests and configuration for auth integration
- Update test utilities for user authentication
- Update Settings page for authenticated export
- Update docker-compose.yml if needed
- Update package-lock.json files
2026-01-24 17:12:39 +01:00
Matteo 804adb7347 docs: add FORK.md with feature summary
- Document all security features added
- Document UX improvements added
- Include migration strategy and backward compatibility notes
- Provide enable instructions for optional features
2026-01-24 17:12:36 +01:00
Matteo 9c6b7dd727 test: add tests for audit logging utility
- Add comprehensive tests for logAuditEvent
- Add tests for getAuditLogs with user filtering
- Test graceful degradation when feature disabled
- Test JSON details parsing
- Follow existing test patterns and style
2026-01-24 17:12:34 +01:00
Matteo f6e337aa98 feat(frontend): add auto-hide header to Editor
- Add mouse-based auto-hide functionality
- Add toggle button to enable/disable auto-hide
- Prevent auto-hide during drawing name editing
- Smooth transitions with translate-y animations
- Dynamic canvas height adjustment based on header visibility
2026-01-24 17:12:31 +01:00
Matteo cbe83efe1f feat(frontend): add select all button to Dashboard
- Add Select All button with CheckSquare/Square icons
- Toggle selection of all drawings in current view
- Match styling with other icon buttons
- Add tooltip for better UX
2026-01-24 17:12:27 +01:00
Matteo 112d58a92a feat(frontend): add profile page for user management
- Add Profile page for viewing/editing user info
- Add display name editing functionality
- Add change password functionality with validation
- Add Profile button to Sidebar navigation
- Handle authentication errors gracefully
2026-01-24 17:12:26 +01:00
Matteo b834f777b5 feat(frontend): add password reset pages
- Add PasswordResetRequest page for requesting reset
- Add PasswordResetConfirm page for confirming reset
- Handle feature disabled state gracefully
- Add routes to App.tsx
2026-01-24 17:12:24 +01:00
Matteo 5f476542e2 feat(frontend): add login and register pages
- Add Login page with email/password form
- Add Register page with email validation
- Add forgot password link to login page
- Update App.tsx with auth routes and AuthProvider
- Add email validation in registration form
2026-01-24 17:12:23 +01:00
Matteo f1a1ff3a8a feat(frontend): add authentication context and API client
- Add AuthContext for managing user authentication state
- Add ProtectedRoute component for route protection
- Update API client with JWT token injection
- Add refresh token rotation support
- Add CSRF token handling
2026-01-24 17:12:21 +01:00
Matteo 29af9fac62 feat(backend): integrate authentication and user isolation
- Add authentication middleware to protected routes
- Add user isolation to drawing and collection queries
- Add audit logging to delete operations
- Update CSRF token handling for authenticated users
2026-01-24 17:12:18 +01:00
Matteo 2998fad8e7 feat(security): add audit logging utility
- Add logAuditEvent function for security event logging
- Add getAuditLogs function for retrieving audit logs
- Gracefully handles disabled feature or missing table
- Feature disabled by default via config flag
2026-01-24 17:12:16 +01:00
Matteo b6e9514eb3 feat(auth): add authentication endpoints (login, register, refresh, me)
- Add POST /auth/register endpoint with email validation
- Add POST /auth/login endpoint with JWT token generation
- Add POST /auth/refresh endpoint for token refresh
- Add GET /auth/me endpoint for current user info
- Add rate limiting for auth endpoints
- Add bcrypt password hashing
- Add JWT access and refresh token generation
2026-01-24 17:12:06 +01:00
Matteo b175706da1 feat(auth): add authentication middleware and utilities
- Add requireAuth middleware for protecting routes
- Add errorHandler and asyncHandler middleware
- Add user isolation helpers for database queries
2026-01-24 17:11:52 +01:00
Matteo 381dd95543 feat(config): add feature flags for optional security features
- Add enablePasswordReset, enableRefreshTokenRotation, enableAuditLogging flags
- All flags default to false for backward compatibility
- Add getOptionalBoolean helper for parsing boolean env vars
- Update .env.example with feature flag documentation
2026-01-24 17:11:50 +01:00
Matteo 78ab52b762 feat(security): add database schema for security features
- Add PasswordResetToken model for password reset flow
- Add RefreshToken model for token rotation tracking
- Add AuditLog model for security event logging
- All features disabled by default via feature flags
2026-01-24 17:11:46 +01:00
Matteo d9013b8f7a feat(auth): add user authentication database schema
- Add User model with email, passwordHash, and name fields
- Add userId foreign key to Drawing and Collection models
- Create initial migration for user authentication
2026-01-24 17:11:40 +01:00
dependabot[bot] 5d29cd919d Bump lodash from 4.17.21 to 4.17.23 in /frontend
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.21 to 4.17.23.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.21...4.17.23)

---
updated-dependencies:
- dependency-name: lodash
  dependency-version: 4.17.23
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-01-23 23:44:41 +00:00
dependabot[bot] 9170930e8e Bump lodash-es from 4.17.21 to 4.17.23 in /frontend
Bumps [lodash-es](https://github.com/lodash/lodash) from 4.17.21 to 4.17.23.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.21...4.17.23)

---
updated-dependencies:
- dependency-name: lodash-es
  dependency-version: 4.17.23
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-01-22 01:37:02 +00:00
Adrian Acala f7c9a1ab80 chore(tests): enable server start during end-to-end tests 2026-01-20 20:38:11 -08:00
Adrian Acala af07a73a07 feat(auth): enhance authentication system with login attempt tracking and configuration options
- Added a new `LoginAttempt` model to track login attempts, including rate limiting and lockout functionality.
- Introduced environment variables for configuring login rate limits and maximum failures.
- Updated the authentication middleware to handle login attempts and enforce rate limits.
- Enhanced the user model with indexing for username and email for improved lookup performance.
- Modified the `.env.example` file to include new optional authentication settings.
- Updated integration tests to cover new login attempt features and authentication state management.
2026-01-20 19:55:32 -08:00
Adrian-Ryan Acala 865285fbb7 fix: sync pasted/uploaded images across collaborating tabs (#36)
* fix: sync pasted/uploaded images across collaborating tabs

- Implement file delta synchronization to broadcast image file data
- Add periodic file sync check to catch async file data arrival
- Wrap Excalidraw addFiles API to automatically emit file changes
- Enhance socket element-update to include file payloads
- Add comprehensive E2E test for image collaboration scenarios
- Improve CORS flexibility for development localhost ports

Fixes #25: New images not appearing when collaborating - collaborators
now see uploaded images immediately instead of placeholder until refresh.

* perf: increase file sync polling interval from 500ms to 1000ms

Reduces CPU overhead while still catching async file arrivals. Most
updates go through the addFiles wrapper anyway.

---------

Co-authored-by: Zimeng Xiong <zxzimeng@gmail.com>
2026-01-20 13:49:00 -08:00
Sushil Kumar 77c22916a8 Fix: Save complete app state (#40)
* pass rest of appState in put request

* fix: support both legacy and current currentItemRoundness formats

Add union type to accept both the old object format {type, value} and
the new enum format for backwards compatibility with existing drawings.

---------

Co-authored-by: Zimeng Xiong <zxzimeng@gmail.com>
2026-01-20 13:49:00 -08:00
dependabot[bot] 08d1479a01 Bump react-router and react-router-dom in /frontend
Bumps [react-router](https://github.com/remix-run/react-router/tree/HEAD/packages/react-router) to 7.12.0 and updates ancestor dependency [react-router-dom](https://github.com/remix-run/react-router/tree/HEAD/packages/react-router-dom). These dependencies need to be updated together.


Updates `react-router` from 7.9.6 to 7.12.0
- [Release notes](https://github.com/remix-run/react-router/releases)
- [Changelog](https://github.com/remix-run/react-router/blob/main/packages/react-router/CHANGELOG.md)
- [Commits](https://github.com/remix-run/react-router/commits/react-router@7.12.0/packages/react-router)

Updates `react-router-dom` from 7.9.6 to 7.12.0
- [Release notes](https://github.com/remix-run/react-router/releases)
- [Changelog](https://github.com/remix-run/react-router/blob/main/packages/react-router-dom/CHANGELOG.md)
- [Commits](https://github.com/remix-run/react-router/commits/react-router-dom@7.12.0/packages/react-router-dom)

---
updated-dependencies:
- dependency-name: react-router
  dependency-version: 7.12.0
  dependency-type: indirect
- dependency-name: react-router-dom
  dependency-version: 7.12.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-01-20 13:49:00 -08:00