{"action":"created","comment":{"url":"https://api.github.com/repos/Neilpang/acme.sh/pulls/comments/89108132","pull_request_review_id":9656563,"id":89108132,"diff_hunk":"@@ -0,0 +1,185 @@\n+#!/usr/bin/env bash\n+\n+Ali_API=\"https://alidns.aliyuncs.com/\"\n+\n+#Ali_Key=\"LTqIA87hOKdjevsf5\"\n+#Ali_Secret=\"0p5EYueFNq501xnCPzKNbx6K51qPH2\"\n+\n+#Usage: dns_ali_add   _acme-challenge.www.domain.com   \"XKrxpRBosdIKFzxW_CT3KLZNf6q0HG9i01zxXp5CPBs\"\n+dns_ali_add() {\n+  fulldomain=$1\n+  txtvalue=$2\n+\n+  if [ -z \"$Ali_Key\" ] || [ -z \"$Ali_Secret\" ]; then\n+    Ali_Key=\"\"\n+    Ali_Secret=\"\"\n+    _err \"You don't specify aliyun api key and secret yet.\"\n+    return 1\n+  fi\n+\n+  #save the api key and secret to the account conf file.\n+  _saveaccountconf Ali_Key \"$Ali_Key\"\n+  _saveaccountconf Ali_Secret \"$Ali_Secret\"\n+\n+  _debug \"First detect the root zone\"\n+  if ! _get_root \"$fulldomain\"; then\n+    return 1\n+  fi\n+\n+  _add_record_query \"$_domain\" \"$_sub_domain\" \"$txtvalue\"\n+\n+  if ! _ali_rest; then\n+    return 1\n+  fi\n+\n+  return 0\n+}\n+\n+dns_ali_rm() {\n+  fulldomain=$1\n+  _clean\n+}\n+\n+####################  Private functions bellow ##################################\n+\n+_get_root() {\n+  domain=$1\n+  i=2\n+  p=1\n+  while true; do\n+    h=$(printf \"%s\" \"$domain\" | cut -d . -f $i-100)\n+    if [ -z \"$h\" ]; then\n+      #not valid\n+      return 1\n+    fi\n+\n+    _describe_records_query \"$h\"\n+    if ! _ali_rest \"ignore\"; then\n+      return 1\n+    fi\n+\n+    if _contains \"$response\" \"PageNumber\"; then\n+      _sub_domain=$(printf \"%s\" \"$domain\" | cut -d . -f 1-$p)\n+      _debug _sub_domain \"$_sub_domain\"\n+      _domain=\"$h\"\n+      _debug _domain \"$_domain\"\n+      return 0\n+    fi\n+    p=\"$i\"\n+    i=$(_math \"$i\" + 1)\n+  done\n+  return 1\n+}\n+\n+_ali_rest() {\n+  signature=$(echo -n \"GET&%2F&$(_urlencode \"$query\")\" | _hmac \"sha1\" \"$(_hex \"$Ali_Secret&\")\" | _base64)\n+  signature=$(_urlencode \"$signature\")\n+  url=\"$Ali_API?$query&Signature=$signature\"\n+\n+  if ! response=\"$(_get \"$url\")\"; then\n+    _err \"error!\"\n+    return 1\n+  fi\n+\n+  if [ -z \"$1\" ]; then\n+    message=\"$(echo -n \"$response\" | _egrep_o \"\\\"Message\\\":\\\"[^\\\"]*\\\"\" | cut -d : -f 2 | tr -d \\\")\"\n+    if [ -n \"$message\" ]; then\n+      _err \"$message\"\n+      return 1\n+    fi\n+  fi\n+\n+  _debug2 response \"$response\"\n+  return 0\n+}\n+\n+_urlencode() {\n+  local dataLength=\"${#1}\"","path":"dnsapi/dns_ali.sh","position":97,"original_position":97,"commit_id":"4330332f00b8b781b1449f2ba3847781eac95bf0","original_commit_id":"4330332f00b8b781b1449f2ba3847781eac95bf0","user":{"login":"Neilpang","id":8305679,"avatar_url":"https://avatars.githubusercontent.com/u/8305679?v=3","gravatar_id":"","url":"https://api.github.com/users/Neilpang","html_url":"https://github.com/Neilpang","followers_url":"https://api.github.com/users/Neilpang/followers","following_url":"https://api.github.com/users/Neilpang/following{/other_user}","gists_url":"https://api.github.com/users/Neilpang/gists{/gist_id}","starred_url":"https://api.github.com/users/Neilpang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Neilpang/subscriptions","organizations_url":"https://api.github.com/users/Neilpang/orgs","repos_url":"https://api.github.com/users/Neilpang/repos","events_url":"https://api.github.com/users/Neilpang/events{/privacy}","received_events_url":"https://api.github.com/users/Neilpang/received_events","type":"User","site_admin":false},"body":"`lcoal` 关键字 是不能再unix 中用的.\r\n","created_at":"2016-11-22T12:48:28Z","updated_at":"2016-11-22T12:48:28Z","html_url":"https://github.com/Neilpang/acme.sh/pull/410#discussion_r89108132","pull_request_url":"https://api.github.com/repos/Neilpang/acme.sh/pulls/410","_links":{"self":{"href":"https://api.github.com/repos/Neilpang/acme.sh/pulls/comments/89108132"},"html":{"href":"https://github.com/Neilpang/acme.sh/pull/410#discussion_r89108132"},"pull_request":{"href":"https://api.github.com/repos/Neilpang/acme.sh/pulls/410"}}},"pull_request":{"url":"https://api.github.com/repos/Neilpang/acme.sh/pulls/410","id":94551725,"html_url":"https://github.com/Neilpang/acme.sh/pull/410","diff_url":"https://github.com/Neilpang/acme.sh/pull/410.diff","patch_url":"https://github.com/Neilpang/acme.sh/pull/410.patch","issue_url":"https://api.github.com/repos/Neilpang/acme.sh/issues/410","number":410,"state":"open","locked":false,"title":"Add DNS API support for aliyun","user":{"login":"baiyangliu","id":5218092,"avatar_url":"https://avatars.githubusercontent.com/u/5218092?v=3","gravatar_id":"","url":"https://api.github.com/users/baiyangliu","html_url":"https://github.com/baiyangliu","followers_url":"https://api.github.com/users/baiyangliu/followers","following_url":"https://api.github.com/users/baiyangliu/following{/other_user}","gists_url":"https://api.github.com/users/baiyangliu/gists{/gist_id}","starred_url":"https://api.github.com/users/baiyangliu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/baiyangliu/subscriptions","organizations_url":"https://api.github.com/users/baiyangliu/orgs","repos_url":"https://api.github.com/users/baiyangliu/repos","events_url":"https://api.github.com/users/baiyangliu/events{/privacy}","received_events_url":"https://api.github.com/users/baiyangliu/received_events","type":"User","site_admin":false},"body":"[阿里云](https://help.aliyun.com/document_detail/29739.html)  \r\nAdd DNS API support for aliyun","created_at":"2016-11-21T04:07:40Z","updated_at":"2016-11-22T12:48:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"830b6ce2c95dc9bfe81f00876f9ed9b0e9022454","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Neilpang/acme.sh/pulls/410/commits","review_comments_url":"https://api.github.com/repos/Neilpang/acme.sh/pulls/410/comments","review_comment_url":"https://api.github.com/repos/Neilpang/acme.sh/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Neilpang/acme.sh/issues/410/comments","statuses_url":"https://api.github.com/repos/Neilpang/acme.sh/statuses/4330332f00b8b781b1449f2ba3847781eac95bf0","head":{"label":"baiyangliu:master","ref":"master","sha":"4330332f00b8b781b1449f2ba3847781eac95bf0","user":{"login":"baiyangliu","id":5218092,"avatar_url":"https://avatars.githubusercontent.com/u/5218092?v=3","gravatar_id":"","url":"https://api.github.com/users/baiyangliu","html_url":"https://github.com/baiyangliu","followers_url":"https://api.github.com/users/baiyangliu/followers","following_url":"https://api.github.com/users/baiyangliu/following{/other_user}","gists_url":"https://api.github.com/users/baiyangliu/gists{/gist_id}","starred_url":"https://api.github.com/users/baiyangliu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/baiyangliu/subscriptions","organizations_url":"https://api.github.com/users/baiyangliu/orgs","repos_url":"https://api.github.com/users/baiyangliu/repos","events_url":"https://api.github.com/users/baiyangliu/events{/privacy}","received_events_url":"https://api.github.com/users/baiyangliu/received_events","type":"User","site_admin":false},"repo":{"id":74245521,"name":"acme.sh","full_name":"baiyangliu/acme.sh","owner":{"login":"baiyangliu","id":5218092,"avatar_url":"https://avatars.githubusercontent.com/u/5218092?v=3","gravatar_id":"","url":"https://api.github.com/users/baiyangliu","html_url":"https://github.com/baiyangliu","followers_url":"https://api.github.com/users/baiyangliu/followers","following_url":"https://api.github.com/users/baiyangliu/following{/other_user}","gists_url":"https://api.github.com/users/baiyangliu/gists{/gist_id}","starred_url":"https://api.github.com/users/baiyangliu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/baiyangliu/subscriptions","organizations_url":"https://api.github.com/users/baiyangliu/orgs","repos_url":"https://api.github.com/users/baiyangliu/repos","events_url":"https://api.github.com/users/baiyangliu/events{/privacy}","received_events_url":"https://api.github.com/users/baiyangliu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/baiyangliu/acme.sh","description":"An ACME Shell script, a certbot client: acme.sh","fork":true,"url":"https://api.github.com/repos/baiyangliu/acme.sh","forks_url":"https://api.github.com/repos/baiyangliu/acme.sh/forks","keys_url":"https://api.github.com/repos/baiyangliu/acme.sh/keys{/key_id}","collaborators_url":"https://api.github.com/repos/baiyangliu/acme.sh/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/baiyangliu/acme.sh/teams","hooks_url":"https://api.github.com/repos/baiyangliu/acme.sh/hooks","issue_events_url":"https://api.github.com/repos/baiyangliu/acme.sh/issues/events{/number}","events_url":"https://api.github.com/repos/baiyangliu/acme.sh/events","assignees_url":"https://api.github.com/repos/baiyangliu/acme.sh/assignees{/user}","branches_url":"https://api.github.com/repos/baiyangliu/acme.sh/branches{/branch}","tags_url":"https://api.github.com/repos/baiyangliu/acme.sh/tags","blobs_url":"https://api.github.com/repos/baiyangliu/acme.sh/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/baiyangliu/acme.sh/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/baiyangliu/acme.sh/git/refs{/sha}","trees_url":"https://api.github.com/repos/baiyangliu/acme.sh/git/trees{/sha}","statuses_url":"https://api.github.com/repos/baiyangliu/acme.sh/statuses/{sha}","languages_url":"https://api.github.com/repos/baiyangliu/acme.sh/languages","stargazers_url":"https://api.github.com/repos/baiyangliu/acme.sh/stargazers","contributors_url":"https://api.github.com/repos/baiyangliu/acme.sh/contributors","subscribers_url":"https://api.github.com/repos/baiyangliu/acme.sh/subscribers","subscription_url":"https://api.github.com/repos/baiyangliu/acme.sh/subscription","commits_url":"https://api.github.com/repos/baiyangliu/acme.sh/commits{/sha}","git_commits_url":"https://api.github.com/repos/baiyangliu/acme.sh/git/commits{/sha}","comments_url":"https://api.github.com/repos/baiyangliu/acme.sh/comments{/number}","issue_comment_url":"https://api.github.com/repos/baiyangliu/acme.sh/issues/comments{/number}","contents_url":"https://api.github.com/repos/baiyangliu/acme.sh/contents/{+path}","compare_url":"https://api.github.com/repos/baiyangliu/acme.sh/compare/{base}...{head}","merges_url":"https://api.github.com/repos/baiyangliu/acme.sh/merges","archive_url":"https://api.github.com/repos/baiyangliu/acme.sh/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/baiyangliu/acme.sh/downloads","issues_url":"https://api.github.com/repos/baiyangliu/acme.sh/issues{/number}","pulls_url":"https://api.github.com/repos/baiyangliu/acme.sh/pulls{/number}","milestones_url":"https://api.github.com/repos/baiyangliu/acme.sh/milestones{/number}","notifications_url":"https://api.github.com/repos/baiyangliu/acme.sh/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/baiyangliu/acme.sh/labels{/name}","releases_url":"https://api.github.com/repos/baiyangliu/acme.sh/releases{/id}","deployments_url":"https://api.github.com/repos/baiyangliu/acme.sh/deployments","created_at":"2016-11-20T01:14:59Z","updated_at":"2016-11-20T01:15:00Z","pushed_at":"2016-11-22T12:35:22Z","git_url":"git://github.com/baiyangliu/acme.sh.git","ssh_url":"git@github.com:baiyangliu/acme.sh.git","clone_url":"https://github.com/baiyangliu/acme.sh.git","svn_url":"https://github.com/baiyangliu/acme.sh","homepage":"https://acme.sh","size":1048,"stargazers_count":0,"watchers_count":0,"language":"Shell","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Neilpang:dev","ref":"dev","sha":"5b771039fc705ed822a3331f5ee4761b5fab2346","user":{"login":"Neilpang","id":8305679,"avatar_url":"https://avatars.githubusercontent.com/u/8305679?v=3","gravatar_id":"","url":"https://api.github.com/users/Neilpang","html_url":"https://github.com/Neilpang","followers_url":"https://api.github.com/users/Neilpang/followers","following_url":"https://api.github.com/users/Neilpang/following{/other_user}","gists_url":"https://api.github.com/users/Neilpang/gists{/gist_id}","starred_url":"https://api.github.com/users/Neilpang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Neilpang/subscriptions","organizations_url":"https://api.github.com/users/Neilpang/orgs","repos_url":"https://api.github.com/users/Neilpang/repos","events_url":"https://api.github.com/users/Neilpang/events{/privacy}","received_events_url":"https://api.github.com/users/Neilpang/received_events","type":"User","site_admin":false},"repo":{"id":48610662,"name":"acme.sh","full_name":"Neilpang/acme.sh","owner":{"login":"Neilpang","id":8305679,"avatar_url":"https://avatars.githubusercontent.com/u/8305679?v=3","gravatar_id":"","url":"https://api.github.com/users/Neilpang","html_url":"https://github.com/Neilpang","followers_url":"https://api.github.com/users/Neilpang/followers","following_url":"https://api.github.com/users/Neilpang/following{/other_user}","gists_url":"https://api.github.com/users/Neilpang/gists{/gist_id}","starred_url":"https://api.github.com/users/Neilpang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Neilpang/subscriptions","organizations_url":"https://api.github.com/users/Neilpang/orgs","repos_url":"https://api.github.com/users/Neilpang/repos","events_url":"https://api.github.com/users/Neilpang/events{/privacy}","received_events_url":"https://api.github.com/users/Neilpang/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Neilpang/acme.sh","description":"An ACME Shell script, a certbot client: acme.sh","fork":false,"url":"https://api.github.com/repos/Neilpang/acme.sh","forks_url":"https://api.github.com/repos/Neilpang/acme.sh/forks","keys_url":"https://api.github.com/repos/Neilpang/acme.sh/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Neilpang/acme.sh/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Neilpang/acme.sh/teams","hooks_url":"https://api.github.com/repos/Neilpang/acme.sh/hooks","issue_events_url":"https://api.github.com/repos/Neilpang/acme.sh/issues/events{/number}","events_url":"https://api.github.com/repos/Neilpang/acme.sh/events","assignees_url":"https://api.github.com/repos/Neilpang/acme.sh/assignees{/user}","branches_url":"https://api.github.com/repos/Neilpang/acme.sh/branches{/branch}","tags_url":"https://api.github.com/repos/Neilpang/acme.sh/tags","blobs_url":"https://api.github.com/repos/Neilpang/acme.sh/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Neilpang/acme.sh/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Neilpang/acme.sh/git/refs{/sha}","trees_url":"https://api.github.com/repos/Neilpang/acme.sh/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Neilpang/acme.sh/statuses/{sha}","languages_url":"https://api.github.com/repos/Neilpang/acme.sh/languages","stargazers_url":"https://api.github.com/repos/Neilpang/acme.sh/stargazers","contributors_url":"https://api.github.com/repos/Neilpang/acme.sh/contributors","subscribers_url":"https://api.github.com/repos/Neilpang/acme.sh/subscribers","subscription_url":"https://api.github.com/repos/Neilpang/acme.sh/subscription","commits_url":"https://api.github.com/repos/Neilpang/acme.sh/commits{/sha}","git_commits_url":"https://api.github.com/repos/Neilpang/acme.sh/git/commits{/sha}","comments_url":"https://api.github.com/repos/Neilpang/acme.sh/comments{/number}","issue_comment_url":"https://api.github.com/repos/Neilpang/acme.sh/issues/comments{/number}","contents_url":"https://api.github.com/repos/Neilpang/acme.sh/contents/{+path}","compare_url":"https://api.github.com/repos/Neilpang/acme.sh/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Neilpang/acme.sh/merges","archive_url":"https://api.github.com/repos/Neilpang/acme.sh/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Neilpang/acme.sh/downloads","issues_url":"https://api.github.com/repos/Neilpang/acme.sh/issues{/number}","pulls_url":"https://api.github.com/repos/Neilpang/acme.sh/pulls{/number}","milestones_url":"https://api.github.com/repos/Neilpang/acme.sh/milestones{/number}","notifications_url":"https://api.github.com/repos/Neilpang/acme.sh/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Neilpang/acme.sh/labels{/name}","releases_url":"https://api.github.com/repos/Neilpang/acme.sh/releases{/id}","deployments_url":"https://api.github.com/repos/Neilpang/acme.sh/deployments","created_at":"2015-12-26T12:56:33Z","updated_at":"2016-11-22T11:51:25Z","pushed_at":"2016-11-22T12:35:23Z","git_url":"git://github.com/Neilpang/acme.sh.git","ssh_url":"git@github.com:Neilpang/acme.sh.git","clone_url":"https://github.com/Neilpang/acme.sh.git","svn_url":"https://github.com/Neilpang/acme.sh","homepage":"https://acme.sh","size":1195,"stargazers_count":1820,"watchers_count":1820,"language":"Shell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":217,"mirror_url":null,"open_issues_count":23,"forks":217,"open_issues":23,"watchers":1820,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Neilpang/acme.sh/pulls/410"},"html":{"href":"https://github.com/Neilpang/acme.sh/pull/410"},"issue":{"href":"https://api.github.com/repos/Neilpang/acme.sh/issues/410"},"comments":{"href":"https://api.github.com/repos/Neilpang/acme.sh/issues/410/comments"},"review_comments":{"href":"https://api.github.com/repos/Neilpang/acme.sh/pulls/410/comments"},"review_comment":{"href":"https://api.github.com/repos/Neilpang/acme.sh/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Neilpang/acme.sh/pulls/410/commits"},"statuses":{"href":"https://api.github.com/repos/Neilpang/acme.sh/statuses/4330332f00b8b781b1449f2ba3847781eac95bf0"}}}}
{"actor":{"display_login":"Neilpang"}}