Commit Graph

3 Commits

  • fix: add input validation and fix unique constraint
    Fixed code quality issues from Task 2 review:
    
    1. Added ID validation in PUT endpoint:
       - Validates req.params.id is a valid positive integer
       - Returns 400 for invalid IDs (non-numeric, negative, zero, decimals)
       - Prevents SQL injection attempts
    
    2. Added path validation in POST and PUT endpoints:
       - Validates projectPath is absolute path
       - Normalizes and resolves paths
       - Detects and blocks path traversal attempts (e.g., ../../../etc)
       - Returns 400 for invalid paths
    
    3. Fixed UNIQUE constraint in database schema:
       - Removed UNIQUE constraint from name column
       - Allows creating projects with same name as deleted projects
       - Application-level duplicate checking remains for active projects
       - Added table migration to drop and recreate schema
    
    Files modified:
    - server.js: Added validateProjectId() and validateProjectPath() helpers
    - services/database.js: Removed UNIQUE constraint, added migration
    
    All validation tested and working correctly.
    
    Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
  • feat: add SQLite database and projects table schema
    - Install better-sqlite3 package for persistent storage
    - Create database service with projects table schema
    - Add indexes on deletedAt and name for efficient queries
    - Support soft-delete with deletedAt timestamp
    - Export database instance for use in server.js
    
    Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
  • Initial commit: Obsidian Web Interface for Claude Code
    - Full IDE with terminal integration using xterm.js
    - Session management with local and web sessions
    - HTML preview functionality
    - Multi-terminal support with session picker
    
    Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>