from bottle import run, request, route

@route("/upload", method="POST")
def upload():
    file = request.files.get("file")
    file.save(".", overwrite=True)

@route("/")
def index():
    return """<html>
<head>
    <title>upload</title>
</head>
<body>
    <form action="upload" method="POST" enctype="multipart/form-data">
        <input type="file" name="file" />
        <input type="submit" value="upload" />
    </form>
</body>
</html>"""


run()

sudo docker run -it --rm --name certbot -v "/etc/letsencrypt:/etc/letsencrypt" -v "/var/lib/letsencrypt:/var/lib/letsencrypt" certbot/certbot certonly -d nodered.wameidemao.com --manual --preferred-challenges dns --server https://acme-v02.api.letsencrypt.org/directory

-d 指定需要申请证书的域名,可以多次指定,且支持泛域名

该命令是交互式的,会自动创建所需 letsencrypt 账户,在过程中需要根据提示手动配置 dns TXT 记录,完成后会在 /etc/letsencrypt/live/ 目录下保存生成好的证书。如果已经存在证书,再次执行这个命令可以 renew 证书

注意域名有效期为:90天