mirror of
https://github.com/caiwx86/small-packages.git
synced 2026-10-31 21:05:13 +08:00
update 2026-07-15 14:09:58
This commit is contained in:
1 parent
c2d17d02c4
commit
a67d83bfc0
1970 files changed
+107
-1523279
No files matched your search
@@ -1,39 +1,9 @@
|
||||
local fs = require "nixio.fs"
|
||||
local dae = require "luci.model.dae_tools"
|
||||
local m, s
|
||||
|
||||
m = Map("dae", translate("DNS Settings"), translate("Configure DNS settings for DAE."))
|
||||
|
||||
-- Check if dns config file exists, create if not
|
||||
local dns_file = "/etc/dae/config.d/dns.dae"
|
||||
if not fs.access(dns_file) then
|
||||
fs.writefile(dns_file, [[# dns.dae
|
||||
dns {
|
||||
optimistic_cache_ttl: 86400
|
||||
max_cache_size: 4096
|
||||
upstream {
|
||||
localdns: 'udp://127.0.0.1:53'
|
||||
overseadns: 'tcp+udp://1.0.0.1:53'
|
||||
nodedns: 'udp://111.222.333.444:53'
|
||||
}
|
||||
routing {
|
||||
request {
|
||||
sub(sub_name) -> overseadns
|
||||
subnode(sub_name) && subnode(name_keyword: 114514) -> nodedns
|
||||
qtype(https) -> reject
|
||||
qname(geosite:gfw) -> overseadns
|
||||
fallback: localdns
|
||||
}
|
||||
response {
|
||||
upstream(overseadns) -> accept
|
||||
qname(geosite:private) -> accept
|
||||
ip(geoip:cn) -> accept
|
||||
fallback: overseadns
|
||||
}
|
||||
}
|
||||
}]]
|
||||
)
|
||||
end
|
||||
|
||||
s = dae.init_editor(m, "dns")
|
||||
dae.add_editor(s, dns_file, "dnsconf", translate("DNS Configuration"))
|
||||
|
||||
@@ -1,31 +1,9 @@
|
||||
local fs = require "nixio.fs"
|
||||
local dae = require "luci.model.dae_tools"
|
||||
local m, s, o
|
||||
|
||||
m = Map("dae", translate("Global Settings"), translate("Configure global settings for DAE."))
|
||||
|
||||
-- Check if config file exists, create if not
|
||||
local config_file = "/etc/dae/config.dae"
|
||||
if not fs.access(config_file) then
|
||||
fs.writefile(config_file, [[# config.dae
|
||||
# load all dae files placed in ./config.d/
|
||||
include {
|
||||
config.d/*.dae
|
||||
}
|
||||
global {
|
||||
log_level:warn
|
||||
check_interval:600s
|
||||
check_tolerance:20ms
|
||||
lan_interface:"br-lan"
|
||||
wan_interface:auto
|
||||
auto_config_kernel_parameter:true
|
||||
sniffing_timeout:300ms
|
||||
udp_check_dns: "dns.google:53,8.8.8.8,2001:4860:4860::8888"
|
||||
tcp_check_url: "http://cp.cloudflare.com,1.1.1.1,2606:4700:4700::1111"
|
||||
dial_mode: domain
|
||||
allow_insecure: true
|
||||
}]])
|
||||
end
|
||||
|
||||
s = dae.init_editor(m, "global")
|
||||
|
||||
|
||||
@@ -1,32 +1,9 @@
|
||||
local fs = require "nixio.fs"
|
||||
local dae = require "luci.model.dae_tools"
|
||||
local m, s
|
||||
|
||||
m = Map("dae", translate("Node Settings"), translate("Configure nodes and groups for DAE."))
|
||||
|
||||
-- Check if node config file exists, create if not
|
||||
local node_file = "/etc/dae/config.d/node.dae"
|
||||
if not fs.access(node_file) then
|
||||
fs.writefile(node_file, [[node {
|
||||
node1: 'xxx'
|
||||
node2: 'xxx'
|
||||
}
|
||||
subscription {
|
||||
my_sub: 'https://www.example.com/subscription/link'
|
||||
}
|
||||
group {
|
||||
my_group {
|
||||
filter: subtag(my_sub) && !name(keyword: 'ExpireAt:')
|
||||
filter: subtag(my_sub2)
|
||||
policy: min_moving_avg
|
||||
}
|
||||
local_group {
|
||||
filter: name(node1, node2)
|
||||
policy: fixed(0)
|
||||
}
|
||||
}]]
|
||||
)
|
||||
end
|
||||
|
||||
s = dae.init_editor(m, "node")
|
||||
dae.add_editor(s, node_file, "nodeconf", translate("Node Configuration"))
|
||||
|
||||
@@ -1,35 +1,9 @@
|
||||
local fs = require "nixio.fs"
|
||||
local dae = require "luci.model.dae_tools"
|
||||
local m, s
|
||||
|
||||
m = Map("dae", translate("Routing Settings"), translate("Configure routing rules for DAE."))
|
||||
|
||||
-- Check if route config file exists, create if not
|
||||
local route_file = "/etc/dae/config.d/route.dae"
|
||||
if not fs.access(route_file) then
|
||||
fs.writefile(route_file, [[routing {
|
||||
pname(dnsmasq, zerotier-one) -> must_direct
|
||||
dip(224.0.0.0/3, 'ff00::/8', geoip:private) -> direct
|
||||
|
||||
domain(geosite:category-bank-cn, geosite:boc@!cn, geosite:synology) -> direct
|
||||
|
||||
domain(geosite:category-ai-!cn, geosite:google, geosite:category-entertainment, geosite:gfw, geosite:github, geosite:spotify) && l4proto(udp) && dport(443) -> block
|
||||
|
||||
domain(geosite:spotify) -> proxy
|
||||
domain(geosite:category-entertainment) -> proxy
|
||||
domain(geosite:category-ai-!cn, geosite:google, geosite:github) -> proxy
|
||||
domain(geosite:gfw) -> proxy
|
||||
|
||||
dip(geoip:telegram) -> proxy
|
||||
|
||||
dip(geoip:cn) -> direct
|
||||
|
||||
l4proto(udp) && dport(443) -> block
|
||||
|
||||
fallback: proxy
|
||||
}]]
|
||||
)
|
||||
end
|
||||
|
||||
s = dae.init_editor(m, "route")
|
||||
dae.add_editor(s, route_file, "routeconf", translate("Route Configuration"))
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
function(x, data) {
|
||||
if(x && x.status == 200) {
|
||||
var log_textarea = document.getElementById('log_textarea');
|
||||
log_textarea.innerHTML = x.responseText;
|
||||
log_textarea.textContent = x.responseText;
|
||||
if (!scrolled) {
|
||||
log_textarea.scrollTop = log_textarea.scrollHeight;
|
||||
scrolled = true;
|
||||
|
||||
Reference in new issue
Block a user