update-09.08
This commit is contained in:
parent
5d6851eccc
commit
2229efac5b
|
@ -0,0 +1,42 @@
|
|||
# 项目迁移了,请看:
|
||||
|
||||
项目已经迁移到新地址:https://github.com/linkease/nas-packages
|
||||
|
||||
# ddnsto-openwrt
|
||||
ddnsto for openwrt
|
||||
|
||||
## 使用方法
|
||||
|
||||
把文件夹 ddnsto 拷贝到 Openwrt 源代码的 package/network/services 里面,拷贝之后为:
|
||||
|
||||
```
|
||||
tree package/network/services/ddnsto
|
||||
package/network/services/ddnsto
|
||||
├── files
|
||||
│ ├── ddnsto.config
|
||||
│ ├── ddnsto.init
|
||||
│ └── ddnsto.uci-default
|
||||
└── Makefile
|
||||
```
|
||||
|
||||
### make menuconfig 选择方法
|
||||
|
||||
```
|
||||
make menuconfig
|
||||
|
||||
Network --->
|
||||
Web Servers/Proxies --->
|
||||
<*> ddnsto....................................... DDNS.to - the reverse proxy
|
||||
|
||||
LuCI --->
|
||||
3. Applications --->
|
||||
<*> luci-app-ddnsto.................................. LuCI support for ddnsto
|
||||
```
|
||||
|
||||
### 部分 Openwrt 老版本兼容性问题
|
||||
|
||||
安装完成点击配置,需要手动运行命令:
|
||||
|
||||
```
|
||||
/etc/init.d/ddnsto enable
|
||||
```
|
|
@ -0,0 +1,57 @@
|
|||
#
|
||||
# Copyright (C) 2015-2016 OpenWrt.org
|
||||
# Copyright (C) 2020 jjm2473@gmail.com
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v3.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_ARCH_DDNSTO:=$(ARCH)
|
||||
|
||||
PKG_NAME:=ddnsto
|
||||
PKG_VERSION:=0.3.0
|
||||
PKG_RELEASE:=1
|
||||
PKG_SOURCE:=$(PKG_NAME)-binary-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://firmware.koolshare.cn/binary/ddnsto/
|
||||
PKG_HASH:=cefd2494cb1c21e2c1616290f715dd6415cd460aafc107c38bb9910c13f42448
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-binary-$(PKG_VERSION)
|
||||
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_USE_MIPS16:=0
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/$(PKG_NAME)
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
SUBMENU:=Web Servers/Proxies
|
||||
TITLE:=DDNS.to - the reverse proxy
|
||||
DEPENDS:=
|
||||
URL:=https://www.ddnsto.com/
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/description
|
||||
DDNS.to is a reverse proxy
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/conffiles
|
||||
/etc/config/ddnsto
|
||||
endef
|
||||
|
||||
define Build/Configure
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/config $(1)/etc/init.d $(1)/etc/uci-defaults
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/ddnsto.$(PKG_ARCH_DDNSTO) $(1)/usr/sbin/ddnsto
|
||||
$(INSTALL_CONF) ./files/ddnsto.config $(1)/etc/config/ddnsto
|
||||
$(INSTALL_BIN) ./files/ddnsto.init $(1)/etc/init.d/ddnsto
|
||||
$(INSTALL_BIN) ./files/ddnsto.uci-default $(1)/etc/uci-defaults/ddnsto
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
|
@ -0,0 +1,3 @@
|
|||
config ddnsto
|
||||
option 'token' ''
|
||||
option 'enabled' '0'
|
|
@ -0,0 +1,26 @@
|
|||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=99
|
||||
USE_PROCD=1
|
||||
|
||||
get_config() {
|
||||
config_get_bool enabled $1 enabled 1
|
||||
config_get_bool logger $1 logger 0
|
||||
config_get token $1 token
|
||||
}
|
||||
|
||||
start_service() {
|
||||
config_load ddnsto
|
||||
config_foreach get_config ddnsto
|
||||
[ $enabled != 1 ] && return 1
|
||||
if [ -z "$token" ]; then
|
||||
logger -t ddnsto -p warn "token not set"
|
||||
return 1
|
||||
fi
|
||||
|
||||
procd_open_instance
|
||||
procd_set_param command /usr/sbin/ddnsto -u "$token"
|
||||
[ "$logger" == 1 ] && procd_set_param stderr 1
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
#!/bin/sh
|
||||
|
||||
uci -q batch <<-EOF >/dev/null
|
||||
delete ucitrack.@ddnsto[-1]
|
||||
add ucitrack ddnsto
|
||||
set ucitrack.@ddnsto[-1].init=ddnsto
|
||||
commit ucitrack
|
||||
EOF
|
||||
|
||||
/etc/init.d/ddnsto enable
|
||||
|
||||
exit 0
|
|
@ -0,0 +1,17 @@
|
|||
# Copyright (C) 2016 Openwrt.org
|
||||
#
|
||||
# This is free software, licensed under the Apache License, Version 2.0 .
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
LUCI_TITLE:=LuCI support for ddnsto
|
||||
LUCI_DEPENDS:=ddnsto
|
||||
LUCI_PKGARCH:=all
|
||||
PKG_VERSION:=1.0.0
|
||||
PKG_RELEASE:=1
|
||||
|
||||
include $(TOPDIR)/feeds/luci/luci.mk
|
||||
|
||||
# call BuildPackage - OpenWrt buildroot signature
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
module("luci.controller.ddnsto", package.seeall)
|
||||
|
||||
function index()
|
||||
if not nixio.fs.access("/etc/config/ddnsto") then
|
||||
return
|
||||
end
|
||||
|
||||
entry({"admin", "services", "ddnsto"}, cbi("ddnsto"), _("DDNS.to"), 20).dependent = true
|
||||
|
||||
entry({"admin", "services", "ddnsto_status"}, call("ddnsto_status"))
|
||||
end
|
||||
|
||||
function ddnsto_status()
|
||||
local sys = require "luci.sys"
|
||||
|
||||
local status = {
|
||||
running = (sys.call("pidof ddnsto >/dev/null") == 0)
|
||||
}
|
||||
|
||||
luci.http.prepare_content("application/json")
|
||||
luci.http.write_json(status)
|
||||
end
|
|
@ -0,0 +1,23 @@
|
|||
--wulishui <wulishui@gmail.com> ,20200911
|
||||
--jjm2473 <jjm2473@gmail.com> ,20210127
|
||||
|
||||
local m, s
|
||||
|
||||
m = Map("ddnsto", translate("DDNS.to"), translate("DDNS.to is a reverse proxy.")
|
||||
.. " <a href=\"https://www.ddnsto.com/\" onclick=\"void(0)\" target=\"_blank\">"
|
||||
.. translate("Official Website")
|
||||
.. "</a>")
|
||||
|
||||
m:section(SimpleSection).template = "ddnsto_status"
|
||||
|
||||
s=m:section(TypedSection, "ddnsto", translate("Global settings"))
|
||||
s.addremove=false
|
||||
s.anonymous=true
|
||||
|
||||
s:option(Flag, "enabled", translate("Enable")).rmempty=false
|
||||
|
||||
s:option(Value, "token", translate("Token")).rmempty=false
|
||||
|
||||
return m
|
||||
|
||||
|
|
@ -0,0 +1 @@
|
|||
<%+ddnsto_status%>
|
|
@ -0,0 +1,26 @@
|
|||
<script type="text/javascript">//<![CDATA[
|
||||
XHR.poll(5, '<%=url("admin/services/ddnsto_status")%>', null,
|
||||
function(x, st)
|
||||
{
|
||||
var tb = document.getElementById('ddnsto_status');
|
||||
if (st && tb)
|
||||
{
|
||||
if (st.running)
|
||||
{
|
||||
tb.innerHTML = '<br/><%:The DDNS.to service is running.%>';
|
||||
}
|
||||
else
|
||||
{
|
||||
tb.innerHTML = '<br/><em><%:The DDNS.to service is not running.%></em>';
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
//]]></script>
|
||||
|
||||
<fieldset class="cbi-section">
|
||||
<legend><%:DDNS.to Status%></legend>
|
||||
<p id="ddnsto_status">
|
||||
<em><%:Collecting data...%></em>
|
||||
</p>
|
||||
</fieldset>
|
|
@ -0,0 +1,32 @@
|
|||
msgid "DDNS.to"
|
||||
msgstr "DDNS.to内网穿透"
|
||||
|
||||
msgid "Running state"
|
||||
msgstr "运行状态"
|
||||
|
||||
msgid "Click to open DDNS.to"
|
||||
msgstr "点击打开DDNS.to"
|
||||
|
||||
msgid "DDNS.to is a reverse proxy."
|
||||
msgstr "DDNS.to是一个内网穿透工具。"
|
||||
|
||||
msgid "Official Website"
|
||||
msgstr "官网"
|
||||
|
||||
msgid "Token"
|
||||
msgstr "令牌"
|
||||
|
||||
msgid "The DDNS.to service is running."
|
||||
msgstr "DDNS.to服务已启动"
|
||||
|
||||
msgid "The DDNS.to service is not running."
|
||||
msgstr "DDNS.to服务未启动"
|
||||
|
||||
msgid "DDNS.to Status"
|
||||
msgstr "DDNS.to服务状态"
|
||||
|
||||
msgid "Collecting data..."
|
||||
msgstr "收集数据..."
|
||||
|
||||
msgid "Global settings"
|
||||
msgstr "全局设置"
|
|
@ -0,0 +1,4 @@
|
|||
#!/bin/sh
|
||||
|
||||
rm -f /tmp/luci-indexcache
|
||||
exit 0
|
Loading…
Reference in New Issue