Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
NordVPN
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Tae_kyon
n00b
n00b


Joined: 19 Apr 2006
Posts: 66

PostPosted: Sat Aug 10, 2019 3:48 pm    Post subject: NordVPN Reply with quote

I have a subscrition to NordVPN and am using it on my Gentoo box. However, I have to import the server configuration files manually into Network-Manager every time.

Openpyn and other such instruments I've found need to be installed with PIP, and in the end I can never get them to work.
An ebuild for nordmn is on panther-overlay, doesn't work either.

Has anyone found a good solution to this?

Thanks
_________________
We shall not cease from exploration. And the end of all our exploring
will be to arrive where we started and know the place for the first time
Back to top
View user's profile Send private message
nowlodek
n00b
n00b


Joined: 20 Jun 2006
Posts: 12

PostPosted: Fri Jan 24, 2020 8:19 pm    Post subject: Reply with quote

You can use NordVPN Linux app.
Get the latest deb package from https://repo.nordvpn.com/deb/nordvpn/debian/pool/main/
Use deb2tar to convert to tar.
Extract
/usr/bin/nordvpn to /usr/local/bin
and
/usr/sbin/nordvpnd to /usr/local/sbin
and
/var/lib/norvpn to /var/lib

then create init file
touch /etc/init.d/nordvpnd
with
Code:
#!/sbin/openrc-run
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

command="/usr/local/sbin/nordvpnd"
pidfile="/run/${RC_SVCNAME}.pid"
retry="SIGTERM/5/SIGTERM/5/SIGKILL/5"
start_stop_daemon_args="--background --make-pidfile"

depend() {
<------>use logger net
<------>provide dns
}

To use it start daemon first
Code:
rc-service nordvpnd start

login to nordvpn
Code:
nordvpn login

and
Code:
nordvpn connect

in case of issues with OpenVPN mode, switch to NordLynx mode
Code:
nordvpn set technology nordlynx
Back to top
View user's profile Send private message
Tae_kyon
n00b
n00b


Joined: 19 Apr 2006
Posts: 66

PostPosted: Sat Jan 25, 2020 12:11 am    Post subject: Reply with quote

Thanks! Looks like just what I need!
_________________
We shall not cease from exploration. And the end of all our exploring
will be to arrive where we started and know the place for the first time
Back to top
View user's profile Send private message
nowlodek
n00b
n00b


Joined: 20 Jun 2006
Posts: 12

PostPosted: Sun Jan 26, 2020 4:09 pm    Post subject: Reply with quote

I'm lazy but I did it.
An ebuild for NordVPN

Code:
touch /usr/local/portage/net-vpn/nordvpn/nordvpn-3.6.0.3.ebuild


nordvpn-3.6.0.3.ebuild
Code:

# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI=7

inherit eutils unpacker

MY_PV=$(ver_rs 3 '-')

DESCRIPTION="NordVPN native client"
HOMEPAGE="https://nordvpn.com"
SRC_URI="https://repo.nordvpn.com/deb/nordvpn/debian/pool/main/nordvpn_${MY_PV}_amd64.deb"

LICENSE="NordVPN"
SLOT="0"
KEYWORDS="-* ~amd64"
IUSE=""

# TODO: verify that list of RDEPEND is complete
RDEPEND="net-misc/networkmanager
         net-vpn/networkmanager-openvpn"

RESTRICT="strip"
S="${WORKDIR}"

src_unpack() {
   # Unpack Debian package containing application's files
   unpack_deb ${A}
   gzip "${S}"/usr/share/doc/nordvpn/changelog.gz -d "${S}"
   gzip "${S}"/usr/share/man/man1/nordvpn.1.gz -d "${S}"
}

