"key_method",
{ 1, 2 },
translate("Enable TLS and assume client role") },
- { Value,
+ { DynamicList,
"tls_cipher",
- "DHE-RSA-AES256-SHA:DHE-DSS-AES256-SHA:AES256-SHA:EDH-RSA-DES-CBC3-SHA:EDH-DSS-DES-CBC3-SHA:DES-CBC3-SHA:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA:AES128-SHA:RC4-SHA:RC4-MD5:EDH-RSA-DES-CBC-SHA:EDH-DSS-DES-CBC-SHA:DES-CBC-SHA:EXP-EDH-RSA-DES-CBC-SHA:EXP-EDH-DSS-DES-CBC-SHA:EXP-DES-CBC-SHA:EXP-RC2-CBC-MD5:EXP-RC4-MD5",
+ {
+ "DHE-RSA-AES256-SHA",
+ "DHE-DSS-AES256-SHA",
+ "AES256-SHA",
+ "EDH-RSA-DES-CBC3-SHA",
+ "EDH-DSS-DES-CBC3-SHA",
+ "DES-CBC3-SHA",
+ "DHE-RSA-AES128-SHA",
+ "DHE-DSS-AES128-SHA",
+ "AES128-SHA",
+ "RC4-SHA",
+ "RC4-MD5",
+ "EDH-RSA-DES-CBC-SHA",
+ "EDH-DSS-DES-CBC-SHA",
+ "DES-CBC-SHA",
+ "EXP-EDH-RSA-DES-CBC-SHA",
+ "EXP-EDH-DSS-DES-CBC-SHA",
+ "EXP-DES-CBC-SHA",
+ "EXP-RC2-CBC-MD5",
+ "EXP-RC4-MD5"
+ },
translate("TLS cipher") },
- { Value,
+ { DynamicList,
"tls_ciphersuites",
- "TLS_AES_256_GCM_SHA384:TLS_AES_128_GCM_SHA256:TLS_CHACHA20_POLY1305_SHA256",
+ {
+ "TLS_AES_256_GCM_SHA384",
+ "TLS_AES_128_GCM_SHA256",
+ "TLS_CHACHA20_POLY1305_SHA256"
+ },
translate("TLS 1.3 or newer cipher") },
{ Value,
"tls_timeout",
--- Copyright 2017-2018 Dirk Brenken (dev@brenken.org)
+-- Copyright 2017-2019 Dirk Brenken (dev@brenken.org)
-- This is free software, licensed under the Apache License, Version 2.0
local fs = require("nixio.fs")
local uci = require("luci.model.uci").cursor()
local http = require("luci.http")
+local util = require("luci.util")
+local scripts = util.split(util.trim(util.exec("ls /etc/travelmate/*.login 2>/dev/null")), "\n", nil, true) or {}
local trmiface = uci:get("travelmate", "global", "trm_iface") or "trm_wwan"
local encr_psk = {"psk", "psk2", "psk-mixed"}
local encr_wpa = {"wpa", "wpa2", "wpa-mixed"}
end
end
+local login_section = (m.hidden.ssid or "") .. (m.hidden.bssid or "")
+login_section = login_section.lower(login_section:gsub("[^%w_]", "_"))
+local cmd = uci:get("travelmate", login_section, "command")
+cmd_list = m:field(ListValue, "cmdlist", translate("Auto Login Script"),
+ translate("External script reference which will be called for automated captive portal logins."))
+cmd_list:value("none")
+for _, z in ipairs(scripts) do
+ cmd_list:value(z)
+end
+cmd_list.default = cmd or "none"
+
function wssid.write(self, section, value)
newsection = uci:section("wireless", "wifi-iface", nil, {
mode = "sta",
else
uci:set("wireless", newsection, "encryption", "none")
end
+ local login_section = (wssid:formvalue(section) or "") .. (bssid:formvalue(section) or "")
+ login_section = login_section.lower(login_section:gsub("[^%w_]", "_"))
+ if not uci:get("travelmate", login_section) and cmd_list:formvalue(section) ~= "none" then
+ uci:set("travelmate", login_section, "login")
+ end
+ if uci:get("travelmate", login_section) then
+ uci:set("travelmate", login_section, "command", cmd_list:formvalue(section))
+ uci:save("travelmate")
+ uci:commit("travelmate")
+ end
uci:save("wireless")
uci:commit("wireless")
luci.sys.call("env -i /bin/ubus call network reload >/dev/null 2>&1")
-- Copyright 2017-2019 Dirk Brenken (dev@brenken.org)
-- This is free software, licensed under the Apache License, Version 2.0
-local fs = require("nixio.fs")
-local uci = require("luci.model.uci").cursor()
-local http = require("luci.http")
+local fs = require("nixio.fs")
+local uci = require("luci.model.uci").cursor()
+local http = require("luci.http")
+local util = require("luci.util")
+local scripts = util.split(util.trim(util.exec("ls /etc/travelmate/*.login 2>/dev/null")), "\n", nil, true) or {}
m = SimpleForm("edit", translate("Edit Wireless Uplink Configuration"))
m.submit = translate("Save")
}
local s = uci:get_all("wireless", m.hidden.cfg)
+
if s ~= nil then
wssid = m:field(Value, "ssid", translate("SSID"))
wssid.datatype = "rangelength(1,32)"
wkey.password = true
wkey.default = s.key or s.password
end
+
+ local login_section = (s.ssid or "") .. (s.bssid or "")
+ login_section = login_section.lower(login_section:gsub("[^%w_]", "_"))
+ local cmd = uci:get("travelmate", login_section, "command")
+ cmd_list = m:field(ListValue, "cmdlist", translate("Auto Login Script"),
+ translate("External script reference which will be called for automated captive portal logins."))
+ cmd_list:value("none")
+ for _, z in ipairs(scripts) do
+ cmd_list:value(z)
+ end
+ cmd_list.default = cmd or "none"
else
m.on_cancel()
end
uci:set("wireless", m.hidden.cfg, "priv_key_pwd", privkeypwd:formvalue(section) or "")
end
end
+ local login_section = (wssid:formvalue(section) or "") .. (bssid:formvalue(section) or "")
+ login_section = login_section.lower(login_section:gsub("[^%w_]", "_"))
+ if not uci:get("travelmate", login_section) and cmd_list:formvalue(section) ~= "none" then
+ uci:set("travelmate", login_section, "login")
+ end
+ if uci:get("travelmate", login_section) then
+ uci:set("travelmate", login_section, "command", cmd_list:formvalue(section))
+ uci:save("travelmate")
+ uci:commit("travelmate")
+ end
uci:save("wireless")
uci:commit("wireless")
luci.sys.call("env -i /bin/ubus call network reload >/dev/null 2>&1")
if (view)
{
view.setAttribute("name", "station_nok");
- view.setAttribute("style", "color: #a22; font-weight: bold");
+ view.setAttribute("style", "text-align: left !important; color: #a22; font-weight: bold");
}
}
}
view = document.getElementById(search);
if (view)
{
- view.setAttribute("style", "color: #37c; font-weight: bold");
+ view.setAttribute("style", "text-align: left !important; color: #37c; font-weight: bold");
}
}
}
local encr = s.encryption or "-"
-%>
<div class="tr cbi-section-table-row cbi-rowstyle-1" name="station_ok" id="1_<%=device%>/<%=ssid%>/<%=bssid%>">
- <div class="td left" name="station_ok" id="2_<%=device%>/<%=ssid%>/<%=bssid%>"><%=device%></div>
- <div class="td left" name="station_ok" id="3_<%=device%>/<%=ssid%>/<%=bssid%>"><%=ssid%></div>
- <div class="td left" name="station_ok" id="4_<%=device%>/<%=ssid%>/<%=bssid%>"><%=bssid%></div>
- <div class="td left" name="station_ok" id="5_<%=device%>/<%=ssid%>/<%=bssid%>"><%=encr%></div>
+ <div class="td left" style="text-align: left !important" name="station_ok" id="2_<%=device%>/<%=ssid%>/<%=bssid%>"><%=device%></div>
+ <div class="td left" style="text-align: left !important" name="station_ok" id="3_<%=device%>/<%=ssid%>/<%=bssid%>"><%=ssid%></div>
+ <div class="td left" style="text-align: left !important" name="station_ok" id="4_<%=device%>/<%=ssid%>/<%=bssid%>"><%=bssid%></div>
+ <div class="td left" style="text-align: left !important" name="station_ok" id="5_<%=device%>/<%=ssid%>/<%=bssid%>"><%=encr%></div>
<div class="td middle cbi-section-actions">
<div>
<input class="cbi-button cbi-button-up" type="button" value="<%:Up%>" onclick="location.href='<%=luci.dispatcher.build_url('admin/services/travelmate/wifiorder')%>?cfg=<%=section%>&dir=up'" alt="<%:Move up%>" title="<%:Move up%>" />
</div>
<%- for i, net in ipairs(iw.scanlist or { }) do -%>
<div class="tr cbi-section-table-row cbi-rowstyle-1">
- <div class="td left">
+ <div class="td left" style="text-align: left !important">
<%=net.ssid and utl.pcdata(net.ssid) or "<em>%s</em>" % translate("hidden")%>
</div>
- <div class="td left">
+ <div class="td left" style="text-align: left !important">
<%=net.bssid and utl.pcdata(net.bssid)%>
</div>
- <div class="td left">
+ <div class="td left" style="text-align: left !important">
<%=format_wifi_encryption(net.encryption)%>
</div>
- <div class="td left">
+ <div class="td left" style="text-align: left !important">
<%=percent_wifi_signal(net)%> %
</div>
<div class="td cbi-section-actions">
bitlen = AF_BITS(rt->rtm_family);
- if ((f->type && rt->rtm_type != f->type) ||
- (f->family && rt->rtm_family != f->family) ||
- (f->proto && rt->rtm_protocol != f->proto) ||
- (f->scope && rt->rtm_scope != f->scope) ||
- (f->iif && iif != f->iif) ||
- (f->oif && oif != f->oif) ||
- (f->table && table != f->table) ||
- diff_prefix(rt->rtm_family, from, rt->rtm_src_len,
- f->from_exact, &f->from) ||
- diff_prefix(rt->rtm_family, dst, rt->rtm_dst_len,
- f->dst_exact, &f->dst) ||
- diff_prefix(rt->rtm_family, gw, bitlen,
- false, &f->gw) ||
- diff_prefix(rt->rtm_family, src, bitlen,
- false, &f->src))
- goto out;
+ if (!f->get) {
+ if ((f->type && rt->rtm_type != f->type) ||
+ (f->family && rt->rtm_family != f->family) ||
+ (f->proto && rt->rtm_protocol != f->proto) ||
+ (f->scope && rt->rtm_scope != f->scope) ||
+ (f->iif && iif != f->iif) ||
+ (f->oif && oif != f->oif) ||
+ (f->table && table != f->table) ||
+ diff_prefix(rt->rtm_family, from, rt->rtm_src_len,
+ f->from_exact, &f->from) ||
+ diff_prefix(rt->rtm_family, dst, rt->rtm_dst_len,
+ f->dst_exact, &f->dst) ||
+ diff_prefix(rt->rtm_family, gw, bitlen,
+ false, &f->gw) ||
+ diff_prefix(rt->rtm_family, src, bitlen,
+ false, &f->src))
+ goto out;
+ }
if (s->callback)
lua_pushvalue(s->L, 2);
nlmsg_append(msg, &rtm, sizeof(rtm), 0);
- if (filter->get)
+ if (filter->get) {
nla_put(msg, RTA_DST, AF_BYTES(filter->dst.family),
&filter->dst.addr.v6);
+ if (filter->src.family)
+ nla_put(msg, RTA_SRC, AF_BYTES(filter->src.family),
+ &filter->src.addr.v6);
+ }
+
nl_cb_set(cb, NL_CB_VALID, NL_CB_CUSTOM, cb_dump_route, &s);
nl_cb_set(cb, NL_CB_FINISH, NL_CB_CUSTOM, cb_done, &s);
nl_cb_err(cb, NL_CB_CUSTOM, cb_error, &s);
out:
nl_cb_put(cb);
- return (s.callback == 0);
+
+ if (s.callback)
+ return 0;
+
+ if (!filter->get)
+ return 1;
+
+ return (s.index > 0);
}
static int route_get(lua_State *L)
{
struct dump_filter filter = { .get = true };
const char *dest = luaL_checkstring(L, 1);
+ const char *from = luaL_optstring(L, 2, NULL);
if (!parse_cidr(dest, &filter.dst))
return _error(L, -1, "Invalid destination");
+ if (from && !parse_cidr(from, &filter.src))
+ return _error(L, -1, "Invalid source");
+
+ if (filter.src.family != 0 &&
+ filter.src.family != filter.dst.family)
+ return _error(L, -1, "Different source/destination family");
+
filter.family = filter.dst.family;
return _route_dump(L, &filter);
@name route
@param address A `luci.ip.cidr` instance or a string containing
a valid IPv4 or IPv6 range as specified by `luci.ip.new()`.
+@param source A `luci.ip.cidr` instance or a string containing
+the preferred source address for route selection (optional).
@return <p>Table containing the fields described below.</p>
<table id="routetable">
<tr><th>Field</th><th>Description</th></tr>
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-06-10 03:40+0200\n"
-"PO-Revision-Date: 2019-07-13 18:28+0900\n"
+"PO-Revision-Date: 2019-08-06 02:52+0900\n"
"Last-Translator: INAGAKI Hiroshi <musashino.open@gmail.com>\n"
"Language-Team: \n"
"Language: ja\n"
#: modules/luci-base/htdocs/luci-static/resources/tools/widgets.js:495
#: modules/luci-base/htdocs/luci-static/resources/tools/widgets.js:499
msgid "Absent Interface"
-msgstr ""
+msgstr "存在しないインターフェース"
#: protocols/luci-proto-ppp/luasrc/model/cbi/admin_network/proto_pppoe.lua:19
msgid "Access Concentrator"
#: modules/luci-base/htdocs/luci-static/resources/tools/widgets.js:46
#: modules/luci-base/htdocs/luci-static/resources/tools/widgets.js:151
msgid "Destination zone"
-msgstr ""
+msgstr "宛先ゾーン"
#: modules/luci-base/htdocs/luci-static/resources/tools/widgets.js:54
#: modules/luci-base/htdocs/luci-static/resources/tools/widgets.js:177
#: protocols/luci-proto-ppp/luasrc/model/cbi/admin_network/proto_pppoe.lua:118
msgid "Host-Uniq tag content"
-msgstr ""
+msgstr "Host-Uniq タグ"
#: modules/luci-base/luasrc/view/lease_status.htm:71
#: modules/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js:31
#: modules/luci-mod-network/htdocs/luci-static/resources/view/network/wifi_join.js:147
msgid "No networks in range"
-msgstr ""
+msgstr "範囲内にネットワークがありません"
#: themes/luci-theme-bootstrap/luasrc/view/themes/bootstrap/header.htm:173
#: themes/luci-theme-material/luasrc/view/themes/material/header.htm:211
#: modules/luci-base/htdocs/luci-static/resources/tools/widgets.js:46
#: modules/luci-base/htdocs/luci-static/resources/tools/widgets.js:151
msgid "Output zone"
-msgstr ""
+msgstr "出力ゾーン"
#: modules/luci-base/luasrc/model/cbi/admin_network/proto_dhcp.lua:63
#: modules/luci-base/luasrc/model/cbi/admin_network/proto_static.lua:155
#: protocols/luci-proto-ppp/luasrc/model/cbi/admin_network/proto_pppoe.lua:119
msgid "Raw hex-encoded bytes. Leave empty unless your ISP require this"
msgstr ""
+"16 進数でエンコードされた、生のバイト値です。 ISP がこれを必須としない場合、"
+"空欄のままにします。"
#: modules/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js:83
msgid ""
#: modules/luci-mod-system/luasrc/model/cbi/admin_system/fstab.lua:176
#: modules/luci-mod-system/luasrc/model/cbi/admin_system/fstab.lua:186
msgid "not present"
-msgstr ""
+msgstr "存在しません"
#: modules/luci-mod-network/luasrc/model/cbi/admin_network/vlan.lua:363
#: themes/luci-theme-bootstrap/luasrc/view/themes/bootstrap/header.htm:163
return nil
end
-function proto.contains_interface(self, ifname)
+function proto.contains_interface(self, ifc)
if self:is_floating() then
return (netmod:ifnameof(ifc) == self:ifname())
else
return nil
end
- function proto.contains_interface(self, ifname)
+ function proto.contains_interface(self, ifc)
return (netmod:ifnameof(ifc) == self:ifname())
end
end
return nil
end
- function proto.contains_interface(self, ifname)
+ function proto.contains_interface(self, ifc)
return (netmod:ifnameof(ifc) == self:ifname())
end
line-height: normal;
display: table-cell;
padding: .5em;
+ word-break: break-all;
+ word-wrap: break-word;
text-align: center;
vertical-align: middle;
}
.col-10 {
flex: 10 10 300px !important;
+ width: 60%;
}
/* dom 元素 */