Commit Graph
47 Commits
Author SHA1 Message Date
xixu-me 80e3c26967 Transform scope parameter for container registry auth
Added logic to remove the cr/[registry]/ prefix from the scope parameter and handle official Docker Hub images by adding the library/ prefix. Updated tests to verify correct scope transformation for Docker Hub, GHCR, and official images.
2025-12-10 13:04:33 +08:00
xixu-me 4993444f51 Add type declarations and improve test typings
Introduces src/types.d.ts and test/types.d.ts for Cloudflare Workers and test utilities. Enhances JSDoc comments and type annotations across test files for better type safety and clarity. Updates tsconfig.json to use bundler module resolution and include additional type sources. Minor test logic and assertion improvements for robustness.
2025-12-08 19:57:48 +08:00
xixu-me d88f1911a6 Improve parsing, regex, and test consistency
Refines regex patterns for URL rewriting and authentication parsing, ensures parseInt uses radix 10 throughout, and updates test mocks and helpers for consistency. Also adds more global variables to ESLint config, improves error handling, and removes unused code in tests.
2025-12-08 19:19:10 +08:00
xixu-me f60661db6f Refactor test helpers and add auth header forwarding tests
Modularizes test helpers into separate files for assertions, generators, and mocks, and updates imports for platform tests. Adds new tests to verify Authorization header forwarding for authenticated requests. Cleans up and simplifies test setup, and updates fixtures for clarity and maintainability.
2025-11-27 16:27:42 +08:00
xixu-me 0204501aba Redirect invalid and incomplete paths to homepage
Update request handling to redirect root, invalid platform prefixes, and platform prefixes without resource paths to the homepage. Adjust tests to expect 302 redirects instead of 404 or 400 responses for these cases.
2025-11-18 18:30:15 +08:00
xixu-me 6245da9e6f Add support for GitHub Gist platform
Added GitHub Gist ('gist') to the supported platforms in the configuration, updated documentation in both English and Chinese READMEs, and included related tests to ensure correct path transformation and base URL.
2025-11-10 20:45:58 +08:00
xixu-me 17f94416d6 Add Git LFS protocol support and tests
Introduces detection and handling for Git LFS (Large File Storage) operations, including LFS-specific endpoints, headers, and user agents. Updates request validation, header management, and cache logic to properly support LFS requests and ensure real-time data synchronization. Adds comprehensive integration and unit tests for LFS scenarios, and documents the new behavior in CLAUDE.md.
2025-11-09 15:51:39 +08:00
Claude 57e30e8aaa Add Docker Hub container registry support with library prefix handling
This commit adds support for Docker Hub (registry-1.docker.io) as a container registry platform with special authentication handling for official images.

Changes:
- Add 'cr-docker' platform pointing to https://registry-1.docker.io in platforms.js
- Implement special authentication scope handling for Docker Hub official images
- Docker Hub stores official images (nginx, redis, etc.) as library/nginx, library/redis
- Single-component image names are automatically prefixed with 'library/' for authentication
- Multi-component names (user/image) are passed through unchanged
- Add comprehensive tests for Docker Hub support

This resolves the issue where pulling public images from Docker Hub would prompt for authentication incorrectly. The library prefix is now automatically added to the authentication scope for single-name images, allowing proper anonymous access to public official images.

Test coverage:
- Official images (single-name): /cr/docker/v2/nginx/manifests/latest
- User images (namespaced): /cr/docker/v2/nginxinc/nginx-unprivileged/manifests/latest
- GET and HEAD request methods verified

