mirror of
https://github.com/gSpotx2f/ruantiblock_openwrt.git
synced 2026-05-13 22:20:59 +00:00
ruantiblock-mod-lua: added lua-idn. luci-app-ruantiblock: updated log.
This commit is contained in:
@@ -10,9 +10,9 @@ LUCI_APP=1
|
|||||||
HTTPS_DNS_PROXY=1
|
HTTPS_DNS_PROXY=1
|
||||||
|
|
||||||
OWRT_VERSION="current"
|
OWRT_VERSION="current"
|
||||||
RUAB_VERSION="2.1.6-r3"
|
RUAB_VERSION="2.1.7-r1"
|
||||||
RUAB_MOD_LUA_VERSION="2.1.6-r1"
|
RUAB_MOD_LUA_VERSION="2.1.7-r1"
|
||||||
RUAB_LUCI_APP_VERSION="2.1.6-r3"
|
RUAB_LUCI_APP_VERSION="2.1.7-r1"
|
||||||
BASE_URL="https://raw.githubusercontent.com/gSpotx2f/packages-openwrt/master"
|
BASE_URL="https://raw.githubusercontent.com/gSpotx2f/packages-openwrt/master"
|
||||||
PKG_DIR="/tmp"
|
PKG_DIR="/tmp"
|
||||||
|
|
||||||
@@ -29,7 +29,6 @@ URL_LUCI_APP_PKG="${BASE_URL}/${OWRT_VERSION}/luci-app-ruantiblock_${RUAB_LUCI_A
|
|||||||
URL_LUCI_APP_RU_PKG="${BASE_URL}/${OWRT_VERSION}/luci-i18n-ruantiblock-ru_${RUAB_LUCI_APP_VERSION}_all.ipk"
|
URL_LUCI_APP_RU_PKG="${BASE_URL}/${OWRT_VERSION}/luci-i18n-ruantiblock-ru_${RUAB_LUCI_APP_VERSION}_all.ipk"
|
||||||
### tor
|
### tor
|
||||||
URL_TORRC="https://raw.githubusercontent.com/gSpotx2f/ruantiblock_openwrt/master/tor/etc/tor/torrc"
|
URL_TORRC="https://raw.githubusercontent.com/gSpotx2f/ruantiblock_openwrt/master/tor/etc/tor/torrc"
|
||||||
URL_LUA_IDN="https://raw.githubusercontent.com/haste/lua-idn/master/idn.lua"
|
|
||||||
|
|
||||||
### Local files
|
### Local files
|
||||||
|
|
||||||
@@ -55,7 +54,6 @@ FILE_INIT_SCRIPT="${PREFIX}/etc/init.d/ruantiblock"
|
|||||||
FILE_MAIN_SCRIPT="${EXEC_DIR}/ruantiblock"
|
FILE_MAIN_SCRIPT="${EXEC_DIR}/ruantiblock"
|
||||||
### tor
|
### tor
|
||||||
FILE_TORRC="${PREFIX}/etc/tor/torrc"
|
FILE_TORRC="${PREFIX}/etc/tor/torrc"
|
||||||
FILE_LUA_IDN="${PREFIX}/usr/lib/lua/idn.lua"
|
|
||||||
|
|
||||||
AWK_CMD="awk"
|
AWK_CMD="awk"
|
||||||
WGET_CMD="$(which wget)"
|
WGET_CMD="$(which wget)"
|
||||||
@@ -228,7 +226,6 @@ InstallLuaModule() {
|
|||||||
InstallPackages "lua" "luasocket" "luasec" "luabitop"
|
InstallPackages "lua" "luasocket" "luasec" "luabitop"
|
||||||
RemoveFile "$FILE_MOD_LUA_PKG" > /dev/null
|
RemoveFile "$FILE_MOD_LUA_PKG" > /dev/null
|
||||||
DlFile "$URL_MOD_LUA_PKG" "$FILE_MOD_LUA_PKG" && $OPKG_CMD install "$FILE_MOD_LUA_PKG"
|
DlFile "$URL_MOD_LUA_PKG" "$FILE_MOD_LUA_PKG" && $OPKG_CMD install "$FILE_MOD_LUA_PKG"
|
||||||
FileExists "$FILE_LUA_IDN" || DlFile "$URL_LUA_IDN" "$FILE_LUA_IDN"
|
|
||||||
$UCI_CMD set ruantiblock.config.bllist_module="/usr/libexec/ruantiblock/ruab_parser.lua"
|
$UCI_CMD set ruantiblock.config.bllist_module="/usr/libexec/ruantiblock/ruab_parser.lua"
|
||||||
$UCI_CMD commit ruantiblock
|
$UCI_CMD commit ruantiblock
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,8 +5,8 @@
|
|||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=luci-app-ruantiblock
|
PKG_NAME:=luci-app-ruantiblock
|
||||||
PKG_VERSION:=2.1.6
|
PKG_VERSION:=2.1.7
|
||||||
PKG_RELEASE:=3
|
PKG_RELEASE:=1
|
||||||
LUCI_TITLE:=LuCI support for ruantiblock
|
LUCI_TITLE:=LuCI support for ruantiblock
|
||||||
LUCI_DEPENDS:=+ruantiblock
|
LUCI_DEPENDS:=+ruantiblock
|
||||||
LUCI_PKGARCH:=all
|
LUCI_PKGARCH:=all
|
||||||
|
|||||||
@@ -107,6 +107,7 @@ log-emerg td {
|
|||||||
}
|
}
|
||||||
.log-info {
|
.log-info {
|
||||||
background-color: var(--app-log-info) !important;
|
background-color: var(--app-log-info) !important;
|
||||||
|
/*color: var(--app-log-dark-font-color) !important;*/
|
||||||
}
|
}
|
||||||
.log-debug {
|
.log-debug {
|
||||||
background-color: var(--app-log-debug) !important;
|
background-color: var(--app-log-debug) !important;
|
||||||
@@ -256,7 +257,9 @@ return baseclass.extend({
|
|||||||
|
|
||||||
timeFilterReValue : false,
|
timeFilterReValue : false,
|
||||||
|
|
||||||
hostFilterValue : [],
|
hostFilterValue : null,
|
||||||
|
|
||||||
|
hostFilterReValue : false,
|
||||||
|
|
||||||
facilityFilterValue : [],
|
facilityFilterValue : [],
|
||||||
|
|
||||||
@@ -274,18 +277,14 @@ return baseclass.extend({
|
|||||||
|
|
||||||
logTimestampFlag : false,
|
logTimestampFlag : false,
|
||||||
|
|
||||||
logHostsFlag : false,
|
logHostFlag : false,
|
||||||
|
|
||||||
logFacilitiesFlag : false,
|
logFacilitiesFlag : false,
|
||||||
|
|
||||||
logLevelsFlag : false,
|
logLevelsFlag : false,
|
||||||
|
|
||||||
logHosts : {},
|
|
||||||
|
|
||||||
logLevelsStat : {},
|
logLevelsStat : {},
|
||||||
|
|
||||||
logHostsDropdown : null,
|
|
||||||
|
|
||||||
logFacilitiesDropdown: null,
|
logFacilitiesDropdown: null,
|
||||||
|
|
||||||
logLevelsDropdown : null,
|
logLevelsDropdown : null,
|
||||||
@@ -315,6 +314,44 @@ return baseclass.extend({
|
|||||||
return (/^[0-9]+$/.test(value)) ? value : 0
|
return (/^[0-9]+$/.test(value)) ? value : 0
|
||||||
},
|
},
|
||||||
|
|
||||||
|
makeRegExpButton(filterEl, checked) {
|
||||||
|
const btnOnClass = 'cbi-button-positive btn important',
|
||||||
|
btnOnStyle = 'text-decoration:none',
|
||||||
|
btnOffClass = 'cbi-button-neutral btn',
|
||||||
|
btnOffStyle = 'text-decoration:line-through';
|
||||||
|
let btn = E('button', {
|
||||||
|
'class': checked ? btnOnClass : btnOffClass,
|
||||||
|
'style': checked ? btnOnStyle : btnOffStyle,
|
||||||
|
'title': _('Apply pattern as regular expression'),
|
||||||
|
'click': ev => {
|
||||||
|
ev.target.toggle();
|
||||||
|
filterEl.focus();
|
||||||
|
ev.preventDefault();
|
||||||
|
},
|
||||||
|
}, 'RE');
|
||||||
|
btn._state = checked;
|
||||||
|
btn._on = function() {
|
||||||
|
this._state = true;
|
||||||
|
this.className = btnOnClass;
|
||||||
|
this.style = btnOnStyle;
|
||||||
|
};
|
||||||
|
btn._off = function() {
|
||||||
|
this._state = false;
|
||||||
|
this.className = btnOffClass;
|
||||||
|
this.style = btnOffStyle;
|
||||||
|
};
|
||||||
|
btn.checked = function() {
|
||||||
|
return this._state;
|
||||||
|
};
|
||||||
|
btn.toggle = function() {
|
||||||
|
this._state ? this._off() : this._on();
|
||||||
|
};
|
||||||
|
btn.set = function(flag) {
|
||||||
|
flag ? this._on() : this._off();
|
||||||
|
};
|
||||||
|
return btn;
|
||||||
|
},
|
||||||
|
|
||||||
makeLogConvertTimestampSection() {
|
makeLogConvertTimestampSection() {
|
||||||
if(!this.enableConvertTimestamp) {
|
if(!this.enableConvertTimestamp) {
|
||||||
return '';
|
return '';
|
||||||
@@ -330,7 +367,7 @@ return baseclass.extend({
|
|||||||
E('label', {}),
|
E('label', {}),
|
||||||
]),
|
]),
|
||||||
E('div', { 'class': 'cbi-value-description' },
|
E('div', { 'class': 'cbi-value-description' },
|
||||||
_('Convert timestamps to a human readable date')
|
_('Convert timestamps to a human readable date.')
|
||||||
),
|
),
|
||||||
]),
|
]),
|
||||||
]);
|
]);
|
||||||
@@ -342,70 +379,52 @@ return baseclass.extend({
|
|||||||
'class': 'cbi-value-title',
|
'class': 'cbi-value-title',
|
||||||
'for' : 'timeFilter',
|
'for' : 'timeFilter',
|
||||||
}, _('Timestamp filter')),
|
}, _('Timestamp filter')),
|
||||||
E('div', { 'class': 'cbi-value-field' },
|
E('div', { 'class': 'cbi-value-field' }, [
|
||||||
E('span', { 'class': 'control-group' }, [
|
E('span', { 'class': 'control-group' }, [
|
||||||
this.timeFilter,
|
this.timeFilter,
|
||||||
E('button', {
|
E('button', {
|
||||||
'class': 'cbi-button btn',
|
'class': 'cbi-button-neutral btn',
|
||||||
'click': L.bind(ev => {
|
'click': ev => {
|
||||||
ev.target.blur();
|
ev.target.blur();
|
||||||
ev.preventDefault();
|
ev.preventDefault();
|
||||||
this.timeFilter.value = null;
|
this.timeFilter.value = null;
|
||||||
this.timeFilter.focus();
|
this.timeFilter.focus();
|
||||||
}, this),
|
},
|
||||||
}, '⌫'),
|
}, '⌫'),
|
||||||
])
|
this.timeFilterReBtn,
|
||||||
),
|
|
||||||
]);
|
|
||||||
},
|
|
||||||
|
|
||||||
makeLogtimeFilterReSection() {
|
|
||||||
return E('div', { 'class': 'cbi-value' }, [
|
|
||||||
E('label', {
|
|
||||||
'class': 'cbi-value-title',
|
|
||||||
'for' : 'timeFilterRe',
|
|
||||||
}, _('Filter is regexp')),
|
|
||||||
E('div', { 'class': 'cbi-value-field' }, [
|
|
||||||
E('div', { 'class': 'cbi-checkbox' }, [
|
|
||||||
this.timeFilterRe,
|
|
||||||
E('label', {}),
|
|
||||||
]),
|
]),
|
||||||
E('div', { 'class': 'cbi-value-description' },
|
E('div', { 'class': 'cbi-value-description' },
|
||||||
_('Apply timestamp filter as regular expression')
|
_('<code>!pattern</code> - entries that do not match the pattern.')
|
||||||
),
|
),
|
||||||
]),
|
]),
|
||||||
]);
|
]);
|
||||||
},
|
},
|
||||||
|
|
||||||
makeLogHostsDropdownItem(host) {
|
makeLogHostFilterSection() {
|
||||||
return E(
|
return E('div', { 'class': 'cbi-value' }, [
|
||||||
'span',
|
E('label', {
|
||||||
{ 'class': 'zonebadge log-host-dropdown-item' },
|
'class': 'cbi-value-title',
|
||||||
E('strong', host)
|
'for' : 'hostFilter',
|
||||||
);
|
}, _('Host filter')),
|
||||||
},
|
E('div', { 'class': 'cbi-value-field' }, [
|
||||||
|
E('span', { 'class': 'control-group' }, [
|
||||||
makeLogHostsDropdownSection() {
|
this.hostFilter,
|
||||||
this.logHostsDropdown = new ui.Dropdown(
|
E('button', {
|
||||||
null,
|
'class': 'cbi-button-neutral btn',
|
||||||
this.logHosts,
|
'click': ev => {
|
||||||
{
|
ev.target.blur();
|
||||||
id : 'logHostsDropdown',
|
ev.preventDefault();
|
||||||
multiple : true,
|
this.hostFilter.value = null;
|
||||||
select_placeholder: _('All'),
|
this.hostFilter.focus();
|
||||||
}
|
},
|
||||||
);
|
}, '⌫'),
|
||||||
return E(
|
this.hostFilterReBtn,
|
||||||
'div', { 'class': 'cbi-value' }, [
|
]),
|
||||||
E('label', {
|
E('div', { 'class': 'cbi-value-description' },
|
||||||
'class': 'cbi-value-title',
|
_('<code>!pattern</code> - entries that do not match the pattern.')
|
||||||
'for' : 'logHostsDropdown',
|
|
||||||
}, _('Hosts')),
|
|
||||||
E('div', { 'class': 'cbi-value-field' },
|
|
||||||
this.logHostsDropdown.render()
|
|
||||||
),
|
),
|
||||||
]
|
]),
|
||||||
);
|
]);
|
||||||
},
|
},
|
||||||
|
|
||||||
makeLogFacilitiesDropdownSection() {
|
makeLogFacilitiesDropdownSection() {
|
||||||
@@ -456,13 +475,13 @@ return baseclass.extend({
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
setRegexpValidator(elem, flag) {
|
setRegexpValidator(elem, flagEl) {
|
||||||
ui.addValidator(
|
ui.addValidator(
|
||||||
elem,
|
elem,
|
||||||
'string',
|
'string',
|
||||||
true,
|
true,
|
||||||
v => {
|
v => {
|
||||||
if(!flag.checked) {
|
if(!flagEl.checked()) {
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
try {
|
try {
|
||||||
@@ -485,10 +504,11 @@ return baseclass.extend({
|
|||||||
this.convertTimestampValue = this.convertTimestamp.checked;
|
this.convertTimestampValue = this.convertTimestamp.checked;
|
||||||
};
|
};
|
||||||
this.timeFilterValue = this.timeFilter.value;
|
this.timeFilterValue = this.timeFilter.value;
|
||||||
this.timeFilterReValue = this.timeFilterRe.checked;
|
this.timeFilterReValue = this.timeFilterReBtn.checked()
|
||||||
};
|
};
|
||||||
if(this.logHostsFlag) {
|
if(this.logHostFlag) {
|
||||||
this.hostFilterValue = this.logHostsDropdown.getValue();
|
this.hostFilterValue = this.hostFilter.value;
|
||||||
|
this.hostFilterReValue = this.hostFilterReBtn.checked()
|
||||||
};
|
};
|
||||||
if(this.logFacilitiesFlag) {
|
if(this.logFacilitiesFlag) {
|
||||||
this.facilityFilterValue = this.logFacilitiesDropdown.getValue();
|
this.facilityFilterValue = this.logFacilitiesDropdown.getValue();
|
||||||
@@ -497,7 +517,8 @@ return baseclass.extend({
|
|||||||
this.levelFilterValue = this.logLevelsDropdown.getValue();
|
this.levelFilterValue = this.logLevelsDropdown.getValue();
|
||||||
};
|
};
|
||||||
this.msgFilterValue = this.msgFilter.value;
|
this.msgFilterValue = this.msgFilter.value;
|
||||||
this.msgFilterReValue = this.msgFilterRe.checked;
|
this.msgFilterReValue = this.msgFilterReBtn.checked()
|
||||||
|
|
||||||
this.logSortingValue = this.logSorting.value;
|
this.logSortingValue = this.logSorting.value;
|
||||||
this.autoRefreshValue = this.autoRefresh.checked;
|
this.autoRefreshValue = this.autoRefresh.checked;
|
||||||
if(this.autorefreshOn) {
|
if(this.autorefreshOn) {
|
||||||
@@ -517,11 +538,12 @@ return baseclass.extend({
|
|||||||
if(this.enableConvertTimestamp) {
|
if(this.enableConvertTimestamp) {
|
||||||
this.convertTimestamp.checked = this.convertTimestampValue;
|
this.convertTimestamp.checked = this.convertTimestampValue;
|
||||||
};
|
};
|
||||||
this.timeFilter.value = this.timeFilterValue;
|
this.timeFilter.value = this.timeFilterValue;
|
||||||
this.timeFilterRe.checked = this.timeFilterReValue;
|
this.timeFilterReBtn.set(this.timeFilterReValue);
|
||||||
};
|
};
|
||||||
if(this.logHostsFlag) {
|
if(this.logHostFlag) {
|
||||||
this.logHostsDropdown.setValue(this.hostFilterValue);
|
this.hostFilter.value = this.hostFilterValue;
|
||||||
|
this.hostFilterReBtn.set(this.hostFilterReValue);
|
||||||
};
|
};
|
||||||
if(this.logFacilitiesFlag) {
|
if(this.logFacilitiesFlag) {
|
||||||
this.logFacilitiesDropdown.setValue(this.facilityFilterValue);
|
this.logFacilitiesDropdown.setValue(this.facilityFilterValue);
|
||||||
@@ -529,8 +551,9 @@ return baseclass.extend({
|
|||||||
if(this.logLevelsFlag) {
|
if(this.logLevelsFlag) {
|
||||||
this.logLevelsDropdown.setValue(this.levelFilterValue);
|
this.logLevelsDropdown.setValue(this.levelFilterValue);
|
||||||
};
|
};
|
||||||
this.msgFilter.value = this.msgFilterValue;
|
this.msgFilter.value = this.msgFilterValue;
|
||||||
this.msgFilterRe.checked = this.msgFilterReValue;
|
this.msgFilterReBtn.set(this.msgFilterReValue);
|
||||||
|
|
||||||
this.logSorting.value = this.logSortingValue;
|
this.logSorting.value = this.logSortingValue;
|
||||||
this.autoRefresh.checked = this.autoRefreshValue;
|
this.autoRefresh.checked = this.autoRefreshValue;
|
||||||
},
|
},
|
||||||
@@ -586,35 +609,63 @@ return baseclass.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
setStringFilter(entriesArray, fieldNum, pattern) {
|
setStringFilter(entriesArray, fieldNum, pattern) {
|
||||||
let fArr = [];
|
let not = pattern.startsWith('!');
|
||||||
|
pattern = pattern.replace(/^!/, '');
|
||||||
|
let isHFunc = (typeof(this.filterHighlightFunc) == 'function');
|
||||||
|
let fArr = [];
|
||||||
|
if(!pattern) {
|
||||||
|
return entriesArray;
|
||||||
|
};
|
||||||
entriesArray.forEach((e, i) => {
|
entriesArray.forEach((e, i) => {
|
||||||
if(e[fieldNum] !== null && e[fieldNum].includes(pattern)) {
|
if(e[fieldNum] == null) {
|
||||||
if(typeof(this.filterHighlightFunc) == 'function') {
|
return;
|
||||||
e[fieldNum] = e[fieldNum].replace(pattern, this.filterHighlightFunc);
|
};
|
||||||
|
if(not) {
|
||||||
|
if(!(e[fieldNum].includes(pattern))) {
|
||||||
|
fArr.push(e);
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
if(e[fieldNum].includes(pattern)) {
|
||||||
|
if(isHFunc) {
|
||||||
|
e[fieldNum] = e[fieldNum].replace(pattern, this.filterHighlightFunc);
|
||||||
|
};
|
||||||
|
fArr.push(e);
|
||||||
};
|
};
|
||||||
fArr.push(e);
|
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
return fArr;
|
return fArr;
|
||||||
},
|
},
|
||||||
|
|
||||||
setRegexpFilter(entriesArray, fieldNum, pattern, formElem) {
|
setRegexpFilter(entriesArray, fieldNum, pattern) {
|
||||||
let fArr = [];
|
let not = pattern.startsWith('!');
|
||||||
|
pattern = pattern.replace(/^!/, '');
|
||||||
|
let isHFunc = (typeof(this.filterHighlightFunc) == 'function');
|
||||||
|
let fArr = [];
|
||||||
|
if(!pattern) {
|
||||||
|
return entriesArray;
|
||||||
|
};
|
||||||
try {
|
try {
|
||||||
let regExp = new RegExp(pattern, 'giu');
|
let regExp = new RegExp(pattern, 'giu');
|
||||||
entriesArray.forEach((e, i) => {
|
entriesArray.forEach((e, i) => {
|
||||||
if(e[fieldNum] !== null && regExp.test(e[fieldNum])) {
|
if(e[fieldNum] == null) {
|
||||||
if(this.filterHighlightFunc) {
|
return;
|
||||||
e[fieldNum] = e[fieldNum].replace(regExp, this.filterHighlightFunc);
|
};
|
||||||
|
if(not) {
|
||||||
|
if(!(regExp.test(e[fieldNum]))) {
|
||||||
|
fArr.push(e);
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
if(regExp.test(e[fieldNum])) {
|
||||||
|
if(isHFunc) {
|
||||||
|
e[fieldNum] = e[fieldNum].replace(regExp, this.filterHighlightFunc);
|
||||||
|
};
|
||||||
|
fArr.push(e);
|
||||||
};
|
};
|
||||||
fArr.push(e);
|
|
||||||
};
|
};
|
||||||
regExp.lastIndex = 0;
|
regExp.lastIndex = 0;
|
||||||
});
|
});
|
||||||
} catch(err) {
|
} catch(err) {
|
||||||
if(err.name == 'SyntaxError') {
|
if(err.name == 'SyntaxError') {
|
||||||
ui.addNotification(null,
|
|
||||||
E('p', {}, _('Invalid regular expression') + ': ' + err.message));
|
|
||||||
return entriesArray;
|
return entriesArray;
|
||||||
} else {
|
} else {
|
||||||
throw err;
|
throw err;
|
||||||
@@ -629,20 +680,18 @@ return baseclass.extend({
|
|||||||
return entriesArray;
|
return entriesArray;
|
||||||
};
|
};
|
||||||
return (this.timeFilterReValue) ?
|
return (this.timeFilterReValue) ?
|
||||||
this.setRegexpFilter(entriesArray, 1, fPattern, this.timeFilter) :
|
this.setRegexpFilter(entriesArray, 1, fPattern) :
|
||||||
this.setStringFilter(entriesArray, 1, fPattern);
|
this.setStringFilter(entriesArray, 1, fPattern);
|
||||||
},
|
},
|
||||||
|
|
||||||
setHostFilter(entriesArray) {
|
setHostFilter(entriesArray) {
|
||||||
let logHostsKeys = Object.keys(this.logHosts);
|
let fPattern = this.hostFilterValue;
|
||||||
if(logHostsKeys.length > 0 && this.logHostsDropdown) {
|
if(!fPattern) {
|
||||||
this.logHostsDropdown.addChoices(logHostsKeys, this.logHosts);
|
return entriesArray;
|
||||||
if(this.hostFilterValue.length == 0) {
|
|
||||||
return entriesArray;
|
|
||||||
};
|
|
||||||
return entriesArray.filter(e => this.hostFilterValue.includes(e[2]));
|
|
||||||
};
|
};
|
||||||
return entriesArray;
|
return (this.hostFilterReValue) ?
|
||||||
|
this.setRegexpFilter(entriesArray, 2, fPattern) :
|
||||||
|
this.setStringFilter(entriesArray, 2, fPattern);
|
||||||
},
|
},
|
||||||
|
|
||||||
setFacilityFilter(entriesArray) {
|
setFacilityFilter(entriesArray) {
|
||||||
@@ -673,7 +722,7 @@ return baseclass.extend({
|
|||||||
return entriesArray;
|
return entriesArray;
|
||||||
};
|
};
|
||||||
return (this.msgFilterReValue) ?
|
return (this.msgFilterReValue) ?
|
||||||
this.setRegexpFilter(entriesArray, 5, fPattern, this.msgFilter) :
|
this.setRegexpFilter(entriesArray, 5, fPattern) :
|
||||||
this.setStringFilter(entriesArray, 5, fPattern);
|
this.setStringFilter(entriesArray, 5, fPattern);
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -803,19 +852,15 @@ return baseclass.extend({
|
|||||||
if(this.logTimestampFlag && !this.logTimeFilterElem) {
|
if(this.logTimestampFlag && !this.logTimeFilterElem) {
|
||||||
this.logTimeFilterElem = this.makeLogTimeFilterSection();
|
this.logTimeFilterElem = this.makeLogTimeFilterSection();
|
||||||
};
|
};
|
||||||
if(this.logTimestampFlag && !this.logtimeFilterReElem) {
|
if(this.logHostFlag && !this.logHostFilterElem) {
|
||||||
this.logtimeFilterReElem = this.makeLogtimeFilterReSection();
|
this.logHostFilterElem = this.makeLogHostFilterSection();
|
||||||
};
|
};
|
||||||
|
|
||||||
if(this.logFacilitiesFlag && !this.logFacilitiesDropdown) {
|
if(this.logFacilitiesFlag && !this.logFacilitiesDropdown) {
|
||||||
this.logFacilitiesDropdownElem = this.makeLogFacilitiesDropdownSection();
|
this.logFacilitiesDropdownElem = this.makeLogFacilitiesDropdownSection();
|
||||||
};
|
};
|
||||||
if(this.logLevelsFlag && !this.logLevelsDropdown) {
|
if(this.logLevelsFlag && !this.logLevelsDropdown) {
|
||||||
this.logLevelsDropdownElem = this.makeLogLevelsDropdownSection();
|
this.logLevelsDropdownElem = this.makeLogLevelsDropdownSection();
|
||||||
};
|
};
|
||||||
if(this.logHostsFlag && !this.logHostsDropdown) {
|
|
||||||
this.logHostsDropdownElem = this.makeLogHostsDropdownSection();
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
if(!autorefresh) {
|
if(!autorefresh) {
|
||||||
@@ -845,21 +890,20 @@ return baseclass.extend({
|
|||||||
E('span', { 'class': 'control-group' }, [
|
E('span', { 'class': 'control-group' }, [
|
||||||
this.tailInput,
|
this.tailInput,
|
||||||
E('button', {
|
E('button', {
|
||||||
'class': 'cbi-button btn',
|
'class': 'cbi-button-neutral btn',
|
||||||
'click': L.bind(ev => {
|
'click': ev => {
|
||||||
ev.target.blur();
|
ev.target.blur();
|
||||||
ev.preventDefault();
|
ev.preventDefault();
|
||||||
this.tailInput.value = 0;
|
this.tailInput.value = 0;
|
||||||
this.tailInput.focus();
|
this.tailInput.focus();
|
||||||
}, this),
|
},
|
||||||
}, '⌫'),
|
}, '⌫'),
|
||||||
])
|
])
|
||||||
),
|
),
|
||||||
]),
|
]),
|
||||||
this.logConvertTimestampElem,
|
this.logConvertTimestampElem,
|
||||||
this.logTimeFilterElem,
|
this.logTimeFilterElem,
|
||||||
this.logtimeFilterReElem,
|
this.logHostFilterElem,
|
||||||
this.logHostsDropdownElem,
|
|
||||||
this.logFacilitiesDropdownElem,
|
this.logFacilitiesDropdownElem,
|
||||||
this.logLevelsDropdownElem,
|
this.logLevelsDropdownElem,
|
||||||
E('div', { 'class': 'cbi-value' }, [
|
E('div', { 'class': 'cbi-value' }, [
|
||||||
@@ -867,33 +911,22 @@ return baseclass.extend({
|
|||||||
'class': 'cbi-value-title',
|
'class': 'cbi-value-title',
|
||||||
'for' : 'msgFilter',
|
'for' : 'msgFilter',
|
||||||
}, _('Message filter')),
|
}, _('Message filter')),
|
||||||
E('div', { 'class': 'cbi-value-field' },
|
E('div', { 'class': 'cbi-value-field' }, [
|
||||||
E('span', { 'class': 'control-group' }, [
|
E('span', { 'class': 'control-group' }, [
|
||||||
this.msgFilter,
|
this.msgFilter,
|
||||||
E('button', {
|
E('button', {
|
||||||
'class': 'cbi-button btn',
|
'class': 'cbi-button-neutral btn',
|
||||||
'click': L.bind(ev => {
|
'click': ev => {
|
||||||
ev.target.blur();
|
ev.target.blur();
|
||||||
ev.preventDefault();
|
ev.preventDefault();
|
||||||
this.msgFilter.value = null;
|
this.msgFilter.value = null;
|
||||||
this.msgFilter.focus();
|
this.msgFilter.focus();
|
||||||
}, this),
|
},
|
||||||
}, '⌫'),
|
}, '⌫'),
|
||||||
])
|
this.msgFilterReBtn,
|
||||||
)
|
|
||||||
]),
|
|
||||||
E('div', { 'class': 'cbi-value' }, [
|
|
||||||
E('label', {
|
|
||||||
'class': 'cbi-value-title',
|
|
||||||
'for' : 'msgFilterRe',
|
|
||||||
}, _('Filter is regexp')),
|
|
||||||
E('div', { 'class': 'cbi-value-field' }, [
|
|
||||||
E('div', { 'class': 'cbi-checkbox' }, [
|
|
||||||
this.msgFilterRe,
|
|
||||||
E('label', {}),
|
|
||||||
]),
|
]),
|
||||||
E('div', { 'class': 'cbi-value-description' },
|
E('div', { 'class': 'cbi-value-description' },
|
||||||
_('Apply message filter as regular expression')
|
_('<code>!pattern</code> - entries that do not match the pattern.')
|
||||||
),
|
),
|
||||||
]),
|
]),
|
||||||
]),
|
]),
|
||||||
@@ -1057,10 +1090,10 @@ return baseclass.extend({
|
|||||||
ui.addValidator(this.tailInput, 'uinteger', true);
|
ui.addValidator(this.tailInput, 'uinteger', true);
|
||||||
|
|
||||||
this.convertTimestamp = E('input', {
|
this.convertTimestamp = E('input', {
|
||||||
'id' : 'convertTimestamp',
|
'id' : 'convertTimestamp',
|
||||||
'name' : 'convertTimestamp',
|
'name': 'convertTimestamp',
|
||||||
'type' : 'checkbox',
|
'type': 'checkbox',
|
||||||
'form' : 'logFilterForm',
|
'form': 'logFilterForm',
|
||||||
});
|
});
|
||||||
this.convertTimestamp.checked = this.convertTimestampValue;
|
this.convertTimestamp.checked = this.convertTimestampValue;
|
||||||
|
|
||||||
@@ -1073,27 +1106,30 @@ return baseclass.extend({
|
|||||||
'placeholder': _('Type a search pattern...'),
|
'placeholder': _('Type a search pattern...'),
|
||||||
});
|
});
|
||||||
|
|
||||||
this.timeFilterRe = E('input', {
|
this.timeFilterReBtn = this.makeRegExpButton(this.timeFilter, this.timeFilterReValue);
|
||||||
'id' : 'timeFilterRe',
|
this.setRegexpValidator(this.timeFilter, this.timeFilterReBtn);
|
||||||
'name' : 'timeFilterRe',
|
|
||||||
'type' : 'checkbox',
|
this.hostFilter = E('input', {
|
||||||
'form' : 'logFilterForm',
|
'id' : 'hostFilter',
|
||||||
'change': ev => this.timeFilter.focus(),
|
'name' : 'hostFilter',
|
||||||
|
'type' : 'text',
|
||||||
|
'form' : 'logFilterForm',
|
||||||
|
'class' : 'cbi-input-text',
|
||||||
|
'placeholder': _('Type a search pattern...'),
|
||||||
});
|
});
|
||||||
|
|
||||||
this.setRegexpValidator(this.timeFilter, this.timeFilterRe);
|
this.hostFilterReBtn = this.makeRegExpButton(this.hostFilter, this.hostFilterReValue);
|
||||||
|
this.setRegexpValidator(this.hostFilter, this.hostFilterReBtn);
|
||||||
|
|
||||||
this.logConvertTimestampElem = '';
|
this.logConvertTimestampElem = '';
|
||||||
this.logTimeFilterElem = '';
|
this.logTimeFilterElem = '';
|
||||||
this.logtimeFilterReElem = '';
|
this.logHostFilterElem = '';
|
||||||
this.logHostsDropdownElem = '';
|
|
||||||
this.logFacilitiesDropdownElem = '';
|
this.logFacilitiesDropdownElem = '';
|
||||||
this.logLevelsDropdownElem = '';
|
this.logLevelsDropdownElem = '';
|
||||||
|
|
||||||
if(this.logTimestampFlag) {
|
if(this.logTimestampFlag) {
|
||||||
this.logConvertTimestampElem = this.makeLogConvertTimestampSection();
|
this.logConvertTimestampElem = this.makeLogConvertTimestampSection();
|
||||||
this.logTimeFilterElem = this.makeLogTimeFilterSection();
|
this.logTimeFilterElem = this.makeLogTimeFilterSection();
|
||||||
this.logtimeFilterReElem = this.makeLogtimeFilterReSection();
|
|
||||||
};
|
};
|
||||||
if(this.logLevelsFlag) {
|
if(this.logLevelsFlag) {
|
||||||
this.logLevelsDropdownElem = this.makeLogLevelsDropdownSection();
|
this.logLevelsDropdownElem = this.makeLogLevelsDropdownSection();
|
||||||
@@ -1101,8 +1137,8 @@ return baseclass.extend({
|
|||||||
if(this.logFacilitiesFlag) {
|
if(this.logFacilitiesFlag) {
|
||||||
this.logFacilitiesDropdownElem = this.makeLogFacilitiesDropdownSection();
|
this.logFacilitiesDropdownElem = this.makeLogFacilitiesDropdownSection();
|
||||||
};
|
};
|
||||||
if(this.logHostsFlag) {
|
if(this.logHostFlag) {
|
||||||
this.logHostsDropdownElem = this.makeLogHostsDropdownSection();
|
this.logHostFilterElem = this.makeLogHostFilterSection();
|
||||||
};
|
};
|
||||||
|
|
||||||
this.msgFilter = E('input', {
|
this.msgFilter = E('input', {
|
||||||
@@ -1114,15 +1150,8 @@ return baseclass.extend({
|
|||||||
'placeholder': _('Type a search pattern...'),
|
'placeholder': _('Type a search pattern...'),
|
||||||
});
|
});
|
||||||
|
|
||||||
this.msgFilterRe = E('input', {
|
this.msgFilterReBtn = this.makeRegExpButton(this.msgFilter, this.msgFilterReValue);
|
||||||
'id' : 'msgFilterRe',
|
this.setRegexpValidator(this.msgFilter, this.msgFilterReBtn);
|
||||||
'name' : 'msgFilterRe',
|
|
||||||
'type' : 'checkbox',
|
|
||||||
'form' : 'logFilterForm',
|
|
||||||
'change': ev => this.msgFilter.focus(),
|
|
||||||
});
|
|
||||||
|
|
||||||
this.setRegexpValidator(this.msgFilter, this.msgFilterRe);
|
|
||||||
|
|
||||||
this.logSorting = E('select', {
|
this.logSorting = E('select', {
|
||||||
'id' : 'logSorting',
|
'id' : 'logSorting',
|
||||||
|
|||||||
@@ -54,9 +54,6 @@ return baseclass.extend({
|
|||||||
|
|
||||||
// syslog-ng
|
// syslog-ng
|
||||||
syslog_ngHandler(strArray, lineNum) {
|
syslog_ngHandler(strArray, lineNum) {
|
||||||
if(!(strArray[2] in this.logHosts)) {
|
|
||||||
this.logHosts[strArray[2]] = this.makeLogHostsDropdownItem(strArray[2]);
|
|
||||||
};
|
|
||||||
return [
|
return [
|
||||||
lineNum, // # (Number)
|
lineNum, // # (Number)
|
||||||
strArray[1], // Timestamp (String)
|
strArray[1], // Timestamp (String)
|
||||||
@@ -130,8 +127,7 @@ return baseclass.extend({
|
|||||||
this.logTimestampFlag = true;
|
this.logTimestampFlag = true;
|
||||||
this.logFacilitiesFlag = true;
|
this.logFacilitiesFlag = true;
|
||||||
this.logLevelsFlag = true;
|
this.logLevelsFlag = true;
|
||||||
this.logHostsFlag = false;
|
this.logHostFlag = false;
|
||||||
this.logHosts = {};
|
|
||||||
this.entriesHandler = this.logdHandler;
|
this.entriesHandler = this.logdHandler;
|
||||||
this.logCols = [
|
this.logCols = [
|
||||||
'#',
|
'#',
|
||||||
@@ -148,7 +144,7 @@ return baseclass.extend({
|
|||||||
this.logTimestampFlag = true;
|
this.logTimestampFlag = true;
|
||||||
this.logFacilitiesFlag = false;
|
this.logFacilitiesFlag = false;
|
||||||
this.logLevelsFlag = false;
|
this.logLevelsFlag = false;
|
||||||
this.logHostsFlag = true;
|
this.logHostFlag = true;
|
||||||
this.logFacilities = {};
|
this.logFacilities = {};
|
||||||
this.logLevels = {};
|
this.logLevels = {};
|
||||||
this.entriesHandler = this.syslog_ngHandler;
|
this.entriesHandler = this.syslog_ngHandler;
|
||||||
|
|||||||
@@ -13,18 +13,21 @@ msgstr ""
|
|||||||
"Language: ru\n"
|
"Language: ru\n"
|
||||||
"X-Generator: Poedit 2.0.6\n"
|
"X-Generator: Poedit 2.0.6\n"
|
||||||
|
|
||||||
|
msgid "<code>!pattern</code> - entries that do not match the pattern."
|
||||||
|
msgstr "<code>!шаблон</code> - записи не совпадающие с шаблоном."
|
||||||
|
|
||||||
msgid "2nd level domains that are excluded from optimization"
|
msgid "2nd level domains that are excluded from optimization"
|
||||||
msgstr "Домены 2-го уровня не подлежащие оптимизации"
|
msgstr "Домены 2-го уровня не подлежащие оптимизации"
|
||||||
|
|
||||||
msgid "Add user entries to the blacklist when updating"
|
msgid "Add user entries to the blacklist when updating"
|
||||||
msgstr "Добавлять записи пользователя в блэклист при обновлении"
|
msgstr "Добавлять записи пользователя в блэклист при обновлении"
|
||||||
|
|
||||||
msgid "Alert"
|
|
||||||
msgstr "Тревога"
|
|
||||||
|
|
||||||
msgid "All"
|
msgid "All"
|
||||||
msgstr "Все"
|
msgstr "Все"
|
||||||
|
|
||||||
|
msgid "All entries"
|
||||||
|
msgstr "Все записи"
|
||||||
|
|
||||||
msgid "All entries except matching patterns"
|
msgid "All entries except matching patterns"
|
||||||
msgstr "Все записи, кроме соответствующих шаблонам"
|
msgstr "Все записи, кроме соответствующих шаблонам"
|
||||||
|
|
||||||
@@ -43,6 +46,9 @@ msgstr "Произошла ошибка при попытке получить
|
|||||||
msgid "Apply"
|
msgid "Apply"
|
||||||
msgstr "Применить"
|
msgstr "Применить"
|
||||||
|
|
||||||
|
msgid "Apply pattern as regular expression"
|
||||||
|
msgstr "Применять фильтр как регулярное выражение"
|
||||||
|
|
||||||
msgid "Apply proxy rules to router application traffic"
|
msgid "Apply proxy rules to router application traffic"
|
||||||
msgstr "Применять правила прокси к трафику приложений роутера"
|
msgstr "Применять правила прокси к трафику приложений роутера"
|
||||||
|
|
||||||
@@ -95,9 +101,6 @@ msgstr "Содержимое сохранено."
|
|||||||
msgid "Convert cyrillic domains to punycode"
|
msgid "Convert cyrillic domains to punycode"
|
||||||
msgstr "Конвертировать кириллические домены в punycode"
|
msgstr "Конвертировать кириллические домены в punycode"
|
||||||
|
|
||||||
msgid "Critical"
|
|
||||||
msgstr "Критическая ситуация"
|
|
||||||
|
|
||||||
msgid "Current schedule"
|
msgid "Current schedule"
|
||||||
msgstr "Текущее расписание"
|
msgstr "Текущее расписание"
|
||||||
|
|
||||||
@@ -110,9 +113,6 @@ msgstr "DNS сервер для FQDN записей списка исключе
|
|||||||
msgid "Day"
|
msgid "Day"
|
||||||
msgstr "День"
|
msgstr "День"
|
||||||
|
|
||||||
msgid "Debug"
|
|
||||||
msgstr "Отладка"
|
|
||||||
|
|
||||||
msgid "Description"
|
msgid "Description"
|
||||||
msgstr "Описание"
|
msgstr "Описание"
|
||||||
|
|
||||||
@@ -143,9 +143,6 @@ msgstr "Изменить"
|
|||||||
msgid "Edit entries"
|
msgid "Edit entries"
|
||||||
msgstr "Изменить записи"
|
msgstr "Изменить записи"
|
||||||
|
|
||||||
msgid "Emergency"
|
|
||||||
msgstr "Чрезвычайная ситуация"
|
|
||||||
|
|
||||||
msgid "Enable"
|
msgid "Enable"
|
||||||
msgstr "Включить"
|
msgstr "Включить"
|
||||||
|
|
||||||
@@ -245,9 +242,6 @@ msgstr "Режим ограничения IP адресов"
|
|||||||
msgid "IP subnet patterns (/24) that are excluded from optimization"
|
msgid "IP subnet patterns (/24) that are excluded from optimization"
|
||||||
msgstr "Шаблоны IP подсетей (/24) не подлежащих оптимизации"
|
msgstr "Шаблоны IP подсетей (/24) не подлежащих оптимизации"
|
||||||
|
|
||||||
msgid "Info"
|
|
||||||
msgstr "Информация"
|
|
||||||
|
|
||||||
msgid "Instance"
|
msgid "Instance"
|
||||||
msgstr "Экземпляр"
|
msgstr "Экземпляр"
|
||||||
|
|
||||||
@@ -305,6 +299,9 @@ msgstr "Минута"
|
|||||||
msgid "Module settings"
|
msgid "Module settings"
|
||||||
msgstr "Настройки модуля"
|
msgstr "Настройки модуля"
|
||||||
|
|
||||||
|
msgid "More entries"
|
||||||
|
msgstr "Больше записей"
|
||||||
|
|
||||||
msgid "Name"
|
msgid "Name"
|
||||||
msgstr "Имя"
|
msgstr "Имя"
|
||||||
|
|
||||||
@@ -323,9 +320,6 @@ msgstr "Нет данных"
|
|||||||
msgid "No entries available..."
|
msgid "No entries available..."
|
||||||
msgstr "Нет доступных записей..."
|
msgstr "Нет доступных записей..."
|
||||||
|
|
||||||
msgid "Notice"
|
|
||||||
msgstr "Сообщение"
|
|
||||||
|
|
||||||
msgid "Number of entries"
|
msgid "Number of entries"
|
||||||
msgstr "Кол-во записей"
|
msgstr "Кол-во записей"
|
||||||
|
|
||||||
@@ -598,9 +592,6 @@ msgstr "Режим VPN"
|
|||||||
msgid "VPN routing error! Need restart"
|
msgid "VPN routing error! Need restart"
|
||||||
msgstr "Ошибка маршрутизации VPN! Необходим перезапуск"
|
msgstr "Ошибка маршрутизации VPN! Необходим перезапуск"
|
||||||
|
|
||||||
msgid "Warning"
|
|
||||||
msgstr "Внимание"
|
|
||||||
|
|
||||||
msgid "all"
|
msgid "all"
|
||||||
msgstr "все"
|
msgstr "все"
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +1,19 @@
|
|||||||
msgid ""
|
msgid ""
|
||||||
msgstr "Content-Type: text/plain; charset=UTF-8"
|
msgstr "Content-Type: text/plain; charset=UTF-8"
|
||||||
|
|
||||||
|
msgid "<code>!pattern</code> - entries that do not match the pattern."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
msgid "2nd level domains that are excluded from optimization"
|
msgid "2nd level domains that are excluded from optimization"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
msgid "Add user entries to the blacklist when updating"
|
msgid "Add user entries to the blacklist when updating"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
msgid "Alert"
|
msgid "All"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
msgid "All"
|
msgid "All entries"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
msgid "All entries except matching patterns"
|
msgid "All entries except matching patterns"
|
||||||
@@ -28,6 +31,9 @@ msgstr ""
|
|||||||
msgid "Apply"
|
msgid "Apply"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
msgid "Apply pattern as regular expression"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
msgid "Apply proxy rules to router application traffic"
|
msgid "Apply proxy rules to router application traffic"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
@@ -80,9 +86,6 @@ msgstr ""
|
|||||||
msgid "Convert cyrillic domains to punycode"
|
msgid "Convert cyrillic domains to punycode"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
msgid "Critical"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
msgid "Current schedule"
|
msgid "Current schedule"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
@@ -95,9 +98,6 @@ msgstr ""
|
|||||||
msgid "Day"
|
msgid "Day"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
msgid "Debug"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
msgid "Description"
|
msgid "Description"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
@@ -128,8 +128,6 @@ msgstr ""
|
|||||||
msgid "Edit entries"
|
msgid "Edit entries"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
msgid "Emergency"
|
|
||||||
msgstr ""
|
|
||||||
msgid "Enable"
|
msgid "Enable"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
@@ -226,9 +224,6 @@ msgstr ""
|
|||||||
msgid "IP subnet patterns (/24) that are excluded from optimization"
|
msgid "IP subnet patterns (/24) that are excluded from optimization"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
msgid "Info"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
msgid "Instance"
|
msgid "Instance"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
@@ -286,6 +281,9 @@ msgstr ""
|
|||||||
msgid "Module settings"
|
msgid "Module settings"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
msgid "More entries"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
msgid "Name"
|
msgid "Name"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
@@ -304,9 +302,6 @@ msgstr ""
|
|||||||
msgid "No entries available..."
|
msgid "No entries available..."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
msgid "Notice"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
msgid "Number of entries"
|
msgid "Number of entries"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
@@ -553,9 +548,6 @@ msgstr ""
|
|||||||
msgid "VPN routing error! Need restart"
|
msgid "VPN routing error! Need restart"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
msgid "Warning"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
msgid "all"
|
msgid "all"
|
||||||
msgstr "все"
|
msgstr "все"
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=ruantiblock-mod-lua
|
PKG_NAME:=ruantiblock-mod-lua
|
||||||
PKG_VERSION:=2.1.6
|
PKG_VERSION:=2.1.7
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=1
|
||||||
PKG_MAINTAINER:=gSpot <https://github.com/gSpotx2f/ruantiblock_openwrt>
|
PKG_MAINTAINER:=gSpot <https://github.com/gSpotx2f/ruantiblock_openwrt>
|
||||||
|
|
||||||
@@ -35,6 +35,7 @@ define Package/$(PKG_NAME)/install
|
|||||||
$(INSTALL_BIN) ./files/usr/libexec/ruantiblock/ruab_parser.lua $(1)/usr/libexec/ruantiblock/ruab_parser.lua
|
$(INSTALL_BIN) ./files/usr/libexec/ruantiblock/ruab_parser.lua $(1)/usr/libexec/ruantiblock/ruab_parser.lua
|
||||||
$(INSTALL_DIR) $(1)/usr/lib/lua
|
$(INSTALL_DIR) $(1)/usr/lib/lua
|
||||||
$(INSTALL_DATA) ./files/usr/lib/lua/iptool.lua $(1)/usr/lib/lua/iptool.lua
|
$(INSTALL_DATA) ./files/usr/lib/lua/iptool.lua $(1)/usr/lib/lua/iptool.lua
|
||||||
|
$(INSTALL_DATA) ./files/usr/lib/lua/idn.lua $(1)/usr/lib/lua/idn.lua
|
||||||
endef
|
endef
|
||||||
|
|
||||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
$(eval $(call BuildPackage,$(PKG_NAME)))
|
||||||
|
|||||||
@@ -0,0 +1,337 @@
|
|||||||
|
--[[
|
||||||
|
GitHub: https://github.com/haste/lua-idn/
|
||||||
|
|
||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2011 Trond A Ekseth <troeks@gmail.com>
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person
|
||||||
|
obtaining a copy of this software and associated documentation
|
||||||
|
files (the "Software"), to deal in the Software without
|
||||||
|
restriction, including without limitation the rights to use,
|
||||||
|
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the
|
||||||
|
Software is furnished to do so, subject to the following
|
||||||
|
conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be
|
||||||
|
included in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||||
|
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||||
|
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||||
|
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||||
|
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
|
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||||
|
OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
--]]
|
||||||
|
|
||||||
|
local bit = require'bit'
|
||||||
|
|
||||||
|
local base = 36
|
||||||
|
local tmin = 1
|
||||||
|
local tmax = 26
|
||||||
|
local skew = 38
|
||||||
|
local damp = 700
|
||||||
|
local initial_bias = 72
|
||||||
|
local initial_n = 0x80
|
||||||
|
local delimiter = 0x2D
|
||||||
|
|
||||||
|
-- Bias adaptation function
|
||||||
|
local adapt = function(delta, numpoints, firsttime)
|
||||||
|
if(firsttime) then
|
||||||
|
delta = math.floor(delta / damp)
|
||||||
|
else
|
||||||
|
delta = bit.rshift(delta, 1)
|
||||||
|
end
|
||||||
|
|
||||||
|
delta = delta + math.floor(delta / numpoints)
|
||||||
|
|
||||||
|
local k = 0
|
||||||
|
while(delta > math.floor(((base - tmin) * tmax) / 2)) do
|
||||||
|
delta = math.floor(delta / (base - tmin))
|
||||||
|
k = k + base
|
||||||
|
end
|
||||||
|
|
||||||
|
return math.floor(k + (base - tmin + 1) * delta / (delta + skew))
|
||||||
|
end
|
||||||
|
|
||||||
|
-- tests whether cp is a basic code point:
|
||||||
|
local basic = function(cp)
|
||||||
|
return cp < 0x80
|
||||||
|
end
|
||||||
|
|
||||||
|
local offset = {0, 0x3000, 0xE0000, 0x3C00000}
|
||||||
|
local utf8code = function(U, ...)
|
||||||
|
local numBytes = select('#', ...)
|
||||||
|
for i=1, numBytes do
|
||||||
|
local b = select(i, ...)
|
||||||
|
U = bit.lshift(U, 6) + bit.band(b, 63)
|
||||||
|
end
|
||||||
|
|
||||||
|
return U - offset[numBytes + 1]
|
||||||
|
end
|
||||||
|
|
||||||
|
local toUCS4 = function(str)
|
||||||
|
local out = {}
|
||||||
|
for c in str:gmatch'([%z\1-\127\194-\244][\128-\191]*)' do
|
||||||
|
table.insert(out, utf8code(string.byte(c, 1, -1)))
|
||||||
|
end
|
||||||
|
|
||||||
|
return out
|
||||||
|
end
|
||||||
|
|
||||||
|
local toUnicode = function(n)
|
||||||
|
if(n < 128) then
|
||||||
|
return string.char(n)
|
||||||
|
elseif(n < 2048) then
|
||||||
|
return string.char(192 + ((n - (n % 64)) / 64), 128 + (n % 64))
|
||||||
|
else
|
||||||
|
return string.char(224 + ((n - (n % 4096)) / 4096), 128 + (((n % 4096) - (n % 64)) / 64), 128 + (n % 64))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local punycode_encode
|
||||||
|
do
|
||||||
|
-- returns the basic code point whose value
|
||||||
|
-- (when used for representing integers) is d, which needs to be in
|
||||||
|
-- the range 0 to base-1.
|
||||||
|
local encode_digit = function(d)
|
||||||
|
return d + 22 + 75 * (d < 26 and 1 or 0)
|
||||||
|
-- 0..25 map to ASCII a..z
|
||||||
|
-- 26..35 map to ASCII 0..9
|
||||||
|
end
|
||||||
|
|
||||||
|
function punycode_encode(input)
|
||||||
|
if(type(input) == 'string') then
|
||||||
|
input = toUCS4(input)
|
||||||
|
end
|
||||||
|
|
||||||
|
local output = {}
|
||||||
|
|
||||||
|
-- Initialize the state
|
||||||
|
local n = initial_n
|
||||||
|
local delta = 0
|
||||||
|
local bias = initial_bias
|
||||||
|
|
||||||
|
-- Handle the basic code poinst
|
||||||
|
for j = 1, #input do
|
||||||
|
local c = input[j]
|
||||||
|
if(basic(c)) then
|
||||||
|
table.insert(output, string.char(c))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local h = #output
|
||||||
|
local b = h
|
||||||
|
|
||||||
|
-- h is the number of code points that have been handled, b is the
|
||||||
|
-- number of basic code points.
|
||||||
|
|
||||||
|
if(b > 0) then
|
||||||
|
table.insert(output, string.char(delimiter))
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Main encoding loop
|
||||||
|
while(h < #input) do
|
||||||
|
-- All non-basic code points < n have been
|
||||||
|
-- handled already. Find the next larger one
|
||||||
|
local m = math.huge
|
||||||
|
for j = 1, #input do
|
||||||
|
local c = input[j]
|
||||||
|
if(c >= n and c < m) then
|
||||||
|
m = c
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
delta = delta + (m - n) * (h + 1)
|
||||||
|
n = m
|
||||||
|
|
||||||
|
for j = 1, #input do
|
||||||
|
local cp = input[j]
|
||||||
|
if(cp < n) then
|
||||||
|
delta = delta + 1
|
||||||
|
end
|
||||||
|
|
||||||
|
if(cp == n) then
|
||||||
|
local q = delta
|
||||||
|
local k = base
|
||||||
|
while(true) do
|
||||||
|
local t
|
||||||
|
if(k <= bias) then
|
||||||
|
t = tmin
|
||||||
|
else
|
||||||
|
if(k >= bias + tmax) then
|
||||||
|
t = tmax
|
||||||
|
else
|
||||||
|
t = k - bias
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if(q < t) then break end
|
||||||
|
|
||||||
|
table.insert(output, string.char(encode_digit(t + (q - t) % (base - t))))
|
||||||
|
q = math.floor((q - t) / (base - t))
|
||||||
|
|
||||||
|
k = k + base
|
||||||
|
end
|
||||||
|
|
||||||
|
table.insert(output, string.char(encode_digit(q)))
|
||||||
|
bias = adapt(delta, h + 1, h == b)
|
||||||
|
delta = 0
|
||||||
|
h = h +1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
delta = delta + 1
|
||||||
|
n = n + 1
|
||||||
|
end
|
||||||
|
|
||||||
|
return table.concat(output)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local punycode_decode
|
||||||
|
do
|
||||||
|
local decode_digit = function(d)
|
||||||
|
if(d - 48 < 10) then
|
||||||
|
return d - 22
|
||||||
|
elseif(d - 65 < 26) then
|
||||||
|
return d - 65
|
||||||
|
elseif(d - 97 < 26) then
|
||||||
|
return d - 97
|
||||||
|
else
|
||||||
|
return base
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function punycode_decode(input)
|
||||||
|
if(type(input) == 'string') then
|
||||||
|
input = toUCS4(input)
|
||||||
|
end
|
||||||
|
|
||||||
|
local output = {}
|
||||||
|
|
||||||
|
-- Initialize the state
|
||||||
|
local n = initial_n
|
||||||
|
local i = 0
|
||||||
|
local out = 1
|
||||||
|
local bias = initial_bias
|
||||||
|
|
||||||
|
local b = 1
|
||||||
|
for j = 1, #input do
|
||||||
|
if(input[j] == delimiter) then
|
||||||
|
b = j
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
for j = 1, #input do
|
||||||
|
local c = input[j]
|
||||||
|
if(not basic(c)) then return nil, 'Invalid input' end
|
||||||
|
end
|
||||||
|
|
||||||
|
for j = 1, b - 1 do
|
||||||
|
local c = input[j]
|
||||||
|
output[out] = toUnicode(c)
|
||||||
|
out = out + 1
|
||||||
|
end
|
||||||
|
|
||||||
|
local index = 1
|
||||||
|
if(b > 1) then
|
||||||
|
index = b + 1
|
||||||
|
end
|
||||||
|
|
||||||
|
local inputLength = #input
|
||||||
|
while(index <= inputLength) do
|
||||||
|
local oldi = i
|
||||||
|
local w = 1
|
||||||
|
local k = base
|
||||||
|
|
||||||
|
while(true) do
|
||||||
|
if(index > inputLength) then return nil, 'Bad input' end
|
||||||
|
local digit = decode_digit(input[index])
|
||||||
|
if(digit >= base) then return nil, 'Bad input' end
|
||||||
|
index = index + 1
|
||||||
|
i = i + (digit * w)
|
||||||
|
|
||||||
|
local t
|
||||||
|
if(k <= bias) then
|
||||||
|
t = tmin
|
||||||
|
elseif(k >= bias + tmax) then
|
||||||
|
t = tmax
|
||||||
|
else
|
||||||
|
t = k - bias
|
||||||
|
end
|
||||||
|
|
||||||
|
if(digit < t) then
|
||||||
|
break
|
||||||
|
end
|
||||||
|
|
||||||
|
w = w * (base - t)
|
||||||
|
|
||||||
|
k = k + base
|
||||||
|
end
|
||||||
|
|
||||||
|
bias = adapt(i - oldi, out, oldi == 0)
|
||||||
|
|
||||||
|
n = n + math.floor(i / (out))
|
||||||
|
i = (i % out) + 1
|
||||||
|
|
||||||
|
table.insert(output, i, toUnicode(n))
|
||||||
|
out = out + 1
|
||||||
|
end
|
||||||
|
|
||||||
|
return table.concat(output)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local idn_encode
|
||||||
|
do
|
||||||
|
function idn_encode(domain)
|
||||||
|
local labels = {}
|
||||||
|
for label in domain:gmatch('([^.]+)%.?') do
|
||||||
|
-- Domain names can only consist of a-z, A-Z, 0-9, - and aren't allowed
|
||||||
|
-- to start or end with a hyphen
|
||||||
|
local first, last = label:sub(1, 1), label:sub(-1)
|
||||||
|
if(first == '-' or last == '-') then
|
||||||
|
return nil, 'Invalid DNS label'
|
||||||
|
end
|
||||||
|
|
||||||
|
if(label:match('^[a-zA-Z0-9-]+$')) then
|
||||||
|
table.insert(labels, label)
|
||||||
|
elseif(label:sub(1,1) ~= '-' and label:sub(2,2) ~= '-') then
|
||||||
|
local plabel = punycode_encode(label)
|
||||||
|
table.insert(labels, string.format('xn--%s', plabel))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return table.concat(labels, '.')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local idn_decode
|
||||||
|
do
|
||||||
|
function idn_decode(domain)
|
||||||
|
local labels = {}
|
||||||
|
for label in domain:gmatch('([^.]+)%.?') do
|
||||||
|
if(label:sub(1, 4) == 'xn--') then
|
||||||
|
table.insert(labels, punycode_decode(label:sub(5)))
|
||||||
|
elseif(label:match('^[a-zA-Z0-9-]+$')) then
|
||||||
|
table.insert(labels, label)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return table.concat(labels, '.')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return {
|
||||||
|
encode = idn_encode,
|
||||||
|
decode = idn_decode,
|
||||||
|
|
||||||
|
punycode = {
|
||||||
|
encode = punycode_encode,
|
||||||
|
decode = punycode_decode,
|
||||||
|
},
|
||||||
|
}
|
||||||
@@ -309,7 +309,7 @@ function BlackListParser:convert_encoding(input)
|
|||||||
if self.ICONV_TYPE == "lua" and self.iconv_handler then
|
if self.ICONV_TYPE == "lua" and self.iconv_handler then
|
||||||
output = self.iconv_handler:iconv(input)
|
output = self.iconv_handler:iconv(input)
|
||||||
elseif self.ICONV_TYPE == "standalone" and self.ICONV_CMD then
|
elseif self.ICONV_TYPE == "standalone" and self.ICONV_CMD then
|
||||||
local iconv_handler = assert(io.popen('printf \'' .. input .. '\' | ' .. self.ICONV_CMD .. ' -f "' .. self.site_encoding .. '" -t "' .. self.encoding .. '"', 'r'))
|
local iconv_handler = assert(io.popen('printf \'%s\' \'' .. input .. '\' | ' .. self.ICONV_CMD .. ' -f "' .. self.site_encoding .. '" -t "' .. self.encoding .. '"', 'r'))
|
||||||
output = iconv_handler:read("*a")
|
output = iconv_handler:read("*a")
|
||||||
iconv_handler:close()
|
iconv_handler:close()
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=ruantiblock-mod-py
|
PKG_NAME:=ruantiblock-mod-py
|
||||||
PKG_VERSION:=2.1.6
|
PKG_VERSION:=2.1.7
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=1
|
||||||
PKG_MAINTAINER:=gSpot <https://github.com/gSpotx2f/ruantiblock_openwrt>
|
PKG_MAINTAINER:=gSpot <https://github.com/gSpotx2f/ruantiblock_openwrt>
|
||||||
|
|
||||||
|
|||||||
@@ -5,8 +5,8 @@
|
|||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=ruantiblock
|
PKG_NAME:=ruantiblock
|
||||||
PKG_VERSION:=2.1.6
|
PKG_VERSION:=2.1.7
|
||||||
PKG_RELEASE:=3
|
PKG_RELEASE:=1
|
||||||
PKG_MAINTAINER:=gSpot <https://github.com/gSpotx2f/ruantiblock_openwrt>
|
PKG_MAINTAINER:=gSpot <https://github.com/gSpotx2f/ruantiblock_openwrt>
|
||||||
|
|
||||||
include $(INCLUDE_DIR)/package.mk
|
include $(INCLUDE_DIR)/package.mk
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ config main 'config'
|
|||||||
option bllist_sd_limit '16'
|
option bllist_sd_limit '16'
|
||||||
option bllist_fqdn_filter '1'
|
option bllist_fqdn_filter '1'
|
||||||
option bllist_fqdn_filter_type '0'
|
option bllist_fqdn_filter_type '0'
|
||||||
option bllist_enable_idn '0'
|
option bllist_enable_idn '1'
|
||||||
option bllist_alt_nslookup '0'
|
option bllist_alt_nslookup '0'
|
||||||
option bllist_alt_dns_addr '8.8.8.8'
|
option bllist_alt_dns_addr '8.8.8.8'
|
||||||
|
|
||||||
|
|||||||
@@ -140,7 +140,7 @@ BLLIST_FQDN_EXCLUDED_FILE="/etc/ruantiblock/fqdn_excluded"
|
|||||||
### Обрезка www[0-9]. в FQDN (0 - выкл, 1 - вкл)
|
### Обрезка www[0-9]. в FQDN (0 - выкл, 1 - вкл)
|
||||||
BLLIST_STRIP_WWW=1
|
BLLIST_STRIP_WWW=1
|
||||||
### Преобразование кириллических доменов в punycode (0 - выкл, 1 - вкл)
|
### Преобразование кириллических доменов в punycode (0 - выкл, 1 - вкл)
|
||||||
BLLIST_ENABLE_IDN=0
|
BLLIST_ENABLE_IDN=1
|
||||||
### Перенаправлять DNS-запросы на альтернативный DNS-сервер для заблокированных FQDN (0 - выкл, 1 - вкл)
|
### Перенаправлять DNS-запросы на альтернативный DNS-сервер для заблокированных FQDN (0 - выкл, 1 - вкл)
|
||||||
BLLIST_ALT_NSLOOKUP=0
|
BLLIST_ALT_NSLOOKUP=0
|
||||||
### Альтернативный DNS-сервер
|
### Альтернативный DNS-сервер
|
||||||
|
|||||||
Reference in New Issue
Block a user