src_install() {
   cd ${S}

#   doinitd>etc/init.d/nordvpn
   newinitd "${FILESDIR}"/nordvpn.initd ${PN}

#   into<-->/usr
   dobin<->usr/bin/nordvpn
   dosbin<>usr/sbin/nordvpnd

   insinto>/var/lib/nordvpn
   doins -r var/lib/nordvpn

   insinto>/usr/share/bash-completion/completions
   doins <>usr/share/bash-completion/completions/nordvpn
   
   dodoc usr/share/doc/nordvpn/changelog
   doman usr/share/man/man1/nordvpn.1
}


new init file for package
Code:
touch /usr/local/portage/net-vpn/nordvpn/files/nordvpn.initd


nordvpn.initd
Code:

#!/sbin/openrc-run
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

command="/usr/sbin/nordvpnd"
pidfile="/run/${RC_SVCNAME}.pid"
retry="SIGTERM/5/SIGTERM/5/SIGKILL/5"
start_stop_daemon_args="--background --make-pidfile"

depend() {
   use logger net
   provide dns
}



Last edited by nowlodek on Sun Jan 26, 2020 8:51 pm; edited 1 time in total
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 15276

PostPosted: Sun Jan 26, 2020 5:03 pm    Post subject: Reply with quote

The way you represent tabs makes it difficult for users to quickly copy/paste this into a working ebuild. Do you have a repository somewhere from which interested users could download it? If not, consider posting the ebuild with tabs as actual tabs, not as placeholders.
nowlodek wrote:
Code:
SRC_URI="https://repo.nordvpn.com/deb/nordvpn/debian/pool/main/nordvpn_${MY_PV}_amd64.deb"
KEYWORDS="~amd64"
I think it is conventional to include a -* in KEYWORDS when, as here, you download a prebuilt file that only works on one architecture.
man 5 ebuild:
              · If you do not know if an ebuild runs under a particular  arch,
                then do not specify it in KEYWORDS.  It will then be masked by
                default on that architecture.

              · If the ebuild is known not to work on an  arch,  disable  that
                arch  in  KEYWORDS.   This would be done by specifying "-ppc",
                for example. This will  ensure  that  it  is  explicitly  key‐
                word-masked for that architecture.
In this case, you know it will not work on non-amd64.
nowlodek wrote:
Code:
DEPEND="${RDEPEND}"
I think this is incorrect. As a prebuilt package, the only things needed to "build" it are tools for unpacking upstream's archive. The packages in your RDEPEND may be needed to run it, but are not needed if someone just wants to run emerge --buildpkgonly.
nowlodek wrote:
Code:
S=${WORKDIR}
For consistency, this should be quoted.
nowlodek wrote:
Code:
<------>gzip ${S}/usr/share/doc/nordvpn/changelog.gz -d ${S}
<------>gzip ${S}/usr/share/man/man1/nordvpn.1.gz -d ${S}
Again, quoting. Although rare, some people might set PORTAGE_TMPDIR, and by extension WORKDIR, and by extension, S, to a path with spaces.
nowlodek wrote:
Code:
<------>cd ${S}
Quoting.
nowlodek wrote:
Code:
command="/usr/local/sbin/nordvpnd"
Your ebuild installs this file into /usr/sbin, not /usr/local/sbin.
Back to top
View user's profile Send private message
nowlodek
n00b
n00b


Joined: 20 Jun 2006
Posts: 12

PostPosted: Sun Jan 26, 2020 9:01 pm    Post subject: Reply with quote

Thank you for looking up.
There are others architectures so I started with ~amd64 with hope to include another.
Post altered accordingly.
Back to top
View user's profile Send private message
elover
n00b
n00b


Joined: 20 Nov 2019
Posts: 25
Location: Spain

PostPosted: Mon Jan 27, 2020 10:08 am    Post subject: Reply with quote

Hey, I found this ebuild.


nordvpn-3.5.0-r2.ebuild

Code:
Close
# Copyright 2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

inherit unpacker