All Docker Hub specific tests pass.
2025-11-09 07:16:03 +00:00
xixu-me 7d50e9e788 Improve range request caching and media file handling
Enhances caching strategy to only cache 200 responses (not 206), supports serving range requests from cached full content, and avoids compression for media files to ensure proper byte-range support. Adds comprehensive tests for range request caching, media file handling, cache key management, and performance metrics.
2025-09-03 03:26:01 +08:00
xixu-me d231a61528 Remove test README and update format scripts
Deleted test/README.md and updated the Prettier format scripts in package.json to exclude markdown files from formatting.
2025-09-03 02:42:58 +08:00
xixu-me 0a5ef94d81 Add Jenkins plugin mirror support
Introduces Jenkins plugin and update center mirror support in README and platform config. Updates transformPath logic for Jenkins endpoints and adds comprehensive tests for Jenkins path handling and URL construction.
2025-09-03 01:47:23 +08:00
xixu-me 16edbd841d Revert "Add Kaggle platform support and path transformation"
This reverts commit 1480595fbc.
2025-08-20 22:30:06 +08:00
xixu-me 1480595fbc Add Kaggle platform support and path transformation
Introduces Kaggle as a supported platform in the configuration and health check. Implements special path transformation logic for Kaggle API endpoints in transformPath, and adds comprehensive tests to verify correct path handling for various Kaggle API routes.
2025-08-20 22:17:48 +08:00
xixu-me a9843ab948 Add Civitai platform support
Added 'civitai' to the PLATFORMS config and updated tests to include Civitai path transformations. This enables handling of Civitai URLs in the platform configuration and ensures correct path transformation logic.
2025-08-20 21:37:57 +08:00
xixu-me 8089a30b96 Update AI API references and Gemini test case
Revised README to clarify 'AI 推理 API' terminology, updated Gemini API example URLs to use 'gemini-2.5-flash', and adjusted the related test case in platforms.test.js to match the new Gemini API path.
2025-08-14 17:09:58 +08:00
xixu-me 144da6a0e7 Update AI provider keys and docs for consistency
Renamed several AI provider keys and references (e.g., 'ip-google' to 'ip-gemini', 'ip-mistral' to 'ip-mistralai', etc.) in the codebase, documentation, and tests for improved clarity and alignment with provider branding. Updated README usage examples and provider tables to match the new keys.
2025-08-14 16:52:14 +08:00
xixu-me 9edb80e619 Update AI inference providers list and tests
Expanded and reordered the list of AI inference providers in the platform configuration to include new providers such as ip-github, ip-nvidia, ip-braintrust, ip-jina, ip-voyageai, ip-burncloud, and ip-poe. Updated the corresponding test to match the new provider list and order.
2025-08-14 15:09:20 +08:00
xixu-me 313f338489 Add OpenRouter to AI inference providers
Added 'ip-openrouter' with its URL to the PLATFORMS config and updated related tests to include OpenRouter as a supported AI inference provider.
2025-08-14 14:35:41 +08:00
xixu-me 2cab404223 Add AI inference providers to platform config and tests
Added major AI/ML inference providers to the PLATFORMS config. Introduced comprehensive tests to ensure all providers are defined, their paths are transformed correctly, and valid URLs are constructed.
2025-08-14 13:59:18 +08:00
xixu-me 8e3f75e7a4 Add Homebrew support and tests
Added Homebrew, Homebrew API, and Homebrew Bottles platform support in the configuration. Updated the README with Homebrew usage instructions and examples. Introduced comprehensive tests for Homebrew path transformations to ensure correct behavior.
2025-08-11 09:38:17 +08:00
xixu-me ae67123de3 Remove PyTorch platform support and related tests
This commit removes all code, documentation, and tests related to the PyTorch platform. PyTorch is no longer listed as a supported platform in the configuration, README files, or test suites.
2025-08-07 14:53:47 +08:00
xixu-me 3c7ed0a985 Improve PyTorch wheel index URL rewriting and tests
Refactors PyTorch path transformation logic and enhances URL rewriting for PyTorch wheel index pages to handle both absolute and relative links. Removes unnecessary cache skipping for PyTorch index pages and adds dedicated tests for PyTorch URL rewriting and path transformation.
2025-08-07 14:44:33 +08:00
xixu-me 7336649595 Add PyTorch platform support and URL rewriting
Introduces PyTorch platform support with URL rewriting for wheel index pages in src/index.js. Updates documentation in both English and Chinese READMEs to reflect new PyTorch installation URLs and verification steps. Adds comprehensive tests for PyTorch proxying, URL transformation, and error handling in test/index.test.js and new test/pytorch.test.js.
2025-08-07 14:07:09 +08:00
xixu-me b4af10603a Add PyTorch platform support and documentation
Introduces PyTorch as a supported platform in the configuration, updates test utilities and test cases for PyTorch URLs, and adds detailed usage and acceleration instructions for PyTorch in both English and Chinese README files.
2025-08-07 13:51:28 +08:00
xixu-me 781357fa6d Update CRAN ggplot2 version in docs and tests
Changed references of ggplot2 from version 3.4.4 to 3.5.2 in both English and Chinese README files and updated related test cases in cran.test.js to ensure consistency with the latest package version.
2025-07-31 18:14:55 +08:00
xixu-me 0dc07a01f3 Update Gitea archive path from main.zip to master.zip
Changed documentation and test cases to use 'master.zip' instead of 'main.zip' for Gitea archive URLs to reflect the correct branch naming.
2025-07-31 18:01:30 +08:00
xixu-me 3bc67f3e9b Add openSUSE platform support and tests
Added openSUSE to the supported platforms in the documentation and configuration. Updated README with openSUSE usage instructions and examples. Introduced tests to verify openSUSE path transformation logic.
2025-07-31 14:40:48 +08:00
xixu-me ee9d44911c Add CRAN platform support and documentation
Added CRAN (R package repository) support to the platform configuration and updated the README with usage instructions and examples for CRAN. Introduced tests for CRAN path transformation and configuration in a new test/cran.test.js file.
2025-07-31 14:09:47 +08:00
xixu-me f0d449fdec Add Rust crates.io support and path transformation
Added Rust crates.io platform support in the documentation and platforms config. Implemented special path transformation logic for crates.io API endpoints in transformPath. Added tests to verify correct path transformation for various crates.io API routes.
2025-07-31 13:23:30 +08:00
xixu-me 47e5882346 Expand README with more platforms and usage examples
Added support and documentation for additional platforms including Gitea, Codeberg, SourceForge, Maven, Gradle, RubyGems, Go, NuGet, Packagist, and various Linux distributions. Expanded usage examples and configuration instructions for these platforms, improved clarity and consistency in language, and updated sections on Git global acceleration, academic resource acceleration, and package manager integration. Minor language and formatting improvements throughout. Also updated a test README for clearer language.
2025-07-28 21:45:19 +08:00
xixu-me 09b1a3ec40 Add Gitea, Codeberg, and SourceForge platform support
Extended platform support by adding Gitea, Codeberg, and SourceForge to the configuration and documentation. Updated tests to cover new platforms and their path transformations, and enhanced README with usage examples and badges for the new platforms.
2025-07-28 18:49:06 +08:00
xixu-me ef4362ea50 Remove Docker Hub specific support and code
Eliminated Docker Hub-specific configuration, path/scope transforms, and related documentation. Deleted src/config/docker.js and its tests, removed Docker Hub from supported platforms, and refactored code to use generic container registry logic. This simplifies the codebase by dropping special handling for Docker Hub library images.
2025-07-28 17:24:03 +08:00
xixu-me eef204ab49 Add Docker Hub support with path and scope handling
Introduces Docker Hub-specific configuration and utilities, including path and scope transformation for library images. Updates the main logic to handle Docker Hub authentication and path rewriting. Adds tests for Docker Hub path, scope, and authentication header parsing. Updates documentation to reflect Docker Hub support and usage examples.
2025-07-28 17:04:07 +08:00
xixu-me 7e2fc46e88 Refactor container registry support and docs
Updated README to clarify container registry usage and examples, including new supported registries and configuration instructions. Removed NVIDIA NGC from supported registries in code and tests. Standardized test cases and examples to use 'nginxinc/nginx-unprivileged' for container registry paths, improving consistency across documentation and tests.
2025-07-25 19:47:44 +08:00
xixu-me ba5b728b2f Remove Docker Hub registry support and references
Eliminates support for Docker Hub ('cr-docker') from platform configuration, request handling logic, and all related tests. Updates terminology and test cases to use other container registries (e.g., GHCR) and removes Docker-specific path and scope transformations. This simplifies container registry support and focuses on currently supported platforms.
2025-07-25 19:02:40 +08:00
xixu-me 3e3eab5867 Add Docker registry proxy support and tests
Implements Docker registry request detection, authentication handling, and proxy logic in src/index.js. Adds comprehensive tests for Docker registry support, including API version checks, URL transformation, authentication, HTTP methods, error handling, header preservation, and platform support in test/docker-registry.test.js.
2025-07-25 16:08:02 +08:00
xixu-me df16d0806a Refactor platform config and unify path transformation
Simplifies PLATFORMS to map platform keys to base URLs and introduces a unified transformPath function for path normalization. Updates usage in src/index.js and refactors tests to validate the new structure and container registry support.
2025-07-25 14:16:26 +08:00
xixu-me b147ea7052 Add npm registry URL rewriting and improve formatting
Introduces logic to rewrite npm registry tarball URLs in JSON responses to route through the proxy endpoint, ensuring package names are preserved. Also improves code formatting and consistency across source and test files, and adds related test cases for npm URL rewriting.
2025-07-25 09:36:03 +08:00
xixu-me b264c9d713 Update documentation for clarity and formatting
Improved wording, formatting, and badge order in README.md to better highlight Xget's features and advantages. Fixed spacing and link formatting in CONTRIBUTING.md and test/README.md for consistency and readability.
2025-07-24 22:24:31 +08:00
xixu-me 38833f4c3a Update documentation to use '存储库' instead of '项目'
Replaced occurrences of '项目' (project) with '存储库' (repository) across issue templates, contributing guide, and README for consistency and clarity. Updated badges, usage examples, and contribution instructions to reflect this terminology change. No functional code changes were made.
2025-07-24 21:53:48 +08:00
xixu-me da0b518900 Update test tooling and scripts, add tsconfig.json
Modernizes test and lint scripts in package.json to use Vitest, Prettier, and ESLint directly. Updates devDependencies to latest versions. Adds a tsconfig.json for type checking and editor support. Improves test mocking in performance.test.js and updates documentation in README.md to reflect new test commands. Cleans up unused options in vitest.config.js.
2025-07-24 21:28:47 +08:00
xixu-me b34e490e6c Migrate issue templates to YAML and add contribution docs
Replaced Markdown issue templates with structured YAML templates for bug reports, feature requests, performance issues, deployment help, and platform support. Added .prettierrc.json and .prettierignore for code formatting, a detailed CONTRIBUTING.md, and a pull request template. Updated CODE_OF_CONDUCT.md and README.md to reference new contribution guidelines. Added ESLint config, test scripts, and initial test files to improve project maintainability and onboarding.
2025-07-24 21:05:13 +08:00
xixu-me 11076bb7ea Refactor conda channel support and update docs
Added explicit support for conda community channels in platform config and request handling. Updated README with improved conda usage instructions, new .condarc and environment.yml examples, and clarified download/configuration steps. Removed Vitest test dependencies and test files from the project.
2025-07-24 14:49:21 +08:00
xixu-me 9f119f21c3 Serve external homepage and remove local homepage
Replaces the local homepage HTML with a redirect to an external static homepage at https://xixu-me.github.io/Xget-page/. Removes the now-unused homepage.js file and updates tests to reflect the new homepage behavior.
2025-07-22 21:49:06 +08:00
xixu-me a1ff8750d8 Add modern homepage and serve it at root path
Introduces a new `generateHomepage` function in `src/homepage.js` that returns a modern HTML homepage for Xget, featuring a URL converter and platform information. Updates the root path handler in `src/index.js` to serve this homepage directly instead of redirecting to an external site. Adjusts tests in `test/index.spec.js` to validate the new homepage content and response headers.
2025-07-22 19:33:33 +08:00
xixu-me a42111452e Add Git operation support and improve request handling
Introduces detection and special handling for Git operations, allowing POST requests for Git endpoints and bypassing cache for such requests. Adjusts headers and response logic to ensure compatibility with Git clients. Updates tests to cover Git and regular file download scenarios, and refines security method validation.
2025-07-21 14:35:01 +08:00
xixu-me 66d2461caf Create some code 2024-11-01 19:08:30 +08:00