VPN Manager for OpenVPN

  • hi zomboided,

    I see this in my log, but where is this noncache option to select?

    WARNING: this configuration may cache passwords in memory -- use the auth-nocache option to prevent this

  • You'd need to put this in the openvpn file, it's not something selectable via the GUI. The ovpn files are based on what the provider supplies, and this is a common warning across many them. I'd not worry about it (the password needs to be stored as plain text on the box anyway). If you are worried about it then you need to look at using the user defined option and add your own/modified ovpn files.

  • thanks for quick reply.

    do you have a link or instructions on your github for me to follow for this?

    I hate to store passwords in plain text.

  • It's all on the wiki, but you'll not avoid storing passwords as plain text though (they're passed to openvpn during connection so need to be stored in this way). The alternative to avoid that is to use openvpn directly on the command line and enter the password when prompted. The addon won't work with this approach though.

  • Zomboided Rep OpenVPN User here first off I want to say THANKS ZOMBOIDED!!!!

    Zomboided has been rather excellent in the past I have used and had zero issues.

    At current I am having some issues that kind of throw me for a loop and I cannot provide a log because it will not log until a connection starts.

    Well then on with the show! here are my issues or fixes I would like to see.

    Addition of changing DHCP for LibreElec I am unsure how to do this manually at current but would be excellent if it were an included feature.

    NORDVPN downloader is hanging and making my device over heat it hangs downloads hangs downloads hangs downloads then craps out with an error.

    Why don't you allow users to use samba or SSH to load the files locally through the program and apply them?

    So under nordvpn say upload them yourself through samba or ssh to this directory or download automatically?

    I can download them and put them in the Download folder and all it does is try to download again leaving duplicate copies with the same name oddly ? Either this or introduce a resume download rather than crap out and do it over again?

    Very very crazy I will say this was a restored libreelec using the built in backup manager.

    Also I have tried uninstalling and reinstalling several times without any luck what is so ever.

    A little help here on how to manually get the software to see the files and know they are current and downloaded would be nice.

    Would be great to stop the program from doing downloading of ovpn files at this point or trick it into believing what it has in downloads/openvpn is fine.... Very crazy trying to get my OVPN files updated it just keeps freezing.

    I will note I have tried this on a pi 2 and a pi 3 now and it just stops downloading before it gets halfway through downloading it usually gets stuck at about 5 or 6 files and puts on the breaks and stops downloading on both devices would be cool if I could get this going and updated manually I started poking around with SSH to try and see where and how this info is being stored but I have yet to see where it is being stored or how I could just add the new info I'm sure there is some way possibly to do such a thing or a way could be implemented in the code but I've spent a full 24 hours messing about trying different pi's different sd cards etc thinking it may have been something hardware related no luck.

    Tried also to import them as user defined that's when the pi3 started overheating with the temp logo... I could blow on it and cool it down but it would not get past say maybe 1/6th of the importing and it hung there for about an hour or better this I only tried once I will say that and I did not try trimming it down to just the servers I frequently connect to maybe that would work I'll have to give it a run tomorrow getting kind of late.

    All of my microsd's are 80+ MBs Samsung Evo 32GB and Sandisk Ultra Plus 64GB my ISP connect is 1GB/1GB fiber attempted on 2 raspberry pi3's and 1 raspberry pi 2 which is the one that it was on initially and working.

    Edited 3 times, last by forlotto ().

  • You can use user defined if you want to manage the files yourself. Instructions are on the wiki and there's an import wizard to help you.

    If it's hanging, try clearing out what's already downloaded (settings/utilities has this option) Nothing I can do without seeing a log tho. You can switch on debug and grab the kodi log file whenever you want, I don't need the openvpn log

  • alright then I will likely have a go at it today kinda just got a littl break from canning some things from the garden I'll have a go at it after this and possibly shorten down the listing.

    Import wizard instructions on the wiki hrmmm I wasn't aware of the wiki I was scouring the github for comments that would be like mine but none matched what I was looking for. I did see talk of importing and using possibly two different vpn providers etc. But my issue is a bit different I still insist it would be cool to beable to import locally from a folder under the correct vpn's name rather than having the user defined as there may be settings that are specific to a certain VPN that the program handles well in the program section but not so much whilst trying to do user defined. Simplicity is the end result of any good work or it seems as if this is the likely evolution and while this is a bit simple as it stands when things are buggy like this it would be an excellent way to fix a small checkbox to import locally from folder and a reminder every so often to make sure to update would go a long way not to mention possibly be a bit faster I don't know the difference between VPN's and how they handle but I am aware of the security woes from many of them.

    Anyways I really appreciate the work if you let me know how much a bottle of your favorite beer costs and direct me to paypal where I can buy you one I'd be more than happy to.

  • For most providers it generates ovpn files from tagged templates and only downloads ~5 small files. Nord is the exception as they want to expose all servers and let the user load balance if they're doing it all manually. So for the most part, user replaceable files beyond what you can already do would not work well. Also, if everything works the files will only download once and then the addon will warn you when an update is ready and only download the refreshed files when you want it to.

    User Defined is the answer for what you think you want to do. Use the import wizard, it should just work. Messing with files can cause things to break as the addon manages them all. I could have an option to rename user defined but that's something for very little gain as I can't think where it's surfaced outside of the config screens. I'd rather understand why it's not working for you though (if that's still the case after clearing out the directory). I'm pretty sure others are using Nord and anyone running a recent build is downloading files.

    If you want to donate beer, give that money to your favourite charity. They need it more than me but the sentiment is appreciated.

  • I see a frequent invalid window id error in the logs dunno where it is coming from ... There is a crap ton of things going on I may have to do a rebuild and make a good backup from that hundreds of addons is probably making this all an impossible dream.

    DEBUG: VPN Mgr : -- Exit addon.py --

    23:27:37.480 T:807400352 INFO: CPythonInvoker(64, /storage/.kodi/addons/service.vpn.manager/addon.py): script successfully run

    23:27:37.483 T:1945190400 DEBUG: Clearing cached fileitems [plugin://service.vpn.manager/?list]

    23:27:37.486 T:1945190400 DEBUG: CGUIMediaWindow::GetDirectory (plugin://service.vpn.manager/?list)

    23:27:37.487 T:1945190400 DEBUG: ParentPath = [plugin://service.vpn.manager/?list]

    23:27:37.487 T:1646261152 DEBUG: Thread JobWorker start, auto delete: true

    23:27:37.540 T:1646261152 DEBUG: Previous line repeats 1 times.

    23:27:37.540 T:1646261152 DEBUG: CAddonDatabase::SetLastUsed[service.vpn.manager] took 52 ms

    23:27:37.540 T:1032844192 DEBUG: Thread JobWorker start, auto delete: true

    23:27:37.541 T:1604318112 DEBUG: StartScript - calling plugin VPN Manager for OpenVPN('plugin://service.vpn.manager/','8','?list')

    23:27:37.542 T:1024455584 DEBUG: Thread LanguageInvoker start, auto delete: false

    23:27:37.542 T:1024455584 INFO: initializing python engine.

    23:27:37.543 T:1024455584 DEBUG: CPythonInvoker(69, /storage/.kodi/addons/service.vpn.manager/addon.py): start processing

    23:27:38.000 T:1945190400 DEBUG: ------ Window Init (DialogBusy.xml) ------

    23:27:38.374 T:807400352 INFO: Python script stopped

    23:27:38.376 T:807400352 DEBUG: Thread LanguageInvoker 807400352 terminating

    23:27:38.403 T:790623136 ERROR: EXCEPTION: Window id does not exist

    23:27:38.522 T:1024455584 DEBUG: -->Python Interpreter Initialized<--

    23:27:38.523 T:1024455584 DEBUG: CPythonInvoker(69, /storage/.kodi/addons/service.vpn.manager/addon.py): the source file to load is "/storage/.kodi/addons/service.vpn.manager/addon.py"

    23:27:38.523 T:1024455584 DEBUG: CPythonInvoker(69, /storage/.kodi/addons/service.vpn.manager/addon.py): setting the Python path to /storage/.kodi/addons/service.vpn.manager:/usr/lib/python27.zip:/usr/lib/python2.7:/usr/lib/python2.7/plat-linux2:/usr/lib/python2.7/lib-tk:/usr/lib/python2.7/lib-old:/usr/lib/python2.7/lib-dynload:/usr/lib/python2.7/site-packages:/usr/lib/python2.7/site-packages/gtk-2.0

    23:27:38.523 T:1024455584 DEBUG: CPythonInvoker(69, /storage/.kodi/addons/service.vpn.manager/addon.py): entering source directory /storage/.kodi/addons/service.vpn.manager

    23:27:38.525 T:1024455584 DEBUG: CPythonInvoker(69, /storage/.kodi/addons/service.vpn.manager/addon.py): instantiating addon using automatically obtained id of "service.vpn.manager" dependent on version 2.7.0 of the xbmc.python api

    23:27:38.779 T:1024455584 DEBUG: VPN Mgr : -- Entered addon.py plugin://service.vpn.manager/ 8 ?list --

    23:27:38.805 T:1024455584 DEBUG: VPN Mgr : Parsed arguments to action=list params=

    23:27:38.851 T:1024455584 DEBUG: VPN Mgr : Listing the connections available for NordVPN

    23:27:38.874 T:1024455584 DEBUG: VPN Mgr : Getting list of profiles in /storage/.kodi/addons/service.vpn.manager/NordVPN/*.ovpn

    23:27:38.905 T:790623136 ERROR: EXCEPTION: Window id does not exist

    23:27:39.570 T:1024455584 ERROR: Previous line repeats 1 times.

    23:27:39.570 T:1024455584 DEBUG: VPN Mgr : -- Exit addon.py --

    23:27:39.570 T:1024455584 INFO: CPythonInvoker(69, /storage/.kodi/addons/service.vpn.manager/addon.py): script successfully run

    23:27:40.210 T:1945190400 DEBUG: Saving fileitems [plugin://service.vpn.manager/?list]

    23:27:40.225 T:1945190400 DEBUG: -- items: 1095, sort method: 0, ascending: false

    23:27:40.399 T:1024455584 INFO: Python script stopped

    23:27:40.400 T:1024455584 DEBUG: Thread LanguageInvoker 1024455584 terminating

    23:27:40.577 T:1024455584 DEBUG: Thread BackgroundLoader start, auto delete: false

    23:27:40.583 T:790623136 ERROR: EXCEPTION: Window id does not exist

    23:27:40.637 T:1945190400 DEBUG: ------ Window Deinit (DialogBusy.xml) ------

    23:27:41.084 T:790623136 ERROR: EXCEPTION: Window id does not exist

    23:27:41.368 T:1024455584 DEBUG: Thread BackgroundLoader 1024455584 terminating

    23:27:41.596 T:790623136 ERROR: EXCEPTION: Window id does not exist

    23:27:44.649 T:1945190400 ERROR: Previous line repeats 6 times.

    23:27:44.649 T:1945190400 DEBUG: Keyboard: scancode: 0x01, sym: 0x001b, unicode: 0x001b, modifier: 0x0

    23:27:44.765 T:1945190400 DEBUG: OnKey: escape (0xf01b) pressed, action is PreviousMenu

    23:27:44.765 T:1945190400 DEBUG: CGUIWindowManager::PreviousWindow: Deactivate

    23:27:45.128 T:790623136 ERROR: EXCEPTION: Window id does not exist

    23:27:45.130 T:1945190400 DEBUG: ------ Window Deinit (MyPrograms.xml) ------


  • This doesn't show me anything to do with the downloading of files. This looks like you're trying to list the connections.

    Go to setting/utilities and clear out the vpn provider files and the downloaded data. Then reboot with debug switched on. Then try and validate a connection. You should post the complete log, not an extract

    If you're using a funky skin, it might be worth switching to the standard one too for this.

    EDIT : I just tried this on my dev build....NordVPN downloads it's trillions of files just fine, then when I cancel the connection attempt and go back in, it realises that it's already downloaded them and doesn't try again.

    Edited 2 times, last by zomboided ().

  • I have a suggestion for a future release....

    One thing that was annoying me was that if the VPN is dropped whilst playing LiveTV, then when you try to bring up certain windows (e.g. TVGuide) ontop of LiveTV with the current channel still playing in the background, then it reconnects the VPN, and playback stops.

    I managed to get round this by commenting out the following line in service.py:

    #Stop any media playing before switching VPNs around

    #if player.isPlaying(): player.stop()

    I had tried switching on/off the vpn_reconnect_while_playing option but that does not influence this line of code.

    Just wondering if an option could be added in future to decide whether or not a (re)connect will stop playing the video. Either that, or maybe it shouldn't run this line if the vpn_reconnect_while_playing is set to false?

    For the time being I have switched off automatic updates, since I'll need to repeat this hack after future updates.

  • So you're watching live tv with a vpn enabled, and when the vpn drops you don't want it to reconnect? Surely just disable the vpn for live tv? You can use window filtering for that, or I added integrated support to the TV Guide Fullscreen addon if you're using that.

    I'll check out that line of code too. It's there to stop media from playing when the vpn has died. Maybe that is something that's optional, but if it is, it suggests that you don't care whether you use vpn for that source and should just filter it off anyway

  • My use-case is probably quite unusual....

    I have actually setup WindowID filtering to force it to reconnect when I use any of the PVR-related features. This is because I am using add-on filtering for certain addons e.g. BBC iPlayer, where I want the VPN to be disconnected (since they need a UK IP). When leaving the addon (e.g. BBC iPlayer), it does not automatically reconnect so I've reconfigured it so that the windows I use most commonly (e.g. TV Guide), trigger a reconnect.

    We discussed this back in March via PM and you gave me a hack to the code so I could force certain WindowID's (e.g. TV Guide) to reconnect the VPN. You then added the WindowID filtering logic to the code, and then I could remove my hack and use the built-in WindowID filtering.

    So I suppose I'm asking for the WindowID filtering I've setup to force it to reconnect to only take effect if there isn't video playing in the background. My hack of commenting that line out seems to kind of work though not 100% sure there won't be other side effects. It looks like the vpn_reconnect_while_playing does not take effect for the WindowID filtering.

  • It's not unusual - it's the reason I added support to the TV Guide Fullscreen addon. In that addon I added some code to github which was merged that allowed you to switch VPNs on and off with channels, based on the addon that was backing them. The BBC iPlayer problem was the very reason I did this. If a channel is using an addon which has an addon filter, it'll switch the VPN before changing channel (adds a delay, but nothing I can do about that). If it's already on the right VPN, then it'll just switch the channel. This is the right answer to your problem (and is one that I use).

    The option you mention is just about checking to see whether the VPN is connected. Originally I had only done this outside of playback as I was worried about the CPU overhead. I'm not bothered about this any more as it's minimal. This is working fine, it's not supposed to affect the line you're pointing at.

    I get the concept of 'wait for no video playing before reconnect', but I'd worry that it would lead to things streaming over the wrong, or worse, no VPN connection when you were expecting it to. Given that there's no kill switch built in, this is the next best thing.

    I need to think more about that line you've pointed out. Other people have whined at me about playback stopping for local media if the VPN is jittery and I've dismissed them with a 'get a better VPN', but I've now realised this line is the cause of those issues.

  • I still have this issue of playback stopping from local source when vpn gets disconnected. I had asked it long time back. It would be great if it gets fixed.

    Though I have got used to it.

  • ace310, go and pick up 4.1.5 from github

    Release 4.1.5 · Zomboided/service.vpn.manager · GitHub
    Install that directly over what you have and switch on debug (settings/debug)

    You'll need to set up VPN cycling if you've not done that already. This can be done in settings/utilities and you can assign a remote button or key to swap between VPNs.

    Set up a couple of different VPNs so that you have something to cycle against. Each time you cycle it'll cause the disconnect/reconnect to happen as if your connection was glitching.

    Play some local media or PVR or whatever the selection of media is that you consider to be local and cycle the connections.

    In the log, you'll see this line, this example is a steam from an addon :

    13:02:21.376 T:8872 NONE: VPN Mgr Debug: Changing VPN. Current playing http//sniidevices.scrippsnetworks.com/0232/0232648_6.mp4[/media]

    You can search on the term in bold. I've had to remove a : after http: to stop the forum trying to format it as media, you may need to do this too, but please let me know what you've changed.

    For each of the different kinds of local media you use, get me this line and a comment on what it is (e.g. local stored file, file stored on an SMB share, PVR stream on local network, etc).

    Then play some media that's not local and post up that.

    This won't fix your problem but it might help me understand what the different sorts of local media are and if I can filter them out somehow.

    Edited 2 times, last by zomboided ().

  • Here are some examples of local streams from my machine

    Live TV

    14:02:43.189 T:140004189796096 NONE: VPN Mgr Debug: Changing VPN. Current playing pvr://channels/tv/All channels/pvr.hts_1304825683.pvr

    Library File

    14:05:53.865 T:140004189796096 NONE: VPN Mgr Debug: Changing VPN. Current playing /storage/tvshows/Bones/Bones.S12E07.720p.mkv

    PVR Recording

    14:09:09.342 T:140004189796096 NONE: VPN Mgr Debug: Changing VPN. Current playing pvr://recordings/tv/active/New_ Victoria/New%3a%20Victoria%20The%20Sins%20of%20the%20Father%3a%20Drama%20series.%20Despite%20giving%20birth%20to%20a%20healthy%20Prince%20of%20Wales%2c%20Victoria%20finds%20herself%20paralysed%20by%20an%20inexplicable%20sorrow.%20%5bAD%2cS%5d, TV%20(ITV%20Yorkshire%20HD), 20170917_200000, 1149230897.pvr

  • Will report back soon, got little tied up today.