DESCRIPTION="NordVPN CLI tool for Linux"
HOMEPAGE="https://nordvpn.com"
BASE_URI="https://repo.nordvpn.com/deb/${PN}/debian/pool/main"
SRC_URI="
   amd64? ( "${BASE_URI}/${P/-/_}-${PR/r}_amd64.deb" )
   arm? ( "${BASE_URI}/${P/-/_}-${PR/r}_armel.deb" )
   arm64? ( "${BASE_URI}/${P/-/_}-${PR/r}_arm64.deb" )
   x86? ( "${BASE_URI}/${P/-/_}-${PR/r}_i386.deb" )
"

LICENSE="NordVPN"
SLOT="0"
KEYWORDS="~amd64 ~arm ~arm64 ~x86"
IUSE="nordlynx systemd"
RESTRICT="mirror strip"

RDEPEND="
   dev-libs/libxslt[crypt]
   net-firewall/iptables
   sys-apps/iproute2[iptables]
   sys-apps/net-tools
   sys-process/procps
   nordlynx? (
      net-vpn/wireguard[module,tools]
   )
   systemd? (
      sys-apps/systemd
   )
"

S="${WORKDIR}"

src_unpack() {
   unpack_deb "${A}"
}

src_prepare() {
   rm _gpgbuilder || die
   use !systemd && ( rm -rf usr/lib || die )
   mv usr/share/doc/nordvpn/changelog.gz .
   gunzip changelog.gz
   mv usr/share/man/man1/${PN}.1.gz .
   gunzip ${PN}.1.gz
   rm -rf usr/share/man \
      usr/share/doc \
      etc
   default
}

src_install() {
   dodoc changelog
   rm changelog
   doman ${PN}.1
   rm ${PN}.1
   mkdir -p "${ED}"
   cp -r . "${ED}"/
   doinitd "${FILESDIR}/${PN}"
}

pkg_postinst() {
   echo
   elog "Thanks for installing the NordVPN client."
   elog "Don't forget to purchase your NordVPN plan in order to use the client."
   echo
}


Could be arranged for the latest version deb?
Back to top
View user's profile Send private message
nowlodek
n00b
n00b


Joined: 20 Jun 2006
Posts: 12

PostPosted: Mon Jan 27, 2020 4:59 pm    Post subject: Reply with quote

Change the number and save it as nordvpn-3.6.0-r4.ebuild and try to emerge.
Deb file structure is the same so elevating ebuild should work.
Current deb file ver. 3.6.0-3 => 3.6.0-r4 ebuild ver.
Back to top
View user's profile Send private message
MrEncryptor
n00b
n00b


Joined: 26 Feb 2020
Posts: 1

PostPosted: Wed Feb 26, 2020 5:15 am    Post subject: Reply with quote

HEY!
If you're getting this when you try to connect:
Code:
~ $ nordvpn c
A new version of NordVPN is available! Please update the application.
Connecting to Arrakis #420 (xx.nordvpn.com)
Whoops! Connection failed. Please try again. If the problem persists, contact our customer support.


And if you're getting this issue in your ` /usr/sbin/nordpvnd ` logs:
Code:

2020/02/25 22:01:52 [INFO] Tue Feb 25 22:01:52 2020 /sbin/ip link set dev tun0 up mtu 1500
2020/02/25 22:01:52 [INFO] Tue Feb 25 22:01:52 2020 MANAGEMENT: Client disconnected
2020/02/25 22:01:52 [INFO] Tue Feb 25 22:01:52 2020 Linux ip link set failed: could not execute external program
2020/02/25 22:01:52 [INFO] Tue Feb 25 22:01:52 2020 Exiting due to fatal error
2020/02/25 22:01:52 [Error] Linux ip link set failed: could not execute external program
2020/02/25 22:01:52 Linux ip link set failed: could not execute external program


It's probably because your ip binary is in ` /bin/ip ` instead of ` /sbin/ip ` where nordvpn wants to use it. My solution was to symlink it there:
Code:
# ln -s /bin/ip /sbin/ip
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum