yuezk / GlobalProtect-openconnect

A GlobalProtect VPN client for Linux, written in Rust, based on OpenConnect and Tauri, supports SSO with MFA, Yubikey, and client certificate authentication, etc.
GNU General Public License v3.0
1.2k stars 140 forks source link

building from source on PureOS (Debian) #382

Open gurucubano opened 1 week ago

gurucubano commented 1 week ago

OK, let's go the hard way and build from source the gpclient.

I git cloned from from

purism@pureos:~/guru$ rm -rf GlobalProtect-openconnect
purism@pureos:~/guru$ git clone https://github.com/yuezk/GlobalProtect-openconnect.git
Cloning into 'GlobalProtect-openconnect'...
...

installed all the Prerequisites mentioned in README.mdand run:

export INCLUDE_GUI=1
make
/bin/sh: 1: jq: not found
error: failed to parse manifest at `/home/purism/guru/GlobalProtect-openconnect/Cargo.toml`

Caused by:
  invalid type: unit variant, expected string only for key `profile.release.strip`
rm -rf .build/gpgui
if [ 1 -eq 1 ]; then \
    echo "Downloading GlobalProtect GUI..."; \
    mkdir -p .build/gpgui; \
    curl -sSL https://github.com/yuezk/GlobalProtect-openconnect/releases/download/v/gpgui_aarch64.bin.tar.xz \
        -o .build/gpgui/gpgui_aarch64.bin.tar.xz; \
    tar -xJf .build/gpgui/*.tar.xz -C .build/gpgui; \
else \
    echo "Skipping GlobalProtect GUI download (INCLUDE_GUI=0)"; \
fi
Downloading GlobalProtect GUI...
xz: (stdin): File format not recognized
tar: Child returned status 1
tar: Error is not recoverable: exiting now
make: *** [Makefile:67: download-gui] Error 2

The downloaded file contains only

cat .build/gpgui/gpgui_aarch64.bin.tar.xz Not Found

uname -m aarch64



.build/gpgui/gpgui_aarch64.bin.tar.xz
yuezk commented 1 week ago

Try to install the jq command first. Looks the doc omit this one.

gurucubano commented 1 week ago

Yep, I saw it in the Makefile what is causing this. What could jp be for apt install ....?

yuezk commented 1 week ago

It's jq, not jp. Try sudo apt-get install jq

gurucubano commented 1 week ago

With jq installed it gives now:

$ make
error: failed to parse manifest at `/home/purism/guru/GlobalProtect-openconnect/Cargo.toml`

Caused by:
  invalid type: unit variant, expected string only for key `profile.release.strip`
rm -rf .build/gpgui
if [ 1 -eq 1 ]; then \
    echo "Downloading GlobalProtect GUI..."; \
    mkdir -p .build/gpgui; \
    curl -sSL https://github.com/yuezk/GlobalProtect-openconnect/releases/download/v/gpgui_aarch64.bin.tar.xz \
        -o .build/gpgui/gpgui_aarch64.bin.tar.xz; \
...

The rest are errors due not detecting the VERSION (...) correctly.

yuezk commented 1 week ago

Run the cargo metadata --no-deps --format-version 1 | jq -r '.packages[0].version' command in your directly and see what's the output.

yuezk commented 1 week ago

The RUST version must be 1.75 or later. That could be the problem.

gurucubano commented 1 week ago

El día martes, junio 25, 2024 a las 05:53:45 -0700, Kevin Yue escribió:

The RUST version must be 1.75 or later. That could be the problem.

rustc -V shows 1.48.0

gurucubano commented 1 week ago

El día martes, junio 25, 2024 a las 05:52:32 -0700, Kevin Yue escribió:

Run the cargo metadata --no-deps --format-version 1 | jq -r '.packages[0].version' command in your directly and see what's the output.

cargo metadata --no-deps --format-version 1 | jq -r '.packages[0].version'
error: failed to parse manifest at `/home/purism/guru/GlobalProtect-openconnect/Cargo.toml`

Caused by:
  invalid type: unit variant, expected string only for key `profile.release.strip`
yuezk commented 1 week ago

You need to upgrade Rust to 1.75 or above.

gurucubano commented 1 week ago

El día martes, junio 25, 2024 a las 09:28:12 -0700, Kevin Yue escribió:

You need to upgrade Rust to 1.75 or above.

-- Reply to this email directly or view it on GitHub: https://github.com/yuezk/GlobalProtect-openconnect/issues/382#issuecomment-2190600726 You are receiving this because you authored the thread.

On my FreeBSD laptop I have:

globalprotect-openconnect-1.4.9_1.pkg rust-1.72.0.pkg

gpclient --version 2024-06-26 07:11:14.174 INFO [100698] @.*** GlobalProtect started, version: 1.4.9

yuezk commented 1 week ago

1.4.9 was written in C++, while 2.x was refactored using Rust. And the Rust version is at least 1.75.

gurucubano commented 1 week ago

I started compiling 1.4.9 from source:

purism@pureos:~/FreeBSD/GlobalProtect-openconnect-1.4.9$ ./scripts/install.sh
-- CMAKE_INSTALL_PREFIX was set to: /usr
CMake Error at /usr/lib/aarch64-linux-gnu/cmake/Qt5/Qt5Config.cmake:28 (find_package):
  Could not find a package configuration file provided by "Qt5WebEngine" with
  any of the following names:

    Qt5WebEngineConfig.cmake
    qt5webengine-config.cmake

  Add the installation prefix of "Qt5WebEngine" to CMAKE_PREFIX_PATH or set
  "Qt5WebEngine_DIR" to a directory containing one of the above files.  If
  "Qt5WebEngine" provides a separate development package or SDK, be sure it
  has been installed.
Call Stack (most recent call first):
  CMakeLists.txt:23 (find_package)

-- Configuring incomplete, errors occurred!

I’ve install everything which smells of qt5webengine*:

sudo apt install qtbase5-dev
sudo apt install qtdeclarative5-dev
sudo apt install libqt5websockets5
sudo apt install libqt5websockets5-dev
sudo apt install libqt5webengine5
sudo apt install libqt5webchannel5-dev
sudo apt install libqt5webenginewidgets5
sudo apt install libqt5webkit5-dev
sudo apt install libqt5webview5-dev

apt search qt5web* | grep byzantium | grep  installed
libqt5webchannel5/byzantium,now 5.15.2-2 arm64 [installed,automatic]
libqt5webchannel5-dev/byzantium,now 5.15.2-2 arm64 [installed]
libqt5webengine-data/byzantium,now 5.15.2+dfsg-3 all [installed,automatic]
libqt5webengine5/byzantium,now 5.15.2+dfsg-3 arm64 [installed]
libqt5webenginecore5/byzantium,now 5.15.2+dfsg-3 arm64 [installed,automatic]
libqt5webenginewidgets5/byzantium,now 5.15.2+dfsg-3 arm64 [installed]
libqt5webkit5/byzantium,now 5.212.0~alpha4-11 arm64 [installed,automatic]
libqt5webkit5-dev/byzantium,now 5.212.0~alpha4-11 arm64 [installed]
libqt5websockets5/byzantium,now 5.15.2-2 arm64 [installed]
libqt5websockets5-dev/byzantium,now 5.15.2-2 arm64 [installed]
libqt5webview5/byzantium,now 5.15.2-2 arm64 [installed,automatic]
libqt5webview5-dev/byzantium,now 5.15.2-2 arm64 [installed]

ls -C1d /usr/lib/aarch64-linux-gnu/cmake/Qt5Web*
/usr/lib/aarch64-linux-gnu/cmake/Qt5WebChannel
/usr/lib/aarch64-linux-gnu/cmake/Qt5WebKit
/usr/lib/aarch64-linux-gnu/cmake/Qt5WebKitWidgets
/usr/lib/aarch64-linux-gnu/cmake/Qt5WebSockets
/usr/lib/aarch64-linux-gnu/cmake/Qt5WebView

How could I get:

    Qt5WebEngineConfig.cmake
    qt5webengine-config.cmake
yuezk commented 4 days ago

@gurucubano you may need to install the QtWebEngine component on your OS. The package name may vary.

gurucubano commented 3 days ago

Thank you! With this and another pkg I’ve got it made:

sudo apt install qtwebengine5-dev
sudo apt install qt5keychain-dev

...
[ 98%] Building CXX object GPClient/CMakeFiles/gpclient.dir/gpclient_autogen/EWIEGA46WW/qrc_resources.cpp.o
[100%] Linking CXX executable gpclient
[100%] Built target gpclient
-- Install configuration: "Release"
-- Installing: /usr/bin/gpservice
-- Installing: /usr/share/dbus-1/system.d/com.yuezk.qt.GPService.conf
-- Installing: /usr/share/dbus-1/system-services/com.yuezk.qt.GPService.service
-- Installing: /etc/gpservice/gp.conf
-- Installing: /usr/lib/systemd/system/gpservice.service
-- Installing: /usr/bin/gpclient
...

and it works fine, I can SSH into my company’s network directly from the L5.