Code Monkey home page Code Monkey logo

Comments (15)

furlongm avatar furlongm commented on June 30, 2024

I would like to add this functionality, but it looks like the source port will be removed from the management interface. See https://community.openvpn.net/openvpn/ticket/664 for more details.

from openvpn-monitor.

kidmock avatar kidmock commented on June 30, 2024

Thanks for for trying. That really sucks. I wonder if they will come up with an alternative way to find unique connections. I guess I'll fork and use my crappy work around since I don't use ipv6

from openvpn-monitor.

furlongm avatar furlongm commented on June 30, 2024

Currently the port is there for ipv4 addresses in openvpn < 2.4, but according to that bug report, the port will disappear in 2.4, for both ipv4 and ipv6.

from openvpn-monitor.

kidmock avatar kidmock commented on June 30, 2024

Yeah, I get it If you enable this feature with 2.4 or ipv6 You run the risk of nuking all users. :( Bummer. I'm not mad

from openvpn-monitor.

furlongm avatar furlongm commented on June 30, 2024

Can you see if 9c5969f gives you the functionality you are looking for?

from openvpn-monitor.

kidmock avatar kidmock commented on June 30, 2024

Well.... It looks good but doesn't work :)

Additionally, semantic_version isn't available from epel on RHEL/CentOS 6.x. I had to install from pip.

pip install semantic_version

I'll do some debugging this evening and get you more feedback.

from openvpn-monitor.

kidmock avatar kidmock commented on June 30, 2024

Ok here's what I can observe. Sorry I'm a network dude not a developer. :)

When I hit the disconnect button, the Form Data is being set in the request:

vpn_id:VPN1
ip:***.***.***.***
port:35827

However this conditional is never true:

         if 'vpn_id' in kwargs:

from openvpn-monitor.

furlongm avatar furlongm commented on June 30, 2024

I've tried to reproduce this on CentOS 6 but it works fine for me. Are you using the latest commit? If not, can you try it?

If it still doesn't work, can you print kwargs to see what is in it?

from openvpn-monitor.

kidmock avatar kidmock commented on June 30, 2024

I threw in some additional logging but I'm not sure how to debug any further.

--- openvpn-monitor/openvpn-monitor.py	2017-01-05 11:21:13.196328443 +0000
+++ monitor/openvpn-monitor.py	2017-01-05 11:40:16.486459071 +0000
@@ -146,8 +146,10 @@
 
     def __init__(self, cfg, **kwargs):
         self.vpns = cfg.vpns
+        info('Initialize OpenvpnMgmtInterface class')
 
         if 'vpn_id' in kwargs:
+            info('vpn_id is in kwargs')
             self._socket_connect(self.vpns[kwargs['vpn_id']])
             if self.s:
                 version = self.send_command('version\n')

tried to post data with curl

curl -u username 'https://localhost/monitor/openvpn-monitor.py' --data 'vpn_id=VPN1&ip=***.***.***.***.&port=41630'

With the log results

[Thu Jan 05 11:54:28 2017] [error] [client ***.***.***.***] INFO: Using config file: ./openvpn-monitor.conf, referer: https://localhost/monitor/openvpn-monitor.py
[Thu Jan 05 11:54:28 2017] [error] [client ***.***.***.***] INFO: Initialize OpenvpnMgmtInterface class, referer: https://localhost/monitor/openvpn-monitor.py

Thoughts?

from openvpn-monitor.

kidmock avatar kidmock commented on June 30, 2024

Yes, I pulled down a fresh copy of the code just before I ran my test.

from openvpn-monitor.

furlongm avatar furlongm commented on June 30, 2024

Try info(kwargs)

from openvpn-monitor.

kidmock avatar kidmock commented on June 30, 2024
     def __init__(self, cfg, **kwargs):
         self.vpns = cfg.vpns
+        info('Initialize OpenvpnMgmtInterface class')
+        info(kwargs)
+        info('End')

         if 'vpn_id' in kwargs:
+            info('vpn_id is in kwargs')
             self._socket_connect(self.vpns[kwargs['vpn_id']])
             if self.s:
                 version = self.send_command('version\n')

yup Definitely not seeing the post data. hmmm

[Thu Jan 05 12:36:46 2017] [error] [client **.***.***.***] INFO: Initialize OpenvpnMgmtInterface class, referer: https://localhost/monitor
[Thu Jan 05 12:36:46 2017] [error] [client **.***.***.***] INFO: {}, referer: https://localhost/monitor
[Thu Jan 05 12:36:46 2017] [error] [client **.***.***.***] INFO: End, referer: https://localhost/monitor

The only thing I can think of is I use LINOTP which is also a WSGI app. There might be some interference.

I'll have to really dig to see why the post data isn't being passed.

from openvpn-monitor.

furlongm avatar furlongm commented on June 30, 2024

Could you insert info(kwargs) into main() and render() ?

That way we can see at what point it gets lost.

from openvpn-monitor.

furlongm avatar furlongm commented on June 30, 2024

@kidmock any luck debugging this issue?

from openvpn-monitor.

furlongm avatar furlongm commented on June 30, 2024

I'm going to close this issue for now, as I can't reproduce. If you can reproduce, please re-open and add further details.

from openvpn-monitor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.