AlexStocks opened a new issue, #6:
URL: https://github.com/apache/dubbo-net/issues/6

   ## 问题
   
   集成测试与示例把**一个具体的公网 IP** 写死成了默认注册中心:
   
   ```
   Tests/DubboClientIntegrationTests/Program.cs:8    const string 
DefaultZooKeeper = "110.40.136.183:2181";
   Tests/DubboClientIntegrationTests/Program.cs:9    const string DefaultNacos  
   = "nacos://110.40.136.183:8848";
   Tests/DubboClientIntegrationTests/Program.cs:10   const string ProviderHost  
   = "110.40.136.183";
   Tests/QueryDemo/Program.cs:6                      const string 
DefaultZooKeeper = "110.40.136.183:2181";
   Tests/QueryDemo/Program.cs:8                      const string ProviderHost  
   = "110.40.136.183";
   ```
   
   README 也在 810 / 815 / 827 行把这个地址作为"公开测试注册中心"介绍给用户。
   
   ## 为什么需要处理
   
   1. **可用性**:这台机器一旦下线或更换 IP,仓库的示例与文档全部失效,而维护者可能并不知道。
   2. **信任面**:让用户默认连一个非 ASF 控制的主机,属于不合适的默认值;即使它是善意的测试环境。
   3. **运维风险**:公开文档里的地址会带来扫描与滥用流量,对提供者也是负担。
   4. **可移植性**:CI 与贡献者无法在本地复现。
   
   ## 建议
   
   1. 默认值改为本地回环,并允许通过参数/环境变量覆盖:
      ```csharp
      const string DefaultZooKeeper = "127.0.0.1:2181";
      // 或读环境变量 DUBBONET_TEST_ZK,缺省 127.0.0.1:2181
      ```
   2. README 中把该 IP 换成 `127.0.0.1`,并补一句"如需使用共享测试环境,请自备并显式传入"。
   3. 如果确实希望保留一个公共测试环境,应该由 ASF/Dubbo 社区托管并在文档中说明归属与 SLA,而不是个人服务器硬编码。
   4. 配合 `compose.yaml` + `Tests/DubboClientIntegrationTests/Dockerfile` 提供可一键起 
ZooKeeper/Nacos 的本地环境,让集成测试可自洽运行。
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to