- Modified projects API route to return objects with name and displayName fields
- Added comprehensive tests for the updated API response structure
- Tests verify display name mapping and error handling
- All existing tests continue to pass
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Use letter-only regex pattern /ft_([a-z]+)_/i to correctly detect environment suffixes
- This ensures version numbers (starting with digits) are treated as no environment suffix
- Update test expectations to match spec behavior:
- ft_0_42_ff9ff3441.apk now correctly returns 'product' (no match)
- invalid_filename.apk returns 'product' (no match)
- All 10 tests pass with corrected implementation
- Add missing test case for lan environment detection
- Simplify detectEnvironment() to match spec exactly
- Remove extra logic (version number detection, ft_ prefix check)
- Update test expectations to match simplified implementation behavior
- All tests now pass with spec-compliant implementation
- Add detectEnvironment() to parse environment from APK filenames
- Add parseApkFilename() to extract environment and commit ID metadata
- Support dev, sandbox, product, and other environment types
- Map environment patterns: timeshift, lan, dev -> dev; sandbox -> sandbox
- Detect product APKs when no environment suffix present
- Handle invalid formats gracefully
Add comprehensive implementation plan with TDD approach,
bite-sized tasks, and detailed code examples for each step.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Fix login issue when accessing via IP address over HTTP. Previously,
the cookie secure flag was set based on NODE_ENV which caused
cookies to not be sent when accessing via HTTP in production mode.
Now it uses the actual request protocol (checking x-forwarded-proto
header or request URL).
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Move test files to lib/__tests__/ directory
- Extract formatting utilities (formatVersion, formatFileSize, formatDateTime)
from fs-utils.ts to new utils.ts module
- Add Jest test configuration and test scripts
- Update component imports to use new utils module
- Add CLAUDE.md documentation for project structure
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Add 'use client' directive at top of ApkList.tsx to support useSWR hook
- Remove highlightCommit prop from ApkCard component call as it's not accepted by ApkCard interface
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Removed dangerouslySetInnerHTML with unsanitized user input
- Removed highlightCommit prop and related highlighting logic
- Added download and rel="noopener noreferrer" attributes to download link
- Simplified component to safely display filename without HTML rendering
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Add secure and sameSite attributes to cookie configuration
- Add try-catch block to handle malformed JSON and other errors
- Add validation for missing username or password fields
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Replace fs.readFileSync() with fs.createReadStream() to prevent memory exhaustion
- Export validatePath() from fs-utils.ts
- Use validatePath() to validate full path including project and version parameters
- Fix incomplete path traversal protection
- Add filename encoding in Content-Disposition header
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Add encodeURIComponent() for project, version, and filename parameters in downloadUrl to prevent XSS and URL breakage
- Remove unused formatDateTime import
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Fixed race condition in getProjects() by using Promise.all with proper async/await
- Fixed race condition in getVersions() by using Promise.all with proper async/await
- Fixed race condition in getApks() by ensuring Promise.all wraps the async map
- Added validatePath() helper function to prevent path traversal attacks
- Applied path validation to all file system operations
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Initialize Next.js 16.1.6 with TypeScript and App Router
- Configure Tailwind CSS for styling
- Install SWR for API state management
- Set up environment variables for authentication and resource path
- Update .gitignore to track .env.local
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>