diff options
Diffstat (limited to 'applications/luci-app-wireguard')
8 files changed, 31 insertions, 3 deletions
diff --git a/applications/luci-app-wireguard/luasrc/view/wireguard.htm b/applications/luci-app-wireguard/luasrc/view/wireguard.htm index 444533275e..6ec9ddb368 100644 --- a/applications/luci-app-wireguard/luasrc/view/wireguard.htm +++ b/applications/luci-app-wireguard/luasrc/view/wireguard.htm @@ -9,6 +9,13 @@ local last_device = "" local enc = { } + local function wg_clean(value) + if value and value == "(none)" then + value = "" + end + return value + end + local wg_dump = io.popen("wg show all dump") if wg_dump then local line @@ -33,7 +40,7 @@ address = value end end - enc[line[1]] = "[Interface]\nPrivateKey = " ..line[2].. "\nAddress = " ..address + enc[line[1]] = "[Interface]\nPrivateKey = " ..wg_clean(line[2]).. "\nAddress = " ..address else local peer = { public_key = line[2], @@ -53,7 +60,7 @@ end end table.insert(data[line[1]].peers, peer) - enc[line[1]] = enc[line[1]].. "\n\n[Peer]\nEndpoint = " ..line[4].. "\nPublicKey = " ..line[2].. "\nAllowedIPs = " ..line[5] + enc[line[1]] = enc[line[1]].. "\n\n[Peer]\nEndpoint = " ..wg_clean(line[4]).. "\nPublicKey = " ..wg_clean(line[2]).. "\nAllowedIPs = " ..wg_clean(line[5]) end end end @@ -194,7 +201,7 @@ for ikey, iface in pairs(data) do <%- local qrcode if fs.access("/usr/bin/qrencode") then - if enc[ikey]:sub(26,31) ~= "(none)" then + if enc[ikey]:sub(26, 26) ~= "\n" then qrcode = luci.sys.exec("/usr/bin/qrencode --inline --8bit --type=SVG --output=- '" ..enc[ikey].. "'") end else diff --git a/applications/luci-app-wireguard/po/ja/wireguard.po b/applications/luci-app-wireguard/po/ja/wireguard.po index 5cd7a90037..921ede1244 100644 --- a/applications/luci-app-wireguard/po/ja/wireguard.po +++ b/applications/luci-app-wireguard/po/ja/wireguard.po @@ -58,6 +58,9 @@ msgstr "永続的なキープアライブ" msgid "Public Key" msgstr "公開鍵" +msgid "Show/Hide QR-Code" +msgstr "" + msgid "WireGuard Status" msgstr "WireGuard ステータス" diff --git a/applications/luci-app-wireguard/po/pt-br/wireguard.po b/applications/luci-app-wireguard/po/pt-br/wireguard.po index d3b5059d5f..2874639b67 100644 --- a/applications/luci-app-wireguard/po/pt-br/wireguard.po +++ b/applications/luci-app-wireguard/po/pt-br/wireguard.po @@ -57,6 +57,9 @@ msgstr "Manter Conexões Abertas (Keepalive)" msgid "Public Key" msgstr "Chave Pública" +msgid "Show/Hide QR-Code" +msgstr "" + msgid "WireGuard Status" msgstr "Estado do WireGuard" diff --git a/applications/luci-app-wireguard/po/ru/wireguard.po b/applications/luci-app-wireguard/po/ru/wireguard.po index 202a49eff4..3781d89522 100644 --- a/applications/luci-app-wireguard/po/ru/wireguard.po +++ b/applications/luci-app-wireguard/po/ru/wireguard.po @@ -58,6 +58,9 @@ msgstr "Постоянные Проверки Активности" msgid "Public Key" msgstr "Публичный Ключ" +msgid "Show/Hide QR-Code" +msgstr "" + msgid "WireGuard Status" msgstr "Состояние WireGuard" diff --git a/applications/luci-app-wireguard/po/sv/wireguard.po b/applications/luci-app-wireguard/po/sv/wireguard.po index 3422ae91e9..c0f7040c67 100644 --- a/applications/luci-app-wireguard/po/sv/wireguard.po +++ b/applications/luci-app-wireguard/po/sv/wireguard.po @@ -46,6 +46,9 @@ msgstr "Hålla vid liv ständigt" msgid "Public Key" msgstr "Publik nyckel" +msgid "Show/Hide QR-Code" +msgstr "" + msgid "WireGuard Status" msgstr "Status för WireGuard" diff --git a/applications/luci-app-wireguard/po/templates/wireguard.pot b/applications/luci-app-wireguard/po/templates/wireguard.pot index 9ec5c60048..3cec473ecf 100644 --- a/applications/luci-app-wireguard/po/templates/wireguard.pot +++ b/applications/luci-app-wireguard/po/templates/wireguard.pot @@ -46,6 +46,9 @@ msgstr "" msgid "Public Key" msgstr "" +msgid "Show/Hide QR-Code" +msgstr "" + msgid "WireGuard Status" msgstr "" diff --git a/applications/luci-app-wireguard/po/zh-cn/wireguard.po b/applications/luci-app-wireguard/po/zh-cn/wireguard.po index 38fd784b12..1864048d5b 100644 --- a/applications/luci-app-wireguard/po/zh-cn/wireguard.po +++ b/applications/luci-app-wireguard/po/zh-cn/wireguard.po @@ -60,6 +60,9 @@ msgstr "Keepalive 间隔(秒)" msgid "Public Key" msgstr "公钥" +msgid "Show/Hide QR-Code" +msgstr "" + msgid "WireGuard Status" msgstr "WireGuard 状态" diff --git a/applications/luci-app-wireguard/po/zh-tw/wireguard.po b/applications/luci-app-wireguard/po/zh-tw/wireguard.po index 66fd9649e6..83da0c351a 100644 --- a/applications/luci-app-wireguard/po/zh-tw/wireguard.po +++ b/applications/luci-app-wireguard/po/zh-tw/wireguard.po @@ -60,6 +60,9 @@ msgstr "Keepalive 間隔(秒)" msgid "Public Key" msgstr "公鑰" +msgid "Show/Hide QR-Code" +msgstr "" + msgid "WireGuard Status" msgstr "WireGuard 狀態" |