Merge branch 'main' of gitlab.com:taurusxin/hugo

This commit is contained in:
TaurusXin 2022-08-15 18:26:29 +08:00
commit 7c2b82a7c5
2 changed files with 38 additions and 32 deletions

View File

@ -7,7 +7,7 @@ aliases:
- contact
slug: about
license: CC BY-NC-ND
lastmod: '2021-12-10'
lastmod: '2022-07-28'
menu:
main:
weight: -90
@ -22,8 +22,8 @@ menu:
## 职业
- 英国考文垂大学 (Coventry University) Computer Science 在读本科生
- 英国谢菲尔德大学 (The University Of Sheffield) Engineering Data Communication 在读研究生
- 英国考文垂大学 (Coventry University) Computer Science 学士(一等学位)
- 英国谢菲尔德大学 (The University Of Sheffield) Engineering Data Communication 在读硕士
- 技术方向
- Web 全栈开发
- 移动应用开发

View File

@ -11,26 +11,23 @@ date: "2022-07-24 12:11:00"
官网:<https://www1.hi.cn/>
![image-20220724121339813](https://cdn.rhyland.cn/hugo/2022/07-24/image-20220724121339813.png)
2022 年 7 月 23 日,国产数字证书品牌 HiCA 正式上线,提供免费的半年 IP 或者通配符域名 SSL 证书,非常实用。
![HiCA 官网](https://cdn.rhyland.cn/hugo/2022/07-27/image-20220727235855829.png)
2022 年 7 月 22 日,国产数字证书品牌 HiCA 正式上线,提供免费的半年 IP 或者通配符域名 SSL 证书,非常实用。
7.27 更新:
官网文档已上线,移步 <https://www1.hi.cn/docs/intro> 获得更多教程
## acme.sh
HiCA 默认只提供 acme 协议签发证书,并且禁止任何 GUI 的形式对外公开服务,我们使用最简单的 acme.sh 脚本进行自动签发证书和更新证书。
使用以下命令行安装 acme.sh 自动化脚本,并且替换 `my@example.com` 为你的邮箱
```
```shell
curl https://get.acme.sh | sh -s email=my@example.com
```
## IP 证书
免费的 IP SSL 证书非常少,现在能有一家国产公司站出来,真的为之感到骄傲,并且支持 IPv4 / IPv6 的 IP 证书
@ -43,9 +40,7 @@ curl https://get.acme.sh | sh -s email=my@example.com
使用宝塔面板新建一个站点,域名填写你的 IP然后测试直接访问 IP成功看到页面即可。
记住此站点的根目录 `/www/wwwroot/xx.xx.xx.xx`
记住此站点的根目录 `/www/wwwroot/你的IP`
### 任意 HTTP 服务器
@ -59,27 +54,29 @@ sudo apt install nginx
Ubuntu 默认的网站根目录位于 `/var/www/html`
### 签发
进入到你的服务器终端,输入以下命令行
```shell
acme.sh --issue -d [IPv4/IPv6] --webroot [网站根目录] --server https://acme.hi.cn/directory
acme.sh --issue \
-d [IPv4/IPv6] \
--webroot [网站根目录] \
--server https://acme.hi.cn/directory
```
例如为 IP 1.1.1.1 申请证书,则执行
```shell
acme.sh --issue -d 1.1.1.1 --webroot /www/wwwroot/1.1.1.1 --server https://acme.hi.cn/directory
acme.sh --issue \
-d 1.1.1.1 \
--webroot /www/wwwroot/1.1.1.1 \
--server https://acme.hi.cn/directory
```
稍等片刻,提示签发成功即可下载证书,位于 `~/.acme.sh/xx.xx.xx.xx`
若提示 acme.sh 命令不存在,直接 cd 到 家目录下的 `.acme.sh` 目录下只用相对路径执行命令即可。
若提示 acme.sh 命令不存在,直接 cd 到 /root 目录下的 `.acme.sh` 目录下只用相对路径执行命令即可。
## 通配符证书
@ -91,30 +88,39 @@ acme.sh --issue -d 1.1.1.1 --webroot /www/wwwroot/1.1.1.1 --server https://acme.
![image-20220724123219633](https://cdn.rhyland.cn/hugo/2022/07-24/image-20220724123219633.png)
然后打开服务器终端cd 到 `.acme.sh` 目录下,编辑 `dnsapi`下的 `dns_ali.sh`文件,将第 5、6 行的 `Api_Key``Api_Secret` 替换成你申请到的 Key 和 Secret
使用以下命令添加环境变量
![image-20220724123631426](https://cdn.rhyland.cn/hugo/2022/07-24/image-20220724123631426.png)
```shell
export Ali_Key="你申请的Key"
export Ali_Secret="你申请的Secret"
```
acme.sh 还提供了很多其它云服务厂商的 DNS API详细可以参照官网 GitHub 的 Wiki
### 签发
进入到你的服务器终端,输入以下命令行
```shell
acme.sh --issue -d \*.[域名] -d [域名] --dns dns_ali --server https://acme.hi.cn/directory
acme.sh --issue \
-d \*.[域名] \
-d [域名] \
--dns dns_ali \
--server https://acme.hi.cn/directory
```
例如为域名 taurusxin.com 申请证书,则执行
例如为域名 taurusxin.com 申请通配符证书,则执行
```shell
acme.sh --issue -d \*.taurusxin.com -d taurusxin.com --dns dns_ali --server https://acme.hi.cn/directory
acme.sh --issue \
-d \*.taurusxin.com \
-d taurusxin.com \
--dns dns_ali \
--server https://acme.hi.cn/directory
```
稍等片刻,提示签发成功即可下载证书,同样位于 `~/.acme.sh/your.domain`
稍等片刻,提示签发成功即可下载证书,同样位于 `~/.acme.sh/你的域名`
若提示 acme.sh 命令不存在,直接 cd 到 目录下的 `.acme.sh` 目录下只用相对路径执行命令即可。
若提示 acme.sh 命令不存在,直接 cd 到 /root 目录下的 `.acme.sh` 目录下只用相对路径执行命令即可。
![image-20220724124717718](https://cdn.rhyland.cn/hugo/2022/07-24/image-20220724124717718.png)