diff --git a/luci-app-passwall/luasrc/controller/passwall.lua b/luci-app-passwall/luasrc/controller/passwall.lua index edb3b4c4d..01e2558ac 100644 --- a/luci-app-passwall/luasrc/controller/passwall.lua +++ b/luci-app-passwall/luasrc/controller/passwall.lua @@ -2,20 +2,20 @@ -- Copyright (C) 2021-2022 xiaorouji module("luci.controller.passwall", package.seeall) -local api = require "luci.model.cbi.passwall.api.api" +local api = require "luci.passwall.api" local appname = api.appname local ucic = luci.model.uci.cursor() local http = require "luci.http" local util = require "luci.util" local i18n = require "luci.i18n" -local brook = require("luci.model.cbi." .. appname ..".api.brook") -local v2ray = require("luci.model.cbi." .. appname ..".api.v2ray") -local xray = require("luci.model.cbi." .. appname ..".api.xray") -local trojan_go = require("luci.model.cbi." .. appname ..".api.trojan_go") -local hysteria = require("luci.model.cbi." .. appname ..".api.hysteria") +local brook = require("luci.passwall.brook") +local v2ray = require("luci.passwall.v2ray") +local xray = require("luci.passwall.xray") +local trojan_go = require("luci.passwall.trojan_go") +local hysteria = require("luci.passwall.hysteria") function index() - appname = require "luci.model.cbi.passwall.api.api".appname + appname = require "luci.passwall.api".appname entry({"admin", "services", appname}).dependent = true entry({"admin", "services", appname, "reset_config"}, call("reset_config")).leaf = true entry({"admin", "services", appname, "show"}, call("show_menu")).leaf = true diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/client/acl.lua b/luci-app-passwall/luasrc/model/cbi/passwall/client/acl.lua index c387a8c29..5bc5f6dc8 100644 --- a/luci-app-passwall/luasrc/model/cbi/passwall/client/acl.lua +++ b/luci-app-passwall/luasrc/model/cbi/passwall/client/acl.lua @@ -1,4 +1,4 @@ -local api = require "luci.model.cbi.passwall.api.api" +local api = require "luci.passwall.api" local appname = api.appname local sys = api.sys local has_chnlist = api.fs.access("/usr/share/passwall/rules/chnlist") diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/client/acl_config.lua b/luci-app-passwall/luasrc/model/cbi/passwall/client/acl_config.lua index 5bac5c5b3..b43f15a28 100644 --- a/luci-app-passwall/luasrc/model/cbi/passwall/client/acl_config.lua +++ b/luci-app-passwall/luasrc/model/cbi/passwall/client/acl_config.lua @@ -1,4 +1,4 @@ -local api = require "luci.model.cbi.passwall.api.api" +local api = require "luci.passwall.api" local appname = api.appname local sys = api.sys local has_v2ray = api.is_finded("v2ray") diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/client/app_update.lua b/luci-app-passwall/luasrc/model/cbi/passwall/client/app_update.lua index 13289a975..68c5f207f 100644 --- a/luci-app-passwall/luasrc/model/cbi/passwall/client/app_update.lua +++ b/luci-app-passwall/luasrc/model/cbi/passwall/client/app_update.lua @@ -1,4 +1,4 @@ -local api = require "luci.model.cbi.passwall.api.api" +local api = require "luci.passwall.api" local appname = api.appname m = Map(appname) diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/client/auto_switch.lua b/luci-app-passwall/luasrc/model/cbi/passwall/client/auto_switch.lua index 221de2916..e628ab3ce 100644 --- a/luci-app-passwall/luasrc/model/cbi/passwall/client/auto_switch.lua +++ b/luci-app-passwall/luasrc/model/cbi/passwall/client/auto_switch.lua @@ -1,4 +1,4 @@ -local api = require "luci.model.cbi.passwall.api.api" +local api = require "luci.passwall.api" local appname = api.appname local nodes_table = {} diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/client/global.lua b/luci-app-passwall/luasrc/model/cbi/passwall/client/global.lua index b210ab0c4..d7a0a00b3 100644 --- a/luci-app-passwall/luasrc/model/cbi/passwall/client/global.lua +++ b/luci-app-passwall/luasrc/model/cbi/passwall/client/global.lua @@ -1,4 +1,4 @@ -local api = require "luci.model.cbi.passwall.api.api" +local api = require "luci.passwall.api" local appname = api.appname local uci = api.uci local datatypes = api.datatypes diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/client/haproxy.lua b/luci-app-passwall/luasrc/model/cbi/passwall/client/haproxy.lua index a1270087a..b60a1f735 100644 --- a/luci-app-passwall/luasrc/model/cbi/passwall/client/haproxy.lua +++ b/luci-app-passwall/luasrc/model/cbi/passwall/client/haproxy.lua @@ -1,4 +1,4 @@ -local api = require "luci.model.cbi.passwall.api.api" +local api = require "luci.passwall.api" local appname = api.appname local sys = api.sys local net = require "luci.model.network".init() diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/client/log.lua b/luci-app-passwall/luasrc/model/cbi/passwall/client/log.lua index 5580e17aa..1520fa28d 100644 --- a/luci-app-passwall/luasrc/model/cbi/passwall/client/log.lua +++ b/luci-app-passwall/luasrc/model/cbi/passwall/client/log.lua @@ -1,4 +1,4 @@ -local api = require "luci.model.cbi.passwall.api.api" +local api = require "luci.passwall.api" local appname = api.appname f = SimpleForm(appname) diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/client/node_config.lua b/luci-app-passwall/luasrc/model/cbi/passwall/client/node_config.lua index 3509cf3ee..995647dce 100644 --- a/luci-app-passwall/luasrc/model/cbi/passwall/client/node_config.lua +++ b/luci-app-passwall/luasrc/model/cbi/passwall/client/node_config.lua @@ -1,4 +1,4 @@ -local api = require "luci.model.cbi.passwall.api.api" +local api = require "luci.passwall.api" local appname = api.appname local uci = api.uci diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/client/node_list.lua b/luci-app-passwall/luasrc/model/cbi/passwall/client/node_list.lua index d0f505e4e..76c81dd28 100644 --- a/luci-app-passwall/luasrc/model/cbi/passwall/client/node_list.lua +++ b/luci-app-passwall/luasrc/model/cbi/passwall/client/node_list.lua @@ -1,4 +1,4 @@ -local api = require "luci.model.cbi.passwall.api.api" +local api = require "luci.passwall.api" local appname = api.appname local sys = api.sys local datatypes = api.datatypes diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/client/node_subscribe.lua b/luci-app-passwall/luasrc/model/cbi/passwall/client/node_subscribe.lua index 087916353..de8b41040 100644 --- a/luci-app-passwall/luasrc/model/cbi/passwall/client/node_subscribe.lua +++ b/luci-app-passwall/luasrc/model/cbi/passwall/client/node_subscribe.lua @@ -1,4 +1,4 @@ -local api = require "luci.model.cbi.passwall.api.api" +local api = require "luci.passwall.api" local appname = api.appname local has_ss = api.is_finded("ss-redir") local has_ss_rust = api.is_finded("sslocal") diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/client/node_subscribe_config.lua b/luci-app-passwall/luasrc/model/cbi/passwall/client/node_subscribe_config.lua index cc1f25a76..6a7625747 100644 --- a/luci-app-passwall/luasrc/model/cbi/passwall/client/node_subscribe_config.lua +++ b/luci-app-passwall/luasrc/model/cbi/passwall/client/node_subscribe_config.lua @@ -1,4 +1,4 @@ -local api = require "luci.model.cbi.passwall.api.api" +local api = require "luci.passwall.api" local appname = api.appname local sys = api.sys local has_ss = api.is_finded("ss-redir") diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/client/other.lua b/luci-app-passwall/luasrc/model/cbi/passwall/client/other.lua index 32edee5a9..6e9b7be9c 100644 --- a/luci-app-passwall/luasrc/model/cbi/passwall/client/other.lua +++ b/luci-app-passwall/luasrc/model/cbi/passwall/client/other.lua @@ -1,4 +1,4 @@ -local api = require "luci.model.cbi.passwall.api.api" +local api = require "luci.passwall.api" local appname = api.appname local fs = api.fs local has_v2ray = api.is_finded("v2ray") diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/client/rule.lua b/luci-app-passwall/luasrc/model/cbi/passwall/client/rule.lua index 2510512ac..df5ff5ca8 100644 --- a/luci-app-passwall/luasrc/model/cbi/passwall/client/rule.lua +++ b/luci-app-passwall/luasrc/model/cbi/passwall/client/rule.lua @@ -1,4 +1,4 @@ -local api = require "luci.model.cbi.passwall.api.api" +local api = require "luci.passwall.api" local appname = api.appname local has_v2ray = api.is_finded("v2ray") local has_xray = api.is_finded("xray") diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/client/rule_list.lua b/luci-app-passwall/luasrc/model/cbi/passwall/client/rule_list.lua index 2e5ca60ec..1e4753d68 100644 --- a/luci-app-passwall/luasrc/model/cbi/passwall/client/rule_list.lua +++ b/luci-app-passwall/luasrc/model/cbi/passwall/client/rule_list.lua @@ -1,4 +1,4 @@ -local api = require "luci.model.cbi.passwall.api.api" +local api = require "luci.passwall.api" local appname = api.appname local fs = api.fs local sys = api.sys diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/client/shunt_rules.lua b/luci-app-passwall/luasrc/model/cbi/passwall/client/shunt_rules.lua index b2e9a8fad..6eae2cdbe 100644 --- a/luci-app-passwall/luasrc/model/cbi/passwall/client/shunt_rules.lua +++ b/luci-app-passwall/luasrc/model/cbi/passwall/client/shunt_rules.lua @@ -1,4 +1,4 @@ -local api = require "luci.model.cbi.passwall.api.api" +local api = require "luci.passwall.api" local appname = api.appname local datatypes = api.datatypes diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/server/api/hysteria.lua b/luci-app-passwall/luasrc/model/cbi/passwall/server/api/hysteria.lua deleted file mode 100644 index 0fdf8939b..000000000 --- a/luci-app-passwall/luasrc/model/cbi/passwall/server/api/hysteria.lua +++ /dev/null @@ -1,24 +0,0 @@ -module("luci.model.cbi.passwall.server.api.hysteria", package.seeall) -function gen_config(user) - local config = { - listen = ":" .. user.port, - protocol = user.protocol or "udp", - obfs = user.hysteria_obfs, - cert = user.tls_certificateFile, - key = user.tls_keyFile, - auth = (user.hysteria_auth_type == "string") and { - mode = "password", - config = { - password = user.hysteria_auth_password - } - } or nil, - disable_udp = (user.hysteria_udp == "0") and true or false, - alpn = user.hysteria_alpn or nil, - up_mbps = tonumber(user.hysteria_up_mbps) or 10, - down_mbps = tonumber(user.hysteria_down_mbps) or 50, - recv_window_conn = (user.hysteria_recv_window_conn) and tonumber(user.hysteria_recv_window_conn) or nil, - recv_window = (user.hysteria_recv_window) and tonumber(user.hysteria_recv_window) or nil, - disable_mtu_discovery = (user.hysteria_disable_mtu_discovery) and true or false - } - return config -end diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/server/api/shadowsocks.lua b/luci-app-passwall/luasrc/model/cbi/passwall/server/api/shadowsocks.lua deleted file mode 100644 index 5b32c4645..000000000 --- a/luci-app-passwall/luasrc/model/cbi/passwall/server/api/shadowsocks.lua +++ /dev/null @@ -1,25 +0,0 @@ -module("luci.model.cbi.passwall.server.api.shadowsocks", package.seeall) -function gen_config(user) - local config = {} - config.server_port = tonumber(user.port) - config.password = user.password - config.timeout = tonumber(user.timeout) - config.fast_open = (user.tcp_fast_open and user.tcp_fast_open == "1") and true or false - config.method = user.method - - if user.type == "SS-Rust" then - config.server = "::" - config.mode = "tcp_and_udp" - else - config.server = {"[::0]", "0.0.0.0"} - end - - if user.type == "SSR" then - config.protocol = user.protocol - config.protocol_param = user.protocol_param - config.obfs = user.obfs - config.obfs_param = user.obfs_param - end - - return config -end diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/server/api/trojan.lua b/luci-app-passwall/luasrc/model/cbi/passwall/server/api/trojan.lua deleted file mode 100644 index 466d12042..000000000 --- a/luci-app-passwall/luasrc/model/cbi/passwall/server/api/trojan.lua +++ /dev/null @@ -1,61 +0,0 @@ -module("luci.model.cbi.passwall.server.api.trojan", package.seeall) -function gen_config(user) - local cipher = "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES128-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA:AES128-SHA:AES256-SHA:DES-CBC3-SHA" - local cipher13 = "TLS_AES_128_GCM_SHA256:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_256_GCM_SHA384" - local config = { - run_type = "server", - local_addr = "::", - local_port = tonumber(user.port), - remote_addr = (user.remote_enable == "1" and user.remote_address) and user.remote_address or nil, - remote_port = (user.remote_enable == "1" and user.remote_port) and tonumber(user.remote_port) or nil, - password = user.uuid, - log_level = (user.log and user.log == "1") and tonumber(user.loglevel) or 5, - ssl = { - cert = user.tls_certificateFile, - key = user.tls_keyFile, - key_password = "", - cipher = cipher, - cipher_tls13 = cipher13, - prefer_server_cipher = true, - reuse_session = true, - session_ticket = (user.tls_sessionTicket == "1") and true or false, - session_timeout = 600, - plain_http_response = "", - curves = "", - dhparam = "" - }, - tcp = { - prefer_ipv4 = false, - no_delay = true, - keep_alive = true, - reuse_port = false, - fast_open = (user.tcp_fast_open and user.tcp_fast_open == "1") and true or false, - fast_open_qlen = 20 - } - } - if user.type == "Trojan-Go" then - config.ssl.cipher = nil - config.ssl.cipher_tls13 = nil - config.udp_timeout = 60 - config.disable_http_check = true - config.transport_plugin = ((user.tls == nil or user.tls ~= "1") and user.trojan_transport == "original") and { - enabled = user.plugin_type ~= nil, - type = user.plugin_type or "plaintext", - command = user.plugin_type ~= "plaintext" and user.plugin_cmd or nil, - option = user.plugin_type ~= "plaintext" and user.plugin_option or nil, - arg = user.plugin_type ~= "plaintext" and { user.plugin_arg } or nil, - env = {} - } or nil - config.websocket = (user.trojan_transport == 'ws') and { - enabled = true, - path = user.ws_path or "/", - host = user.ws_host or "" - } or nil - config.shadowsocks = (user.ss_aead == "1") and { - enabled = true, - method = user.ss_aead_method or "aes_128_gcm", - password = user.ss_aead_pwd or "" - } or nil - end - return config -end \ No newline at end of file diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/server/api/xray.lua b/luci-app-passwall/luasrc/model/cbi/passwall/server/api/xray.lua deleted file mode 100644 index 2e05735a9..000000000 --- a/luci-app-passwall/luasrc/model/cbi/passwall/server/api/xray.lua +++ /dev/null @@ -1,242 +0,0 @@ -module("luci.model.cbi.passwall.server.api.xray", package.seeall) -local uci = require"luci.model.uci".cursor() - -function gen_config(user) - local settings = nil - local routing = nil - local outbounds = { - {protocol = "freedom", tag = "direct"}, {protocol = "blackhole", tag = "blocked"} - } - - if user.protocol == "vmess" or user.protocol == "vless" then - if user.uuid then - local clients = {} - for i = 1, #user.uuid do - clients[i] = { - id = user.uuid[i], - flow = ("vless" == user.protocol and "1" == user.tls and user.tlsflow) and user.tlsflow or nil - } - end - settings = { - clients = clients, - decryption = user.decryption or "none" - } - end - elseif user.protocol == "socks" then - settings = { - udp = ("1" == user.udp_forward) and true or false, - auth = ("1" == user.auth) and "password" or "noauth", - accounts = ("1" == user.auth) and { - { - user = user.username, - pass = user.password - } - } or nil - } - elseif user.protocol == "http" then - settings = { - allowTransparent = false, - accounts = ("1" == user.auth) and { - { - user = user.username, - pass = user.password - } - } or nil - } - user.transport = "tcp" - user.tcp_guise = "none" - elseif user.protocol == "shadowsocks" then - settings = { - method = user.method, - password = user.password, - ivCheck = ("1" == user.iv_check) and true or false, - network = user.ss_network or "TCP,UDP" - } - elseif user.protocol == "trojan" then - if user.uuid then - local clients = {} - for i = 1, #user.uuid do - clients[i] = { - password = user.uuid[i], - } - end - settings = { - clients = clients - } - end - elseif user.protocol == "mtproto" then - settings = { - users = { - { - secret = (user.password == nil) and "" or user.password - } - } - } - elseif user.protocol == "dokodemo-door" then - settings = { - network = user.d_protocol, - address = user.d_address, - port = tonumber(user.d_port) - } - end - - if user.fallback and user.fallback == "1" then - local fallbacks = {} - for i = 1, #user.fallback_list do - local fallbackStr = user.fallback_list[i] - if fallbackStr then - local tmp = {} - string.gsub(fallbackStr, '[^' .. "," .. ']+', function(w) - table.insert(tmp, w) - end) - local dest = tmp[1] or "" - local path = tmp[2] - if dest:find("%.") then - else - dest = tonumber(dest) - end - fallbacks[i] = { - path = path, - dest = dest, - xver = 1 - } - end - end - settings.fallbacks = fallbacks - end - - routing = { - domainStrategy = "IPOnDemand", - rules = { - { - type = "field", - ip = {"10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16"}, - outboundTag = (user.accept_lan == nil or user.accept_lan == "0") and "blocked" or "direct" - } - } - } - - if user.outbound_node and user.outbound_node ~= "nil" then - local outbound = nil - if user.outbound_node == "_iface" and user.outbound_node_iface then - outbound = { - protocol = "freedom", - tag = "outbound", - streamSettings = { - sockopt = { - interface = user.outbound_node_iface - } - } - } - else - local outbound_node_t = uci:get_all("passwall", user.outbound_node) - if user.outbound_node == "_socks" or user.outbound_node == "_http" then - outbound_node_t = { - type = user.type, - protocol = user.outbound_node:gsub("_", ""), - transport = "tcp", - address = user.outbound_node_address, - port = user.outbound_node_port, - username = (user.outbound_node_username and user.outbound_node_username ~= "") and user.outbound_node_username or nil, - password = (user.outbound_node_password and user.outbound_node_password ~= "") and user.outbound_node_password or nil, - } - end - outbound = require("luci.model.cbi.passwall.api.util_xray").gen_outbound(nil, outbound_node_t, "outbound") - end - if outbound then - table.insert(outbounds, 1, outbound) - end - end - - local config = { - log = { - -- error = "/tmp/etc/passwall_server/log/" .. user[".name"] .. ".log", - loglevel = ("1" == user.log) and user.loglevel or "none" - }, - -- 传入连接 - inbounds = { - { - listen = (user.bind_local == "1") and "127.0.0.1" or nil, - port = tonumber(user.port), - protocol = user.protocol, - settings = settings, - streamSettings = { - network = user.transport, - security = "none", - tlsSettings = ("1" == user.tls) and { - disableSystemRoot = false, - certificates = { - { - certificateFile = user.tls_certificateFile, - keyFile = user.tls_keyFile - } - } - } or nil, - tcpSettings = (user.transport == "tcp") and { - acceptProxyProtocol = (user.acceptProxyProtocol and user.acceptProxyProtocol == "1") and true or false, - header = { - type = user.tcp_guise, - request = (user.tcp_guise == "http") and { - path = user.tcp_guise_http_path or {"/"}, - headers = { - Host = user.tcp_guise_http_host or {} - } - } or nil - } - } or nil, - kcpSettings = (user.transport == "mkcp") and { - mtu = tonumber(user.mkcp_mtu), - tti = tonumber(user.mkcp_tti), - uplinkCapacity = tonumber(user.mkcp_uplinkCapacity), - downlinkCapacity = tonumber(user.mkcp_downlinkCapacity), - congestion = (user.mkcp_congestion == "1") and true or false, - readBufferSize = tonumber(user.mkcp_readBufferSize), - writeBufferSize = tonumber(user.mkcp_writeBufferSize), - seed = (user.mkcp_seed and user.mkcp_seed ~= "") and user.mkcp_seed or nil, - header = {type = user.mkcp_guise} - } or nil, - wsSettings = (user.transport == "ws") and { - acceptProxyProtocol = (user.acceptProxyProtocol and user.acceptProxyProtocol == "1") and true or false, - headers = (user.ws_host) and {Host = user.ws_host} or nil, - path = user.ws_path - } or nil, - httpSettings = (user.transport == "h2") and { - path = user.h2_path, host = user.h2_host - } or nil, - dsSettings = (user.transport == "ds") and { - path = user.ds_path - } or nil, - quicSettings = (user.transport == "quic") and { - security = user.quic_security, - key = user.quic_key, - header = {type = user.quic_guise} - } or nil, - grpcSettings = (user.transport == "grpc") and { - serviceName = user.grpc_serviceName - } or nil - } - } - }, - -- 传出连接 - outbounds = outbounds, - routing = routing - } - - local alpn = {} - if user.alpn then - string.gsub(user.alpn, '[^' .. "," .. ']+', function(w) - table.insert(alpn, w) - end) - end - if alpn and #alpn > 0 then - if config.inbounds[1].streamSettings.tlsSettings then - config.inbounds[1].streamSettings.tlsSettings.alpn = alpn - end - end - - if "1" == user.tls then - config.inbounds[1].streamSettings.security = "tls" - end - - return config -end diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/server/index.lua b/luci-app-passwall/luasrc/model/cbi/passwall/server/index.lua index 042ff093c..22a26f216 100644 --- a/luci-app-passwall/luasrc/model/cbi/passwall/server/index.lua +++ b/luci-app-passwall/luasrc/model/cbi/passwall/server/index.lua @@ -1,4 +1,4 @@ -local api = require "luci.model.cbi.passwall.api.api" +local api = require "luci.passwall.api" m = Map("passwall_server", translate("Server-Side")) diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/server/user.lua b/luci-app-passwall/luasrc/model/cbi/passwall/server/user.lua index 972659dcc..023d7efcd 100644 --- a/luci-app-passwall/luasrc/model/cbi/passwall/server/user.lua +++ b/luci-app-passwall/luasrc/model/cbi/passwall/server/user.lua @@ -1,4 +1,4 @@ -local api = require "luci.model.cbi.passwall.api.api" +local api = require "luci.passwall.api" local ss_encrypt_method_list = { "rc4-md5", "aes-128-cfb", "aes-192-cfb", "aes-256-cfb", "aes-128-ctr", diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/api/api.lua b/luci-app-passwall/luasrc/passwall/api.lua old mode 100755 new mode 100644 similarity index 99% rename from luci-app-passwall/luasrc/model/cbi/passwall/api/api.lua rename to luci-app-passwall/luasrc/passwall/api.lua index 35698aede..29fd3b1d8 --- a/luci-app-passwall/luasrc/model/cbi/passwall/api/api.lua +++ b/luci-app-passwall/luasrc/passwall/api.lua @@ -1,4 +1,4 @@ -module("luci.model.cbi.passwall.api.api", package.seeall) +module("luci.passwall.api", package.seeall) fs = require "nixio.fs" sys = require "luci.sys" uci = require"luci.model.uci".cursor() diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/api/brook.lua b/luci-app-passwall/luasrc/passwall/brook.lua similarity index 97% rename from luci-app-passwall/luasrc/model/cbi/passwall/api/brook.lua rename to luci-app-passwall/luasrc/passwall/brook.lua index b74d41cfc..990e7c074 100644 --- a/luci-app-passwall/luasrc/model/cbi/passwall/api/brook.lua +++ b/luci-app-passwall/luasrc/passwall/brook.lua @@ -1,5 +1,5 @@ -module("luci.model.cbi.passwall.api.brook", package.seeall) -local api = require "luci.model.cbi.passwall.api.api" +module("luci.passwall.brook", package.seeall) +local api = require "luci.passwall.api" local fs = api.fs local sys = api.sys local util = api.util diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/api/hysteria.lua b/luci-app-passwall/luasrc/passwall/hysteria.lua similarity index 97% rename from luci-app-passwall/luasrc/model/cbi/passwall/api/hysteria.lua rename to luci-app-passwall/luasrc/passwall/hysteria.lua index e27ec0ec7..9e9330c73 100644 --- a/luci-app-passwall/luasrc/model/cbi/passwall/api/hysteria.lua +++ b/luci-app-passwall/luasrc/passwall/hysteria.lua @@ -1,5 +1,5 @@ -module("luci.model.cbi.passwall.api.hysteria", package.seeall) -local api = require "luci.model.cbi.passwall.api.api" +module("luci.passwall.hysteria", package.seeall) +local api = require "luci.passwall.api" local fs = api.fs local sys = api.sys local util = api.util diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/server/api/app.lua b/luci-app-passwall/luasrc/passwall/server_app.lua old mode 100755 new mode 100644 similarity index 92% rename from luci-app-passwall/luasrc/model/cbi/passwall/server/api/app.lua rename to luci-app-passwall/luasrc/passwall/server_app.lua index 46cb4e893..f4f49724a --- a/luci-app-passwall/luasrc/model/cbi/passwall/server/api/app.lua +++ b/luci-app-passwall/luasrc/passwall/server_app.lua @@ -1,7 +1,7 @@ #!/usr/bin/lua local action = arg[1] -local api = require "luci.model.cbi.passwall.api.api" +local api = require "luci.passwall.api" local sys = api.sys local uci = api.uci local jsonc = api.jsonc @@ -10,7 +10,7 @@ local CONFIG = "passwall_server" local CONFIG_PATH = "/tmp/etc/" .. CONFIG local LOG_APP_FILE = "/tmp/log/" .. CONFIG .. ".log" local TMP_BIN_PATH = CONFIG_PATH .. "/bin" -local require_dir = "luci.model.cbi.passwall.server.api." +local require_dir = "luci.passwall." local ipt_bin = sys.exec("echo -n $(/usr/share/passwall/iptables.sh get_ipt_bin)") local ip6t_bin = sys.exec("echo -n $(/usr/share/passwall/iptables.sh get_ip6t_bin)") @@ -131,7 +131,7 @@ local function start() end bin = ln_run("/usr/bin/microsocks", "microsocks_" .. id, string.format("-i :: -p %s %s", port, auth), log_path) elseif type == "SS" or type == "SSR" then - config = require(require_dir .. "shadowsocks").gen_config(user) + config = require(require_dir .. "util_shadowsocks").gen_config_server(user) local udp_param = "" udp_forward = tonumber(user.udp_forward) or 1 if udp_forward == 1 then @@ -140,22 +140,22 @@ local function start() type = type:lower() bin = ln_run("/usr/bin/" .. type .. "-server", type .. "-server", "-c " .. config_file .. " " .. udp_param, log_path) elseif type == "SS-Rust" then - config = require(require_dir .. "shadowsocks").gen_config(user) + config = require(require_dir .. "util_shadowsocks").gen_config_server(user) bin = ln_run("/usr/bin/ssserver", "ssserver", "-c " .. config_file, log_path) elseif type == "V2ray" then - config = require(require_dir .. "xray").gen_config(user) + config = require(require_dir .. "util_xray").gen_config_server(user) bin = ln_run(api.get_v2ray_path(), "v2ray", "run -c " .. config_file, log_path) elseif type == "Xray" then - config = require(require_dir .. "xray").gen_config(user) + config = require(require_dir .. "util_xray").gen_config_server(user) bin = ln_run(api.get_xray_path(), "xray", "run -c " .. config_file, log_path) elseif type == "Trojan" then - config = require(require_dir .. "trojan").gen_config(user) + config = require(require_dir .. "util_trojan").gen_config_server(user) bin = ln_run("/usr/sbin/trojan", "trojan", "-c " .. config_file, log_path) elseif type == "Trojan-Plus" then - config = require(require_dir .. "trojan").gen_config(user) + config = require(require_dir .. "util_trojan").gen_config_server(user) bin = ln_run("/usr/sbin/trojan-plus", "trojan-plus", "-c " .. config_file, log_path) elseif type == "Trojan-Go" then - config = require(require_dir .. "trojan").gen_config(user) + config = require(require_dir .. "util_trojan").gen_config_server(user) bin = ln_run(api.get_trojan_go_path(), "trojan-go", "-config " .. config_file, log_path) elseif type == "Brook" then local brook_protocol = user.protocol @@ -167,7 +167,7 @@ local function start() end bin = ln_run(api.get_brook_path(), "brook_" .. id, string.format("--debug %s -l :%s -p %s%s", brook_protocol, port, brook_password, brook_path_arg), log_path) elseif type == "Hysteria" then - config = require(require_dir .. "hysteria").gen_config(user) + config = require(require_dir .. "util_hysteria").gen_config_server(user) bin = ln_run(api.get_hysteria_path(), "hysteria", "-c " .. config_file .. " server", log_path) end diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/api/trojan_go.lua b/luci-app-passwall/luasrc/passwall/trojan_go.lua similarity index 97% rename from luci-app-passwall/luasrc/model/cbi/passwall/api/trojan_go.lua rename to luci-app-passwall/luasrc/passwall/trojan_go.lua index e42a4f409..67fb671d3 100644 --- a/luci-app-passwall/luasrc/model/cbi/passwall/api/trojan_go.lua +++ b/luci-app-passwall/luasrc/passwall/trojan_go.lua @@ -1,5 +1,5 @@ -module("luci.model.cbi.passwall.api.trojan_go", package.seeall) -local api = require "luci.model.cbi.passwall.api.api" +module("luci.passwall.trojan_go", package.seeall) +local api = require "luci.passwall.api" local fs = api.fs local sys = api.sys local util = api.util diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/api/util_hysteria.lua b/luci-app-passwall/luasrc/passwall/util_hysteria.lua similarity index 78% rename from luci-app-passwall/luasrc/model/cbi/passwall/api/util_hysteria.lua rename to luci-app-passwall/luasrc/passwall/util_hysteria.lua index f0e8184f3..9769a009f 100644 --- a/luci-app-passwall/luasrc/model/cbi/passwall/api/util_hysteria.lua +++ b/luci-app-passwall/luasrc/passwall/util_hysteria.lua @@ -1,8 +1,33 @@ -module("luci.model.cbi.passwall.api.util_hysteria", package.seeall) -local api = require "luci.model.cbi.passwall.api.api" +module("luci.passwall.util_hysteria", package.seeall) +local api = require "luci.passwall.api" local uci = api.uci local jsonc = api.jsonc +function gen_config_server(node) + local config = { + listen = ":" .. node.port, + protocol = node.protocol or "udp", + obfs = node.hysteria_obfs, + cert = node.tls_certificateFile, + key = node.tls_keyFile, + auth = (node.hysteria_auth_type == "string") and { + mode = "password", + config = { + password = node.hysteria_auth_password + } + } or nil, + disable_udp = (node.hysteria_udp == "0") and true or false, + alpn = node.hysteria_alpn or nil, + up_mbps = tonumber(node.hysteria_up_mbps) or 10, + down_mbps = tonumber(node.hysteria_down_mbps) or 50, + recv_window_conn = (node.hysteria_recv_window_conn) and tonumber(node.hysteria_recv_window_conn) or nil, + recv_window = (node.hysteria_recv_window) and tonumber(node.hysteria_recv_window) or nil, + disable_mtu_discovery = (node.hysteria_disable_mtu_discovery) and true or false + } + return config +end + + function gen_config(var) local node_id = var["-node"] if not node_id then diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/api/util_naiveproxy.lua b/luci-app-passwall/luasrc/passwall/util_naiveproxy.lua similarity index 89% rename from luci-app-passwall/luasrc/model/cbi/passwall/api/util_naiveproxy.lua rename to luci-app-passwall/luasrc/passwall/util_naiveproxy.lua index d8576a4ff..91c78347c 100644 --- a/luci-app-passwall/luasrc/model/cbi/passwall/api/util_naiveproxy.lua +++ b/luci-app-passwall/luasrc/passwall/util_naiveproxy.lua @@ -1,5 +1,5 @@ -module("luci.model.cbi.passwall.api.util_naiveproxy", package.seeall) -local api = require "luci.model.cbi.passwall.api.api" +module("luci.passwall.util_naiveproxy", package.seeall) +local api = require "luci.passwall.api" local uci = api.uci local jsonc = api.jsonc diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/api/util_shadowsocks.lua b/luci-app-passwall/luasrc/passwall/util_shadowsocks.lua similarity index 84% rename from luci-app-passwall/luasrc/model/cbi/passwall/api/util_shadowsocks.lua rename to luci-app-passwall/luasrc/passwall/util_shadowsocks.lua index cc8e29317..78673e35f 100644 --- a/luci-app-passwall/luasrc/model/cbi/passwall/api/util_shadowsocks.lua +++ b/luci-app-passwall/luasrc/passwall/util_shadowsocks.lua @@ -1,8 +1,33 @@ -module("luci.model.cbi.passwall.api.util_shadowsocks", package.seeall) -local api = require "luci.model.cbi.passwall.api.api" +module("luci.passwall.util_shadowsocks", package.seeall) +local api = require "luci.passwall.api" local uci = api.uci local jsonc = api.jsonc +function gen_config_server(node) + local config = {} + config.server_port = tonumber(node.port) + config.password = node.password + config.timeout = tonumber(node.timeout) + config.fast_open = (node.tcp_fast_open and node.tcp_fast_open == "1") and true or false + config.method = node.method + + if node.type == "SS-Rust" then + config.server = "::" + config.mode = "tcp_and_udp" + else + config.server = {"[::0]", "0.0.0.0"} + end + + if node.type == "SSR" then + config.protocol = node.protocol + config.protocol_param = node.protocol_param + config.obfs = node.obfs + config.obfs_param = node.obfs_param + end + + return config +end + function gen_config(var) local node_id = var["-node"] if not node_id then diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/api/util_trojan.lua b/luci-app-passwall/luasrc/passwall/util_trojan.lua similarity index 57% rename from luci-app-passwall/luasrc/model/cbi/passwall/api/util_trojan.lua rename to luci-app-passwall/luasrc/passwall/util_trojan.lua index ed804cba2..33814d279 100644 --- a/luci-app-passwall/luasrc/model/cbi/passwall/api/util_trojan.lua +++ b/luci-app-passwall/luasrc/passwall/util_trojan.lua @@ -1,8 +1,69 @@ -module("luci.model.cbi.passwall.api.util_trojan", package.seeall) -local api = require "luci.model.cbi.passwall.api.api" +module("luci.passwall.util_trojan", package.seeall) +local api = require "luci.passwall.api" local uci = api.uci local json = api.jsonc +function gen_config_server(node) + local cipher = "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES128-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA:AES128-SHA:AES256-SHA:DES-CBC3-SHA" + local cipher13 = "TLS_AES_128_GCM_SHA256:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_256_GCM_SHA384" + local config = { + run_type = "server", + local_addr = "::", + local_port = tonumber(node.port), + remote_addr = (node.remote_enable == "1" and node.remote_address) and node.remote_address or nil, + remote_port = (node.remote_enable == "1" and node.remote_port) and tonumber(node.remote_port) or nil, + password = node.uuid, + log_level = (node.log and node.log == "1") and tonumber(node.loglevel) or 5, + ssl = { + cert = node.tls_certificateFile, + key = node.tls_keyFile, + key_password = "", + cipher = cipher, + cipher_tls13 = cipher13, + prefer_server_cipher = true, + reuse_session = true, + session_ticket = (node.tls_sessionTicket == "1") and true or false, + session_timeout = 600, + plain_http_response = "", + curves = "", + dhparam = "" + }, + tcp = { + prefer_ipv4 = false, + no_delay = true, + keep_alive = true, + reuse_port = false, + fast_open = (node.tcp_fast_open and node.tcp_fast_open == "1") and true or false, + fast_open_qlen = 20 + } + } + if node.type == "Trojan-Go" then + config.ssl.cipher = nil + config.ssl.cipher_tls13 = nil + config.udp_timeout = 60 + config.disable_http_check = true + config.transport_plugin = ((node.tls == nil or node.tls ~= "1") and node.trojan_transport == "original") and { + enabled = node.plugin_type ~= nil, + type = node.plugin_type or "plaintext", + command = node.plugin_type ~= "plaintext" and node.plugin_cmd or nil, + option = node.plugin_type ~= "plaintext" and node.plugin_option or nil, + arg = node.plugin_type ~= "plaintext" and { node.plugin_arg } or nil, + env = {} + } or nil + config.websocket = (node.trojan_transport == 'ws') and { + enabled = true, + path = node.ws_path or "/", + host = node.ws_host or "" + } or nil + config.shadowsocks = (node.ss_aead == "1") and { + enabled = true, + method = node.ss_aead_method or "aes_128_gcm", + password = node.ss_aead_pwd or "" + } or nil + end + return config +end + function gen_config(var) local node_id = var["-node"] if not node_id then diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/api/util_xray.lua b/luci-app-passwall/luasrc/passwall/util_xray.lua similarity index 80% rename from luci-app-passwall/luasrc/model/cbi/passwall/api/util_xray.lua rename to luci-app-passwall/luasrc/passwall/util_xray.lua index 66bf669a4..adbb91cfd 100644 --- a/luci-app-passwall/luasrc/model/cbi/passwall/api/util_xray.lua +++ b/luci-app-passwall/luasrc/passwall/util_xray.lua @@ -1,5 +1,5 @@ -module("luci.model.cbi.passwall.api.util_xray", package.seeall) -local api = require "luci.model.cbi.passwall.api.api" +module("luci.passwall.util_xray", package.seeall) +local api = require "luci.passwall.api" local uci = api.uci local sys = api.sys local jsonc = api.jsonc @@ -237,6 +237,246 @@ function gen_outbound(flag, node, tag, proxy_table) return result end +function gen_config_server(node) + local settings = nil + local routing = nil + local outbounds = { + {protocol = "freedom", tag = "direct"}, {protocol = "blackhole", tag = "blocked"} + } + + if node.protocol == "vmess" or node.protocol == "vless" then + if node.uuid then + local clients = {} + for i = 1, #node.uuid do + clients[i] = { + id = node.uuid[i], + flow = ("vless" == node.protocol and "1" == node.tls and node.tlsflow) and node.tlsflow or nil + } + end + settings = { + clients = clients, + decryption = node.decryption or "none" + } + end + elseif node.protocol == "socks" then + settings = { + udp = ("1" == node.udp_forward) and true or false, + auth = ("1" == node.auth) and "password" or "noauth", + accounts = ("1" == node.auth) and { + { + user = node.username, + pass = node.password + } + } or nil + } + elseif node.protocol == "http" then + settings = { + allowTransparent = false, + accounts = ("1" == node.auth) and { + { + user = node.username, + pass = node.password + } + } or nil + } + node.transport = "tcp" + node.tcp_guise = "none" + elseif node.protocol == "shadowsocks" then + settings = { + method = node.method, + password = node.password, + ivCheck = ("1" == node.iv_check) and true or false, + network = node.ss_network or "TCP,UDP" + } + elseif node.protocol == "trojan" then + if node.uuid then + local clients = {} + for i = 1, #node.uuid do + clients[i] = { + password = node.uuid[i], + } + end + settings = { + clients = clients + } + end + elseif node.protocol == "mtproto" then + settings = { + users = { + { + secret = (node.password == nil) and "" or node.password + } + } + } + elseif node.protocol == "dokodemo-door" then + settings = { + network = node.d_protocol, + address = node.d_address, + port = tonumber(node.d_port) + } + end + + if node.fallback and node.fallback == "1" then + local fallbacks = {} + for i = 1, #node.fallback_list do + local fallbackStr = node.fallback_list[i] + if fallbackStr then + local tmp = {} + string.gsub(fallbackStr, '[^' .. "," .. ']+', function(w) + table.insert(tmp, w) + end) + local dest = tmp[1] or "" + local path = tmp[2] + if dest:find("%.") then + else + dest = tonumber(dest) + end + fallbacks[i] = { + path = path, + dest = dest, + xver = 1 + } + end + end + settings.fallbacks = fallbacks + end + + routing = { + domainStrategy = "IPOnDemand", + rules = { + { + type = "field", + ip = {"10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16"}, + outboundTag = (node.accept_lan == nil or node.accept_lan == "0") and "blocked" or "direct" + } + } + } + + if node.outbound_node and node.outbound_node ~= "nil" then + local outbound = nil + if node.outbound_node == "_iface" and node.outbound_node_iface then + outbound = { + protocol = "freedom", + tag = "outbound", + streamSettings = { + sockopt = { + interface = node.outbound_node_iface + } + } + } + else + local outbound_node_t = uci:get_all("passwall", node.outbound_node) + if node.outbound_node == "_socks" or node.outbound_node == "_http" then + outbound_node_t = { + type = node.type, + protocol = node.outbound_node:gsub("_", ""), + transport = "tcp", + address = node.outbound_node_address, + port = node.outbound_node_port, + username = (node.outbound_node_username and node.outbound_node_username ~= "") and node.outbound_node_username or nil, + password = (node.outbound_node_password and node.outbound_node_password ~= "") and node.outbound_node_password or nil, + } + end + outbound = require("luci.passwall.util_xray").gen_outbound(nil, outbound_node_t, "outbound") + end + if outbound then + table.insert(outbounds, 1, outbound) + end + end + + local config = { + log = { + -- error = "/tmp/etc/passwall_server/log/" .. user[".name"] .. ".log", + loglevel = ("1" == node.log) and node.loglevel or "none" + }, + -- 传入连接 + inbounds = { + { + listen = (node.bind_local == "1") and "127.0.0.1" or nil, + port = tonumber(node.port), + protocol = node.protocol, + settings = settings, + streamSettings = { + network = node.transport, + security = "none", + tlsSettings = ("1" == node.tls) and { + disableSystemRoot = false, + certificates = { + { + certificateFile = node.tls_certificateFile, + keyFile = node.tls_keyFile + } + } + } or nil, + tcpSettings = (node.transport == "tcp") and { + acceptProxyProtocol = (node.acceptProxyProtocol and node.acceptProxyProtocol == "1") and true or false, + header = { + type = node.tcp_guise, + request = (node.tcp_guise == "http") and { + path = node.tcp_guise_http_path or {"/"}, + headers = { + Host = node.tcp_guise_http_host or {} + } + } or nil + } + } or nil, + kcpSettings = (node.transport == "mkcp") and { + mtu = tonumber(node.mkcp_mtu), + tti = tonumber(node.mkcp_tti), + uplinkCapacity = tonumber(node.mkcp_uplinkCapacity), + downlinkCapacity = tonumber(node.mkcp_downlinkCapacity), + congestion = (node.mkcp_congestion == "1") and true or false, + readBufferSize = tonumber(node.mkcp_readBufferSize), + writeBufferSize = tonumber(node.mkcp_writeBufferSize), + seed = (node.mkcp_seed and node.mkcp_seed ~= "") and node.mkcp_seed or nil, + header = {type = node.mkcp_guise} + } or nil, + wsSettings = (node.transport == "ws") and { + acceptProxyProtocol = (node.acceptProxyProtocol and node.acceptProxyProtocol == "1") and true or false, + headers = (node.ws_host) and {Host = node.ws_host} or nil, + path = node.ws_path + } or nil, + httpSettings = (node.transport == "h2") and { + path = node.h2_path, host = node.h2_host + } or nil, + dsSettings = (node.transport == "ds") and { + path = node.ds_path + } or nil, + quicSettings = (node.transport == "quic") and { + security = node.quic_security, + key = node.quic_key, + header = {type = node.quic_guise} + } or nil, + grpcSettings = (node.transport == "grpc") and { + serviceName = node.grpc_serviceName + } or nil + } + } + }, + -- 传出连接 + outbounds = outbounds, + routing = routing + } + + local alpn = {} + if node.alpn then + string.gsub(node.alpn, '[^' .. "," .. ']+', function(w) + table.insert(alpn, w) + end) + end + if alpn and #alpn > 0 then + if config.inbounds[1].streamSettings.tlsSettings then + config.inbounds[1].streamSettings.tlsSettings.alpn = alpn + end + end + + if "1" == node.tls then + config.inbounds[1].streamSettings.security = "tls" + end + + return config +end + function gen_config(var) local flag = var["-flag"] local node_id = var["-node"] diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/api/v2ray.lua b/luci-app-passwall/luasrc/passwall/v2ray.lua similarity index 97% rename from luci-app-passwall/luasrc/model/cbi/passwall/api/v2ray.lua rename to luci-app-passwall/luasrc/passwall/v2ray.lua index 6c7ac633c..3cd40974e 100644 --- a/luci-app-passwall/luasrc/model/cbi/passwall/api/v2ray.lua +++ b/luci-app-passwall/luasrc/passwall/v2ray.lua @@ -1,5 +1,5 @@ -module("luci.model.cbi.passwall.api.v2ray", package.seeall) -local api = require "luci.model.cbi.passwall.api.api" +module("luci.passwall.v2ray", package.seeall) +local api = require "luci.passwall.api" local fs = api.fs local sys = api.sys local util = api.util diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/api/xray.lua b/luci-app-passwall/luasrc/passwall/xray.lua similarity index 97% rename from luci-app-passwall/luasrc/model/cbi/passwall/api/xray.lua rename to luci-app-passwall/luasrc/passwall/xray.lua index c7bdcd38f..bdbb19cdb 100644 --- a/luci-app-passwall/luasrc/model/cbi/passwall/api/xray.lua +++ b/luci-app-passwall/luasrc/passwall/xray.lua @@ -1,5 +1,5 @@ -module("luci.model.cbi.passwall.api.xray", package.seeall) -local api = require "luci.model.cbi.passwall.api.api" +module("luci.passwall.xray", package.seeall) +local api = require "luci.passwall.api" local fs = api.fs local sys = api.sys local util = api.util diff --git a/luci-app-passwall/luasrc/view/passwall/app_update/brook_version.htm b/luci-app-passwall/luasrc/view/passwall/app_update/brook_version.htm index 7df3ec425..2ea8f26c2 100644 --- a/luci-app-passwall/luasrc/view/passwall/app_update/brook_version.htm +++ b/luci-app-passwall/luasrc/view/passwall/app_update/brook_version.htm @@ -1,5 +1,5 @@ <% -local api = require "luci.model.cbi.passwall.api.api" +local api = require "luci.passwall.api" local brook_version = api.get_brook_version() -%> diff --git a/luci-app-passwall/luasrc/view/passwall/app_update/hysteria_version.htm b/luci-app-passwall/luasrc/view/passwall/app_update/hysteria_version.htm index 57b9f0a87..20e428b08 100644 --- a/luci-app-passwall/luasrc/view/passwall/app_update/hysteria_version.htm +++ b/luci-app-passwall/luasrc/view/passwall/app_update/hysteria_version.htm @@ -1,5 +1,5 @@ <% -local api = require "luci.model.cbi.passwall.api.api" +local api = require "luci.passwall.api" local hysteria_version = api.get_hysteria_version() -%> diff --git a/luci-app-passwall/luasrc/view/passwall/app_update/trojan_go_version.htm b/luci-app-passwall/luasrc/view/passwall/app_update/trojan_go_version.htm index a78c0017c..0223a1bc2 100644 --- a/luci-app-passwall/luasrc/view/passwall/app_update/trojan_go_version.htm +++ b/luci-app-passwall/luasrc/view/passwall/app_update/trojan_go_version.htm @@ -1,5 +1,5 @@ <% -local api = require "luci.model.cbi.passwall.api.api" +local api = require "luci.passwall.api" local trojan_go_version = api.get_trojan_go_version() -%> diff --git a/luci-app-passwall/luasrc/view/passwall/app_update/v2ray_version.htm b/luci-app-passwall/luasrc/view/passwall/app_update/v2ray_version.htm index 44611ae6d..d10e5accd 100644 --- a/luci-app-passwall/luasrc/view/passwall/app_update/v2ray_version.htm +++ b/luci-app-passwall/luasrc/view/passwall/app_update/v2ray_version.htm @@ -1,5 +1,5 @@ <% -local api = require "luci.model.cbi.passwall.api.api" +local api = require "luci.passwall.api" local v2ray_version = api.get_v2ray_version() -%> diff --git a/luci-app-passwall/luasrc/view/passwall/app_update/xray_version.htm b/luci-app-passwall/luasrc/view/passwall/app_update/xray_version.htm index 47fb292c6..cfc4df5c9 100644 --- a/luci-app-passwall/luasrc/view/passwall/app_update/xray_version.htm +++ b/luci-app-passwall/luasrc/view/passwall/app_update/xray_version.htm @@ -1,5 +1,5 @@ <% -local api = require "luci.model.cbi.passwall.api.api" +local api = require "luci.passwall.api" local xray_version = api.get_xray_version() -%> diff --git a/luci-app-passwall/luasrc/view/passwall/auto_switch/footer.htm b/luci-app-passwall/luasrc/view/passwall/auto_switch/footer.htm index cf672e22c..bb6f2cc02 100644 --- a/luci-app-passwall/luasrc/view/passwall/auto_switch/footer.htm +++ b/luci-app-passwall/luasrc/view/passwall/auto_switch/footer.htm @@ -1,5 +1,5 @@ <% -local api = require "luci.model.cbi.passwall.api.api" +local api = require "luci.passwall.api" -%>