Commit Graph

30 Commits

Author SHA1 Message Date
08f9015101 feat: update download page title to use display name
- Add Project interface with name and displayName
- Fetch projects via SWR
- Add getProjectDisplayName helper function
- Use display name in the download page title

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-04 22:17:31 +08:00
585827c632 fix: remove unused formatVersion import from ApkList
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-04 22:17:31 +08:00
173f182b21 feat: update ApkList to use tabbed view
Replaced card-based layout with tabbed interface for APK environments.
Now displays APKs grouped by dev/product/sandbox/other tabs with counts.

- Replaced ApkCard with ApkTable component
- Added tab navigation with active state styling
- Group APKs by environment using reduce
- Show count badges for each environment tab

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-04 22:17:31 +08:00
d42b72b650 feat: update SearchForm to use project display names
Add Project interface with name and displayName fields to support project aliases. Update SWR hook to type projects as Project[]. Display project.displayName in dropdown while using project.name as the option value for API compatibility.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-04 22:17:31 +08:00
bf63f52b66 feat: add ApkTable component 2026-03-04 22:17:31 +08:00
e217d1c6c9 fix: resolve duplicate commit field and add commitId filter test
- Replace spread operator with explicit field selection to avoid
  duplicate commit field from getApks() and parseApkFilename()
- Add test case for commitId parameter filtering to ensure
  the filter parameter works correctly with new metadata extraction

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-04 22:17:31 +08:00
792ad8619c feat: update APKs API to include environment metadata
- Add parseApkFilename() integration to extract environment and commit info
- Return environment field (dev/sandbox/product/other) in API response
- Return commit field (short commit ID) in API response
- Add comprehensive test coverage for the new metadata

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-04 22:17:31 +08:00
aeb29d0428 feat: update projects API to include display names
- 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>
2026-03-04 22:17:31 +08:00
46d9f3a299 fix: set cookie secure flag based on request protocol
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>
2026-03-04 13:03:44 +08:00
8227f36cbe refactor: organize tests and extract formatting utilities
- 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>
2026-03-04 02:33:30 +08:00
93d43c8451 feat: redirect home page to download page 2026-03-04 02:15:38 +08:00
240fd8b528 feat: add download page with SearchForm and ApkList 2026-03-04 02:14:16 +08:00
993ce520f0 fix: add 'use client' directive and fix prop mismatch
- 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>
2026-03-04 02:12:39 +08:00
608d67c7fd feat: add ApkList component 2026-03-04 02:11:04 +08:00
36b60687f0 fix: remove XSS vulnerability and add security attributes
- 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>
2026-03-04 02:10:06 +08:00
99694cbc4c feat: add ApkCard component 2026-03-04 02:08:50 +08:00
df5c0b4237 fix: add error handling and use existing utility
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-03-04 02:08:09 +08:00
fdeb42f212 feat: add SearchForm component 2026-03-04 02:06:53 +08:00
5365352331 fix: add cookie security attributes and error handling
- 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>
2026-03-04 02:05:55 +08:00
bdb4d0cf32 feat: add login page and API 2026-03-04 02:04:50 +08:00
e2b4105fb6 fix: remove font overrides to use Tailwind configuration 2026-03-04 02:04:02 +08:00
0329bd2ff6 fix: improve font configuration for Chinese support 2026-03-04 02:03:22 +08:00
f3b0d79ef9 feat: update root layout with metadata
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-03-04 02:02:31 +08:00
cf7d3d5618 fix: use streaming and add path validation
- 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>
2026-03-04 02:01:38 +08:00
7d5ee36f56 feat: add /api/download endpoint for APK file downloads
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-03-04 02:00:36 +08:00
91c94bde88 fix: add URL encoding and remove unused import
- 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>
2026-03-04 01:59:53 +08:00
0d1ba31175 feat: add /api/apks endpoint 2026-03-04 01:58:52 +08:00
c032c7fd5d feat: add /api/versions endpoint 2026-03-04 01:57:46 +08:00
5be115d323 feat: add /api/projects endpoint 2026-03-04 01:56:47 +08:00
a78f029e03 Initial commit from Create Next App 2026-03-04 01:45:44 +08:00