{"id":1299,"date":"2025-02-02T02:28:00","date_gmt":"2025-02-01T18:28:00","guid":{"rendered":"https:\/\/blog.5danyuan.com\/?p=1299"},"modified":"2025-01-24T14:36:39","modified_gmt":"2025-01-24T06:36:39","slug":"nas-%e4%b8%8a%e4%bd%bf%e7%94%a8-lets-encrypt-%e5%8a%a8%e6%80%81-dns-%e7%bb%ad%e6%9c%9f-ssl-%e8%af%81%e4%b9%a6","status":"publish","type":"post","link":"https:\/\/blog.5danyuan.com\/?p=1299","title":{"rendered":"NAS \u4e0a\u4f7f\u7528 Let&#8217;s encrypt \u52a8\u6001 DNS \u7eed\u671f SSL \u8bc1\u4e66"},"content":{"rendered":"\n<p>\u80cc\u666f\u662f\u6211\u5728 NAS \u4e0a\u90e8\u7f72\u4e86 immich \u6765\u5b58\u653e\u7167\u7247\uff0c\u57fa\u4e8e\u65b9\u4fbf\u4f7f\u7528\u548c\u5b89\u5168\u8003\u8651\uff0c\u4f7f\u7528 https \u53ef\u80fd\u66f4\u5408\u9002\u3002\u719f\u6089 immich \u7684\u5c0f\u4f19\u4f34\u53ef\u80fd\u77e5\u9053\uff0c\u8fd9\u4e2a\u5e94\u7528\u9700\u8981\u4f7f\u7528\u53cd\u5411\u4ee3\u7406\u6765\u652f\u6301 SSL\uff0c\u867d\u7136\u5bf9\u4e8e\u4e0d\u80fd\u76f4\u63a5\u652f\u6301\u611f\u89c9\u4e0d\u53ef\u601d\u8bae\uff0c \u4f46\u662f\u8fd9\u4e5f\u4e0d\u662f\u592a\u5927\u7684\u95ee\u9898\uff0c\u5f00\u4e2a nginx \u955c\u50cf\u4e5f\u5c31\u5b9e\u73b0\u4e86\u53cd\u5411\u4ee3\u7406\uff0c\u5173\u952e\u662f\u5982\u4f55\u652f\u6301 SSL \u8bc1\u4e66\u3002<\/p>\n\n\n\n<p>\u73b0\u5728\u5bb6\u5ead\u4f7f\u7528\u7684\u57fa\u672c\u4e0a\u90fd\u662f\u52a8\u6001 IP\uff0c\u60f3\u8981\u6b63\u786e\u89e3\u6790\u57df\u540d\u5230\u5b9e\u9645 IP \u5c31\u6bd4\u8f83\u9ebb\u70e6\uff0c\u597d\u5728 NAS \u4e0a\u652f\u6301\u52a8\u6001 DNS \u7684\u89e3\u6790\uff0c\u8863\u670d\u81ea\u5df1\u6d17\u4f7f\u7528\u7684\u662f DNSPod\uff0c\u6240\u4ee5\u4ece\u91cc\u9762\u5bfc\u51fa\u4e00\u4e2a api key\uff0c\u653e\u5230 NAS \u91cc\u5c31\u53ef\u4ee5\u4e86\uff0c\u56e0\u4e3a\u53ea\u9700\u8981\u5f88\u7b80\u5355\u5730\u65e0\u8111\u4e0b\u4e00\u6b65\uff0c\u6240\u4ee5\u8fd9\u91cc\u5c31\u4e0d\u5c55\u5f00\u63cf\u8ff0\u4e86\u3002<\/p>\n\n\n\n<p>\u4f46\u662f\uff0c\u63a5\u4e0b\u6765\u6211\u6709\u78b0\u5230\u4e00\u4e2a\u95ee\u9898\uff0c\u7531\u4e8e\u5bf9\u4e8e\u5bb6\u5ead IP \u5730\u5740\u6765\u8bf4\uff0c80 \u548c 443 \u7aef\u53e3\u4e00\u822c\u662f\u88ab\u8fd0\u8425\u5546\u7ed9\u7981\u6b62\u4e86\u7684\uff0c\u6240\u4ee5 DNS \u6821\u9a8c\u7684\u65b9\u5f0f\u5c31\u8d70\u4e0d\u901a\uff0c\u9000\u800c\u6c42\u5176\u6b21\u770b\u57df\u540d\u89e3\u6790\uff0c\u800c certbot \u53c8\u4e0d\u652f\u6301 DNSPod \u7684\uff0c\u641c\u7d22\u4e86\u4e00\u756a\uff0c\u7f51\u4e0a\u6709\u73b0\u6210\u7684\uff0c\u4e8e\u662f\u505a\u4e86\u4e00\u4e2a docker \u955c\u50cf\uff0c\u5728 NAS \u4e0a\u90e8\u7f72\u3002<\/p>\n\n\n\n<p>\u7b2c\u4e00\u6b65\uff1a\u514b\u9686\u4ed3\u5e93<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git@github.com:chenlongqiang\/docker-certbot-dnspod.git<\/code><\/pre>\n\n\n\n<p>\u7b2c\u4e8c\u6b65\uff1a\u6784\u5efa\u955c\u50cf<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cd docker-certbot-dnspod\ndocker build -t certbot-dnspod .<\/code><\/pre>\n\n\n\n<p>\u8bf7\u6ce8\u610f\uff0c\u4e0a\u9762\u547d\u4ee4\u6700\u540e\u8fd8\u6709\u4e00\u4e2a\u82f1\u6587\u7684\u53e5\u53f7\u54df\u3002<\/p>\n\n\n\n<p>\u7b2c\u4e09\u6b65\uff1a\u66f4\u65b0 dnspod.ini \u914d\u7f6e\uff0c\u53ef\u4ee5\u5728 https:\/\/console.dnspod.cn\/account\/token\/token \u8fdb\u884c DNSPod Token \u79d8\u94a5\u521b\u5efa\u3002<\/p>\n\n\n\n<p>\u7b2c\u56db\u90e8\uff1a\u90e8\u7f72\u955c\u50cf<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># \u7533\u8bf7\u65b0\u8bc1\u4e66\uff0c\u6267\u884c\u540e\u4f1a\u8fdb\u884c\u547d\u4ee4\u884c\u4ea4\u4e92\uff0c\u586b\u5199\u5b8c\u4fe1\u606f\u540e\u5c06\u5728 certs \u76ee\u5f55\u4e0b\u751f\u6210\u7533\u8bf7\u6210\u529f\u7684\u8bc1\u4e66\ndocker run -it --rm -v .\/conf\/dnspod.ini:\/data\/certbot\/dnspod.ini -v .\/certs:\/etc\/letsencrypt certbot-dnspod -d your_domain.com -d \"*.your_domain.com\"\n\n# \u7eed\u671f certs \u76ee\u5f55\u4e0b\u7684\u8bc1\u4e66\ndocker run -it --rm -v .\/conf\/dnspod.ini:\/data\/certbot\/dnspod.ini -v .\/certs:\/etc\/letsencrypt certbot-dnspod renew<\/code><\/pre>\n\n\n\n<p>\u8bf7\u6ce8\u610f\uff0c\u5982\u679c\u4e0d\u9700\u8981\u4e00\u6b21\u6027\uff0c\u90a3\u4e48\u53ef\u4ee5\u4e0d\u6dfb\u52a0 &#8211;rm \u53c2\u6570\u3002\u540c\u65f6\u8bf7\u4fee\u6539 dnspod.ini \u7684\u8def\u5f84\u4e3a\u4f60\u7684\u5b9e\u9645\u8def\u5f84\u3002<\/p>\n\n\n\n<p>\u7ecf\u8fc7\u9a8c\u8bc1\uff0c\u786e\u5b9e\u53ef\u4ee5\u83b7\u53d6\u5230 Let&#8217;s encrypt \u751f\u6210\u7684\u8bc1\u4e66\uff0c\u7136\u540e\u66f4\u65b0\u5230 nginx \u7684\u8def\u5f84\u91cc\u3002<\/p>\n\n\n\n<p>\u4e0d\u8fc7\uff0c\u4e00\u4e2a https \u7684\u5730\u5740\u8fd8\u5e26\u7aef\u53e3\u53f7\uff0c\u770b\u7740\u5c31\u602a\u602a\u7684\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u80cc\u666f\u662f\u6211\u5728 NAS \u4e0a\u90e8\u7f72\u4e86 immich \u6765\u5b58\u653e\u7167\u7247\uff0c\u57fa\u4e8e\u65b9\u4fbf\u4f7f\u7528\u548c\u5b89\u5168\u8003\u8651\uff0c\u4f7f\u7528 https \u53ef\u80fd\u66f4\u5408\u9002\u3002 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[336],"class_list":["post-1299","post","type-post","status-publish","format-standard","hentry","category-daily","tag-docker"],"_links":{"self":[{"href":"https:\/\/blog.5danyuan.com\/index.php?rest_route=\/wp\/v2\/posts\/1299","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.5danyuan.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.5danyuan.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.5danyuan.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.5danyuan.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1299"}],"version-history":[{"count":0,"href":"https:\/\/blog.5danyuan.com\/index.php?rest_route=\/wp\/v2\/posts\/1299\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.5danyuan.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1299"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.5danyuan.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1299"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.5danyuan.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1299"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}