Merge pull request #6367 from stangri/master-luci-app-pbr

luci-app-pbr: update to 1.1.1-1
This commit is contained in:
Stan Grishin 2023-05-04 19:41:04 -06:00 committed by GitHub
commit 10a9047c62
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 149 additions and 108 deletions

View file

@ -5,7 +5,7 @@ include $(TOPDIR)/rules.mk
PKG_LICENSE:=GPL-3.0-or-later PKG_LICENSE:=GPL-3.0-or-later
PKG_MAINTAINER:=Stan Grishin <stangri@melmac.ca> PKG_MAINTAINER:=Stan Grishin <stangri@melmac.ca>
PKG_VERSION:=1.1.0-1 PKG_VERSION:=1.1.1-1
LUCI_TITLE:=Policy Based Routing Service Web UI LUCI_TITLE:=Policy Based Routing Service Web UI
LUCI_DESCRIPTION:=Provides Web UI for Policy Based Routing Service. LUCI_DESCRIPTION:=Provides Web UI for Policy Based Routing Service.

View file

@ -181,17 +181,19 @@ var status = baseclass.extend({
warningTorUnsetProto: _("Please unset 'proto' or set 'proto' to 'all' for policy '%s'"), warningTorUnsetProto: _("Please unset 'proto' or set 'proto' to 'all' for policy '%s'"),
warningTorUnsetChainIpt: _("Please unset 'chain' or set 'chain' to 'PREROUTING' for policy '%s'"), warningTorUnsetChainIpt: _("Please unset 'chain' or set 'chain' to 'PREROUTING' for policy '%s'"),
warningTorUnsetChainNft: _("Please unset 'chain' or set 'chain' to 'prerouting' for policy '%s'"), warningTorUnsetChainNft: _("Please unset 'chain' or set 'chain' to 'prerouting' for policy '%s'"),
warningInvalidOVPNConfig: _("Invalid OpenVPN config for %s interface"),
warningOutdatedWebUIApp: _("The WebUI application is outdated (version %s), please update it"),
}; };
var warningsTitle = E('label', { class: 'cbi-value-title' }, _("Service Warnings")); var warningsTitle = E('label', { class: 'cbi-value-title' }, _("Service Warnings"));
var text = ""; var text = "";
(reply.warnings).forEach(element => { (reply.warnings).forEach(element => {
if (element.id && textLabelsTable[element.id]) { if (element.id && textLabelsTable[element.id]) {
if (element.id !== 'warningPolicyProcessCMD') { if (element.id !== 'warningPolicyProcessCMD') {
text += (textLabelsTable[element.id]).format(element.extra || ' ') + "<br />"; text += (textLabelsTable[element.id] + '.').format(element.extra || ' ') + "<br />";
} }
} }
else { else {
text += _("Unknown Warning!") + "<br />"; text += _("Unknown Warning.") + "<br />";
} }
}); });
var warningsText = E('div', {}, text); var warningsText = E('div', {}, text);
@ -202,28 +204,28 @@ var status = baseclass.extend({
var errorsDiv = []; var errorsDiv = [];
if (reply.errors && reply.errors.length) { if (reply.errors && reply.errors.length) {
var textLabelsTable = { var textLabelsTable = {
errorConfigValidation: _("Config (%s) validation failure!").format('/etc/config/' + pkg.Name), errorConfigValidation: _("Config (%s) validation failure").format('/etc/config/' + pkg.Name),
errorNoIpFull: _("%s binary cannot be found!").format('ip-full'), errorNoIpFull: _("%s binary cannot be found").format('ip-full'),
errorNoIptables: _("%s binary cannot be found!").format('iptables'), errorNoIptables: _("%s binary cannot be found").format('iptables'),
errorNoIpset: _("Resolver set support (%s) requires ipset, but ipset binary cannot be found!").format(uci.get(pkg.Name, 'config', 'resolver_set')), errorNoIpset: _("Resolver set support (%s) requires ipset, but ipset binary cannot be found").format(uci.get(pkg.Name, 'config', 'resolver_set')),
errorNoNft: _("Resolver set support (%s) requires nftables, but nft binary cannot be found!").format(uci.get(pkg.Name, 'config', 'resolver_set')), errorNoNft: _("Resolver set support (%s) requires nftables, but nft binary cannot be found").format(uci.get(pkg.Name, 'config', 'resolver_set')),
errorResolverNotSupported: _("Resolver set (%s) is not supported on this system!").format(uci.get(pkg.Name, 'config', 'resolver_set')), errorResolverNotSupported: _("Resolver set (%s) is not supported on this system").format(uci.get(pkg.Name, 'config', 'resolver_set')),
errorServiceDisabled: _("The %s service is currently disabled!").format(pkg.Name), errorServiceDisabled: _("The %s service is currently disabled").format(pkg.Name),
errorNoWanGateway: _("The %s service failed to discover WAN gateway!").format(pkg.Name), errorNoWanGateway: _("The %s service failed to discover WAN gateway").format(pkg.Name),
errorIpsetNameTooLong: _("The ipset name '%s' is longer than allowed 31 characters!"), errorIpsetNameTooLong: _("The ipset name '%s' is longer than allowed 31 characters"),
errorNftsetNameTooLong: _("The nft set name '%s' is longer than allowed 31 characters!"), errorNftsetNameTooLong: _("The nft set name '%s' is longer than allowed 31 characters"),
errorUnexpectedExit: _("Unexpected exit or service termination: '%s'!"), errorUnexpectedExit: _("Unexpected exit or service termination: '%s'"),
errorPolicyNoSrcDest: _("Policy '%s' has no source/destination parameters!"), errorPolicyNoSrcDest: _("Policy '%s' has no source/destination parameters"),
errorPolicyNoInterface: _("Policy '%s' has no assigned interface!"), errorPolicyNoInterface: _("Policy '%s' has no assigned interface"),
errorPolicyUnknownInterface: _("Policy '%s' has an unknown interface!"), errorPolicyUnknownInterface: _("Policy '%s' has an unknown interface"),
errorPolicyProcessCMD: _("%s"), errorPolicyProcessCMD: _("%s"),
errorFailedSetup: _("Failed to set up '%s'!"), errorFailedSetup: _("Failed to set up '%s'"),
errorFailedReload: _("Failed to reload '%s'!"), errorFailedReload: _("Failed to reload '%s'"),
errorUserFileNotFound: _("Custom user file '%s' not found or empty!"), errorUserFileNotFound: _("Custom user file '%s' not found or empty"),
ererrorUserFileSyntax: _("Syntax error in custom user file '%s'!"), errorUserFileSyntax: _("Syntax error in custom user file '%s'"),
errorUserFileRunning: _("Error running custom user file '%s'!"), errorUserFileRunning: _("Error running custom user file '%s'"),
errorUserFileNoCurl: _("Use of 'curl' is detected in custom user file '%s', but 'curl' isn't installed!"), errorUserFileNoCurl: _("Use of 'curl' is detected in custom user file '%s', but 'curl' isn't installed"),
errorNoGateways: _("Failed to set up any gateway!"), errorNoGateways: _("Failed to set up any gateway"),
errorResolver: _("Resolver %s"), errorResolver: _("Resolver %s"),
errorPolicyProcessNoIpv6: _("Skipping IPv6 policy '%s' as IPv6 support is disabled"), errorPolicyProcessNoIpv6: _("Skipping IPv6 policy '%s' as IPv6 support is disabled"),
errorPolicyProcessUnknownFwmark: _("Unknown packet mark for interface '%s'"), errorPolicyProcessUnknownFwmark: _("Unknown packet mark for interface '%s'"),
@ -233,13 +235,14 @@ var status = baseclass.extend({
errorPolicyProcessInsertionFailedIpv4: _("Insertion failed for IPv4 for policy %s"), errorPolicyProcessInsertionFailedIpv4: _("Insertion failed for IPv4 for policy %s"),
errorInterfaceRoutingEmptyValues: _("Received empty tid/mark or interface name when setting up routing"), errorInterfaceRoutingEmptyValues: _("Received empty tid/mark or interface name when setting up routing"),
errorFailedToResolve: _("Failed to resolve %s"), errorFailedToResolve: _("Failed to resolve %s"),
errorInvalidOVPNConfig: _("Invalid OpenVPN config for %s interface"),
}; };
var errorsTitle = E('label', { class: 'cbi-value-title' }, _("Service Errors")); var errorsTitle = E('label', { class: 'cbi-value-title' }, _("Service Errors"));
var text = ""; var text = "";
(reply.errors).forEach(element => { (reply.errors).forEach(element => {
if (element.id && textLabelsTable[element.id]) { if (element.id && textLabelsTable[element.id]) {
if (element.id !== 'errorPolicyProcessCMD') { if (element.id !== 'errorPolicyProcessCMD') {
text += (textLabelsTable[element.id]).format(element.extra || ' ') + "<br />"; text += (textLabelsTable[element.id] + '!').format(element.extra || ' ') + "<br />";
} }
} }
else { else {

View file

@ -2,13 +2,13 @@ msgid ""
msgstr "Content-Type: text/plain; charset=UTF-8" msgstr "Content-Type: text/plain; charset=UTF-8"
#: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:179 #: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:179
#: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:219 #: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:221
msgid "%s" msgid "%s"
msgstr "" msgstr ""
#: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:206 #: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:208
#: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:207 #: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:209
msgid "%s binary cannot be found!" msgid "%s binary cannot be found"
msgstr "" msgstr ""
#: applications/luci-app-pbr/htdocs/luci-static/resources/view/pbr/overview.js:61 #: applications/luci-app-pbr/htdocs/luci-static/resources/view/pbr/overview.js:61
@ -67,8 +67,8 @@ msgstr ""
msgid "Condensed output" msgid "Condensed output"
msgstr "" msgstr ""
#: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:205 #: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:207
msgid "Config (%s) validation failure!" msgid "Config (%s) validation failure"
msgstr "" msgstr ""
#: applications/luci-app-pbr/htdocs/luci-static/resources/view/pbr/overview.js:68 #: applications/luci-app-pbr/htdocs/luci-static/resources/view/pbr/overview.js:68
@ -79,8 +79,8 @@ msgstr ""
msgid "Custom User File Includes" msgid "Custom User File Includes"
msgstr "" msgstr ""
#: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:222 #: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:224
msgid "Custom user file '%s' not found or empty!" msgid "Custom user file '%s' not found or empty"
msgstr "" msgstr ""
#: applications/luci-app-pbr/htdocs/luci-static/resources/view/pbr/overview.js:254 #: applications/luci-app-pbr/htdocs/luci-static/resources/view/pbr/overview.js:254
@ -95,7 +95,7 @@ msgstr ""
msgid "Default ICMP Interface" msgid "Default ICMP Interface"
msgstr "" msgstr ""
#: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:310 #: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:313
msgid "Disable" msgid "Disable"
msgstr "" msgstr ""
@ -105,7 +105,7 @@ msgstr ""
msgid "Disabled" msgid "Disabled"
msgstr "" msgstr ""
#: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:306 #: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:309
msgid "Disabling %s service" msgid "Disabling %s service"
msgstr "" msgstr ""
@ -127,7 +127,7 @@ msgstr ""
msgid "Do not enforce policies when their gateway is down" msgid "Do not enforce policies when their gateway is down"
msgstr "" msgstr ""
#: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:299 #: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:302
msgid "Enable" msgid "Enable"
msgstr "" msgstr ""
@ -138,12 +138,12 @@ msgstr ""
msgid "Enabled" msgid "Enabled"
msgstr "" msgstr ""
#: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:295 #: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:298
msgid "Enabling %s service" msgid "Enabling %s service"
msgstr "" msgstr ""
#: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:224 #: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:226
msgid "Error running custom user file '%s'!" msgid "Error running custom user file '%s'"
msgstr "" msgstr ""
#: applications/luci-app-pbr/htdocs/luci-static/resources/view/pbr/overview.js:162 #: applications/luci-app-pbr/htdocs/luci-static/resources/view/pbr/overview.js:162
@ -152,20 +152,20 @@ msgid ""
"QoS. Change with caution together with" "QoS. Change with caution together with"
msgstr "" msgstr ""
#: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:221 #: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:223
msgid "Failed to reload '%s'!" msgid "Failed to reload '%s'"
msgstr "" msgstr ""
#: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:235 #: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:237
msgid "Failed to resolve %s" msgid "Failed to resolve %s"
msgstr "" msgstr ""
#: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:220 #: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:222
msgid "Failed to set up '%s'!" msgid "Failed to set up '%s'"
msgstr "" msgstr ""
#: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:226 #: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:228
msgid "Failed to set up any gateway!" msgid "Failed to set up any gateway"
msgstr "" msgstr ""
#: applications/luci-app-pbr/htdocs/luci-static/resources/view/pbr/overview.js:138 #: applications/luci-app-pbr/htdocs/luci-static/resources/view/pbr/overview.js:138
@ -188,11 +188,11 @@ msgstr ""
msgid "Insert" msgid "Insert"
msgstr "" msgstr ""
#: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:233 #: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:235
msgid "Insertion failed for IPv4 for policy %s" msgid "Insertion failed for IPv4 for policy %s"
msgstr "" msgstr ""
#: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:232 #: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:234
msgid "Insertion failed for both IPv4 and IPv6 for policy %s" msgid "Insertion failed for both IPv4 and IPv6 for policy %s"
msgstr "" msgstr ""
@ -204,6 +204,11 @@ msgstr ""
msgid "Interface" msgid "Interface"
msgstr "" msgstr ""
#: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:184
#: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:238
msgid "Invalid OpenVPN config for %s interface"
msgstr ""
#: applications/luci-app-pbr/htdocs/luci-static/resources/view/pbr/overview.js:195 #: applications/luci-app-pbr/htdocs/luci-static/resources/view/pbr/overview.js:195
msgid "Local addresses / devices" msgid "Local addresses / devices"
msgstr "" msgstr ""
@ -212,7 +217,7 @@ msgstr ""
msgid "Local ports" msgid "Local ports"
msgstr "" msgstr ""
#: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:230 #: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:232
msgid "Mismatched IP family between in policy %s" msgid "Mismatched IP family between in policy %s"
msgstr "" msgstr ""
@ -268,16 +273,16 @@ msgstr ""
msgid "Policies" msgid "Policies"
msgstr "" msgstr ""
#: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:220
msgid "Policy '%s' has an unknown interface"
msgstr ""
#: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:219
msgid "Policy '%s' has no assigned interface"
msgstr ""
#: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:218 #: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:218
msgid "Policy '%s' has an unknown interface!" msgid "Policy '%s' has no source/destination parameters"
msgstr ""
#: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:217
msgid "Policy '%s' has no assigned interface!"
msgstr ""
#: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:216
msgid "Policy '%s' has no source/destination parameters!"
msgstr "" msgstr ""
#: applications/luci-app-pbr/htdocs/luci-static/resources/view/pbr/overview.js:56 #: applications/luci-app-pbr/htdocs/luci-static/resources/view/pbr/overview.js:56
@ -296,7 +301,7 @@ msgstr ""
msgid "Protocol" msgid "Protocol"
msgstr "" msgstr ""
#: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:234 #: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:236
msgid "Received empty tid/mark or interface name when setting up routing" msgid "Received empty tid/mark or interface name when setting up routing"
msgstr "" msgstr ""
@ -308,33 +313,33 @@ msgstr ""
msgid "Remote ports" msgid "Remote ports"
msgstr "" msgstr ""
#: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:227 #: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:229
msgid "Resolver %s" msgid "Resolver %s"
msgstr "" msgstr ""
#: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:210 #: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:212
msgid "Resolver set (%s) is not supported on this system!" msgid "Resolver set (%s) is not supported on this system"
msgstr "" msgstr ""
#: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:177 #: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:177
msgid "Resolver set (%s) is not supported on this system." msgid "Resolver set (%s) is not supported on this system."
msgstr "" msgstr ""
#: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:208 #: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:210
msgid "" msgid ""
"Resolver set support (%s) requires ipset, but ipset binary cannot be found!" "Resolver set support (%s) requires ipset, but ipset binary cannot be found"
msgstr "" msgstr ""
#: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:209 #: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:211
msgid "" msgid ""
"Resolver set support (%s) requires nftables, but nft binary cannot be found!" "Resolver set support (%s) requires nftables, but nft binary cannot be found"
msgstr "" msgstr ""
#: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:277 #: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:280
msgid "Restart" msgid "Restart"
msgstr "" msgstr ""
#: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:273 #: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:276
msgid "Restarting %s service" msgid "Restarting %s service"
msgstr "" msgstr ""
@ -368,11 +373,11 @@ msgstr ""
msgid "Select Add for -A/add and Insert for -I/Insert." msgid "Select Add for -A/add and Insert for -I/Insert."
msgstr "" msgstr ""
#: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:334 #: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:337
msgid "Service Control" msgid "Service Control"
msgstr "" msgstr ""
#: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:237 #: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:240
msgid "Service Errors" msgid "Service Errors"
msgstr "" msgstr ""
@ -389,7 +394,7 @@ msgstr ""
msgid "Service Status" msgid "Service Status"
msgstr "" msgstr ""
#: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:185 #: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:187
msgid "Service Warnings" msgid "Service Warnings"
msgstr "" msgstr ""
@ -399,15 +404,15 @@ msgid ""
"%sREADME%s for details." "%sREADME%s for details."
msgstr "" msgstr ""
#: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:228 #: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:230
msgid "Skipping IPv6 policy '%s' as IPv6 support is disabled" msgid "Skipping IPv6 policy '%s' as IPv6 support is disabled"
msgstr "" msgstr ""
#: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:266 #: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:269
msgid "Start" msgid "Start"
msgstr "" msgstr ""
#: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:262 #: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:265
msgid "Starting %s service" msgid "Starting %s service"
msgstr "" msgstr ""
@ -421,7 +426,7 @@ msgstr ""
msgid "Starting (WAN) Table ID number for tables created by the service." msgid "Starting (WAN) Table ID number for tables created by the service."
msgstr "" msgstr ""
#: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:288 #: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:291
msgid "Stop" msgid "Stop"
msgstr "" msgstr ""
@ -433,7 +438,7 @@ msgstr ""
msgid "Stopped (version: %s)" msgid "Stopped (version: %s)"
msgstr "" msgstr ""
#: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:284 #: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:287
msgid "Stopping %s service" msgid "Stopping %s service"
msgstr "" msgstr ""
@ -457,8 +462,8 @@ msgstr ""
msgid "Suppress/No output" msgid "Suppress/No output"
msgstr "" msgstr ""
#: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:223 #: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:225
msgid "Syntax error in custom user file '%s'!" msgid "Syntax error in custom user file '%s'"
msgstr "" msgstr ""
#: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:166 #: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:166
@ -471,12 +476,12 @@ msgstr ""
msgid "The %s is not supported on this system." msgid "The %s is not supported on this system."
msgstr "" msgstr ""
#: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:212 #: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:214
msgid "The %s service failed to discover WAN gateway!" msgid "The %s service failed to discover WAN gateway"
msgstr "" msgstr ""
#: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:211 #: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:213
msgid "The %s service is currently disabled!" msgid "The %s service is currently disabled"
msgstr "" msgstr ""
#: applications/luci-app-pbr/htdocs/luci-static/resources/view/pbr/overview.js:83 #: applications/luci-app-pbr/htdocs/luci-static/resources/view/pbr/overview.js:83
@ -485,38 +490,42 @@ msgstr ""
msgid "The %s support is unknown." msgid "The %s support is unknown."
msgstr "" msgstr ""
#: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:213 #: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:185
msgid "The ipset name '%s' is longer than allowed 31 characters!" msgid "The WebUI application is outdated (version %s), please update it"
msgstr ""
#: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:214
msgid "The nft set name '%s' is longer than allowed 31 characters!"
msgstr "" msgstr ""
#: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:215 #: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:215
msgid "Unexpected exit or service termination: '%s'!" msgid "The ipset name '%s' is longer than allowed 31 characters"
msgstr "" msgstr ""
#: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:246 #: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:216
msgid "The nft set name '%s' is longer than allowed 31 characters"
msgstr ""
#: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:217
msgid "Unexpected exit or service termination: '%s'"
msgstr ""
#: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:249
msgid "Unknown Error!" msgid "Unknown Error!"
msgstr "" msgstr ""
#: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:194 #: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:196
msgid "Unknown Warning!" msgid "Unknown Warning."
msgstr ""
#: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:229
msgid "Unknown packet mark for interface '%s'"
msgstr "" msgstr ""
#: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:231 #: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:231
msgid "Unknown packet mark for interface '%s'"
msgstr ""
#: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:233
msgid "Unknown protocol in policy %s" msgid "Unknown protocol in policy %s"
msgstr "" msgstr ""
#: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:225 #: applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js:227
msgid "" msgid ""
"Use of 'curl' is detected in custom user file '%s', but 'curl' isn't " "Use of 'curl' is detected in custom user file '%s', but 'curl' isn't "
"installed!" "installed"
msgstr "" msgstr ""
#: applications/luci-app-pbr/htdocs/luci-static/resources/view/pbr/overview.js:102 #: applications/luci-app-pbr/htdocs/luci-static/resources/view/pbr/overview.js:102

View file

@ -34,7 +34,9 @@ print_json_string() { json_init; json_add_string "$1" "$2"; json_dump; json_clea
logger() { /usr/bin/logger -t "$packageName" "$@"; } logger() { /usr/bin/logger -t "$packageName" "$@"; }
ubus_get_status() { ubus call service list "{ 'name': '$packageName' }" | jsonfilter -e "@['${packageName}'].instances.main.data.status.${1}"; } ubus_get_status() { ubus call service list "{ 'name': '$packageName' }" | jsonfilter -e "@['${packageName}'].instances.main.data.status.${1}"; }
ubus_get_gateway() { ubus call service list "{ 'name': '$packageName' }" | jsonfilter -e "@['${packageName}'].instances.main.data.gateways[@.name='${1}']${2:+.$2}"; } ubus_get_gateway() { ubus call service list "{ 'name': '$packageName' }" | jsonfilter -e "@['${packageName}'].instances.main.data.gateways[@.name='${1}']${2:+.$2}"; }
is_greater() { test "$(printf '%s\n' "$@" | sort -V | head -n 1)" != "$1"; }
is_greater_or_equal() { test "$(printf '%s\n' "$@" | sort -V | head -n 1)" = "$2"; } is_greater_or_equal() { test "$(printf '%s\n' "$@" | sort -V | head -n 1)" = "$2"; }
opkg_get_version() { grep -m1 -A1 "$1" '/usr/lib/opkg/status' | grep -m1 'Version: ' | sed 's|Version: \(.*\)|\1|'; }
get_init_list() { get_init_list() {
local name local name
@ -130,20 +132,26 @@ EOF
if [ -n "$warnings" ]; then if [ -n "$warnings" ]; then
while read -r line; do while read -r line; do
if str_contains "$line" ' '; then if str_contains "$line" ' '; then
error_id="${line% *}" warning_id="${line% *}"
error_extra="${line#* }" warning_extra="${line#* }"
else else
error_id="$line" warning_id="$line"
unset error_extra unset warning_extra
fi fi
json_add_object json_add_object
json_add_string 'id' "$error_id" json_add_string 'id' "$warning_id"
json_add_string 'extra' "$error_extra" json_add_string 'extra' "$warning_extra"
json_close_object json_close_object
done <<EOF done <<EOF
$(echo "$warnings" | tr \# \\n) $(echo "$warnings" | tr \# \\n)
EOF EOF
fi fi
if is_greater "$(opkg_get_version "${name}")" "$(opkg_get_version "luci-app-${name}")"; then
json_add_object
json_add_string 'id' 'warningOutdatedWebUIApp'
json_add_string 'extra' "$(opkg_get_version "luci-app-${name}")"
json_close_object
fi
json_close_array json_close_array
json_close_object json_close_object
json_dump json_dump
@ -158,7 +166,7 @@ check_unbound() { command -v unbound >/dev/null 2>&1; }
check_agh_ipset() { check_agh_ipset() {
check_ipset || return 1 check_ipset || return 1
check_agh || return 1 check_agh || return 1
is_greater_or_equal "$($agh --version | sed 's|AdGuard Home, version v\(.*\)|\1|')" '0.107.13' is_greater_or_equal "$($agh --version | sed 's|AdGuard Home, version v\(.*\)|\1|' | sed 's|-.*||')" '0.107.13'
} }
check_dnsmasq_ipset() { check_dnsmasq_ipset() {
local o; local o;
@ -246,6 +254,15 @@ is_ovpn() { local dev; network_get_device dev "$1"; [ "${dev:0:3}" = "tun" ] ||
is_pptp() { local proto; proto=$(uci -q get network."$1".proto); [ "${proto:0:4}" = "pptp" ]; } is_pptp() { local proto; proto=$(uci -q get network."$1".proto); [ "${proto:0:4}" = "pptp" ]; }
is_softether() { local dev; network_get_device dev "$1"; [ "${dev:0:4}" = "vpn_" ]; } is_softether() { local dev; network_get_device dev "$1"; [ "${dev:0:4}" = "vpn_" ]; }
is_tor() { [ "$(str_to_lower "$1")" = "tor" ]; } is_tor() { [ "$(str_to_lower "$1")" = "tor" ]; }
is_tor_running() {
local ret=0
if [ -s "/etc/tor/torrc" ]; then
json_load "$(ubus call service list "{ 'name': 'tor' }")"
json_select 'tor'; json_select 'instances'; json_select 'instance1';
json_get_var ret 'running'; json_cleanup
fi
if [ "$ret" = "0" ]; then return 1; else return 0; fi
}
is_wg() { local proto; proto=$(uci -q get network."$1".proto); [ "${proto:0:9}" = "wireguard" ]; } is_wg() { local proto; proto=$(uci -q get network."$1".proto); [ "${proto:0:9}" = "wireguard" ]; }
is_tunnel() { is_dslite "$1" || is_l2tp "$1" || is_oc "$1" || is_ovpn "$1" || is_pptp "$1" || is_softether "$1" || is_tor "$1" || is_wg "$1"; } is_tunnel() { is_dslite "$1" || is_l2tp "$1" || is_oc "$1" || is_ovpn "$1" || is_pptp "$1" || is_softether "$1" || is_tor "$1" || is_wg "$1"; }
is_wan() { [ "$1" = "$wanIface4" ] || { [ "${1##wan}" != "$1" ] && [ "${1##wan6}" = "$1" ]; } || [ "${1%%wan}" != "$1" ]; } is_wan() { [ "$1" = "$wanIface4" ] || { [ "${1##wan}" != "$1" ] && [ "${1##wan6}" = "$1" ]; } || [ "${1%%wan}" != "$1" ]; }
@ -264,25 +281,37 @@ pbr_find_iface() {
fi fi
eval "$1"='${iface:-$i}' eval "$1"='${iface:-$i}'
} }
_find_firewall_wan_zone() { [ "$(uci -q get "firewall.${1}.name")" = "wan" ] && firewallWanZone="$1"; }
_build_ifaces_all() { ifacesAll="${ifacesAll}${1} "; } _build_ifaces_all() { ifacesAll="${ifacesAll}${1} "; }
_build_ifaces_supported() { is_supported_interface "$1" && ifacesSupported="${ifacesSupported}${1} "; } _build_ifaces_supported() { is_supported_interface "$1" && ! str_contains "$ifacesSupported" "$1" && ifacesSupported="${ifacesSupported}${1} "; }
get_supported_interfaces() { get_supported_interfaces() {
local name i local name i
name="$(basename "$1")" name="$(basename "$1")"
name="${name:-$packageName}" name="${name:-$packageName}"
local firewallWanZone
local ifacesAll ifacesSupported local ifacesAll ifacesSupported
local webui_show_ignore_target local webui_show_ignore_target
local ignored_interface supported_interface local ignored_interface supported_interface
local wanIface4 wanIface6 local wanIface4 wanIface6
config_load "$name" config_load "$packageName"
config_get_bool webui_show_ignore_target 'config' 'webui_show_ignore_target' '0' config_get_bool webui_show_ignore_target 'config' 'webui_show_ignore_target' '0'
config_get ignored_interface 'config' 'ignored_interface' config_get ignored_interface 'config' 'ignored_interface'
config_get supported_interface 'config' 'supported_interface' config_get supported_interface 'config' 'supported_interface'
local i
config_load 'network' config_load 'network'
config_foreach _build_ifaces_all 'interface' config_foreach _build_ifaces_all 'interface'
pbr_find_iface wanIface4 'wan' pbr_find_iface wanIface4 'wan'
pbr_find_iface wanIface6 'wan6' pbr_find_iface wanIface6 'wan6'
config_load 'firewall'
config_foreach _find_firewall_wan_zone 'zone'
for i in $(uci -q get "firewall.${firewallWanZone}.network"); do
is_supported_interface "$i" && ! str_contains "$ifacesSupported" "$1" && ifacesSupported="${ifacesSupported}${i} "
done
config_load 'network'
config_foreach _build_ifaces_supported 'interface' config_foreach _build_ifaces_supported 'interface'
if is_tor_running; then
ifacesSupported="$ifacesSupported tor"
fi
if [ "$webui_show_ignore_target" -eq "1" ]; then if [ "$webui_show_ignore_target" -eq "1" ]; then
ifacesSupported="$ifacesSupported ignore" ifacesSupported="$ifacesSupported ignore"
fi fi