Commit Graph

28 Commits

Author SHA1 Message Date
Antigravity
37d9bea7bb fix: change socket port to 3005 (conflict with grafana) and make CI artifacts non-blocking
Some checks failed
CI / Lint, Test & Build (push) Successful in 12m43s
CI / Deploy production (on server) (push) Has been cancelled
2026-05-19 21:06:34 +00:00
Antigravity
fdb148144e fix: restore brainstorming feature with missing socket server and real-time events
Some checks failed
CI / Lint, Test & Build (push) Failing after 7m48s
CI / Deploy production (on server) (push) Has been cancelled
2026-05-19 20:07:56 +00:00
Antigravity
28f46860c1 fix: add Redis service and REDIS_URL to web container
Some checks failed
CI / Lint, Test & Build (push) Failing after 7m48s
CI / Deploy production (on server) (push) Has been cancelled
2026-05-17 18:04:17 +00:00
Antigravity
759487cb36 fix(deploy): exécuter sur le serveur + build CI réutilisé (~2 min)
Some checks failed
CI / Lint, Test & Build (push) Failing after 7m52s
CI / Deploy production (on server) (push) Has been cancelled
Le deploy SSH depuis ubuntu-24.04 ne rebuildait pas sur 190 (image d'hier).
Déploiement sur runner docker-host, artifact Next.js de la CI, Dockerfile.prebuilt,
script deploy-prod.sh. workflow_run supprimé au profit de needs:[ci] même fichier.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-17 10:19:16 +00:00
Antigravity
0e60c0e591 fix(deploy): déclencher après CI et vérifier le commit déployé
All checks were successful
CI / Lint, Test & Build (push) Successful in 12m13s
Le job deploy référençait needs:[ci] dans un autre workflow (inefficace
sur Gitea). Déclenchement via workflow_run après CI réussie, empreinte
GIT_COMMIT dans l'image, endpoint /api/build-info et health check sur
127.0.0.1:3000 avec comparaison du SHA attendu.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-17 09:59:33 +00:00
Antigravity
dc4244f2ad fix: pgvector deployment — idempotent migration, pgvector image, schema sync
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 2m21s
- docker-compose.yml: switch postgres:16-alpine to pgvector/pgvector:pg16
- migration: rewrite with IF NOT EXISTS guards, DO block for safe
  text→vector(1536) conversion, handles partial/re-run states
- schema.prisma (both): add @default(now()) on NoteEmbedding.updatedAt,
  sync mcp-server embedding type to Unsupported("vector(1536)")
- deploy.yaml: add docker compose pull postgres before build
2026-05-12 07:28:03 +00:00
Antigravity
03e6a62b80 feat: migrate semantic search to pgvector + full-text search
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 2m12s
Replace JSON-string embeddings with native pgvector(1536) storage and
add PostgreSQL full-text search (tsvector/GIN) with Reciprocal Rank Fusion
for hybrid keyword + semantic ranking.

Changes:
- NoteEmbedding.embedding: String → vector(1536) via pgvector
- NoteEmbedding: added updatedAt for reindex tracking
- Note: added tsv (tsvector) with auto-update trigger for FTS
- semantic-search.service: hybrid FTS + vector search with RRF fusion
- embedding.service: toVectorString() for pgvector SQL literals
- Removed JS-side cosine similarity loops (now DB-side via <=>)
- Added HNSW index on NoteEmbedding.embedding (cosine distance)
- Added GIN index on Note.tsv for FTS queries

Schema migration in: prisma/migrations/20260512120000_pgvector_and_fts_search/

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-12 07:03:56 +00:00
Antigravity
0311c97a35 fix: add /health endpoint before auth middleware for Docker healthcheck (was 401 with MCP_REQUIRE_AUTH=true)
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 16s
2026-05-03 19:45:27 +00:00
Sepehr Ramezani
dbd49d6fcb feat: 8 AI providers, rich text editor, agent notifications, UI contrast & font settings
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 1m25s
- Add DeepSeek, OpenRouter, Mistral, Z.AI, LM Studio as AI providers
  with editable model names via Combobox in admin settings
- Fix OpenRouter broken by normalizeProvider bug in config.ts
- Convert agent-created notes from Markdown to HTML (TipTap rich text)
- Add Notification model + in-app notifications for agent results
- Agent notification click opens the created note directly
- Add note count display on notebook and inbox headers
- Fix checklist toggle in card view (persist state via localCheckItems)
- Add checklist creation option in tabs/list view (dropdown on + button)
- Fix image description ENOENT error with HTTP fallback
- Improve UI contrast across all themes (input, border, checkbox visibility)
- Add font family setting (Inter vs System Default) in Appearance settings
- Fix CSS font-sans variable conflict (removed dead Geist references)
- Update README with new features and 8 providers

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-05-01 16:14:07 +02:00
1345403a31 feat: Notion-like rich text editor with TipTap, 4 note types, slash commands & bubble menu
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 1m33s
2026-05-01 01:11:03 +02:00
39c705592a feat: robust automatic DB migration for Docker deployments
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 44s
Backup before migration (pg_dump/SQLite copy), DB connection wait with
retries, idempotent prisma migrate deploy, old backup cleanup (keep 5),
and server refuses to start if migration fails.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-28 21:30:45 +02:00
2f1837560b fix: align MCP server schema with memento-note + per-request user isolation
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 12s
- Remove `embedding` column from MCP Note model (dropped by migration 20260425120000)
- Add missing columns: trashedAt, dismissedFromRecent, contentUpdatedAt, cardSizeMode
- Add NoteEmbedding model and Label.notebook relation
- Use AsyncLocalStorage to pass authenticated userId from API key to tool handlers
- Enable SSE mode and auth in docker-compose for N8N integration

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-26 14:44:01 +02:00
5bf2d7b983 ci: check http://192.168.1.190:3000 from runner, fix healthcheck node http
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 4s
Made-with: Cursor
2026-04-25 21:51:41 +02:00
4e84b03575 ci: fix healthcheck (use wget), increase timeout to 180s
Some checks failed
Deploy to Production / Build and Deploy (push) Failing after 3m13s
Made-with: Cursor
2026-04-25 21:44:09 +02:00
986d438738 fix: resolve React Error #310 and refactor admin section
Some checks failed
Deploy to Production / Build and Deploy (push) Has been cancelled
- Fix React bug #33580: remove Suspense boundaries co-located with Link components
- Delete settings/loading.tsx and admin/loading.tsx (root cause of race condition)
- Convert all admin navigation from Next.js Link to anchor tags
- Move admin pages to dedicated (admin) route group
- Add AdminHeader matching main header visual design
- Add AdminSidebar with anchor-based navigation
- Add /api/admin/models route handler (replaces server actions for GET)
- Add /api/debug/client-error for server-side browser error reporting
- Add useNoteRefreshOptional() to fix crash in AdminHeader
- Hide Admin Dashboard menu for non-admin users
- Change app icons from yellow to blue (#3A7CA5) matching brand primary
- Fix admin search bar width to match main header

Made-with: Cursor
2026-04-25 20:46:10 +02:00
Sepehr Ramezani
97163bfb89 fix: production deployment hardening
Some checks failed
Deploy to Production / Deploy to 192.168.1.190 (push) Has been cancelled
Docker:
- Restrict PostgreSQL port to 127.0.0.1 only (not exposed to LAN)
- Add APP_BASE_URL for MCP server to reach Next.js via Docker network
- Fix MCP healthcheck (remove always-passing fallback)
- Add resource limits to mcp-server container

Dockerfile:
- Remove full node_modules copy (standalone already includes deps)
  Reduces image size by ~500MB+

Config:
- Add MCP_SERVER_MODE and MCP_SERVER_URL to deploy.sh and .env.docker.example
- Deploy script now auto-sets MCP_SERVER_URL based on NEXTAUTH_URL

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-21 23:09:22 +02:00
Sepehr Ramezani
cff36d9619 fix: MCP server Docker deployment, healthchecks, and minor fixes
MCP server:
- Fix Prisma imports from stale client-generated path to @prisma/client
- Switch schema from SQLite to PostgreSQL for Docker compatibility
- Add prisma generate step to Dockerfile with proper binaryTargets
- Include index-sse.js in Docker build (was excluded by .dockerignore)
- Install openssl and libc6-compat in Alpine image for Prisma runtime

Docker:
- Fix memento-note healthcheck (wget unavailable in bullseye-slim)

Minor fixes:
- scrape.service SSRF protection, middleware route coverage
- canvas-board and note-input type fixes
- next.config turbopack and devIndicators adjustments

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-21 22:22:02 +02:00
Sepehr Ramezani
d3c2de2000 feat: add env setup wizard, fix docker-compose env passthrough and email from field
- Add interactive setup wizard (scripts/setup-env.js) with SQLite/PostgreSQL
  choice, AI provider config, email, MCP, admin account creation, and
  auto-switch of Prisma schema provider
- Fix docker-compose.yml: remove duplicate environment entries that overrode
  env_file values with empty strings (broke AI providers in Docker). Now only
  DATABASE_URL, NODE_ENV, NEXT_TELEMETRY_DISABLED remain in environment:
- Fix revalidateTag('system-config', '/settings') crash: Next.js 16 interprets
  the second arg as a cacheLife profile, not a path. Caused 500 on all admin
  settings saves
- Fix Resend "from" field: was building noreply@localhost which Resend rejects.
  Now uses SMTP_FROM from config, with localhost-aware fallback
- Add debug logging for auto-labeling background task
- Default DATABASE_URL changed from user:password to memento:memento

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-21 22:22:02 +02:00
Sepehr Ramezani
ffb2465b78 fix: add missing MCP_SERVER_MODE and MCP_SERVER_URL to docker-compose
These env vars are read by memento-note/app/actions/mcp-keys.ts
but were not passed through from docker-compose.yml.
2026-04-20 22:58:10 +02:00
Sepehr Ramezani
5b7cbcbc49 docs: add complete guide, env files, fix docker-compose
- Add GUIDE.md: complete user documentation covering installation,
  Docker deployment, AI providers, MCP server, N8N integration,
  email config, admin panel, env var reference, troubleshooting
- Add mcp-server/.env.example with all MCP-specific variables
- Update .env.docker.example with all 42 environment variables
- Fix docker-compose.yml: parameterize PostgreSQL credentials,
  add missing env vars (CUSTOM_OPENAI, AI_PROVIDER_CHAT,
  ALLOW_REGISTRATION, RESEND_API_KEY)
- Track memento-note/.env.example
2026-04-20 22:57:09 +02:00
Sepehr Ramezani
e4d4e23dc7 chore: clean up repo for public release
- Remove BMAD framework, IDE configs, dev screenshots, test files,
  internal docs, and backup files
- Rename keep-notes/ to memento-note/
- Update all references from keep-notes to memento-note
- Add Apache 2.0 license with Commons Clause (non-commercial restriction)
- Add clean .gitignore and .env.docker.example
2026-04-20 22:48:06 +02:00
Sepehr Ramezani
2eceb32fd4 chore: snapshot before performance optimization 2026-04-17 21:14:43 +02:00
Sepehr Ramezani
8f9031f076 fix: update masonry grid sizing logic and notebook list padding 2026-02-14 14:20:32 +01:00
8617117dec fix: remove Ollama default fallbacks in factory and Docker
ROOT CAUSE: The factory was defaulting to 'ollama' when no provider
was configured, and docker-compose.yml was always setting OLLAMA_BASE_URL
even when using OpenAI. This caused the app to try connecting to Ollama
even when OpenAI was configured in the admin.

CRITICAL CHANGES:
1. lib/ai/factory.ts - Removed 'ollama' default fallback
   - getTagsProvider() now throws error if AI_PROVIDER_TAGS not set
   - getEmbeddingsProvider() now throws error if AI_PROVIDER_EMBEDDING not set
   - Forces explicit configuration instead of silent fallback to Ollama

2. docker-compose.yml - Removed default OLLAMA_BASE_URL
   - Changed: OLLAMA_BASE_URL=${OLLAMA_BASE_URL:-http://ollama:11434}
   - To: OLLAMA_BASE_URL=${OLLAMA_BASE_URL}
   - Only set if explicitly defined in .env.docker

3. Application name: Mento → Memento (correct spelling)
   - Updated in: sidebar, README, deploy.sh, DOCKER_DEPLOYMENT.md

4. app/api/ai/config/route.ts - Return 'not set' instead of 'ollama'
   - Makes it clear when provider is not configured

IMPACT: The app will now properly use OpenAI when configured in the
admin interface, instead of silently falling back to Ollama.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-12 23:08:20 +01:00
76c7cd97e9 fix: resolve Docker AI features connection to Ollama
Critical fix for AI features (reformulation, auto-labels) in Docker.
Only title generation was working because it had hardcoded fallback.

Problem:
- Code uses OLLAMA_BASE_URL environment variable
- docker-compose.yml was setting OLLAMA_API_URL (wrong variable)
- .env.docker was missing on server
- Container couldn't connect to Ollama service

Root cause:
- Environment variable name mismatch
- Missing OLLAMA_BASE_URL configuration
- localhost:11434 doesn't work in Docker (need service name)

Solution:
1. Update docker-compose.yml:
   - Change OLLAMA_API_URL → OLLAMA_BASE_URL
   - Add OLLAMA_MODEL environment variable
   - Default to http://ollama:11434 (Docker service name)

2. Update .env.docker:
   - Add OLLAMA_BASE_URL="http://ollama:11434"
   - Add OLLAMA_MODEL="granite4:latest"
   - Document AI provider configuration

3. Update .env.docker.example:
   - Add examples for different Ollama setups
   - Document Docker service name vs external IP
   - Add OpenAI configuration example

Result:
✓ All AI features now work in Docker (titles, reformulation, auto-labels)
✓ Proper connection to Ollama container via Docker network
✓ Clear documentation for different deployment scenarios

Technical details:
- Docker service name "ollama" resolves to container IP
- Port 11434 accessible within memento-network
- Fallback to localhost only for local development

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-12 22:13:35 +01:00
c95b0d5650 feat: add Docker environment configuration for remote access
Fixes redirect issue where application redirects to localhost:3000
instead of server IP when accessed from remote browser.

Problem:
- Accessing http://192.168.1.190:3000 redirects to http://localhost:3000
- NEXTAUTH_URL was hardcoded to localhost in .env
- Remote users cannot access the application

Solution:
1. Create .env.docker with server-specific configuration
   - NEXTAUTH_URL="http://192.168.1.190:3000"
   - Ollama URL for container-to-container communication

2. Update docker-compose.yml:
   - Add env_file: .env.docker
   - Loads Docker-specific environment variables

3. Create .env.docker.example as template:
   - Document NEXTAUTH_URL configuration
   - Users can copy and customize for their server IP/domain

Files:
- .env.docker: Docker environment (gitignored)
- .env.docker.example: Template for users
- docker-compose.yml: Load .env.docker
- .env.example: Update NEXTAUTH_URL documentation

Usage:
On production server, edit .env.docker with your server IP:
NEXTAUTH_URL="http://YOUR_IP:3000"

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-12 21:38:46 +01:00
ff110b735c fix: resolve Docker Compose build failure with Prisma Client generation
Fix critical issue where `docker compose build` was failing with:
"Module not found: Can't resolve '../prisma/client-generated'"

Root cause:
- Next.js build requires Prisma Client during webpack compilation
- Prisma Client was not being generated before the Next.js build step

Changes:
1. keep-notes/Dockerfile:
   - Add explicit `RUN npx prisma generate` in builder stage before `npm run build`
   - Ensures client-generated directory exists when Next.js compiles

2. keep-notes/package.json:
   - Update build script: "prisma generate && next build --webpack"
   - Double-protection: runs prisma generate both in Dockerfile and build script

3. docker-compose.yml:
   - Remove obsolete `version: '3.8'` attribute (deprecated in Docker Compose v2)

Result:
✓ Docker build now completes successfully
✓ Prisma Client generated at ./prisma/client-generated
✓ Next.js webpack compilation finds the client module

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-12 21:12:47 +01:00
640fcb26f7 fix: improve note interactions and markdown LaTeX support
## Bug Fixes

### Note Card Actions
- Fix broken size change functionality (missing state declaration)
- Implement React 19 useOptimistic for instant UI feedback
- Add startTransition for non-blocking updates
- Ensure smooth animations without page refresh
- All note actions now work: pin, archive, color, size, checklist

### Markdown LaTeX Rendering
- Add remark-math and rehype-katex plugins
- Support inline equations with dollar sign syntax
- Support block equations with double dollar sign syntax
- Import KaTeX CSS for proper styling
- Equations now render correctly instead of showing raw LaTeX

## Technical Details

- Replace undefined currentNote references with optimistic state
- Add optimistic updates before server actions for instant feedback
- Use router.refresh() in transitions for smart cache invalidation
- Install remark-math, rehype-katex, and katex packages

## Testing

- Build passes successfully with no TypeScript errors
- Dev server hot-reloads changes correctly
2026-01-09 22:13:49 +01:00