mirror of
https://github.com/NewFuture/DDNS.git
synced 2026-10-20 00:16:45 +00:00
master
32
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
3c8578e9f4 |
feat(mcp): add Streamable HTTP transport (#736)
* feat(mcp): add Streamable HTTP transport Add a modern MCP 2026-07-28 HTTP endpoint for standalone and Web modes, with shared listener configuration, authentication, schema, tests, and bilingual documentation. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * fix(tests): support Python 2 HTTP assertions Normalize response header names and call handler methods through their underlying functions so the HTTP tests behave consistently on Python 2.7 and Python 3. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * fix(mcp): harden HTTP request handling Validate mirrored request IDs, align Config Studio listener checks, bound socket reads, and accept the binary wrapper's documented SIGINT exit status. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * fix(mcp): align HTTP negotiation validation Reject unavailable Accept media types by quality and keep schema host validation consistent with runtime listener checks. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * fix(tests): validate host schema behavior Assert accepted and rejected host samples instead of comparing Unicode escape representations that differ on Python 2.7. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * fix(tests): avoid cross-engine schema regex Keep the schema pattern contract without executing its ECMA-262 Unicode escape through Python 2's incompatible regex engine. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * fix(mcp): validate HTTP request boundaries Reject empty tokens and malformed JSON-RPC request shapes, and keep Config Studio bracket validation aligned with runtime listener handling. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * fix(mcp): tighten HTTP input validation Reject legacy notifications, nested host brackets, and document the required JSON content type so validation remains consistent across runtime, schema, and Config Studio. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * fix(mcp): validate Origin before method errors Apply the existing Origin policy to non-POST MCP requests and return CORS headers for configured allowed origins. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * docs(mcp): clarify proxy Origin allowlist Explain that browser clients behind TLS termination must allowlist the public HTTPS origin even when the public page appears same-origin. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * docs(mcp): add standalone server guide Move MCP client setup, transports, tools, security, and protocol limits into dedicated Chinese and English pages with matching navigation and index links. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * fix(mcp): reject duplicate routing headers Reject repeated MCP protocol, method, and name headers before body consistency checks across Python 2 and Python 3. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * fix(mcp): validate named request headers Validate Mcp-Name for tools/call, prompts/get, and resources/read before dispatching unsupported methods. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> |
||
|
|
d14594f14d |
feat(web): add local management dashboard (#718)
* feat(web): add local management dashboard Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * fix(web): address review and Python 2 compatibility Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * chore: remove design session artifacts Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * fix(web): harden packaged resources and HTTP semantics Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * test(web): support Python 2 handler mocks Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * fix(web): detect all external schedulers Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> |
||
|
|
06fceed0f7 |
feat(cache): add configurable cache max age (#709)
* feat(cache): add configurable cache max age Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * test(cache): cover cache max age integration paths Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * test(cache): fix portable regression test formatting Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * style(test): format cache max age run test Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Future New (WEILAI LIU) <weilail@microsoft.com> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> |
||
|
|
93d4698ff7 |
feat(provider.west): add West.cn DNS provider support (#628)
* Initial plan * feat(provider.west): add West.cn DNS provider support Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * refactor(provider.west): address review feedback - remove LINE_MAPPING, implement domain fallback, update docs Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * fix(provider.west): improve logging format for root domain Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fix(provider.west): correct comment about domain parsing order and clarify error code handling Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * refactor(provider.west): simplify domain not found check to use code=404 Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> Co-authored-by: New Future <NewFuture@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> |
||
|
|
f26d50678f |
refactor(provider): optimize cloudns implementation and add documentation (#664)
* Initial plan * refactor(provider.cloudns): optimize and simplify implementation Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * docs(providers): add comprehensive cloudns documentation and update indices Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * fix(provider.cloudns): change default TTL from 3600s to 60s Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * fix(provider.cloudns): fix Python 2.7 compatibility with dict unpacking Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> |
||
|
|
f99fd8f0b3 |
feat(provider): add EdgeOne DNS provider for non-accelerated domain records (#588)
* Initial plan * feat(provider): add EdgeOne DNS provider for non-accelerated domains Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * docs(provider): add EdgeOne DNS documentation for non-accelerated domains Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * fix(provider): update EdgeOne provider aliases per feedback - Acceleration domains: edgeone, edgeone_acc, teo_acc - DNS records: edgeone_dns, teo_dns, edgeone_noacc - Removed: teo, tencentedgeone, neo_acc, neo - Updated documentation to reflect new aliases Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * feat(provider): add extra parameter support and update documentation index - Add edgeone_dns to provider index documentation (README.md) - Add "teo" alias for backward compatibility (not documented) - Enable EdgeOneProvider to support both acceleration and DNS records via extra['dns_record'] parameter - Update provider aliases and documentation Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * docs: create comprehensive new-provider agent guide - Add detailed step-by-step guide for creating new DNS providers - Include API analysis, implementation, testing, and documentation steps - Provide code templates and examples for both BaseProvider and SimpleProvider - Add completion checklist and common pitfalls - Document all requirements including compatibility checks and index updates Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * refactor(provider): change extra parameter from dns_record to teoDomainType - Change EdgeOneProvider to use teoDomainType parameter instead of dns_record - Support values: "dns" or "acceleration" (default) - Parameter is case-insensitive - EdgeOneDnsProvider now uses extra parameter to control behavior - All 55 tests passing Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * refactor(provider): simplify EdgeOneDnsProvider with helper method - Extract common extra parameter preparation into _prepare_extra() method - Reduces code duplication across _query_record, _create_record, _update_record - All 55 tests passing Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * refactor(provider): make EdgeOneDnsProvider more elegant and concise - Use class attribute _default_domain_type = "dns" for clarity - Replace _prepare_extra() with inline setdefault() for more Pythonic code - setdefault() allows users to override teoDomainType if needed - All 55 tests passing Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * refactor(provider): use options instead of extra for teoDomainType - Move teoDomainType from per-call extra to instance-level options - More appropriate since provider type is fixed per instance - EdgeOneProvider reads teoDomainType from self.options at initialization - EdgeOneDnsProvider sets teoDomainType="dns" in __init__ - Simplified implementation: 28 lines vs 43 lines for EdgeOneDnsProvider - All 55 tests passing Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * refactor(provider): support both extra and options for teoDomainType with priority - Remove __init__ from EdgeOneProvider, read directly from self.options - Support teoDomainType in both extra (per-call) and options (initialization) - extra parameter has higher priority than options - Priority: extra > options > default ("acceleration") - All 55 tests passing Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * docs(provider): add teoDomainType parameter documentation for EdgeOne - Document how to switch between acceleration domains and DNS records - Explain extra.teoDomainType parameter usage - Add configuration examples for both modes - Update parameter tables with teoDomainType and extra - Document priority: extra > initialization parameter - Add bilingual documentation (Chinese and English) Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * docs(provider): remove initialization parameter config example from EdgeOne - Remove the example showing teoDomainType via initialization parameters - Only document usage via extra parameter - Remove priority note since only one method is documented - Keep recommendation to use EdgeOneDnsProvider for cleaner code - Update both Chinese and English documentation Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * docs(agent): update new-provider guide with relative paths and schema notes - Update CLI compatibility note to mention checking --dns parameter choices - Change schema note to only require v4.0 (latest format) updates - Replace "multi-provider format" with "latest schema format" - Convert all absolute paths to relative paths from project root - Remove /home/runner/work/DDNS/DDNS/ prefix from all file paths Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * docs(agent): correct latest schema version to v4.1 - Update schema compatibility section to reference v4.1 instead of v4.0 - v4.1 is the latest schema format that requires updates Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * feat(config): add edgeone_dns to CLI and schema v4.1 - Add edgeone_dns to CLI --dns parameter choices - Add edgeone_dns to schema v4.1 provider enum (both legacy and multi-provider sections) - Update provider descriptions to include EdgeOne DNS Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Refactor labels_to_prompts_mapping format * fix(provider): filter teoDomainType from extra params before API call - Remove teoDomainType from extra dict before passing to Tencent Cloud API - Fixes "UnknownParameter - The parameter `extra_teoDomainType` is not recognized" error - teoDomainType is internal parameter for routing, not for API requests - All 55 tests passing Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * docs(provider): update schema references to v4.1.json in EdgeOne docs - Update all $schema references from v4.0.json to v4.1.json - Applied to edgeone.md, edgeone.en.md, edgeone_dns.md, edgeone_dns.en.md - Ensures documentation references the latest schema format Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * Changes before error encountered Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * fix(config): preserve nested extra dict from JSON/ENV config - Process "extra" dict before extra_ prefixed keys to avoid flattening - Fixes issue where {"extra":{"teoDomainType":"dns"}} was incorrectly transformed to {"extra_teoDomainType":"dns"} - Maintains backward compatibility with extra_ prefixed keys - Priority: explicit extra dict > extra_ prefixed keys > unknown keys Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update tests/test_provider_edgeone_dns.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update tests/test_provider_edgeone_dns.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * style: apply ruff formatting fixes - Format 9 files with ruff - Fix 2 linting issues automatically - One complexity warning remains (C901) but doesn't affect functionality - All code now follows consistent formatting standards Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * docs(agent): add ruff installation instructions to new-provider guide - Add pip3 install ruff command before formatting/linting steps - Ensures developers have required tools before running verification - Prevents common setup errors Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * docs(config): clarify extra dict and extra_ prefix priority within config sources - Add comments explaining that extra_ prefixed keys override nested extra dict values within the same source - Improves code documentation clarity for config flattening logic - Addresses feedback about intra-source priority ordering Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * refactor(config): reduce complexity of _collect_extra method - Extract _process_extra_from_source helper method to reduce cyclomatic complexity - Fixes ruff C901 error (complexity was 14, now under threshold) - Maintains all existing functionality and test coverage - All 60 extra-related tests passing Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> Co-authored-by: New Future <NewFuture@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> |
||
|
|
1600e57aff |
feat(config): add support for extra configuration fields (#562)
* Initial plan * feat(config): add extra field support to Config class Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * feat(config): complete extra field implementation with documentation Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * docs(config): add practical examples for extra fields usage Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * fix(config): remove func from known_keys, delete docs, update schema Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * fix(config): revert v4.0.json changes and fix lint/format issues Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * Remove statistics option from ruff-action args * Update ddns/config/cli.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fix(config): fix lint error and Python 2.7 compatibility Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * fix(config): remove redundant extra unpacking in provider init Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * fix(config): make set_record call Python 2.7 compatible Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> Co-authored-by: New Future <NewFuture@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> |
||
|
|
c2cad12380 |
refactor(http.proxy): add "SYSTEM" and fix "DIRECT" proxy, implement proxy list support with automatic fallback (#537)
* feat(http): implement proxy list support with fallback mechanism - Add proxies parameter to request() function for proxy list support - Maintain backward compatibility with single proxy parameter - Implement proxy fallback logic that tries each proxy in order - Update provider base classes to use proxy lists directly - Add comprehensive tests for proxy list functionality - Support None in proxy list to represent direct connection Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * fix(http): handle empty proxy list edge case and remove duplicate function definition - Fix empty proxy list to default to direct connection - Remove duplicate function definition in request() - Add test case for empty proxy list scenario Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * fix(tests): correct provider proxy list test mocking - Fix provider test mocking to use HttpResponse objects - All proxy list tests now pass correctly - Provider integration tests verify proxy list functionality Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * fix(lint): resolve flake8 issues - remove whitespace and fix indentation Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * refactor(http): remove proxy parameter and implement ProxiesHandler Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * refactor(http): implement ProxiesHandler based on ProxyHandler with proxy_open override Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * refactor(http): remove proxy wrapper class and string compatibility per feedback Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * refactor(http): implement ProxiesHandler with proxy_open override as requested Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * refactor(http): update endpoint URLs to use HTTP instead of HTTPS for testing * feat: Add support for proxy settings in configuration - Introduced a new "proxy" property in the schema to allow HTTP proxy settings in various formats. - Updated tests to validate the handling of proxy settings, including special values and array formats. - Enhanced environment variable loading to support proxy configurations, ensuring precedence rules are respected. - Added tests for multi-provider configurations with independent proxy settings and global proxy overrides. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> Co-authored-by: New Future <NewFuture@users.noreply.github.com> |
||
|
|
96b4ca2e0c |
feat(config): 支持多配置文件和多服务商 优化http support multi config/providers (#531)
* Initial plan * Implement multi-provider and multi-config file support Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * Complete multi-provider and multi-config support with comprehensive testing Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * Address code review feedback: fix exit behavior, remove special env handling, fix log level Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * Add object-with-configs array support for improved JSON schema validation Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * Address code review feedback: simplify config path handling, remove load_config function, and improve debug provider logic Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * Address final code review feedback: improve log handling, provider logging, and debug assignment logic Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * Address final review feedback: simplify debug provider logic and remove array format support Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * Fix lint issues: remove whitespace from blank lines and apply black formatting Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * Implement schema v4.1 with multi-provider support using providers array format Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * Address code review feedback: rename tests, use global log settings, simplify config logic, remove configs format support Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * Fix lint issues and simplify complex functions to reduce cyclomatic complexity Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * Address code review feedback: enhance config functions and inline simple logic Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * Fix Python 2.7 compatibility and lint issues in test_config_schema_v4_1.py Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * Simplify config logic, fix Python 2.7 compatibility, and improve code formatting Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * Optimize config logic and enhance schema v4.0/v4.1 compatibility tests Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * Update file.py * Update file.py * Update file.py * Update file.py * Fix critical bug in multi-provider config processing and clean up lint issues Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * fix * 优化测试代码格式,移除多余空行并调整注释位置 * refactor: update HTTP request handling and improve error processing - Refactored imports for better clarity and organization. - Added custom HTTP error processor to handle all HTTP error status codes gracefully. - Enhanced SSL certificate loading with additional paths for Windows. - Updated test cases to use HTTP instead of HTTPS for testing endpoints. - Added tests for handling HTTP 400 Bad Request and SSL auto fallback behavior. * update http * update docs * refactor: enhance SSL handling in SSLAutoFallbackHandler for better compatibility * add multi tests * fix patch and add rename fileds * refactor: update provider field naming in configuration tests for consistency * update doc link * fix encoding * fix * 清理编码问题 * fix 编码问题 --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> |
||
|
|
5e1a8d5aaf |
feat(provider:edgeone): 支持腾讯EdgeOne Add Tencent Cloud EdgeOne DNS provider support (#521)
* Initial plan * Implement Tencent Cloud EdgeOne DNS provider Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * Refactor EdgeOne provider to inherit from TencentCloudProvider and simplify API logic Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * Implement EdgeOne provider according to official acceleration domain APIs Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * refactor(provider:EdgeOne): streamline API calls and improve test coverage * Update tests/test_provider_edgeone.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * IP_DOMAIN upper case * update comments * fix: address EdgeOne provider feedback - update alias, logging, and add documentation Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * fix: simplify response handling in acceleration domain creation and update * update docs --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> Co-authored-by: New Future <NewFuture@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> |
||
|
|
22c9cf8d54 |
feat(provider:NameSilo):添加NameSilo支持(待验证) (#514)
* Implement NameSilo DNS provider with comprehensive test coverage Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * Refactor NameSilo provider based on code review feedback Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * Add NameSilo to CLI, schema, and documentation Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * Fix NameSilo provider based on code review feedback and resolve flake8 linting issues Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * Add warning if ID is configured for NameSilo provider NameSilo only requires API key (token) authentication and does not need the ID field. Added warning message to inform users when ID is unnecessarily configured. Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * Fix NameSilo provider based on code review and add to README index Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * Fix NameSilo provider based on code review: update domain parameter usage and clarify API parameter meanings Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * Remove dict handling logic and single record test, fix rrhost parameter in NameSilo provider Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> Co-authored-by: New Future <NewFuture@users.noreply.github.com> |
||
|
|
485e6a3e26 |
Refact(config): 统一配置 (#506)
* Add unit tests for configuration loading and JSON handling - Introduced comprehensive unit tests for the ddns.config.__init__ module, covering various scenarios for the load_config function, including configuration merging, error handling, and CLI integration. - Created a new test suite for the JSON configuration module, validating loading, saving, and edge cases for JSON files. - Removed outdated SSL configuration tests that are no longer relevant to the current implementation. * feat(provider): add endpoint parameter to SimpleProvider and update user agent format feat(cli): add endpoint argument to load_config test(tests): add tests for endpoint handling and user agent formatting * feat(doc): add comprehensive configuration documentation for DDNS system * feat: Update environment variable handling and documentation - Changed default values for DDNS_INDEX4 and DDNS_INDEX6 from "default" to ["default"] in env.md and json.md. - Enhanced documentation for index4 and index6 to clarify handling of special prefixes (regex, cmd, shell) and their impact on splitting. - Updated schema to reflect new default values and added support for custom API endpoints and SSL settings. - Improved test coverage for environment variable handling, including special cases for proxy and SSL settings. - Refactored tests to ensure proper handling of environment variables and their precedence over defaults. - Minor adjustments to test cases for consistency and clarity. * fix config and tests * fix error * fix tests * fix tests * fix * Add comprehensive unit tests for configuration file loading - Introduced a new test suite for the configuration file loading module, covering JSON and AST parsing, fallback logic, error handling, and various edge cases. - Replaced references to `load_json_config` with `load_file_config` in existing tests to unify configuration loading methods. - Removed the outdated `test_config_json.py` file as its functionality is now covered in the new test suite. * Fix test_load_config_priority_order mock parameter names for clarity * Add main entry point for test execution in configuration tests * Enhance Config class to flatten single-element lists and improve configuration loading tests * fix tests * update tests * fix: 修复类型注释以支持 None 类型并更新测试用例描述 * fix lint * fix py2.7 * feat: 添加对51dns和aliesa的支持,并更新SSL参数处理 * Refactor unit tests for configuration modules - Updated test descriptions to specify the ddns.config.env and ddns.config.file modules. - Removed redundant comments and improved clarity in test cases. - Consolidated test cases for loading configurations from various sources, ensuring better readability and maintainability. - Enhanced edge case handling and validation in load_config tests. - Improved assertions and mock setups for better accuracy in testing configuration loading behavior. * fix unicode_literals * fix lint and tests * fix tests * fix py2 tests * fix tests and update doc * fix py2.7 test * fix py2 patch * 更新配置文件加载器,修复编码问题 * fix encoding for py2 * 更新 get_ip 函数参数,修改文档以支持阿里云ESA和No-IP自定义端点,添加多个DNS服务示例 * Refactor documentation for DNS providers: - Updated DNSpod documentation by removing redundant configuration examples and enhancing the complete configuration example. - Added English and Chinese documentation for HE.net (Hurricane Electric) with detailed configuration steps and troubleshooting tips. - Introduced English and Chinese documentation for Huawei Cloud DNS, including access key authentication and endpoint configuration. - Enhanced No-IP documentation by clarifying authentication methods and providing comprehensive configuration examples. - Improved Tencent Cloud DNS documentation with additional endpoint options and detailed permission requirements. * Add documentation for new DNS providers and update existing provider guides - Introduced Debug Provider documentation in both English and Chinese. - Added DNS.COM configuration guide in English and Chinese, including authentication methods and troubleshooting. - Updated DNSPod documentation to include separate guides for DNSPod China and DNSPod Global, with detailed configuration examples. - Revised HE.net documentation to streamline configuration examples and optional parameters. - Enhanced Huawei Cloud DNS documentation with clearer endpoint selection and optional parameters. - Updated No-IP documentation to clarify authentication methods and response codes. * Fix stdout and stderr encoding in test setup for compatibility with non-UTF-8 systems * Update environment variable documentation to remove dot-to-underscore conversion * Refactor configuration loading and error handling in ddns.config module - Removed logging in favor of direct stderr/stdout output for error messages. - Simplified the configuration generation logic in load_config. - Enhanced error handling for missing configuration files and invalid formats. - Updated unit tests to reflect changes in output handling and error scenarios. * update config document * fix lint * 更新 Python 配置文档,添加 GitHub Copilot 使用指南和配置生成逻辑,优化配置加载流程 * Refactor Config class to replace dict() method with md5() for generating hash of configurations; update tests to reflect changes in default values and utility methods. * Enhance environment variable handling in load_config function; prioritize DDNS_PROXY over standard proxies, and improve test coverage for proxy configurations and environment variable management. * 添加缓存模块及其测试用例,支持文件缓存功能;新增调试和回调配置文件,更新构建工作流以测试不同配置 * rename * 优化测试用例以确保在空配置情况下正确退出;使用临时目录避免干扰 * fix env test |
||
|
|
78b0e953da |
feat(AliESA) 阿里云边缘安全加速 DNS provider support (#498)
* Initial plan * Implement AliESA (阿里云边缘安全加速) DNS provider with comprehensive tests and documentation Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * Add manual site ID specification support for minimal permissions and enhanced documentation Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * Refactor AliesaProvider to extend AlidnsProvider and use BaseProvider's _split_zone_and_sub with manual site ID support Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * Add comprehensive unit tests following official ESA API documentation Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * fix pipeline * Refactor aliesa inheritance structure and address review comments Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * Address review comments: fix lint issues, remove unsupported features from docs, clean up schema Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * Address review comments: fix Python 2.7 compatibility, simplify tests, remove unsupported features, add configurable endpoints Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * Address review comments: fix Python 2.7 compatibility, implement _validate method, fix lint issues, update docs Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * Remove _split_zone_and_sub override as requested - focus on format checking Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * Fix ESA API HTTP method issue and imports Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * Refactor request method to avoid code duplication and improve TTL handling Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * fix aliesa * Refactor API attribute to endpoint in provider classes for consistency * Remove redundant validation method from AliesaProvider class * Update author attribution and improve documentation formatting in AliesaProvider * Remove outdated configuration examples and tests for region endpoints in AliesaProvider documentation and tests * Add Cloudflare DNS configuration guides in English and Chinese * remove json content * Refactor encoding methods and update domain splitting function across providers * fix py2 * fix * Update type hints and logging in AliDNS and AliESA providers * 修改请求参数 * lower case * update * fix true * improve query * fix bug * fix typos * override remark * fix lint --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> Co-authored-by: New Future <NewFuture@users.noreply.github.com> |
||
|
|
492e4fbf91 |
Add No-IP (noip.com) Dynamic DNS Provider Support (#505)
* Initial plan * Implement No-IP (noip.com) provider with comprehensive tests and documentation Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * Fix lint issues and address code review feedback Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * Update README files to include No-IP provider documentation links Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * Refactor No-IP documentation for clarity and consistency; update JSON schema to include additional DNS providers --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> Co-authored-by: New Future <NewFuture@users.noreply.github.com> |
||
|
|
1e351642d5 |
feat(config:line): 支持自定义线路参数 (#501)
* Initial plan * Add line configuration support for DNS providers Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * Add line parameter documentation to CLI, ENV, and README Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * Implement line parameter in config.py and update v4.0 schema, fix lint issues Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> |
||
|
|
f1a764d3c2 |
refact(provider): 巨大重构 (#484)
* abc * update base * update * add doc * dnspod class provider * lint * fix lint * 类型检查 * add alidns * cloudflare * dnspod 国际版 * Update pyproject.toml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * update dnscom * Update dnspod.py * fix lint * 提供兼容的encode 和 quote 方法 * huawei dns * 名称兼容 * join domain * static * update base * add callback * update http * fix and update hw * merge * refactor: reorganize imports and enhance logging in provider modules * refactor: update method signatures to use None as default for extra parameters * Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update ddns/provider/__init__.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * resolve comments * update doc * update doc * using self logger * update format * Refactor config handling and update provider docs Refactored argument parsing and config file logic in ddns/util/config.py for clarity and improved debug handling. Updated provider development documentation to clarify standard and non-standard DNS provider requirements and examples. Added 'print' as a valid DNS provider in the v4.0 schema and improved enum formatting for log options. Minor logging and message adjustments in ddns/__main__.py. * Rename PrintProvider to DebugProvider and update references Renamed PrintProvider to DebugProvider and updated all references in the codebase, including configuration defaults and schema. This change standardizes the provider naming and improves clarity by using 'debug' instead of 'print' for the default DNS provider. * Add logger support to Cache and BaseProvider classes Introduced logger injection for Cache and BaseProvider to improve logging consistency and flexibility. Updated main entry to pass logger instances, enhanced debug log formats, and fixed a documentation reference in provider.md. * update callback * fix lint * Add and refine provider authentication validation Introduces a _validate method to BaseProvider and its subclasses to ensure authentication credentials are properly set. Refactors CallbackProvider to simplify parameter replacement and validation. Adds stricter validation for CloudflareProvider, requiring a valid email for auth_id. Updates HTTP parameter handling in BaseProvider for improved query and body management. * fix py2 * fix import * fix dnspod and Improve logging and robustness in DDNS provider and utils Enhanced logging throughout the DDNS provider base and main entrypoint for better traceability, including more informative log messages and additional warning/critical logs. Improved the robustness of domain splitting and zone ID resolution logic. Updated dnspod provider methods with doc links and fixed parameter handling. Refactored config to disable cache in debug mode, and standardized string quoting and regex usage in IP utility functions for consistency. * Mask sensitive data in logs for URL and body Introduced the _mask_sensitive_data method to obfuscate sensitive information such as authentication tokens in URLs and request bodies before logging. Updated logging statements to use this masking for improved security. * Add unit tests for BaseProvider and update CI workflow Introduces a test suite for BaseProvider in tests/test_base_provider.py and initializes the tests package. Updates the GitHub Actions workflow to run unit tests as part of the build process. * Remove unused encoding parameter from _quote method The _quote static method in BaseProvider no longer accepts the unused 'encoding' parameter, aligning its signature with actual usage and simplifying the code. * Remove unused 'errors' parameter from _quote method The _quote static method in BaseProvider no longer accepts the 'errors' parameter, as it was not used. The type annotation and call to quote have been updated accordingly. * Refactor CallbackProvider and add unit tests Refactored CallbackProvider to improve variable replacement and HTTP method handling in set_record. Added comprehensive unit tests for CallbackProvider covering initialization, variable replacement, HTTP request logic, and error handling. Minor cleanup in get_system_info_str to remove redundant comment. * Rename and update provider test files, add DebugProvider tests Renamed test_base_provider.py to test_provider_base.py and test_callback_provider.py to test_provider_callback.py for consistency. Updated imports and minor formatting in test_provider_callback.py. Added comprehensive unit and integration tests for DebugProvider in new test_provider_debug.py. * he tests * Refactor tests to use shared BaseProviderTestCase Introduces a new test_base.py with BaseProviderTestCase to provide common setup and utilities for provider tests. Refactors test_provider_base.py, test_provider_callback.py, test_provider_debug.py, and test_provider_he.py to inherit from BaseProviderTestCase, reducing code duplication and improving maintainability. * Improve test configuration and Python 2.7 compatibility Added mock installation for Python 2.7 in CI and as an optional dependency. Enhanced pyproject.toml with unified unittest and pytest configuration, coverage, and flake8 settings. Added a comprehensive tests/README.md for running and writing tests. Refactored test_provider_base.py to use _TestProvider for clarity and consistency. * fix py2 pip * fix pip2 * install pip * tmp dir * Use PY env variable for Python 2.7 setup in CI Replaces hardcoded 'python2' with the PY environment variable in the build workflow for Python 2.7. This improves flexibility and consistency in the CI setup. * Add stub DNS record methods to DebugProvider and HeProvider Introduces _query_zone_id, _create_record, _update_record, and _query_record methods to DebugProvider and HeProvider. DebugProvider raises NotImplementedError for create/update, while HeProvider returns False for these methods. This prepares both providers for a unified interface and future extension. * fix debug * fix tests * fix typos * fix id check * callback 兼容python2 * add SimpleProvider * fix * fix lint * remove duplicate code * fix lint * fix tests * query with condition * fix test for py2 * fix debug tests * run ut in more system * add unit tests for SimpleProvider and update README * Refactor dnspod provider and add comprehensive tests Refactored the DnspodProvider to improve record querying logic, parameter handling, and logging. Expanded the provider development guide with detailed instructions and best practices for both SimpleProvider and BaseProvider. Added a full-featured test suite for DnspodProvider, including unit and integration tests, and updated test documentation for improved clarity and usage instructions. * fix type * format * Add unit tests for AlidnsProvider and CloudflareProvider Added comprehensive unit and integration tests for AlidnsProvider and CloudflareProvider in tests/test_provider_alidns.py and tests/test_provider_cloudflare.py. Also updated type hints in set_record methods in ddns/provider/_base.py for better type accuracy. * Add and update provider tests; fix datetime usage Added comprehensive unit and integration tests for DnscomProvider and HuaweiDNSProvider. Updated test authorship to GitHub Copilot. Improved test structure and naming for SimpleProvider. Fixed datetime usage in alidns.py and huaweidns.py to use timezone-aware UTC. Cleaned up and clarified test README instructions. * Use datetime.utcnow() for UTC timestamps Replaced usage of datetime.now(timezone.utc) with datetime.utcnow() in AlidnsProvider and HuaweiDNSProvider to avoid deprecation warnings and ensure compatibility. Updated related tests to mock datetime.utcnow() instead of datetime.now(). * Add unit tests for DnspodComProvider Introduces unit and integration tests for the DnspodComProvider class, verifying class constants, initialization, inheritance, API endpoint differences, and default line settings. * feat: Add TencentCloudProvider and implement related unit tests - Introduced TencentCloudProvider for Tencent Cloud DNSPod API integration. - Updated existing provider classes to utilize datetime.utcnow() for consistent UTC timestamp handling. - Refactored unit tests for AlidnsProvider, CallbackProvider, DnscomProvider, and HuaweiDNSProvider to use the new now() method for timestamp generation. - Added comprehensive unit tests for TencentCloudProvider covering initialization, validation, signature generation, record querying, creation, and updating. - Ensured compatibility with existing functionality while enhancing test coverage and reliability. * fix tests * always use the time * fix TencentCloudProvider * fix lint * Add new feature to process user input Introduced a function to handle and validate user input, improving the robustness of the input processing workflow. * Update unit tests for various DNS providers * Refactor test imports to use base_test.py for consistency across provider tests * Enhance CallbackProvider and HTTP utilities - Updated CallbackProvider to include User-Agent header in requests. - Improved handling of GET and POST methods based on the presence of auth_token. - Added a new HTTP utilities module for better HTTP request handling, including SSL verification and redirect following. - Implemented comprehensive unit tests for the new HTTP utilities, covering various scenarios including SSL handling, redirects, and error responses. - Added real integration tests for CallbackProvider using httpbin.org to validate actual HTTP interactions. - Enhanced test coverage for SimpleProvider, including verification of sensitive data masking and initialization options. * Refactor provider constants and response handling - Changed class constants from CamelCase (ContentType, DecodeResponse) to snake_case (content_type, decode_response) for consistency across providers. - Updated the default value of `verify_ssl` to "auto" in SimpleProvider. - Adjusted the initialization of providers to accept `verify_ssl` as a parameter. - Modified the handling of headers in HTTP requests to ensure `accept` and `content-type` are set correctly. - Updated tests to reflect changes in constant naming and initialization parameters. - Enhanced error handling in HTTP requests to provide more informative messages. * Refactor unit tests to use MagicMock for improved clarity and consistency * Enhance TencentCloudProvider with improved zone ID querying and response handling in unit tests * Refactor HTTP callback handling and enhance error logging - Improved error handling in CallbackProvider to log exceptions and empty responses. - Introduced HttpResponse class to encapsulate HTTP response details, including status, reason, headers, and body. - Updated send_http_request to return HttpResponse objects instead of raw response strings. - Enhanced tests for CallbackProvider and send_http_request to validate logging and response handling. - Added unit tests for HttpResponse and decoding response bodies with various character sets. * Enhance TencentCloudProvider with improved header handling and signature generation in unit tests * Enhance error handling and logging in DnspodProvider and TencentCloudProvider unit tests * Enhance Python 2/3 compatibility in test_util_http.py with utility functions for string encoding and decoding * fix py2 and time * fix tests * disable push build * Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update tests/test_provider_cloudflare.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * update doc * Refactor TencentCloudProvider methods to use consistent parameter naming for subdomains; update documentation for DNSPod provider authentication methods; enhance error handling in tests to return False instead of raising exceptions for non-existent records; improve masking of sensitive data in URLs; add tests for URL-encoded sensitive data handling. * Add Callback Provider documentation and enhance DNSPod and Tencent Cloud guides - Introduced a comprehensive documentation for the Callback Provider, detailing configuration, request methods, variable replacements, usage scenarios, and troubleshooting tips. - Updated DNSPod documentation to include a link to Tencent Cloud DNSPod for better user guidance. - Added a new Tencent Cloud DNS configuration guide in both English and Chinese, outlining authentication methods, configuration examples, optional parameters, and troubleshooting steps. - Enhanced test cases for AlidnsProvider to validate signature generation and request handling, ensuring proper HTTP interactions and error handling. - Improved error message validation in DNSPod tests to ensure clarity in authentication failure messages. * Enhance documentation and validation for DNS providers; add Callback Provider configuration guide and improve error handling messages for Cloudflare, DNS.COM, HE.net, and HuaweiDNS providers. * Update tests/test_provider_callback.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update tests/test_provider_dnscom.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update tests/test_provider_debug.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update tests/test_provider_he.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> |
||
|
|
bdc9979c10 |
feat(log+doc): 增加log配置,完善文档 (#480)
* update log config * add cli 文档 * update cli config * add docker 文档 |
||
|
|
46918ef98d |
feat(config): 支持环境变量传递数组参数 Support array in environment variables and improve logic (#476)
* feat(config): 环境变量支持数组 * 简单参数支持‘,’分割 * fix typo and update doc * 优化逻辑 |
||
|
|
da19b8c0c4 |
更新配置文件模式至v4.0 重构日志配置,(#465)
Break changes * 移除调试模式, * 添加日志级别和输出文件 |
||
|
|
a1a8f8565c |
feat(run): support custom cache file (#376)
* feat(run): support custom cache file * fix cannot using C style conditional operator * fix lint * fix lint |
||
|
|
3680c2088c | fix: schema add cache property (#354) | ||
|
|
e0a1390ddf | fix #173 domain pattern to match start with * (#245) | ||
|
|
e424df3729 |
feat(config): index4/6允许使用列表提供多个规则 (#188)
* feat(config): index4/6允许使用列表提供多个规则 * fix(config): 修改逻辑及schema Co-authored-by: New Future <NewFuture@users.noreply.github.com> |
||
|
|
ad15059cbf |
feat(dnsprovider): support custom callback api (#170)
* feat(dnsprovider): support custom callback api * feat(callback): shouldn't try to parsing return close #163 |
||
|
|
0b5f2ad8b0 |
Huaweidns (#132)
* 增加华为DNS 增加华为DNS * 更换get获取IP地址的接口 更换get获取IP地址的接口,搜狐返回的可能是GBK,有几个框框字,改为只匹配unicode能解析的部分 * 增加华为DNS 增加华为DNS * 增加huaweidns 增加huaweidns * Update huaweidns.py 我抄了好多你们的代码。。改成我名字真的没问题吗?哈哈 * Update README.md |
||
|
|
d6bc54e896 | schema update | ||
|
|
331b11c2f2 | feat(ttl): support ttl and update schema #14 | ||
|
|
390dd0543e | Update schema for HE.net | ||
|
|
65ec7baeea |
feat(ip): 支持自定义URL
* 更换默认IP提取API * 支持自定义url `url:https:\\xxx.com` #36 #85 #83 |
||
|
|
bccb8406bb | fix(schema): update all to v2 | ||
|
|
52b61b5cb9 | fix(schema): update cache $id | ||
|
|
62858101ac | feat(schema): 添加cache字段是否启用缓存 |