Let's Encrypt WebApp Renewer 使用教程

Let's Encrypt WebApp Renewer 使用教程

letsencrypt-webapp-renewer[PLEASE USE FREE MS MANAGED CERTS INSTEAD] Simple WebJob-ready console application for renewing Azure Web App SSL certificates项目地址:https://gitcode.com/gh_mirrors/le/letsencrypt-webapp-renewer

1、项目介绍

letsencrypt-webapp-renewer 是一个用于自动续订 Azure Web App SSL 证书的命令行工具。它基于 letsencrypt-azure-core,提供了以下功能:

  • 支持在任意 Web App 上安装,不限于同一 Web App。
  • 支持管理多个 Web App 的 SSL 证书。
  • 通过 SendGrid 内置了电子邮件通知功能。
  • 无外部依赖,仅依赖 Let's Encrypt。

该项目建议使用 Microsoft 托管的免费证书,但如果你需要自托管证书续订,letsencrypt-webapp-renewer 是一个不错的选择。

2、项目快速启动

安装

  1. 克隆项目仓库:

    git clone https://github.com/ohadschn/letsencrypt-webapp-renewer.git
    cd letsencrypt-webapp-renewer
    
  2. 下载最新的 WebJob zip 文件并部署到你的 Web App:

    # 下载最新版本
    wget https://github.com/ohadschn/letsencrypt-webapp-renewer/releases/latest/download/letsencrypt-webapp-renewer.zip
    
    # 部署到 Web App
    az webapp deployment source config-zip --resource-group <your-resource-group> --name <your-webapp-name> --src letsencrypt-webapp-renewer.zip
    

配置

  1. 创建一个新的 AAD 服务主体,并记录以下参数:

    • SubscriptionId
    • TenantId
    • ResourceGroup
    • WebApp
    • ClientId
    • ClientSecret
  2. 配置 Web App 设置:

    Set-LetsEncryptConfiguration.ps1 -SubscriptionId <your-subscription-id> -TenantId <your-tenant-id> -ResourceGroup <your-resource-group> -WebApp <your-webapp-name> -ClientId <your-client-id> -ClientSecret <your-client-secret>
    

运行

  1. 设置 CRON 定时任务以自动续订证书:

    # 编辑 WebJob 的 settings.job 文件
    {
        "schedule": "0 0 1 * * *"  # 每月1号0点执行
    }
    
  2. 部署 WebJob:

    az webapp deployment source config-zip --resource-group <your-resource-group> --name <your-webapp-name> --src letsencrypt-webapp-renewer.zip
    

3、应用案例和最佳实践

应用案例

  • 企业内部 Web 应用:企业内部使用的 Web 应用需要 SSL 证书,但不想手动管理证书续订。
  • 多租户 SaaS 平台:SaaS 平台需要为每个租户自动续订 SSL 证书,确保安全性和合规性。

最佳实践

  • 使用专用 Web App:为证书续订创建一个专用的 Web App,避免与其他应用部署冲突。
  • 定期测试:定期手动触发证书续订任务,确保配置正确且无误。
  • 监控和日志:配置监控和日志记录,及时发现和解决续订失败的问题。

4、典型生态项目

  • Azure Web Appsletsencrypt-webapp-renewer 主要用于 Azure Web Apps,与 Azure 生态紧密集成。
  • Let's Encrypt:依赖 Let's Encrypt 提供的免费 SSL 证书服务。
  • SendGrid:通过 SendGrid 发送续订成功或失败的通知邮件。

通过以上步骤,你可以快速上手并使用 letsencrypt-webapp-renewer 管理 Azure Web App 的 SSL 证书续订。

letsencrypt-webapp-renewer[PLEASE USE FREE MS MANAGED CERTS INSTEAD] Simple WebJob-ready console application for renewing Azure Web App SSL certificates项目地址:https://gitcode.com/gh_mirrors/le/letsencrypt-webapp-renewer

  • 3
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

经梦鸽

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值