Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hill-98/aliyun-ddns-php
Alibaba Cloud DDNS for PHP
https://github.com/hill-98/aliyun-ddns-php
aliyun ddns openwrt php
Last synced: 10 days ago
JSON representation
Alibaba Cloud DDNS for PHP
- Host: GitHub
- URL: https://github.com/hill-98/aliyun-ddns-php
- Owner: Hill-98
- License: gpl-3.0
- Created: 2019-03-31T09:32:24.000Z (almost 6 years ago)
- Default Branch: main
- Last Pushed: 2022-04-02T16:41:05.000Z (almost 3 years ago)
- Last Synced: 2023-08-21T11:18:08.142Z (over 1 year ago)
- Topics: aliyun, ddns, openwrt, php
- Language: PHP
- Size: 301 KB
- Stars: 13
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: Changelog.md
- License: LICENSE
Awesome Lists containing this project
README
# aliyun-ddns-php
[更新日志](https://github.com/Hill-98/aliyun-ddns-php/blob/master/Changelog.md)
如果你在寻找 2.0.0 版本之前的文档,请访问 [Wiki](https://github.com/Hill-98/aliyun-ddns-php/wiki) 。
## 简介
它不只是 DDNS
它可以通过路由器/网关的 dnsmasq 将域名解析到本地 IP,实现本地 0 延迟响应解析。
鉴于安全性,它支持自动设置路由器/网关的防火墙规则,特别适合 IPv6 环境使用。
如果担心执行时发生错误,它支持通过电子邮件发送错误信息。
## 安装
运行需求: [PHP](https://php.net) 8.0+
[点击这里](https://github.com/Hill-98/aliyun-ddns-php/releases/latest/download/aliyun-ddns-php.zip) 下载最新版本
## 配置
复制`config.example.php`到`config.php`
编辑`config.php`
如需用路由器/网关功能,路由器必须支持 Luci RPC,且必须正确设置 `CONFIG_LUCI_RPC_URL`, `CONFIG_LUCI_USERNAME` 和 `CONFIG_LUCI_PASSWORD`
如需使用电子邮件发送错误,必须正确设置电子邮件配置项,且 `CONFIG_ERROR_MAIL` 为 `true`
## 使用
支持 GET (POST) 和 CLI 方式运行
OpenWrt 触发执行:[文档](https://github.com/Hill-98/aliyun-ddns-php/blob/master/docs/Automation.md)
参数名 | 必要 | 说明 | 备注
------------|:---:|------------------|---------------
domain | √ | 域名 | 必须存在于你的 DNS 云解析
ip | √ | 解析记录的 IP | 如果是 `ipv4` 或 `ipv6` 会自动获取对应公网 IP
name | √ | 解析记录的主机记录 |
local-ip | × | 本地 IP | 使用路由器/网关的 dnsmasq 把解析域名指向本地 IP
rule-name | × | 防火墙规则名称 | 自动更新路由器/网关的防火墙规则,防火墙规则配置详见 [文档](https://github.com/Hill-98/aliyun-ddns-php/blob/master/docs/FirewallRule.md)执行成功:HTTP 响应代码为 `200` 或 CLI 退出代码为 `0`
#### 示例:
自动获取公网 IPv6 地址并解析到 test.example.com
**GET:** `http://aliddns.localhost/index.php?domain=example.com&name=test&ip=ipv6`
**CLI:** `php /opt/AliDDNS/index.php --domain example.com --name test --ip ipv6`
## 贡献
欢迎 [Fork](https://github.com/Hill-98/aliyun-ddns-php/fork) 本项目并提交 [PR](https://github.com/Hill-98/aliyun-ddns-php/pulls) 。