Zomboided / service.vpn.manager

VPN plugin for Kodi
GNU General Public License v2.0
307 stars 80 forks source link

Add support for ripe.net to get location info #147

Closed K3rm1t4 closed 5 years ago

K3rm1t4 commented 6 years ago

Please add specific support for CoreELEC, a community fork of LibreELEC. With this enhancement LE-specific features of the add-on, i.e. connect a VPN before Kodi starts, could be made available to CE users, too.

Thanks in advance for consideration.

Zomboided commented 6 years ago

I think that is the only LE specific enhancement? Maybe I'm wrong, I forget. Either way, it doens't look like CoreELEC has a Raspberry Pi build so I can't do this myself. If you post up the contents of etc/os-release, I can have a guess at enabling this

Zomboided commented 6 years ago

I also need to know if the /storage/.config/system.d/ directory exists

K3rm1t4 commented 6 years ago

Having just compared the settings menues between the two, I can confirm your thought. Only the following feature seems to be LE-specific and is currently missing in CE:

FWIW, the "Platform Default" setting for Debug option "Use sudo with openvpn and killall" seems to already work correctly on CE.

To your questions: CoreELEC:~ # cat /etc/os-release NAME="CoreELEC" VERSION="8.90.1" ID="coreelec" VERSION_ID="9.0" PRETTY_NAME="CoreELEC (official): 8.90.1" HOME_URL="http://coreelec.org" BUG_REPORT_URL="https://github.com/CoreELEC/CoreELEC" BUILD_ID="4465e6e34c3a2e39ac5c1cde40367c26851d8217" OPENELEC_ARCH="S905.arm" LIBREELEC_ARCH="S905.arm" LIBREELEC_BUILD="official"

CoreELEC:~ # ls /storage/.config/system.d/ README nfs.mount.sample cifs.mount.sample openvpn.service.sample

In general, the CoreELEC fork is keeping close contact to LE master branch as it is focused on providing better support for AML-based devices right now. So, when in doubt I think you can basically assume that LE and CE are identical in terms of general setup, i.e. file system structure.

Zomboided commented 6 years ago

if you're feeling brave, go to /storage/.kodi/addons/service.vpn.manager/libs

Edit platform.py and locate this:

def supportSystemd():
    if fakeSystemd() : return True
    # Only supporting systemd VPN connection on LibreELEC
    if getPlatform() == platforms.LINUX and xbmcvfs.exists("etc/os-release"):
        os_info = open("etc/os-release", 'r')
        lines = os_info.readlines()
        os_info.close()
        for line in lines:
            if "LibreELEC" in line:
                # Shouldn't really need to check this as LibreELEC comes with systemd installed
                return xbmcvfs.exists(getSystemdPath("system.d/"))
    return False

Where you see the 'if "LibreELEC" in line:' line, change it to 'if "CoreELEC" in line:' Then reboot, then click 'default' on the settings page And just for luck, reboot again. I think it'll work just fine and will try and do the before boot connection.

If you're not feeling brave, I'll can do you a build to install

Zomboided commented 6 years ago

Needless to say, after that you'll have to ensure the option is switched on, create a connection, reboot, see if it updates system.d and does something before Kodi appears. You should see an openvpn.service also appear in the system.d directory that I mentioned

K3rm1t4 commented 6 years ago

Felt brave enough 😉

Your commit a6d45e4 is working fine. Thank you very much!

A few minor issues I stumbled across in the 'VPN Connections' tab of the Settings menu while testing:

  1. Validated connections are displayed by their technical ID (i.e. '1_vpn_validated_friendly'), not by their name as is the case throughout the rest of add-on. Maybe related to Kodi 18 as this issue is not present in my Kodi 17-based LE installation?

  2. Typo 'Eigth' instead of 'Eighth': resources/language/English/strings.po

Before I create a separate issue for this: Have you thought about adding RIPE-NCC as an alternate information provider for IP addresses?

Zomboided commented 6 years ago

Good news, thanks for letting me know. Sometime soon I'll do a release from the repo and it'll pick up a whole bunch of stuff including this.

I don't care about 1 because beta, and it's fine in a proper release (and this wouldn't be the first time).

I've just fixed 2

And for your final thought, go ahead and open a new issue and I'll look at it in the future...it's actually a reasonable remark as these services can be a bit flaky and variety is good. I need to stabilize the code generally at the moment though after a lot of recent changes that I've not released.

Cheers

On Tue, Apr 24, 2018 at 6:46 PM, K3rm1t4 notifications@github.com wrote:

Felt brave enough 😉

Your commit 2f95787 https://github.com/Zomboided/service.vpn.manager/commit/2f957879f623b2db5322edad5b74cc72f9119664 is working fine. Thank you very much!

A few minor issues I stumbled across in the 'VPN Connections' tab of the Settings menu while testing:

1.

Validated connections are displayed by their technical ID (i.e. '1_vpn_validated_friendly'), not by their name as is the case throughout the rest of add-on. Maybe related to Kodi 18 as this issue is not present in my Kodi 17-based LE installation? 2.

Typo 'Eigth' instead of 'Eighth': resources/language/English/strings.po https://github.com/Zomboided/service.vpn.manager/blob/aa57618f333169aedead2729228e5fb223309992/resources/language/English/strings.po#L169

Before I create a separate issue for this: Have you thought about adding RIPE-NCC https://github.com/RIPE-NCC/whois/wiki/WHOIS-REST-API-geolocation as geo location provider for IP addresses?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Zomboided/service.vpn.manager/issues/147#issuecomment-384020606, or mute the thread https://github.com/notifications/unsubscribe-auth/AQSc5fFrnkr4nL6Zh55kh_V0usVIEhmOks5tr2TsgaJpZM4TfZvU .

Zomboided commented 5 years ago

https://www.ripe.net/manage-ips-and-asns/db/tools/geolocation-in-the-ripe-database

Ripe is not a geolocation provider so can't use it. Closing this out.