使CloudFlare DDNS服务中的值与本地动态IP地址同步的脚本。
cfdyndns-updater的Python项目详细描述
cfdyndns更新程序
使CloudFlare DDNS服务中的值与本地值保持同步的脚本 动态IP地址。它启动一个无限循环,定期执行检查,使用 外部服务,无论您的IP地址是否已更改。如果是这样,剧本 向CloudFlare API发送请求并更新DNS记录。
要求
- Python3.6+
如何使用脚本
以以下格式编写配置文件:
email:<your login to Cloudflare>api_key:<Cloudflare API key>periodicity:<timeout between checks in seconds>domains:-example.org# 'proxied: true' is implied-www.example.org-domain:ssh.example.orgproxied:false<...>
您可以将它以
.cloudflare-ddns-config
的名称放入主目录。 在Linux上,还支持系统范围的配置文件:/etc/cloudflare-ddns-config
。安装软件包:
pip install cfdyndns-updater
运行脚本!
cfddns_updater
可以将任何配置文件的路径显式指定为 位置参数:
cfddns_updater config.yml
Exit code | Explanation |
---|---|
2 | invalid command line arguments |
-1 | the configuration file is not found |
-2 | validation of the configuration file was failed |
与系统管理器集成
有关各种配置文件的示例,请参见Wiki pages 系统管理员。如果您最喜欢的一个丢失了,请为它编写自己的配置文件并创建一个pull 请求。欢迎任何贡献!