├── README.md ├── ddnsto ├── Makefile └── files │ ├── ddnsto.config │ ├── ddnsto.init │ └── ddnsto.uci-default └── luci-app-ddnsto ├── Makefile ├── luasrc ├── controller │ └── ddnsto.lua ├── model │ └── cbi │ │ └── ddnsto.lua └── view │ ├── admin_status │ └── index │ │ └── ddnsto.htm │ └── ddnsto_status.htm ├── po └── zh-cn │ └── ddnsto.po └── root └── etc └── uci-defaults └── 50_luci-ddnsto /README.md: -------------------------------------------------------------------------------- 1 | # 项目迁移了,请看: 2 | 3 | 项目已经迁移到新地址:https://github.com/linkease/nas-packages 4 | 5 | # ddnsto-openwrt 6 | ddnsto for openwrt 7 | 8 | ## 使用方法 9 | 10 | 把文件夹 ddnsto 拷贝到 Openwrt 源代码的 package/network/services 里面,拷贝之后为: 11 | 12 | ``` 13 | tree package/network/services/ddnsto 14 | package/network/services/ddnsto 15 | ├── files 16 | │   ├── ddnsto.config 17 | │   ├── ddnsto.init 18 | │   └── ddnsto.uci-default 19 | └── Makefile 20 | ``` 21 | 22 | ### make menuconfig 选择方法 23 | 24 | ``` 25 | make menuconfig 26 | 27 | Network ---> 28 | Web Servers/Proxies ---> 29 | <*> ddnsto....................................... DDNS.to - the reverse proxy 30 | 31 | LuCI ---> 32 | 3. Applications ---> 33 | <*> luci-app-ddnsto.................................. LuCI support for ddnsto 34 | ``` 35 | 36 | ### 部分 Openwrt 老版本兼容性问题 37 | 38 | 安装完成点击配置,需要手动运行命令: 39 | 40 | ``` 41 | /etc/init.d/ddnsto enable 42 | ``` 43 | -------------------------------------------------------------------------------- /ddnsto/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2015-2016 OpenWrt.org 3 | # Copyright (C) 2020 jjm2473@gmail.com 4 | # 5 | # This is free software, licensed under the GNU General Public License v3. 6 | # 7 | 8 | include $(TOPDIR)/rules.mk 9 | 10 | PKG_ARCH_DDNSTO:=$(ARCH) 11 | 12 | PKG_NAME:=ddnsto 13 | PKG_VERSION:=0.3.0 14 | PKG_RELEASE:=1 15 | PKG_SOURCE:=$(PKG_NAME)-binary-$(PKG_VERSION).tar.gz 16 | PKG_SOURCE_URL:=https://firmware.koolshare.cn/binary/ddnsto/ 17 | PKG_HASH:=cefd2494cb1c21e2c1616290f715dd6415cd460aafc107c38bb9910c13f42448 18 | 19 | PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-binary-$(PKG_VERSION) 20 | 21 | PKG_BUILD_PARALLEL:=1 22 | PKG_USE_MIPS16:=0 23 | 24 | include $(INCLUDE_DIR)/package.mk 25 | 26 | define Package/$(PKG_NAME) 27 | SECTION:=net 28 | CATEGORY:=Network 29 | SUBMENU:=Web Servers/Proxies 30 | TITLE:=DDNS.to - the reverse proxy 31 | DEPENDS:= 32 | URL:=https://www.ddnsto.com/ 33 | endef 34 | 35 | define Package/$(PKG_NAME)/description 36 | DDNS.to is a reverse proxy 37 | endef 38 | 39 | define Package/$(PKG_NAME)/conffiles 40 | /etc/config/ddnsto 41 | endef 42 | 43 | define Build/Configure 44 | endef 45 | 46 | define Build/Compile 47 | endef 48 | 49 | define Package/$(PKG_NAME)/install 50 | $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/config $(1)/etc/init.d $(1)/etc/uci-defaults 51 | $(INSTALL_BIN) $(PKG_BUILD_DIR)/ddnsto.$(PKG_ARCH_DDNSTO) $(1)/usr/sbin/ddnsto 52 | $(INSTALL_CONF) ./files/ddnsto.config $(1)/etc/config/ddnsto 53 | $(INSTALL_BIN) ./files/ddnsto.init $(1)/etc/init.d/ddnsto 54 | $(INSTALL_BIN) ./files/ddnsto.uci-default $(1)/etc/uci-defaults/ddnsto 55 | endef 56 | 57 | $(eval $(call BuildPackage,$(PKG_NAME))) 58 | -------------------------------------------------------------------------------- /ddnsto/files/ddnsto.config: -------------------------------------------------------------------------------- 1 | config ddnsto 2 | option 'token' '' 3 | option 'enabled' '0' 4 | -------------------------------------------------------------------------------- /ddnsto/files/ddnsto.init: -------------------------------------------------------------------------------- 1 | #!/bin/sh /etc/rc.common 2 | 3 | START=99 4 | USE_PROCD=1 5 | 6 | get_config() { 7 | config_get_bool enabled $1 enabled 1 8 | config_get_bool logger $1 logger 0 9 | config_get token $1 token 10 | } 11 | 12 | start_service() { 13 | config_load ddnsto 14 | config_foreach get_config ddnsto 15 | [ $enabled != 1 ] && return 1 16 | if [ -z "$token" ]; then 17 | logger -t ddnsto -p warn "token not set" 18 | return 1 19 | fi 20 | 21 | procd_open_instance 22 | procd_set_param command /usr/sbin/ddnsto -u "$token" 23 | [ "$logger" == 1 ] && procd_set_param stderr 1 24 | procd_set_param respawn 25 | procd_close_instance 26 | } 27 | -------------------------------------------------------------------------------- /ddnsto/files/ddnsto.uci-default: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | uci -q batch <<-EOF >/dev/null 4 | delete ucitrack.@ddnsto[-1] 5 | add ucitrack ddnsto 6 | set ucitrack.@ddnsto[-1].init=ddnsto 7 | commit ucitrack 8 | EOF 9 | 10 | /etc/init.d/ddnsto enable 11 | 12 | exit 0 -------------------------------------------------------------------------------- /luci-app-ddnsto/Makefile: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2016 Openwrt.org 2 | # 3 | # This is free software, licensed under the Apache License, Version 2.0 . 4 | # 5 | 6 | include $(TOPDIR)/rules.mk 7 | 8 | LUCI_TITLE:=LuCI support for ddnsto 9 | LUCI_DEPENDS:=ddnsto 10 | LUCI_PKGARCH:=all 11 | PKG_VERSION:=1.0.0 12 | PKG_RELEASE:=1 13 | 14 | include $(TOPDIR)/feeds/luci/luci.mk 15 | 16 | # call BuildPackage - OpenWrt buildroot signature 17 | 18 | -------------------------------------------------------------------------------- /luci-app-ddnsto/luasrc/controller/ddnsto.lua: -------------------------------------------------------------------------------- 1 | module("luci.controller.ddnsto", package.seeall) 2 | 3 | function index() 4 | if not nixio.fs.access("/etc/config/ddnsto") then 5 | return 6 | end 7 | 8 | entry({"admin", "services", "ddnsto"}, cbi("ddnsto"), _("DDNS.to"), 20).dependent = true 9 | 10 | entry({"admin", "services", "ddnsto_status"}, call("ddnsto_status")) 11 | end 12 | 13 | function ddnsto_status() 14 | local sys = require "luci.sys" 15 | 16 | local status = { 17 | running = (sys.call("pidof ddnsto >/dev/null") == 0) 18 | } 19 | 20 | luci.http.prepare_content("application/json") 21 | luci.http.write_json(status) 22 | end 23 | -------------------------------------------------------------------------------- /luci-app-ddnsto/luasrc/model/cbi/ddnsto.lua: -------------------------------------------------------------------------------- 1 | --wulishui ,20200911 2 | --jjm2473 ,20210127 3 | 4 | local m, s 5 | 6 | m = Map("ddnsto", translate("DDNS.to"), translate("DDNS.to is a reverse proxy.") 7 | .. " " 8 | .. translate("Official Website") 9 | .. "") 10 | 11 | m:section(SimpleSection).template = "ddnsto_status" 12 | 13 | s=m:section(TypedSection, "ddnsto", translate("Global settings")) 14 | s.addremove=false 15 | s.anonymous=true 16 | 17 | s:option(Flag, "enabled", translate("Enable")).rmempty=false 18 | 19 | s:option(Value, "token", translate("Token")).rmempty=false 20 | 21 | return m 22 | 23 | 24 | -------------------------------------------------------------------------------- /luci-app-ddnsto/luasrc/view/admin_status/index/ddnsto.htm: -------------------------------------------------------------------------------- 1 | <%+ddnsto_status%> 2 | -------------------------------------------------------------------------------- /luci-app-ddnsto/luasrc/view/ddnsto_status.htm: -------------------------------------------------------------------------------- 1 | 20 | 21 |
22 | <%:DDNS.to Status%> 23 |

