From 15d5d774481f125268b8925da4e5885d318f23ef Mon Sep 17 00:00:00 2001 From: kenzok8 Date: Mon, 12 May 2025 04:21:56 +0800 Subject: [PATCH] update 2025-05-12 04:21:56 --- luci-app-ddns-go/Makefile | 10 +- luci-app-ddns-go/README.md | 118 ---------------- .../resources/view/ddns-go/config.js | 131 ++++++++++++++++++ .../resources/view/ddns-go/ddns-go.js | 66 +++++++++ .../luci-static/resources/view/ddns-go/log.js | 117 ++++++++++++++++ .../luasrc/controller/ddns-go.lua | 45 ------ luci-app-ddns-go/luasrc/model/cbi/ddns-go.lua | 52 ------- .../luasrc/view/ddns-go/ddns-go.htm | 34 ----- .../luasrc/view/ddns-go/ddns-go_log.htm | 90 ------------ .../luasrc/view/ddns-go/ddns-go_status.htm | 33 ----- luci-app-ddns-go/po/templates/ddns-go.pot | 74 ++++++++++ luci-app-ddns-go/po/zh-cn | 1 + luci-app-ddns-go/po/zh-cn/ddns-go.po | 62 --------- luci-app-ddns-go/po/zh_Hans/ddns-go.po | 38 +++-- luci-app-ddns-go/root/etc/config/ddns-go | 14 +- .../root/usr/libexec/ddns-go-call | 32 +++++ .../share/luci/menu.d/luci-app-ddns-go.json | 41 ++++++ .../share/rpcd/acl.d/luci-app-ddns-go.json | 7 +- shadowsocks-rust/Makefile | 10 +- 19 files changed, 513 insertions(+), 462 deletions(-) delete mode 100644 luci-app-ddns-go/README.md create mode 100644 luci-app-ddns-go/htdocs/luci-static/resources/view/ddns-go/config.js create mode 100644 luci-app-ddns-go/htdocs/luci-static/resources/view/ddns-go/ddns-go.js create mode 100644 luci-app-ddns-go/htdocs/luci-static/resources/view/ddns-go/log.js delete mode 100644 luci-app-ddns-go/luasrc/controller/ddns-go.lua delete mode 100644 luci-app-ddns-go/luasrc/model/cbi/ddns-go.lua delete mode 100644 luci-app-ddns-go/luasrc/view/ddns-go/ddns-go.htm delete mode 100644 luci-app-ddns-go/luasrc/view/ddns-go/ddns-go_log.htm delete mode 100644 luci-app-ddns-go/luasrc/view/ddns-go/ddns-go_status.htm create mode 100644 luci-app-ddns-go/po/templates/ddns-go.pot create mode 120000 luci-app-ddns-go/po/zh-cn delete mode 100644 luci-app-ddns-go/po/zh-cn/ddns-go.po create mode 100644 luci-app-ddns-go/root/usr/libexec/ddns-go-call create mode 100644 luci-app-ddns-go/root/usr/share/luci/menu.d/luci-app-ddns-go.json diff --git a/luci-app-ddns-go/Makefile b/luci-app-ddns-go/Makefile index f288b308a..ebb927146 100644 --- a/luci-app-ddns-go/Makefile +++ b/luci-app-ddns-go/Makefile @@ -1,14 +1,17 @@ # SPDX-License-Identifier: GPL-3.0-only # -# Copyright (C) 2021-2024 sirpdboy +# Copyright (C) 2021-2025 sirpdboy # https://github.com/sirpdboy/luci-app-ddns-go # This is free software, licensed under the Apache License, Version 2.0 . # include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-ddns-go -PKG_VERSION:=1.4.5 -PKG_RELEASE:=20240409 +PKG_VERSION:=1.5.0 +PKG_RELEASE:=20250511 + +PKG_MAINTAINER:=sirpdboy +PKG_CONFIG_DEPENDS:= LUCI_TITLE:=LuCI Support for Dynamic ddns-go Client LUCI_DEPENDS:=+ddns-go @@ -20,4 +23,5 @@ define Package/$(PKG_NAME)/conffiles endef include $(TOPDIR)/feeds/luci/luci.mk + # call BuildPackage - OpenWrt buildroot signature diff --git a/luci-app-ddns-go/README.md b/luci-app-ddns-go/README.md deleted file mode 100644 index 8665ed6e3..000000000 --- a/luci-app-ddns-go/README.md +++ /dev/null @@ -1,118 +0,0 @@ -## 访问数:![hello](https://views.whatilearened.today/views/github/sirpdboy/deplives.svg)[![](https://img.shields.io/badge/TG群-点击加入-FFFFFF.svg)](https://t.me/joinchat/AAAAAEpRF88NfOK5vBXGBQ) -### 访问数:[![](https://visitor-badge.glitch.me/badge?page_id=sirpdboy-visitor-badge)] [![](https://img.shields.io/badge/TG群-点击加入-FFFFFF.svg)](https://t.me/joinchat/AAAAAEpRF88NfOK5vBXGBQ) - -欢迎来到sirpdboy的源码仓库! -= -# luci-app-ddns-go - -luci-app-ddns-go 自动获得你的公网 IPv4 或 IPv6 地址,并解析到对应的域名服务。支持的域名服务商 Alidns(阿里云) Dnspod(腾讯云) Cloudflare 华为云 Callback 百度云 porkbun GoDaddy - -[![若部分图片无法正常显示,请挂上机场浏览或点这里到末尾看修复教程](https://visitor-badge.glitch.me/badge?page_id=sirpdboy-visitor-badge)](#解决-github-网页上图片显示失败的问题) [![](https://img.shields.io/badge/TG群-点击加入-FFFFFF.svg)](https://t.me/joinchat/AAAAAEpRF88NfOK5vBXGBQ) - -[luci-app-ddns-go ddns-go动态域名插件](https://github.com/sirpdboy/luci-app-ddns-go) - -====================== - - -请 **认真阅读完毕** 本页面,本页面包含注意事项和如何使用。 - -## 功能说明: - -### ddns-go动态域名插件 -#### 自动获得你的公网 IPv4 或 IPv6 地址,并解析到对应的域名服务。 - - - -- [ddns-go](#ddns-go) - - [特性](#特性) - - [使用方法](#使用方法) - - [说明](#说明) - - [界面](#界面) - - [捐助](#捐助) - - - -## 特性 - -- 支持Mac、Windows、Linux系统,支持ARM、x86架构 -- 支持的域名服务商 `Alidns(阿里云)` `Dnspod(腾讯云)` `Cloudflare` `华为云` `Callback` `百度云` `porkbun` `GoDaddy` -- 支持接口/网卡获取IP -- 支持以服务的方式运行 -- 默认间隔5分钟同步一次 -- 支持多个域名同时解析,公司必备 -- 支持多级域名 -- 网页中配置,简单又方便,可设置 `登录用户名和密码` / `禁止从公网访问` -- 网页中方便快速查看最近50条日志,不需要跑docker中查看 -- 支持webhook通知 -- 支持TTL -- 支持部分dns服务商传递自定义参数,实现地域解析等功能 - -## 使用方法 - -- 将luci-app-ddns-go添加至 LEDE/OpenWRT 源码的方法。 - -### 下载源码方法: - - ```Brach - - # 下载源码 - - git clone https://github.com/sirpdboy/luci-app-ddns-go.git package/ddns-go - make menuconfig - - ``` -### 配置菜单 - - ```Brach - make menuconfig - # 找到 LuCI -> Applications, 选择 luci-app-ddns-go, 保存后退出。 - ``` - -### 编译 - - ```Brach - # 编译固件 - make package/ddns-go/luci-app-ddns-go/compile V=s - ``` - -## 说明 - --源码来源:https://github.com/sirpdboy/luci-app-ddns-go --你可以随意使用其中的源码,但请注明出处。 - -============================ - -## 界面 - -![screenshots](https://raw.githubusercontent.com/jeessy2/ddns-go/master/ddns-web.png) - - -# My other project - -网络速度测试 :https://github.com/sirpdboy/NetSpeedTest - -定时设置插件 : https://github.com/sirpdboy/luci-app-autotimeset - -关机功能插件 : https://github.com/sirpdboy/luci-app-poweroffdevice - -opentopd主题 : https://github.com/sirpdboy/luci-theme-opentopd - -opentoks 主题: https://github.com/sirpdboy/luci-theme-opentoks [仿KOOLSAHRE主题] - -btmob 主题: https://github.com/sirpdboy/luci-theme-btmob - -系统高级设置 : https://github.com/sirpdboy/luci-app-advanced - -## 捐助 - --如果你觉得此项目对你有帮助,请捐助我们,以使项目能持续发展,更加完善。··请作者喝杯咖啡~~~** --你们的支持就是我的动力!** - -| 图飞了😂 | 图飞了😂 | -| :-----------------: | :-------------: | -|![xm1](https://raw.githubusercontent.com/sirpdboy/openwrt/master/doc/支付宝.png) | ![xm1](https://raw.githubusercontent.com/sirpdboy/openwrt/master/doc/微信.png) | - - - 图飞了😂 - - diff --git a/luci-app-ddns-go/htdocs/luci-static/resources/view/ddns-go/config.js b/luci-app-ddns-go/htdocs/luci-static/resources/view/ddns-go/config.js new file mode 100644 index 000000000..290f4ef2a --- /dev/null +++ b/luci-app-ddns-go/htdocs/luci-static/resources/view/ddns-go/config.js @@ -0,0 +1,131 @@ +/* Copyright (C) 2021-2025 sirpdboy herboy2008@gmail.com https://github.com/sirpdboy/luci-app-ddns-go */ +'use strict'; +'require view'; +'require fs'; +'require ui'; +'require uci'; +'require form'; +'require poll'; + +function checkProcess() { + return fs.exec('/bin/pidof', ['ddns-go']).then(function(res) { + return { + running: res.code === 0, + pid: res.code === 0 ? res.stdout.trim() : null + }; + }).catch(function() { + return { running: false, pid: null }; + }); +} + +function renderStatus(isRunning, listen_port, noweb) { + var statusText = isRunning ? _('RUNNING') : _('NOT RUNNING'); + var color = isRunning ? 'green' : 'red'; + var icon = isRunning ? '✓' : '✗'; + var html = String.format( + '%s %s %s', + color, icon, _('DDNS-Go'), statusText + ); + + if (isRunning && res.pid) { + html += ' (PID: ' + res.pid + ')'; + } + + if (isRunning && noweb !== '1') { + html += String.format( + ' %s', + window.location.origin, + listen_port, + _('Open Web Interface') + ); + } + + return html; +} + +return view.extend({ + load: function() { + return Promise.all([ + uci.load('ddns-go') + ]); + }, + + render: function(data) { + var m, s, o; + var listen_port = (uci.get(data[0], 'basic', 'port') || '[::]:9876').split(':').slice(-1)[0]; + var noweb = uci.get(data[0], 'basic', 'noweb') || '0'; + + m = new form.Map('ddns-go', _('DDNS-GO'), + _('DDNS-GO automatically obtains your public IPv4 or IPv6 address and resolves it to the corresponding domain name service.')); + + // 状态显示部分 + s = m.section(form.TypedSection); + s.anonymous = true; + s.render = function() { + var statusView = E('p', { id: 'control_status' }, + ' ' + _('Checking status...')); + + var pollInterval = poll.add(function() { + return checkProcess() + .then(function(res) { + statusView.innerHTML = renderStatus(res.running, listen_port, noweb); + }) + .catch(function(err) { + console.error('Status check failed:', err); + statusView.innerHTML = '⚠ ' + _('Status check error') + ''; + }); + }, 5); // 每5秒检查一次 + + return E('div', { class: 'cbi-section', id: 'status_bar' }, [ + statusView, + E('div', { 'style': 'text-align: right; font-style: italic;' }, [ + E('span', {}, [ + _('© github '), + E('a', { + 'href': 'https://github.com/sirpdboy', + 'target': '_blank', + 'style': 'text-decoration: none;' + }, 'by sirpdboy') + ]) + ]) + ]); + } + + + s = m.section(form.NamedSection, 'config', 'basic'); + + o = s.option(form.Flag, 'enabled', _('Enable')); + o.default = o.disabled; + o.rmempty = false; + + o = s.option(form.Value, 'port', _('Listen port')); + o.default = '[::]:9876'; + o.rmempty = false; + + o = s.option(form.Value, 'time', _('Update interval')); + o.default = '300'; + + o = s.option(form.Value, 'ctimes', _('Compare with service provider N times intervals')); + o.default = '5'; + + o = s.option(form.Value, 'skipverify', _('Skip verifying certificates')); + o.default = '0'; + + o = s.option(form.Value, 'dns', _('Specify DNS resolution server')); + o.value('223.5.5.5', _('Ali DNS 223.5.5.5')); + o.value('223.6.6.6', _('Ali DNS 223.6.6.6')); + o.value('119.29.29.29', _('Tencent DNS 119.29.29.29')); + o.value('1.1.1.1', _('CloudFlare DNS 1.1.1.1')); + o.value('8.8.8.8', _('Google DNS 8.8.8.8')); + o.value('8.8.4.4', _('Google DNS 8.8.4.4')); + o.datatype = 'ipaddr'; + + o = s.option(form.Flag, 'noweb', _('Do not start web services')); + o.default = '0'; + + o = s.option(form.Value, 'delay', _('Delayed Start (seconds)')); + o.default = '60'; + + return m.render(); + } +}); diff --git a/luci-app-ddns-go/htdocs/luci-static/resources/view/ddns-go/ddns-go.js b/luci-app-ddns-go/htdocs/luci-static/resources/view/ddns-go/ddns-go.js new file mode 100644 index 000000000..bfdefc81c --- /dev/null +++ b/luci-app-ddns-go/htdocs/luci-static/resources/view/ddns-go/ddns-go.js @@ -0,0 +1,66 @@ +/* Copyright (C) 2021-2025 sirpdboy herboy2008@gmail.com https://github.com/sirpdboy/luci-app-ddns-go */ + +'use strict'; +'require view'; +'require fs'; +'require ui'; +'require uci'; +'require form'; +'require poll'; + +return view.extend({ + handleSaveApply: null, + handleSave: null, + handleReset: null, + load: function() { + return uci.load('ddns-go'); + }, + + render: function() { + return fs.exec('/bin/pidof', ['ddns-go']).then(function(res) { + var isRunning = res.code === 0; + var port = uci.get('ddns-go', 'basic', 'port') || '[::]:9876'; + var noweb = uci.get('ddns-go', 'basic', 'noweb') || '0'; + port = port.split(':').pop(); + + var container = E('div'); + + var status = E('div', { style: 'text-align: center; padding: 2em;' }, [ + E('img', { + src: 'data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMjQiIGhlaWdodD0iMTAyNCIgdmlld0JveD0iMCAwIDEwMjQgMTAyNCI+PHBhdGggZmlsbD0iI2RmMDAwMCIgZD0iTTk0Mi40MjEgMjM0LjYyNGw4MC44MTEtODAuODExLTE1My4wNDUtMTUzLjA0NS04MC44MTEgODAuODExYy03OS45NTctNTEuNjI3LTE3NS4xNDctODEuNTc5LTI3Ny4zNzYtODEuNTc5LTI4Mi43NTIgMC01MTIgMjI5LjI0OC01MTIgNTEyIDAgMTAyLjIyOSAyOS45NTIgMTk3LjQxOSA4MS41NzkgMjc3LjM3NmwtODAuODExIDgwLjgxMSAxNTMuMDQ1IDE1My4wNDUgODAuODExLTgwLjgxMWM3OS45NTcgNTEuNjI3IDE3NS4xNDcgODEuNTc5IDI3Ny4zNzYgODEuNTc5IDI4Mi43NTIgMCA1MTItMjI5LjI0OCA1MTItNTEyIDAtMTAyLjIyOS0yOS45NTItMTk3LjQxOS04MS41NzktMjc3LjM3NnpNMTk0Ljk0NCA1MTJjMC0xNzUuMTA0IDE0MS45NTItMzE3LjA1NiAzMTcuMDU2LTMxNy4wNTYgNDggMCA5My40ODMgMTAuNjY3IDEzNC4yMjkgMjkuNzgxbC00MjEuNTQ3IDQyMS41NDdjLTE5LjA3Mi00MC43ODktMjkuNzM5LTg2LjI3Mi0yOS43MzktMTM0LjI3MnpNNTEyIDgyOS4wNTZjLTQ4IDAtOTMuNDgzLTEwLjY2Ny0xMzQuMjI5LTI5Ljc4MWw0MjEuNTQ3LTQyMS41NDdjMTkuMDcyIDQwLjc4OSAyOS43ODEgODYuMjcyIDI5Ljc4MSAxMzQuMjI5LTAuMDQzIDE3NS4xNDctMTQxLjk5NSAzMTcuMDk5LTMxNy4wOTkgMzE3LjA5OXoiLz48L3N2Zz4=', + style: 'width: 100px; height: 100px; margin-bottom: 1em;' + }), + E('h2', {}, _('DDNS-GO Service Not Running')), + E('p', {}, _('Please enable the DDNS-GO service')) + ]); + + + if (isRunning && noweb !== '1') { + var iframe = E('iframe', { + src: window.location.origin + ':' + port, + style: 'width: 100%; min-height: 100vh; border: none; border-radius: 3px;' + }); + container.appendChild(iframe); + } else + { + container.appendChild(status); + } + + // Add polling to refresh status + poll.add(function() { + return fs.exec('/bin/pidof', ['ddns-go']).then(function(res) { + var newIsRunning = res.code === 0; + if (newIsRunning !== isRunning) { + window.location.reload(); + } + }); + }, 5); + + poll.start(); + + return container; + }).catch(function(err) { + return E('div', { class: 'error' }, _('Error checking DDNS-Go status: ') + err.message); + }); + } +}); \ No newline at end of file diff --git a/luci-app-ddns-go/htdocs/luci-static/resources/view/ddns-go/log.js b/luci-app-ddns-go/htdocs/luci-static/resources/view/ddns-go/log.js new file mode 100644 index 000000000..9c99b1d2c --- /dev/null +++ b/luci-app-ddns-go/htdocs/luci-static/resources/view/ddns-go/log.js @@ -0,0 +1,117 @@ +/* Copyright (C) 2021-2025 sirpdboy herboy2008@gmail.com https://github.com/sirpdboy/luci-app-ddns-go */ +'use strict'; +'require dom'; +'require fs'; +'require poll'; +'require uci'; +'require view'; +'require form'; + +return view.extend({ + render: function () { + var css = ` + /* 日志框文本区域 */ + #log_textarea pre { + padding: 10px; /* 内边距 */ + border-bottom: 1px solid #ddd; /* 边框颜色 */ + font-size: small; + line-height: 1.3; /* 行高 */ + white-space: pre-wrap; + word-wrap: break-word; + overflow-y: auto; + } + /* 5s 自动刷新文字 */ + .cbi-section small { + margin-left: 1rem; + font-size: small; + color: #666; /* 深灰色文字 */ + } + `; + + var log_textarea = E('div', { 'id': 'log_textarea' }, + E('img', { + 'src': L.resource(['icons/loading.gif']), + 'alt': _('Loading...'), + 'style': 'vertical-align:middle' + }, _('Collecting data ...')) + ); + + var log_path = '/var/log/ddns-go.log'; + var lastLogContent = ''; + + var clear_log_button = E('div', {}, [ + E('button', { + 'class': 'cbi-button cbi-button-remove', + 'click': function (ev) { + ev.preventDefault(); + var button = ev.target; + button.disabled = true; + button.textContent = _('Clear Logs...'); + fs.exec_direct('/usr/libexec/ddns-go-call', ['clear_log']) + .then(function () { + button.textContent = _('Logs cleared successfully!'); + button.disabled = false; + button.textContent = _('Clear Logs'); + // 立即刷新日志显示框 + var log = E('pre', { 'wrap': 'pre' }, [_('Log is clean.')]); + dom.content(log_textarea, log); + lastLogContent = ''; + }) + .catch(function () { + button.textContent = _('Failed to clear log.'); + button.disabled = false; + button.textContent = _('Clear Logs'); + }); + } + }, _('Clear Logs')) + ]); + + poll.add(L.bind(function () { + return fs.read_direct(log_path, 'text') + .then(function (res) { + var newContent = res.trim() || _('Log is clean.'); + + if (newContent !== lastLogContent) { + var log = E('pre', { 'wrap': 'pre' }, [newContent]); + dom.content(log_textarea, log); + log.scrollTop = log.scrollHeight; + lastLogContent = newContent; + } + }).catch(function (err) { + var log; + if (err.toString().includes('NotFoundError')) { + log = E('pre', { 'wrap': 'pre' }, [_('Log file does not exist.')]); + } else { + log = E('pre', { 'wrap': 'pre' }, [_('Unknown error: %s').format(err)]); + } + dom.content(log_textarea, log); + }); + })); + + return E('div', { 'class': 'cbi-map' }, [ + E('style', [css]), + E('div', { 'class': 'cbi-section' }, [ + clear_log_button, + log_textarea, + E('small', {}, _('Refresh every 5 seconds.').format(L.env.pollinterval)), + E('div', { 'class': 'cbi-section-actions cbi-section-actions-right' }) + ]), + E('div', { 'style': 'text-align: right; font-style: italic;' }, [ + E('span', {}, [ + _('© github '), + E('a', { + 'href': 'https://github.com/sirpdboy', + 'target': '_blank', + 'style': 'text-decoration: none;' + }, 'by sirpdboy') + ]) + ]) + + + ]); + }, + + handleSaveApply: null, + handleSave: null, + handleReset: null +}); diff --git a/luci-app-ddns-go/luasrc/controller/ddns-go.lua b/luci-app-ddns-go/luasrc/controller/ddns-go.lua deleted file mode 100644 index 9dae76674..000000000 --- a/luci-app-ddns-go/luasrc/controller/ddns-go.lua +++ /dev/null @@ -1,45 +0,0 @@ --- Copyright (C) 2021-2022 sirpdboy https://github.com/sirpdboy/luci-app-ddns-go --- Licensed to the public under the Apache License 2.0. - -module("luci.controller.ddns-go", package.seeall) - -function index() - if not nixio.fs.access("/etc/config/ddns-go") then - return - end - - local e=entry({"admin", "services", "ddns-go"}, alias("admin", "services", "ddns-go", "setting"),_("DDNS-GO"), 58) - e.dependent=false - e.acl_depends={ "luci-app-ddns-go" } - entry({"admin", "services", "ddns-go", "setting"}, cbi("ddns-go"), _("Base Setting"), 20).leaf=true - entry({"admin", "services", "ddns-go", "ddns-go"}, template("ddns-go/ddns-go"), _("DDNS-GO Control panel"), 30).leaf = true - entry({"admin", "services", "ddnsgo_status"}, call("act_status")) - entry({"admin", "services", "ddns-go", "log"}, template("ddns-go/ddns-go_log"), _("Log"), 40).leaf = true - entry({"admin", "services", "ddns-go", "fetch_log"}, call("fetch_log"), nil).leaf = true - entry({"admin", "services", "ddns-go", "clear_log"}, call("clear_log")).leaf = true -end - -function act_status() - local sys = require "luci.sys" - local e = { } - e.running = sys.call("pidof ddns-go >/dev/null") == 0 - luci.http.prepare_content("application/json") - luci.http.write_json(e) -end -function fetch_log() - local fs = require "nixio.fs" - local log_file = "/var/log/ddns-go.log" - local log_content = fs.readfile(log_file) or "No Log." - luci.http.write(log_content) -end -function clear_log() - local fs = require "nixio.fs" - local log_file = "/var/log/ddns-go.log" - local f = io.open(log_file, "w") - if f then - f:close() - luci.http.status(204, "No Content") - else - luci.http.status(500, "Internal Server Error") - end -end diff --git a/luci-app-ddns-go/luasrc/model/cbi/ddns-go.lua b/luci-app-ddns-go/luasrc/model/cbi/ddns-go.lua deleted file mode 100644 index 37c417a7b..000000000 --- a/luci-app-ddns-go/luasrc/model/cbi/ddns-go.lua +++ /dev/null @@ -1,52 +0,0 @@ --- Copyright (C) 2021-2022 sirpdboy https://github.com/sirpdboy/luci-app-ddns-go - -local m, s ,o - -m = Map("ddns-go") -m.title = translate("DDNS-GO") -m.description = translate("DDNS-GO automatically obtains your public IPv4 or IPv6 address and resolves it to the corresponding domain name service.")..translate("
For specific usage, see:")..translate("GitHub @sirpdboy/luci-app-ddns-go ") - -m:section(SimpleSection).template = "ddns-go/ddns-go_status" - -s = m:section(TypedSection, "basic", translate("Global Settings")) -s.addremove = false -s.anonymous = true - -o = s:option(Flag,"enabled",translate("Enable")) -o.default = 0 - -o = s:option(Value, "port",translate("Set the DDNS-TO access port")) -o.datatype = "uinteger" -o.default=9876 - -o = s:option(Value, "time",translate("update interval")) -o.default=600 - -o = s:option(Value, "ctimes",translate("Compare with service provider N times intervals")) -o.default=5 - -o = s:option(Flag,"skipverify",translate("Skip verifying certificates")) -o.default = 0 - -o = s:option(Value, "dns",translate("Specify DNS resolution server")) -o:value("223.5.5.5", ""..translate("Ali").." DNS (223.5.5.5)") -o:value("223.6.6.6", ""..translate("Ali").." DNS (223.6.6.6)") -o:value("119.29.29.29", ""..translate("Tencent").." DNS (119.29.29.29)") -o:value("1.1.1.1", translate("CloudFlare DNS(1.1.1.1)")) -o:value("8.8.4.4", ""..translate("Google").." DNS(8.8.4.4)") -o:value("8.8.8.8", ""..translate("Google").." DNS(8.8.8.8)") -o.default = "223.5.5.5" - -o = s:option(Flag,"noweb",translate("Do not start web services")) -o.default = 0 - -o = s:option(Value, "delay", translate("Delayed Start (seconds)")) -o.datatype = "and(uinteger,min(0))" -o.default = "60" - -m.apply_on_parse = true -m.on_after_apply = function(self,map) - luci.sys.exec("/etc/init.d/ddns-go restart") -end - -return m diff --git a/luci-app-ddns-go/luasrc/view/ddns-go/ddns-go.htm b/luci-app-ddns-go/luasrc/view/ddns-go/ddns-go.htm deleted file mode 100644 index 7bfbcd78d..000000000 --- a/luci-app-ddns-go/luasrc/view/ddns-go/ddns-go.htm +++ /dev/null @@ -1,34 +0,0 @@ -<%# - Copyright 2008-2024 by sirpdboy - https://github.com/sirpdboy/luci-app-ddns-go - Licensed to the public under the Apache License 2.0. --%> -<% - local running = luci.sys.exec("pidof ddns-go | awk -F ' ' '{print $1}'") -%> -<%+header%> -
- -<% if tonumber(running) ~= nil then %> - - -
- -<% else %> - -
- -

