Skip to content

Commit

Permalink
Release 2022.02.13
Browse files Browse the repository at this point in the history
  • Loading branch information
seud0nym committed Feb 13, 2022
1 parent 90a190a commit d3621ad
Show file tree
Hide file tree
Showing 7 changed files with 58,879 additions and 58,469 deletions.
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"customised",
"customising",
"cwmp",
"CWMPD",
"DDNS",
"DECT",
"DLNA",
Expand Down
17 changes: 17 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
2022.02.13
==========
* tch-gui-unhide: Added per-client device bandwidth monitoring
* tch-gui-unhide: Zel072 DoH Servers list no longer available and has been removed (#57)
* tch-gui-unhide: Add CUPS and IPP links for found USB printers to Printer Sharing screen, and show found USB Printers on Printer Sharing card (#66)
* tch-gui-unhide: Updated FW 17.2 Printer Sharing GUI functionality to match later firmware
* tch-gui-unhide: Fixed hard-coded references to wl1_2 interface (#68)
* tch-gui-unhide: Additional FXS2 device not removed from Telephony Codecs tab on DJA0231
* tch-gui-unhide: Fixed bug that changed card visibility and sequence after tch-gui-unhide upgrade
* tch-gui-unhide: Fixed bug that caused previously minified code to not be detected during tch-gui-unhide upgrade
* tch-gui-unhide-xtra.wireguard: Fixed peer configuration display when experimental GUI code minification enabled
* tch-gui-unhide-xtra.wireguard: Fixed WireGuard card icon not displaying in Telstra themes
* tch-gui-unhide-cards: Show 5 cards across if that is how GUI is configured
* de-telstra: Enabled the CUPS Web Interface and disable Deny-CUPS-lan firewall rules when Printer Sharing enabled (#66)
* de-telstra: Help text did not display default values for the -hd and -hs options (#67)
* de-telstra: When the Guest WiFi was removed on FW 18.1.c and later, the operating system would change the backhaul WiFi to wl1_1 but the wireless configuration stayed as wl1_2 (#68). Run de-telstra with no options to fix an existing installation that has had the Guest WiFi removed.

2022.02.02
==========
* tch-gui-unhide: Manual update recommended, as there are changes to de-telstra, mtd-backup, mtd-restore and reset-to-factory-defaults-with-root
Expand Down
2 changes: 1 addition & 1 deletion VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2022.02.02
2022.02.13
64 changes: 22 additions & 42 deletions extras/tch-gui-unhide-xtra.wireguard
Original file line number Diff line number Diff line change
Expand Up @@ -868,17 +868,27 @@ SH
-- Enable localization
gettext.textdomain('webui-core')
local wireguard_helper = require("wireguard_helper")
local ui_helper = require("web.ui_helper")
local ngx = ngx
local session = ngx.ctx.session
local modalPath = "/modals/wireguard-modal.lp"
if session:hasAccess(modalPath) then
local wireguard_helper = require("wireguard_helper")
local ui_helper = require("web.ui_helper")
local TGU_Config = ngx.shared.TGU_Config
local theme = TGU_Config:get("THEME") or ""
if string.find(theme,"^telstra") then
ngx.print('<style>\
:root {\
--RGB_SYM: #EAEAEA;\
}\
</style>')
end
local html = wireguard_helper.getWireguardCardHTML()
ngx.print('\
<div class="span3">\
<div class="smallcard">\
'); ngx.print(ui_helper.createCardHeader(T"WireGuard",modalPath)); ngx.print('\
',ui_helper.createCardHeader(T"WireGuard",modalPath),'\
<div class="content">\
<div style="position:absolute;z-index:0;bottom:5px;right:5px;height:95px;width:95px;visibility:var(--ICONS);">\
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 65 65" fill="#fff" fill-rule="evenodd" stroke="#000" stroke-linecap="round" stroke-linejoin="round">\
Expand All @@ -889,10 +899,7 @@ if session:hasAccess(modalPath) then
</symbol>\
</svg>\
</div>\
<div class="wireguard-card-content">\
');
ngx.print(html);
ngx.print('\
<div class="wireguard-card-content">',html,'\
</div>\
</div>\
</div>\
Expand Down Expand Up @@ -955,6 +962,7 @@ QR
-- Enable localization
gettext.textdomain('webui-code')
local common = require("common_helper")
local content_helper = require("web.content_helper")
local message_helper = require("web.uimessage_helper")
local post_helper = require("web.post_helper")
Expand Down Expand Up @@ -1167,16 +1175,7 @@ for _,v in ipairs(all_intfs) do
end
end
local config_template ="[Interface]\
PrivateKey = %s\
Address = %s\
\
[Peer]\
PublicKey = %s\
PresharedKey = %s\
AllowedIPs = 0.0.0.0/0%s\
Endpoint = %s\
"
local config_template ="[Interface]\nPrivateKey = %s\nAddress = %s\n\n[Peer]\nPublicKey = %s\nPresharedKey = %s\nAllowedIPs = 0.0.0.0/0%s\nEndpoint = %s\n"
local function validateLogLevel(value,_,_)
if value == "none" or value == "debug" then
Expand Down Expand Up @@ -1394,8 +1393,8 @@ local peer_filter = function(data)
else
data.latest_handshake = os.date("%Y-%m-%d %T",tonumber(untaint(peer.latest_handshake)))
end
data.transfer_rx = wireguard_helper.bytes2string(peer.transfer_rx)
data.transfer_tx = wireguard_helper.bytes2string(peer.transfer_tx)
data.transfer_rx = common.bytes2string(peer.transfer_rx)
data.transfer_tx = common.bytes2string(peer.transfer_tx)
if data.endpoint == "(none)" and peer.endpoint_host ~= "" then
data.endpoint = format("%s:%s",peer.endpoint_host,peer.endpoint_port)
end
Expand Down Expand Up @@ -1613,6 +1612,7 @@ $("#do-import").click(function(){\
');
MOD
cat <<"HLP" > /www/lua/wireguard_helper.lua
local common = require("common_helper")
local content_helper = require("web.content_helper")
local ui_helper = require("web.ui_helper")
local proxy = require("datamodel")
Expand All @@ -1624,26 +1624,6 @@ local find,format,gmatch,lower,match = string.find,string.format,string.gmatch,s
local M = {}
function M.bytes2string(s_bytes)
if s_bytes=="" then
return "0<small>B</small>"
else
local bytes = tonumber(untaint(s_bytes))
local kb = bytes/1024
local mb = kb/1024
local gb = mb/1024
if gb >= 1 then
return format("%.1f",gb).."<small>GB</small>"
elseif mb >= 1 then
return format("%.1f",mb).."<small>MB</small>"
elseif kb >= 1 then
return format("%.1f",kb).."<small>KB</small>"
else
return format("%d",s_bytes).."<small>B</small>"
end
end
end
function M.getWireguardCardHTML()
local content = {
server = "[email protected]",
Expand Down Expand Up @@ -1693,7 +1673,7 @@ function M.getWireguardCardHTML()
elseif content.server == "1" then
html[#html+1] = '<p class="subinfos">'
html[#html+1] = format("%s of %s server peers active<br>",content.server_active_peers,content.server_peers)
html[#html+1] = format(transfer_pattern,M.bytes2string(content.server_tx_bytes),M.bytes2string(content.server_rx_bytes))
html[#html+1] = format(transfer_pattern,common.bytes2string(content.server_tx_bytes),common.bytes2string(content.server_rx_bytes))
html[#html+1] = '</p>'
end
if #interfaces > 1 then
Expand All @@ -1702,7 +1682,7 @@ function M.getWireguardCardHTML()
else
html[#html+1] = ui_helper.createSimpleLight("1",T(format("VPN Client %s active",content.client_interfaces)))
html[#html+1] = '<p class="subinfos">'
html[#html+1] = format(transfer_pattern,M.bytes2string(content.client_tx_bytes),M.bytes2string(content.client_rx_bytes))
html[#html+1] = format(transfer_pattern,common.bytes2string(content.client_tx_bytes),common.bytes2string(content.client_rx_bytes))
if content.external_ipv4_address or content.external_ipv6_address then
html[#html+1] = format(T'External IP: <strong style="letter-spacing:-1px"><span style="font-size:12px">%s</span></strong>',content.external_ipv4_address)
html[#html+1] = format(T'<br><strong style="letter-spacing:-1px"><span style="font-size:12px">%s</span></strong>',content.external_ipv6_address)
Expand All @@ -1714,7 +1694,7 @@ function M.getWireguardCardHTML()
elseif tonumber(content.client_interface_count) > 1 then
html[#html+1] = ui_helper.createSimpleLight("1",T(format('%s of %s VPN Clients active',content.client_active_peers,content.client_interface_count)))
html[#html+1] = '<p class="subinfos">'
html[#html+1] = format(transfer_pattern,M.bytes2string(content.client_tx_bytes),M.bytes2string(content.client_rx_bytes))
html[#html+1] = format(transfer_pattern,common.bytes2string(content.client_tx_bytes),common.bytes2string(content.client_rx_bytes))
html[#html+1] = '</p>'
end
Expand Down
Loading

0 comments on commit d3621ad

Please sign in to comment.