在客户端主机上实现acme dns客户端通信和永久帐户存储的库

pyacmedns的Python项目详细描述


用于处理acme-dns客户端通信和永久帐户存储的客户端库。

安装

从pypi安装

$ pip install pyacmedns

用法

下面是使用此库处理验证的完整示例。

#!/usr/bin/env pythonfrompyacmednsimportClient,Storagewhitelisted_networks=["192.168.11.0/24","[::1]/128"]domain="your.example.org"# Initialize the client. Point it towards your acme-dns instance.client=Client("https://auth.acme-dns.io")# Initialize the storage. If the file does not exist, it will be# automatically created.storage=Storage("/path/to/storage.json")# Check if credentials were previously saved for your domainaccount=storage.fetch("your.example.org")ifnotaccount:# Account did not exist. Let's create a new one# The whitelisted networks parameter is optionalaccount=client.register_account(whitelisted_networks)# Save itstorage.put(domain,account)storage.save()# Update the acme-dns TXT record.client.update_txt_record(account,"___validation_token_recieved_from_the_ca___")

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java Android改造响应不等于邮递员响应   bean的spring初始化失败;嵌套的例外是java。lang.IllegalArgumentException:Pointcut格式不正确:应为“')”   java在运行时传递可选的未知参数   java Android:无法使用密码保护条目   java无法从SimpleIntegerProperty转换为属性<Integer>   java Ibatis:有没有办法在sqlmap xml中的Ibatis resultmap子选择中添加行处理程序?   java如何使用ant脚本运行maven项目?   java如何在DesignGridLayout库中动态创建JButton值?   java JPA多事务管理器   java Eclipse RCP,为编辑器添加了一个新视图   从源文件夹导入时,不会显示Java图像   使用hadoop2设置java单节点集群。4.0与cygwin   java如何连接图像?   JavaJPQL:向数据库中已经存在的值添加一个int值