24 | <%:Collecting data...%> 25 |

26 |
27 | -------------------------------------------------------------------------------- /luci-app-ddnsto/po/zh-cn/ddnsto.po: -------------------------------------------------------------------------------- 1 | msgid "DDNS.to" 2 | msgstr "DDNS.to内网穿透" 3 | 4 | msgid "Running state" 5 | msgstr "运行状态" 6 | 7 | msgid "Click to open DDNS.to" 8 | msgstr "点击打开DDNS.to" 9 | 10 | msgid "DDNS.to is a reverse proxy." 11 | msgstr "DDNS.to是一个内网穿透工具。" 12 | 13 | msgid "Official Website" 14 | msgstr "官网" 15 | 16 | msgid "Token" 17 | msgstr "令牌" 18 | 19 | msgid "The DDNS.to service is running." 20 | msgstr "DDNS.to服务已启动" 21 | 22 | msgid "The DDNS.to service is not running." 23 | msgstr "DDNS.to服务未启动" 24 | 25 | msgid "DDNS.to Status" 26 | msgstr "DDNS.to服务状态" 27 | 28 | msgid "Collecting data..." 29 | msgstr "收集数据..." 30 | 31 | msgid "Global settings" 32 | msgstr "全局设置" 33 | -------------------------------------------------------------------------------- /luci-app-ddnsto/root/etc/uci-defaults/50_luci-ddnsto: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | rm -f /tmp/luci-indexcache 4 | exit 0 5 | --------------------------------------------------------------------------------