Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Alibaba Cloud API #5294

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

PMExtra
Copy link
Contributor

@PMExtra PMExtra commented Sep 19, 2024

#5205 (comment)

@Neilpang 这是基于以上讨论的初步修改版本,尚未测试,只是先看下这个重构思路是否符合预期。

Copy link

Welcome
First thing: don't send PR to the master branch, please send to the dev branch instead.
Please make sure you've read our DNS API Dev Guide and DNS-API-Test.
Then reply on this message, otherwise, your code will not be reviewed or merged.
We look forward to reviewing your Pull request shortly ✨
注意: 必须通过了 DNS-API-Test 才会被 review. 无论是修改, 还是新加的 dns api, 都必须确保通过这个测试.

return 1
fi

# shellcheck disable=SC2034
Ali_API="https://cdn.aliyuncs.com/"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

两边不要定义重名的变量. 这个改个名.
然后修改 _ali_rest() 把api传进去就好了.

@Neilpang
Copy link
Member

基本没啥问题, 继续.

@PMExtra
Copy link
Contributor Author

PMExtra commented Sep 19, 2024

@Neilpang 你看下现在这个模式可以吗?参考每个 rest 之前通过一个函数设置 query 的方式,在同一个函数中设置 API的 endpoint

@PMExtra
Copy link
Contributor Author

PMExtra commented Sep 19, 2024

@Neilpang 我跑了 DNS-API 的测试,发现部分用例(FreeBSD和OpenBSD)会添加值为 acmeTestTxtRecord_ 的TXT记录(后面没有随机字符了,就是到下划线就结束了),而且这个记录似乎没有被自动删除。导致我不得不人工清理解析记录,然后重跑测试才能通过。

日志如下:

  [Thu Sep 19 10:00:36 UTC 2024] _sub_domain='acmetestXyzRandomName.test'
  [Thu Sep 19 10:00:36 UTC 2024] _domain='acme.jubeat.net'
  [Thu Sep 19 10:00:36 UTC 2024] Add record
  [Thu Sep 19 10:00:37 UTC 2024] GET
  [Thu Sep 19 10:00:37 UTC 2024] url='https://alidns.aliyuncs.com/?Signature=P6mHxOtNnmImFNytWBWutcnFSS0%3D&AccessKeyId=***&Action=AddDomainRecord&DomainName=acme.jubeat.net&Format=json&RR=acmetestXyzRandomName.test&SignatureMethod=HMAC-SHA1&SignatureNonce=1726740036N&SignatureVersion=1.0&Timestamp=2024-09-19T10%3A00%3A36Z&Type=TXT&Value=acmeTestTxtRecord_&Version=2015-01-09'
  [Thu Sep 19 10:00:37 UTC 2024] timeout=
  [Thu Sep 19 10:00:37 UTC 2024] _CURL='curl --silent --dump-header /root/.acme.sh/http.header  -L  -g '
  [Thu Sep 19 10:00:38 UTC 2024] ret='0'
  [Thu Sep 19 10:00:38 UTC 2024] response='{"RequestId":"8831E7B6-DAFD-5C7E-A847-1302F6BAB45B","HostId":"alidns.aliyuncs.com","Code":"DomainRecordDuplicate","Message":"The DNS record already exists.","Recommend":"https://api.aliyun.com/troubleshoot?q=DomainRecordDuplicate&product=Alidns&requestId=8831E7B6-DAFD-5C7E-A847-1302F6BAB45B"}'
  [Thu Sep 19 10:00:38 UTC 2024] The DNS record already exists.
  Run Failed

我觉得是测试脚本的问题,这个错误看起来和我当前的改动没有关系,而且在这之前有大量的测试用例都能成功通过。

事实上我也把我当前的分支拉取到正式环境中进行了一次 force renew 测试,能够正确签发并部署新证书到阿里云CDN。

@Neilpang
Copy link
Member

我一会修测试

@Neilpang
Copy link
Member

修了 , 你再试试

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants