Skip to content
This repository has been archived by the owner on Mar 16, 2021. It is now read-only.

Commit

Permalink
Fixed the bug of the syntax about domain (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
fenying committed Mar 2, 2018
1 parent 5233788 commit e35ce21
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
6 changes: 5 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
# Change logs

## v0.2.3

- 修复域名中带横线“-”时无法识别的 Bug。(Issue #2

## v0.2.2

- 配置文件添加 `certbot-root` 配置项以允许使用自定义的 Certbot 的命令名称。
- 配置文件添加 `certbot-root` 配置项以允许使用自定义的 Certbot 的命令名称。(Issue #1

## v0.2.1

Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ find '.' -name '*.sh' -exec chmod 0700 {} \; # 设置 Shell 脚本执行权限
> Access-Key 需要 AliyunDNSFullAccess 权限。参考:
[配置命令行工具和 SDK](https://help.aliyun.com/document_detail/43039.html?spm=a2c4g.11186623.6.550.ap6b0e)

> 注意阿里云命令行工具输出方式必须是 table。
2. 复制 default.conf 配置文件为 /etc/le-alidns.conf,并根据需要配置。

### 配置 Pip 源
Expand Down
6 changes: 3 additions & 3 deletions actions/create-dns-record.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ write_log "Certbot Domain: ${CERTBOT_DOMAIN}";

write_log "Certbot Validation: ${CERTBOT_VALIDATION}";

API_DomainName=$(echo $CERTBOT_DOMAIN | grep -P "\w+\.\w+$" -o)
DomainRecord=$(echo $CERTBOT_DOMAIN | grep -P ".+(?=\.\w+\.\w+$)" -o)
API_DomainName=$(echo $CERTBOT_DOMAIN | grep -P "\w[-\w]*\.\w[-\w]*$" -o)
DomainRecord=$(echo $CERTBOT_DOMAIN | grep -P ".+(?=\.\w[-\w]*\.\w[-\w]*$)" -o)

if [[ "$DomainRecord" == "" ]]; then
API_RR=_acme-challenge
else
API_RR=_acme-challenge.$DomainRecord
fi;


write_log "Domain: ${API_DomainName}";

write_log "Domain Record: ${DomainRecord}";
Expand Down

0 comments on commit e35ce21

Please sign in to comment.