<%:The DDNS-GO service is not running.%>

-

<%:Please enable the DDNS-GO service%>

-
-<% end -%> - -<%+footer%> diff --git a/luci-app-ddns-go/luasrc/view/ddns-go/ddns-go_log.htm b/luci-app-ddns-go/luasrc/view/ddns-go/ddns-go_log.htm deleted file mode 100644 index 62a27e211..000000000 --- a/luci-app-ddns-go/luasrc/view/ddns-go/ddns-go_log.htm +++ /dev/null @@ -1,90 +0,0 @@ -<%+header%> -
- - -
-
-<%
-local fs = require "nixio.fs"
-local log_file_path = "/var/log/ddns-go.log"
-local raw_log_content = fs.readfile(log_file_path) or "No Log."
-local log_lines = {}
-for line in raw_log_content:gmatch("[^\r\n]+") do
-    table.insert(log_lines, line)
-end
-for i=1, math.floor(#log_lines / 2) do
-    log_lines[i], log_lines[#log_lines - i + 1] = log_lines[#log_lines - i + 1], log_lines[i]
-end
-local log_content = table.concat(log_lines, "\n")
-%>
-<%=log_content%>
-
- <%+footer%> - - \ No newline at end of file diff --git a/luci-app-ddns-go/luasrc/view/ddns-go/ddns-go_status.htm b/luci-app-ddns-go/luasrc/view/ddns-go/ddns-go_status.htm deleted file mode 100644 index a67098c0d..000000000 --- a/luci-app-ddns-go/luasrc/view/ddns-go/ddns-go_status.htm +++ /dev/null @@ -1,33 +0,0 @@ -<% -protocol="http://" -%> - - - -
- <%:DDNS-GO Status%> -

- <%:Collecting data...%> -

-
diff --git a/luci-app-ddns-go/po/templates/ddns-go.pot b/luci-app-ddns-go/po/templates/ddns-go.pot new file mode 100644 index 000000000..afee16a6e --- /dev/null +++ b/luci-app-ddns-go/po/templates/ddns-go.pot @@ -0,0 +1,74 @@ +msgid "" +msgstr "" + +msgid "DDNS-GO" +msgstr "" + +msgid "DDNS-GO automatically obtains your public IPv4 or IPv6 address and resolves it to the corresponding domain name service." +msgstr "" + +msgid "Base Setting" +msgstr "" + +msgid "Status check error:" +msgstr "" + +msgid "Checking status..." +msgstr "" + +msgid "DDNS-GO Control panel" +msgstr "" + +msgid "Open Web Interface" +msgstr "" + +msgid "Log" +msgstr "" + +msgid "Clear Logs..." +msgstr "" + +msgid "Logs cleared successfully!" +msgstr "" + +msgid "Clear Logs" +msgstr "" + +msgid "NOT RUNNING" +msgstr "" + +msgid "RUNNING" +msgstr "" + +msgid "DDNS-GO Service Not Running" +msgstr "" + +msgid "Please enable the DDNS-GO service" +msgstr "" + +msgid "Open Web Interface" +msgstr "" + +msgid "Set the DDNS-TO access port" +msgstr "" + +msgid "Collecting data..." +msgstr "" + +msgid "update interval" +msgstr "" + +msgid "Skip verifying certificates" +msgstr "" + +msgid "Compare with service provider N times intervals" +msgstr "" + +msgid "Specify DNS resolution server" +msgstr "" + +msgid "Do not start web services" +msgstr "" + +msgid "Delayed Start (seconds)" +msgstr "" diff --git a/luci-app-ddns-go/po/zh-cn b/luci-app-ddns-go/po/zh-cn new file mode 120000 index 000000000..8d69574dd --- /dev/null +++ b/luci-app-ddns-go/po/zh-cn @@ -0,0 +1 @@ +zh_Hans \ No newline at end of file diff --git a/luci-app-ddns-go/po/zh-cn/ddns-go.po b/luci-app-ddns-go/po/zh-cn/ddns-go.po deleted file mode 100644 index 74ac3fd3f..000000000 --- a/luci-app-ddns-go/po/zh-cn/ddns-go.po +++ /dev/null @@ -1,62 +0,0 @@ -msgid "" -msgstr "Content-Type: text/plain; charset=UTF-8" - -msgid "DDNS-GO" -msgstr "DDNS-GO" - -msgid "DDNS-GO automatically obtains your public IPv4 or IPv6 address and resolves it to the corresponding domain name service." -msgstr "DDNS-GO自动获得你的公网 IPv4 或 IPv6 地址,并解析到对应的域名服务." - -msgid "Base Setting" -msgstr "基本设置" - -msgid "Running state" -msgstr "运行状态" - -msgid "DDNS-GO Control panel" -msgstr "DDNS-GO操作台" - -msgid "Log" -msgstr "日志" - -msgid "The DDNS-GO service is running." -msgstr "DDNS-GO服务已启动" - -msgid "The DDNS-GO service is not running." -msgstr "DDNS-GO服务未启动" - -msgid "DDNS-GO Status" -msgstr "DDNS-GO服务状态" - -msgid "Please enable the DDNS-GO service" -msgstr "请将DDNS-GO服务启用" - -msgid "Click the new page to open ddns-go" -msgstr "点击打开ddns-go后台" - -msgid "Set the DDNS-TO access port" -msgstr "设置访问端口" - -msgid "
For specific usage, see:" -msgstr "
具体使用方法参见:" - -msgid "Collecting data..." -msgstr "收集数据..." - -msgid "update interval" -msgstr "更新间隔" - -msgid "Skip verifying certificates" -msgstr "跳过验证证书" - -msgid "Compare with service provider N times intervals" -msgstr "间隔N次与服务商比对" - -msgid "Specify DNS resolution server" -msgstr "指定DNS解析服务器" - -msgid "Do not start web services" -msgstr "不启动web服务" - -msgid "Delayed Start (seconds)" -msgstr "开机延时启动(秒)" diff --git a/luci-app-ddns-go/po/zh_Hans/ddns-go.po b/luci-app-ddns-go/po/zh_Hans/ddns-go.po index 74ac3fd3f..ece31efda 100644 --- a/luci-app-ddns-go/po/zh_Hans/ddns-go.po +++ b/luci-app-ddns-go/po/zh_Hans/ddns-go.po @@ -10,36 +10,48 @@ msgstr "DDNS-GO自动获得你的公网 IPv4 或 IPv6 地址,并解析到对应 msgid "Base Setting" msgstr "基本设置" -msgid "Running state" -msgstr "运行状态" +msgid "Status check error:" +msgstr "状态检查错误:" + +msgid "Checking status..." +msgstr "检查状态..." msgid "DDNS-GO Control panel" msgstr "DDNS-GO操作台" +msgid "Open Web Interface" +msgstr "打开 Web 界面" + msgid "Log" msgstr "日志" -msgid "The DDNS-GO service is running." -msgstr "DDNS-GO服务已启动" +msgid "Clear Logs..." +msgstr "清除日志..." -msgid "The DDNS-GO service is not running." -msgstr "DDNS-GO服务未启动" +msgid "Logs cleared successfully!" +msgstr "日志清除成功!" -msgid "DDNS-GO Status" -msgstr "DDNS-GO服务状态" +msgid "Clear Logs" +msgstr "清除日志" + +msgid "NOT RUNNING" +msgstr "未运行" + +msgid "RUNNING" +msgstr "运行中" + +msgid "DDNS-GO Service Not Running" +msgstr "DDNS-GO服务未启用" msgid "Please enable the DDNS-GO service" msgstr "请将DDNS-GO服务启用" -msgid "Click the new page to open ddns-go" -msgstr "点击打开ddns-go后台" +msgid "Open Web Interface" +msgstr "打开Web界面" msgid "Set the DDNS-TO access port" msgstr "设置访问端口" -msgid "
For specific usage, see:" -msgstr "
具体使用方法参见:" - msgid "Collecting data..." msgstr "收集数据..." diff --git a/luci-app-ddns-go/root/etc/config/ddns-go b/luci-app-ddns-go/root/etc/config/ddns-go index 123777268..e13a09f64 100644 --- a/luci-app-ddns-go/root/etc/config/ddns-go +++ b/luci-app-ddns-go/root/etc/config/ddns-go @@ -1,5 +1,9 @@ -config basic - option enabled '0' - option logger '1' - option port 9876 - option time 300 \ No newline at end of file +config basic 'config' + option enabled '0' + option logger '1' + option port '9876' + option time '300' + option ctimes '5' + option skipverify '0' + option delay '0' + option dns '223.5.5.5' diff --git a/luci-app-ddns-go/root/usr/libexec/ddns-go-call b/luci-app-ddns-go/root/usr/libexec/ddns-go-call new file mode 100644 index 000000000..f67f369c9 --- /dev/null +++ b/luci-app-ddns-go/root/usr/libexec/ddns-go-call @@ -0,0 +1,32 @@ +#!/bin/sh +# +# Copyright (C) 2023-2025 sirpdboy herboy2008@gmail.com https://github.com/sirpdboy/luci-app-ddns-go +# + +logfile="/var/log/ddns-go.log" +lang=$(uci get luci.main.lang 2>/dev/null) +if [ -z "$lang" ] || [[ "$lang" == "auto" ]]; then + lang=$(echo "${LANG:-${LANGUAGE:-${LC_ALL:-${LC_MESSAGES:-zh_cn}}}}" | awk -F'[ .@]' '{print tolower($1)}' | sed 's/-/_/' 2>/dev/null) +fi + +translate() { + # 处理特殊字符 + local lua_script=$(cat <"${logfile}" + +elif [ "$1" == "child" ]; then + shift + command_name=$1 + shift + "$command_name" "$@" +fi diff --git a/luci-app-ddns-go/root/usr/share/luci/menu.d/luci-app-ddns-go.json b/luci-app-ddns-go/root/usr/share/luci/menu.d/luci-app-ddns-go.json new file mode 100644 index 000000000..58acbf5ab --- /dev/null +++ b/luci-app-ddns-go/root/usr/share/luci/menu.d/luci-app-ddns-go.json @@ -0,0 +1,41 @@ +{ + "admin/services/ddns-go": { + "title": "DDNS-GO", + "order": 58, + "action": { + "type": "firstchild" + }, + "depends": { + "acl": [ "luci-app-ddns-go" ], + "uci": { "ddns-go": true } + } + }, + + "admin/services/ddns-go/config": { + "title": "Base Setting", + "order": 10, + "action": { + "type": "view", + "path": "ddns-go/config" + } + }, + + "admin/services/ddns-go/ddns-go": { + "title": "DDNS-GO Control panel", + "order": 20, + "action": { + "type": "view", + "path": "ddns-go/ddns-go" + } + }, + + "admin/services/ddns-go/log": { + "title": "Log", + "order": 30, + "action": { + "type": "view", + "path": "ddns-go/log" + } + } + +} diff --git a/luci-app-ddns-go/root/usr/share/rpcd/acl.d/luci-app-ddns-go.json b/luci-app-ddns-go/root/usr/share/rpcd/acl.d/luci-app-ddns-go.json index 7f919d250..432a84895 100644 --- a/luci-app-ddns-go/root/usr/share/rpcd/acl.d/luci-app-ddns-go.json +++ b/luci-app-ddns-go/root/usr/share/rpcd/acl.d/luci-app-ddns-go.json @@ -2,10 +2,13 @@ "luci-app-ddns-go": { "description": "Grant UCI access for luci-app-ddns-go", "read": { - "uci": [ "ddns-go" ] + "ubus": { + "service": [ "list" ] + }, + "uci": [ "ddns-go" ,"ddns-go" ] }, "write": { - "uci": [ "ddns-go" ] + "uci": [ "ddns-go" ,"ddns-go" ] } } } diff --git a/shadowsocks-rust/Makefile b/shadowsocks-rust/Makefile index f0bce7941..cd8f01071 100644 --- a/shadowsocks-rust/Makefile +++ b/shadowsocks-rust/Makefile @@ -21,23 +21,23 @@ endif ifeq ($(ARCH),aarch64) PKG_SOURCE:=$(PKG_SOURCE_HEADER).aarch64-$(PKG_SOURCE_BODY).$(PKG_SOURCE_FOOTER) - PKG_HASH:=8462ec05ead8cb6e13dfdc22a813518859da790dbab9a3f716f236a198103aac + PKG_HASH:=acf2eb5df9cb23192cb7e9a4998cf0dd178c5e8c85be3710b7eec7fa489baadd else ifeq ($(ARCH),arm) # Referred to golang/golang-values.mk ARM_CPU_FEATURES:=$(word 2,$(subst +,$(space),$(call qstrip,$(CONFIG_CPU_TYPE)))) ifeq ($(ARM_CPU_FEATURES),) PKG_SOURCE:=$(PKG_SOURCE_HEADER).arm-$(PKG_SOURCE_BODY)eabi.$(PKG_SOURCE_FOOTER) - PKG_HASH:=bc07650d508fd4e558bc5aae95edf80e98f5453dc7fac9a2d0a53fb032e8dc3e + PKG_HASH:=2b492ee8239b2cd097526635934d6744a982a654984c739197dbf858e3a794f3 else PKG_SOURCE:=$(PKG_SOURCE_HEADER).arm-$(PKG_SOURCE_BODY)eabihf.$(PKG_SOURCE_FOOTER) - PKG_HASH:=b1b11b6ee6562075f7948f3386adb5b9dbf49701dda2298c56c1a211be1b9324 + PKG_HASH:=e2e571ab24734996352c40250e6eef381ddaa069a05a0811e0cececdb06cdcd3 endif else ifeq ($(ARCH),i386) PKG_SOURCE:=$(PKG_SOURCE_HEADER).i686-$(PKG_SOURCE_BODY).$(PKG_SOURCE_FOOTER) - PKG_HASH:=9ba74e19d3ad0baf1c28b4cd46cafc8dbce5ce839ff589e16c1be2d64ddc29e4 + PKG_HASH:=366664f894259ad49b7dc58bdb3414af997aee0c8b370319fbd0f7a8792da174 else ifeq ($(ARCH),x86_64) PKG_SOURCE:=$(PKG_SOURCE_HEADER).x86_64-$(PKG_SOURCE_BODY).$(PKG_SOURCE_FOOTER) - PKG_HASH:=c4d528b32639c0da77e93a8ec1cc19f01143af7105ad352f9a6c6257d90a9a17 + PKG_HASH:=b98a70c9c9aa324ed4e50912209f3c4e3f1b9956a58e58ceb5746ff411464c80 else ifeq ($(ARCH),mips) PKG_SOURCE:=$(PKG_SOURCE_HEADER).mips-$(PKG_SOURCE_BODY).$(PKG_SOURCE_FOOTER) PKG_HASH:=6ec59eee83cfca1d9220bc845690655cf6c36b2510c856c059f444a05630414a