Skip to content

Commit

Permalink
release: v1.6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
sangyuxiaowu committed Apr 23, 2024
1 parent c32c30c commit d13470e
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 5 deletions.
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- 服务器 DDNS 工具,用于内网服务动态域名解析,支持 IPv6
- 服务器 SSL 证书申请工具
- 获取远端站点证书,用于同步通配符证书到其他服务器的场景

目前仅支持阿里云,其他云服务的实现可以自行添加。

Expand Down Expand Up @@ -126,6 +127,36 @@ SangServerTool ssl -c "test.json" --retry=3

关于 `CSR` ,这段配不配都无所谓,毕竟是免费的证书,也不会生效,只是验证了域名的归属权。

## 同步

该功能,用于获取远端站点证书,用于同步通配符证书到其他服务器的场景。

参数说明:

| 参数 | 说明|
| --- | --- |
| -c, --config | Required. Set config json file. <br> 设置配置文件路径 |

> 如:获取远端站点证书
```bash
SangServerTool sync -c "test.json"
```

只需要完成一下配置信息:

```json
{
"Certificate": {
"cerpath": "cmartc.cer", // 域名证书路径或要将新申请的证书放哪里
"site":"https://xxx.domain.com/", // 远端 https 站点地址
"okshell": "" // 完成后执行的脚本文件
}
}
```

> 注意:需要手动复制远端的证书密钥到本地,这个是一次性的操作。
# 支持

欢迎喜欢编程的朋友,关注我的微信公众号:桑榆肖物
Expand Down
4 changes: 2 additions & 2 deletions SangServerTool/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@
rootCommand.AddCommand(ddnsCommand);

// 定义获取 https 站点证书命令
var getcertCommand = new Command("getcert", "Get SSL Cert from https site.");
var getcertCommand = new Command("sync", "Get SSL Cert from https site.");
getcertCommand.AddOption(new Option<string>(new[] { "--config", "-c" }, "Set config json file.") { IsRequired = true });
getcertCommand.Handler = CommandHandler.Create<string>(async (config) =>
{
var logger = loggerFactory.CreateLogger("SangServerTool_GetCert");
var logger = loggerFactory.CreateLogger("SangServerTool_Sync");
var getCert = new GetCert(logger);
return await getCert.Run(config);
});
Expand Down
2 changes: 1 addition & 1 deletion SangServerTool/Properties/launchSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"profiles": {
"SangServerTool": {
"commandName": "Project",
"commandLineArgs": "getcert -c \"test.json\""
"commandLineArgs": "sync -c \"test.json\""
}
}
}
2 changes: 1 addition & 1 deletion SangServerTool/SangServerTool.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Authors>SangSQ(桑世强)</Authors>
<Version>1.6.0</Version>
<Version>1.6.1</Version>
<Description>DDNS &amp; SSL Tool</Description>
<Company>SangSQ</Company>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ for plate in ${plates[*]}; do
echo
echo "=========开始发布:${plate} ========="
echo
dotnet publish $project/$project.csproj -c Release -f net6.0 --sc -r $plate -o=publish/$project.$plate -p:PublishSingleFile=true -p:PublishTrimmed=true
dotnet publish $project/$project.csproj -c Release -f net8.0 --sc -r $plate -o=publish/$project.$plate -p:PublishSingleFile=true -p:PublishTrimmed=true
echo
echo "=========开始打包 ========="
echo
Expand Down

0 comments on commit d13470e

Please sign in to comment.