Dev work on luci-app-openvpn - overview connected clients

Hi All,

I've added to a submitted request to implement an connected openvpn users overview in the luci app openvpn module, but it doesn't get any priority at this time/stage. Can anybody point me in the right direction or explain to me why these kind of items don't get picked up? Any help / direction is appriciated.

Link:

It is not getting picked up because there is no volunteer available to implement it.

Hi Jow,

I'm willing to give it a try :slight_smile: I'm no developer, but let's see if i can make some progress. Perhaps with some help.

My toolset:
-- Windows PC with portableapps notepad++, winscp
-- openwrt router tp-link running luci and ofcourse the openvpn luci app

Things i collected:
-- via luci-app-commands i can execute: cat /var/run/openvpn.server.status
-- i noticed that the filename can change - depending on the name configured in luci app openvpn
-- luci runs on openwrt on the following locations:

  • /usr/lib/lua/luci/controller/
  • /usr/lib/lua/luci/model/cbi/
  • /www

files that are needed / impacted:
/usr/lib/lua/luci/controller/openvpn.lua

My action plan:
-- see how i can retrieve the servername via the config file of openvpn app luci
-- see if i can make a simple view in the luci-app-openvpn of the cat command
-- look for optimalisations.

Any help / pointers would help!

Thanks

Be aware that lua is in the process of being removed from luci, in favour of ucode.

Thanks for the heads up. As far as i understand current work is on the luci base for ucode. The openvpn app will follow in the future probably. Let me continue on lua at this moment to achieve the minimal product and then migrate to ucode.

well ..i've got my results, but not the way i intended. However, if somebody else is looking for a very very very basic way of seeing the results in the web interface in the openvpn section, i share it through this way:

File:
\usr\lib\lua\luci\view\openvpn\cbi-select-input-add.htm

<%-
  require "string"
  require "luci.sys"
  local client_output = luci.sys.exec("cat /var/run/openvpn.*.status")
  client_output = string.gsub(client_output, "OpenVPN CLIENT LIST", "")
 -%>

<h4><%:VPN Connected Clients%></h4>
<div class="tr cbi-section-table-row" id="div_clientconnect">
<div class="td left" id="client_output"><%=client_output%></div></div>	
</div>