Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
86c8d188c4 |
No files matched your search
@@ -1,35 +0,0 @@
|
|||||||
name: Checkout private source quietly
|
|
||||||
description: Fetch private source without printing Git diagnostics or retaining credentials.
|
|
||||||
inputs:
|
|
||||||
token:
|
|
||||||
required: true
|
|
||||||
description: Token with read access to the private repository
|
|
||||||
ref:
|
|
||||||
required: true
|
|
||||||
description: Branch, tag, or full commit SHA
|
|
||||||
path:
|
|
||||||
required: true
|
|
||||||
description: Destination within the workspace
|
|
||||||
runs:
|
|
||||||
using: composite
|
|
||||||
steps:
|
|
||||||
- shell: bash
|
|
||||||
env:
|
|
||||||
PRIVATE_TOKEN: ${{ inputs.token }}
|
|
||||||
PRIVATE_REF: ${{ inputs.ref }}
|
|
||||||
PRIVATE_PATH: ${{ inputs.path }}
|
|
||||||
run: |
|
|
||||||
trap 'status=$?; if [ "$status" -ne 0 ]; then echo "::error::Private source checkout failed; diagnostics suppressed."; fi' EXIT
|
|
||||||
(
|
|
||||||
set -euo pipefail
|
|
||||||
export GIT_TERMINAL_PROMPT=0
|
|
||||||
export GIT_CONFIG_COUNT=1
|
|
||||||
export GIT_CONFIG_KEY_0=http.https://github.com/.extraheader
|
|
||||||
GIT_CONFIG_VALUE_0="AUTHORIZATION: basic $(printf 'x-access-token:%s' "$PRIVATE_TOKEN" | base64 | tr -d '\n')"
|
|
||||||
export GIT_CONFIG_VALUE_0
|
|
||||||
git init "$PRIVATE_PATH"
|
|
||||||
git -C "$PRIVATE_PATH" remote add origin https://github.com/yuezk/gpgui
|
|
||||||
git -C "$PRIVATE_PATH" fetch --no-tags --depth=1 -- origin "$PRIVATE_REF"
|
|
||||||
git -C "$PRIVATE_PATH" checkout --detach FETCH_HEAD
|
|
||||||
) >/dev/null 2>&1
|
|
||||||
echo "Private source checkout passed."
|
|
||||||
@@ -1,64 +0,0 @@
|
|||||||
name: Prepare cached macOS native dependencies
|
|
||||||
description: Cache only the completed public native-library prefix, without private source or app outputs.
|
|
||||||
inputs:
|
|
||||||
gpgui-directory:
|
|
||||||
description: Private checkout containing the native dependency builder
|
|
||||||
required: true
|
|
||||||
outputs:
|
|
||||||
prefix:
|
|
||||||
description: Validated native dependency installation prefix
|
|
||||||
value: ${{ steps.identity.outputs.path }}
|
|
||||||
cache-hit:
|
|
||||||
description: Whether the exact dependency cache was restored
|
|
||||||
value: ${{ steps.restore.outputs.cache-hit }}
|
|
||||||
runs:
|
|
||||||
using: composite
|
|
||||||
steps:
|
|
||||||
- name: Identify native dependency cache
|
|
||||||
id: identity
|
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
GPGUI_DIRECTORY: ${{ inputs.gpgui-directory }}
|
|
||||||
GPGUI_MACOS_DEPS_CACHE_DIR: ${{ runner.tool_cache }}
|
|
||||||
run: |
|
|
||||||
set -euo pipefail
|
|
||||||
trap 'status=$?; if [ "$status" -ne 0 ]; then echo "::error::Native dependency cache identification failed; diagnostics suppressed."; fi' EXIT
|
|
||||||
metadata="$("$GPGUI_DIRECTORY/scripts/build-macos-native-deps.sh" --cache-info 2>/dev/null)"
|
|
||||||
key="$(printf '%s\n' "$metadata" | sed -n 's/^key=//p')"
|
|
||||||
prefix="$(printf '%s\n' "$metadata" | sed -n 's/^path=//p')"
|
|
||||||
# Emit only an opaque identity and one dependency directory outside the checkout.
|
|
||||||
if [[ "$key" =~ ^[0-9a-f]{64}$ ]] &&
|
|
||||||
[[ "$metadata" == "key=$key"$'\n'"path=$prefix" ]] &&
|
|
||||||
[[ "${prefix%/*}" == "$RUNNER_TOOL_CACHE/gpgui-macos-native-deps" ]] &&
|
|
||||||
[[ "${prefix##*/}" == macos-*-"$key" ]]; then
|
|
||||||
printf 'key=macos-native-deps-%s\npath=%s\n' "$key" "$prefix" >> "$GITHUB_OUTPUT"
|
|
||||||
else
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Restore public native libraries
|
|
||||||
id: restore
|
|
||||||
uses: actions/cache/restore@v5
|
|
||||||
with:
|
|
||||||
path: ${{ steps.identity.outputs.path }}
|
|
||||||
key: ${{ steps.identity.outputs.key }}
|
|
||||||
|
|
||||||
- name: Build or validate native libraries
|
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
GPGUI_DIRECTORY: ${{ inputs.gpgui-directory }}
|
|
||||||
GPGUI_MACOS_DEPS_CACHE_DIR: ${{ runner.tool_cache }}
|
|
||||||
run: |
|
|
||||||
set -euo pipefail
|
|
||||||
trap 'status=$?; if [ "$status" -ne 0 ]; then echo "::error::Native dependency preparation failed; diagnostics suppressed."; fi' EXIT
|
|
||||||
started=$SECONDS
|
|
||||||
"$GPGUI_DIRECTORY/scripts/build-macos-native-deps.sh" >/dev/null 2>&1
|
|
||||||
echo "Native dependency preparation passed in $((SECONDS - started)) seconds."
|
|
||||||
|
|
||||||
# Save before any private application compilation or signing credential import.
|
|
||||||
- name: Save public native libraries
|
|
||||||
if: steps.restore.outputs.cache-hit != 'true'
|
|
||||||
uses: actions/cache/save@v5
|
|
||||||
with:
|
|
||||||
path: ${{ steps.identity.outputs.path }}
|
|
||||||
key: ${{ steps.identity.outputs.key }}
|
|
||||||
@@ -51,37 +51,20 @@ jobs:
|
|||||||
ref: ${{ inputs.gp_ref }}
|
ref: ${{ inputs.gp_ref }}
|
||||||
path: gpgui-source/gp
|
path: gpgui-source/gp
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
- name: Checkout CI helpers
|
- name: Checkout gpgui
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v6
|
||||||
with:
|
|
||||||
path: .ci
|
|
||||||
persist-credentials: false
|
|
||||||
- name: Checkout gpgui
|
|
||||||
uses: ./.ci/.github/actions/checkout-private
|
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.GH_PAT }}
|
token: ${{ secrets.GH_PAT }}
|
||||||
|
repository: yuezk/gpgui
|
||||||
ref: ${{ inputs.gpgui_ref }}
|
ref: ${{ inputs.gpgui_ref }}
|
||||||
path: gpgui-source/gpgui
|
path: gpgui-source/gpgui
|
||||||
- name: Verify Linux desktop assets
|
- name: Verify Linux desktop assets
|
||||||
if: matrix.os.arch == 'amd64' && inputs.verify_desktop_assets
|
if: matrix.os.arch == 'amd64' && inputs.verify_desktop_assets
|
||||||
run: |
|
run: gpgui-source/gp/scripts/verify-linux-desktop-assets.sh gpgui-source/gpgui
|
||||||
trap 'status=$?; if [ "$status" -ne 0 ]; then echo "::error::Private operation failed; diagnostics suppressed."; fi' EXIT
|
|
||||||
(
|
|
||||||
set -euo pipefail
|
|
||||||
gpgui-source/gp/scripts/verify-linux-desktop-assets.sh gpgui-source/gpgui
|
|
||||||
) >/dev/null 2>&1
|
|
||||||
echo "Private operation passed."
|
|
||||||
|
|
||||||
- name: Tarball
|
- name: Tarball
|
||||||
run: |
|
run: |
|
||||||
trap 'status=$?; if [ "$status" -ne 0 ]; then echo "::error::Private operation failed; diagnostics suppressed."; fi' EXIT
|
|
||||||
(
|
|
||||||
set -euo pipefail
|
|
||||||
cd gpgui-source
|
cd gpgui-source
|
||||||
tar -czf gpgui.tar.gz gpgui gp
|
tar -czf gpgui.tar.gz gpgui gp
|
||||||
) >/dev/null 2>&1
|
|
||||||
echo "Private operation passed."
|
|
||||||
|
|
||||||
- name: Build gpgui in Docker
|
- name: Build gpgui in Docker
|
||||||
env:
|
env:
|
||||||
GPGUI_BUILDER: ${{ inputs.builder }}
|
GPGUI_BUILDER: ${{ inputs.builder }}
|
||||||
@@ -89,34 +72,22 @@ jobs:
|
|||||||
GPGUI_UPDATE_CHANNEL: ${{ inputs.channel }}
|
GPGUI_UPDATE_CHANNEL: ${{ inputs.channel }}
|
||||||
GPGUI_LICENSE_SIGNING_KEYS: ${{ vars.GPGUI_LICENSE_SIGNING_KEYS }}
|
GPGUI_LICENSE_SIGNING_KEYS: ${{ vars.GPGUI_LICENSE_SIGNING_KEYS }}
|
||||||
run: |
|
run: |
|
||||||
trap 'status=$?; if [ "$status" -ne 0 ]; then echo "::error::Private operation failed; diagnostics suppressed."; fi' EXIT
|
|
||||||
(
|
|
||||||
set -euo pipefail
|
|
||||||
docker run --rm \
|
docker run --rm \
|
||||||
-e COREPACK_INTEGRITY_KEYS=0 \
|
-e COREPACK_INTEGRITY_KEYS=0 \
|
||||||
-e GPGUI_BUILD_VERSION \
|
-e GPGUI_BUILD_VERSION \
|
||||||
-e GPGUI_UPDATE_CHANNEL \
|
-e GPGUI_UPDATE_CHANNEL \
|
||||||
-e GPGUI_LICENSE_SIGNING_KEYS \
|
-e GPGUI_LICENSE_SIGNING_KEYS \
|
||||||
-v "$(pwd)/gpgui-source:/workspace" "yuezk/gpdev:$GPGUI_BUILDER"
|
-v "$(pwd)/gpgui-source:/workspace" "yuezk/gpdev:$GPGUI_BUILDER"
|
||||||
) >/dev/null 2>&1
|
|
||||||
echo "Private operation passed."
|
|
||||||
|
|
||||||
- name: Install gpgui in Docker
|
- name: Install gpgui in Docker
|
||||||
env:
|
env:
|
||||||
GPGUI_BUILDER: ${{ inputs.builder }}
|
GPGUI_BUILDER: ${{ inputs.builder }}
|
||||||
run: |
|
run: |
|
||||||
trap 'status=$?; if [ "$status" -ne 0 ]; then echo "::error::Private operation failed; diagnostics suppressed."; fi' EXIT
|
|
||||||
(
|
|
||||||
set -euo pipefail
|
|
||||||
cd gpgui-source
|
cd gpgui-source
|
||||||
tar -xJf ./*.bin.tar.xz
|
tar -xJf ./*.bin.tar.xz
|
||||||
docker run --rm \
|
docker run --rm \
|
||||||
-e COREPACK_INTEGRITY_KEYS=0 \
|
-e COREPACK_INTEGRITY_KEYS=0 \
|
||||||
-v "$(pwd):/workspace" "yuezk/gpdev:$GPGUI_BUILDER" \
|
-v "$(pwd):/workspace" "yuezk/gpdev:$GPGUI_BUILDER" \
|
||||||
bash -c "cd /workspace/gpgui_*/ && ./gpgui --version"
|
bash -c "cd /workspace/gpgui_*/ && ./gpgui --version"
|
||||||
) >/dev/null 2>&1
|
|
||||||
echo "Private operation passed."
|
|
||||||
|
|
||||||
- name: Upload gpgui
|
- name: Upload gpgui
|
||||||
uses: actions/upload-artifact@v7
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
|
|||||||
@@ -1,109 +0,0 @@
|
|||||||
name: Build Linux Native Shell
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_call:
|
|
||||||
inputs:
|
|
||||||
gp_ref:
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
gpgui_ref:
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
channel:
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
secrets:
|
|
||||||
GH_PAT:
|
|
||||||
required: true
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- runner: ubuntu-24.04
|
|
||||||
arch: x86_64
|
|
||||||
- runner: ubuntu-24.04-arm
|
|
||||||
arch: aarch64
|
|
||||||
runs-on: ${{ matrix.runner }}
|
|
||||||
name: build (${{ matrix.arch }})
|
|
||||||
timeout-minutes: 90
|
|
||||||
env:
|
|
||||||
CARGO_INCREMENTAL: '0'
|
|
||||||
CARGO_BUILD_JOBS: '2'
|
|
||||||
GPGUI_BUILD_VERSION: ${{ github.run_number }}.${{ github.run_attempt }}
|
|
||||||
GPGUI_GIT_COMMIT: ${{ inputs.gpgui_ref }}
|
|
||||||
GPGUI_UPDATE_CHANNEL: ${{ inputs.channel }}
|
|
||||||
GPGUI_LICENSE_SIGNING_KEYS: ${{ vars.GPGUI_LICENSE_SIGNING_KEYS }}
|
|
||||||
steps:
|
|
||||||
- name: Checkout GlobalProtect-openconnect
|
|
||||||
uses: actions/checkout@v6
|
|
||||||
with:
|
|
||||||
ref: ${{ inputs.gp_ref }}
|
|
||||||
path: source/gp
|
|
||||||
submodules: recursive
|
|
||||||
persist-credentials: false
|
|
||||||
- name: Checkout CI helpers
|
|
||||||
uses: actions/checkout@v6
|
|
||||||
with:
|
|
||||||
path: .ci
|
|
||||||
persist-credentials: false
|
|
||||||
- name: Checkout gpgui
|
|
||||||
uses: ./.ci/.github/actions/checkout-private
|
|
||||||
with:
|
|
||||||
token: ${{ secrets.GH_PAT }}
|
|
||||||
ref: ${{ inputs.gpgui_ref }}
|
|
||||||
path: source/gpgui
|
|
||||||
- name: Install Ubuntu 24.04 dependencies
|
|
||||||
run: |
|
|
||||||
sudo apt-get update
|
|
||||||
sudo apt-get install -y autoconf automake gettext libtool pkg-config \
|
|
||||||
clang libclang-dev libgtk-4-dev libxml2-dev \
|
|
||||||
libgnutls28-dev liblz4-dev libwayland-dev libxkbcommon-dev libdbus-1-dev
|
|
||||||
pkg-config --exists gtk4 gnutls dbus-1 wayland-client xkbcommon
|
|
||||||
- name: Install the NSH compiler
|
|
||||||
run: rustup toolchain install 1.97.0 --profile minimal
|
|
||||||
- name: Cache public crate downloads
|
|
||||||
uses: actions/cache@v5
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/.cargo/registry/cache
|
|
||||||
~/.cargo/registry/index
|
|
||||||
key: nsh-crates-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('source/gpgui/apps/desktop-nsh/Cargo.lock') }}
|
|
||||||
restore-keys: nsh-crates-${{ runner.os }}-${{ runner.arch }}-
|
|
||||||
- name: Build and package Native Shell
|
|
||||||
run: |
|
|
||||||
trap 'code=$?; if [ "$code" -ne 0 ]; then echo "::error::Native Shell build failed; diagnostics suppressed."; fi' EXIT
|
|
||||||
(
|
|
||||||
set -euo pipefail
|
|
||||||
cd source/gpgui
|
|
||||||
cargo +1.97.0 build --manifest-path apps/desktop-nsh/Cargo.toml --locked \
|
|
||||||
--release --bin gpgui-nsh --target-dir target
|
|
||||||
target/release/gpgui-nsh --version
|
|
||||||
version="$(cargo +1.97.0 metadata --manifest-path apps/desktop-nsh/Cargo.toml --no-deps --format-version 1 \
|
|
||||||
| jq -r '.packages[] | select(.name == "gpgui-nsh") | .version')"
|
|
||||||
directory="gpgui-nsh_$version"
|
|
||||||
archive="gpgui-nsh_$(uname -m).bin.tar.xz"
|
|
||||||
mkdir -p ".build/package/$directory"
|
|
||||||
cp target/release/gpgui-nsh ".build/package/$directory/"
|
|
||||||
cp apps/desktop-nsh/ICU4X-LICENSE.txt ".build/package/$directory/ICU4X-LICENSE.txt"
|
|
||||||
if ldd target/release/gpgui-nsh | grep -q 'libicu'; then
|
|
||||||
echo "The release executable must not depend on ICU4C." >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
tar -cJf ".build/package/$archive" -C .build/package "$directory"
|
|
||||||
sha256sum ".build/package/$archive" | cut -d ' ' -f 1 > ".build/package/$archive.sha256"
|
|
||||||
) >/dev/null 2>&1
|
|
||||||
echo "Native Shell build and version check passed."
|
|
||||||
- name: Upload Native Shell
|
|
||||||
uses: actions/upload-artifact@v7
|
|
||||||
with:
|
|
||||||
name: artifact-gpgui-nsh-${{ matrix.arch }}
|
|
||||||
if-no-files-found: error
|
|
||||||
path: |
|
|
||||||
source/gpgui/.build/package/*.bin.tar.xz
|
|
||||||
source/gpgui/.build/package/*.bin.tar.xz.sha256
|
|
||||||
@@ -16,22 +16,16 @@ on:
|
|||||||
gp_branch:
|
gp_branch:
|
||||||
description: 'GlobalProtect-openconnect ref to build (use the matching tag for stable builds)'
|
description: 'GlobalProtect-openconnect ref to build (use the matching tag for stable builds)'
|
||||||
required: true
|
required: true
|
||||||
default: release/next
|
default: dev
|
||||||
gpgui_branch:
|
gpgui_branch:
|
||||||
description: 'gpgui branch or tag to build and test (use the matching tag for stable builds)'
|
description: 'gpgui ref to build (use the matching tag for stable builds)'
|
||||||
required: true
|
required: true
|
||||||
default: release/next
|
default: dev
|
||||||
build_macos:
|
build_macos:
|
||||||
description: 'Build Apple Silicon artifacts for this run'
|
description: 'Build Apple Silicon artifacts for this run'
|
||||||
required: true
|
required: true
|
||||||
default: false
|
default: false
|
||||||
type: boolean
|
type: boolean
|
||||||
macos_gui:
|
|
||||||
description: 'macOS shell to build; NSH also runs its separate macOS/Linux checks'
|
|
||||||
required: true
|
|
||||||
default: nsh
|
|
||||||
type: choice
|
|
||||||
options: [tauri, nsh]
|
|
||||||
build_bsd:
|
build_bsd:
|
||||||
description: 'Build FreeBSD/OpenBSD packages for this run'
|
description: 'Build FreeBSD/OpenBSD packages for this run'
|
||||||
required: true
|
required: true
|
||||||
@@ -60,12 +54,6 @@ concurrency:
|
|||||||
jobs:
|
jobs:
|
||||||
validate-inputs:
|
validate-inputs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
|
||||||
actions: read
|
|
||||||
contents: read
|
|
||||||
outputs:
|
|
||||||
gp_sha: ${{ steps.sources.outputs.gp_sha }}
|
|
||||||
gpgui_sha: ${{ steps.sources.outputs.gpgui_sha }}
|
|
||||||
steps:
|
steps:
|
||||||
- name: Validate stable refs
|
- name: Validate stable refs
|
||||||
env:
|
env:
|
||||||
@@ -81,53 +69,6 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Checkout CI helpers
|
|
||||||
uses: actions/checkout@v6
|
|
||||||
- name: Restore selected sources on retry
|
|
||||||
id: restored
|
|
||||||
env:
|
|
||||||
GH_TOKEN: ${{ github.token }}
|
|
||||||
run: |
|
|
||||||
set -euo pipefail
|
|
||||||
artifacts="$(gh api "repos/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID/artifacts?per_page=100")"
|
|
||||||
existing="$(jq -r '.artifacts[] | select(.name == "build-source-refs") | .id' <<<"$artifacts")"
|
|
||||||
if [[ -n "$existing" ]]; then
|
|
||||||
gh run download "$GITHUB_RUN_ID" --repo "$GITHUB_REPOSITORY" \
|
|
||||||
--name build-source-refs --dir selected-sources
|
|
||||||
echo "cached=true" >> "$GITHUB_OUTPUT"
|
|
||||||
elif [[ "$GITHUB_RUN_ATTEMPT" -gt 1 ]]; then
|
|
||||||
echo "Retained source refs are unavailable; start a fresh dispatch." >&2
|
|
||||||
exit 1
|
|
||||||
else
|
|
||||||
echo "cached=false" >> "$GITHUB_OUTPUT"
|
|
||||||
fi
|
|
||||||
- name: Select public source
|
|
||||||
if: steps.restored.outputs.cached != 'true'
|
|
||||||
uses: actions/checkout@v6
|
|
||||||
with:
|
|
||||||
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.gp_branch || github.sha }}
|
|
||||||
path: selected/gp
|
|
||||||
- name: Select private source
|
|
||||||
if: steps.restored.outputs.cached != 'true'
|
|
||||||
uses: ./.github/actions/checkout-private
|
|
||||||
with:
|
|
||||||
token: ${{ secrets.GH_PAT }}
|
|
||||||
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.gpgui_branch || github.ref_name }}
|
|
||||||
path: selected/gpgui
|
|
||||||
- name: Record selected sources
|
|
||||||
id: sources
|
|
||||||
run: |
|
|
||||||
python3 scripts/record-build-sources.py selected-sources/sources.json \
|
|
||||||
--gp selected/gp --gpgui selected/gpgui
|
|
||||||
- name: Retain selected sources for retries
|
|
||||||
if: steps.restored.outputs.cached != 'true'
|
|
||||||
uses: actions/upload-artifact@v7
|
|
||||||
with:
|
|
||||||
name: build-source-refs
|
|
||||||
path: selected-sources/sources.json
|
|
||||||
retention-days: 30
|
|
||||||
|
|
||||||
|
|
||||||
test-gp:
|
test-gp:
|
||||||
needs: validate-inputs
|
needs: validate-inputs
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -137,7 +78,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
token: ${{ secrets.GH_PAT }}
|
token: ${{ secrets.GH_PAT }}
|
||||||
repository: yuezk/GlobalProtect-openconnect
|
repository: yuezk/GlobalProtect-openconnect
|
||||||
ref: ${{ needs.validate-inputs.outputs.gp_sha }}
|
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.gp_branch || github.ref }}
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
- name: Run Rust tests as a non-root user with focused privilege checks
|
- name: Run Rust tests as a non-root user with focused privilege checks
|
||||||
run: |
|
run: |
|
||||||
@@ -166,46 +107,6 @@ jobs:
|
|||||||
--bin gpservice device_anchor::tests
|
--bin gpservice device_anchor::tests
|
||||||
'
|
'
|
||||||
|
|
||||||
test-gpgui:
|
|
||||||
needs: validate-inputs
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
timeout-minutes: 85
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
steps:
|
|
||||||
- name: Checkout GlobalProtect-openconnect
|
|
||||||
uses: actions/checkout@v6
|
|
||||||
with:
|
|
||||||
repository: yuezk/GlobalProtect-openconnect
|
|
||||||
ref: ${{ needs.validate-inputs.outputs.gp_sha }}
|
|
||||||
submodules: recursive
|
|
||||||
path: source/gp
|
|
||||||
persist-credentials: false
|
|
||||||
- name: Checkout CI helpers
|
|
||||||
uses: actions/checkout@v6
|
|
||||||
with:
|
|
||||||
path: .ci
|
|
||||||
persist-credentials: false
|
|
||||||
- name: Checkout gpgui
|
|
||||||
uses: ./.ci/.github/actions/checkout-private
|
|
||||||
with:
|
|
||||||
token: ${{ secrets.GH_PAT }}
|
|
||||||
ref: ${{ needs.validate-inputs.outputs.gpgui_sha }}
|
|
||||||
path: source/gpgui
|
|
||||||
- name: Run frontend and Rust unit tests as an ordinary user
|
|
||||||
timeout-minutes: 80
|
|
||||||
run: bash .ci/scripts/test-private-desktop.sh "$PWD/source"
|
|
||||||
|
|
||||||
check-nsh:
|
|
||||||
needs: validate-inputs
|
|
||||||
if: ${{ (github.event_name == 'workflow_dispatch' && inputs.build_macos && inputs.macos_gui == 'nsh') || (startsWith(github.ref, 'refs/tags/') && vars.BUILD_MACOS_ON_TAG == 'true') }}
|
|
||||||
uses: ./.github/workflows/check-nsh.yaml
|
|
||||||
with:
|
|
||||||
gp_ref: ${{ needs.validate-inputs.outputs.gp_sha }}
|
|
||||||
gpgui_ref: ${{ needs.validate-inputs.outputs.gpgui_sha }}
|
|
||||||
secrets:
|
|
||||||
GH_PAT: ${{ secrets.GH_PAT }}
|
|
||||||
|
|
||||||
tarball:
|
tarball:
|
||||||
needs: validate-inputs
|
needs: validate-inputs
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -221,7 +122,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
token: ${{ secrets.GH_PAT }}
|
token: ${{ secrets.GH_PAT }}
|
||||||
repository: yuezk/GlobalProtect-openconnect
|
repository: yuezk/GlobalProtect-openconnect
|
||||||
ref: ${{ needs.validate-inputs.outputs.gp_sha }}
|
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.gp_branch || github.ref }}
|
||||||
path: source/gp
|
path: source/gp
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
|
|
||||||
@@ -351,7 +252,6 @@ jobs:
|
|||||||
build-gp-${{ matrix.package }}/artifacts/*
|
build-gp-${{ matrix.package }}/artifacts/*
|
||||||
|
|
||||||
build-docker-image:
|
build-docker-image:
|
||||||
needs: validate-inputs
|
|
||||||
if: ${{ !(startsWith(github.ref, 'refs/tags/') || (github.event_name == 'workflow_dispatch' && inputs.channel == 'stable')) }}
|
if: ${{ !(startsWith(github.ref, 'refs/tags/') || (github.event_name == 'workflow_dispatch' && inputs.channel == 'stable')) }}
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
@@ -372,7 +272,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
token: ${{ secrets.GH_PAT }}
|
token: ${{ secrets.GH_PAT }}
|
||||||
repository: yuezk/GlobalProtect-openconnect
|
repository: yuezk/GlobalProtect-openconnect
|
||||||
ref: ${{ needs.validate-inputs.outputs.gp_sha }}
|
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.gp_branch || github.ref }}
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v4
|
uses: docker/setup-buildx-action@v4
|
||||||
@@ -434,8 +334,8 @@ jobs:
|
|||||||
name: build-gpgui (glibc)
|
name: build-gpgui (glibc)
|
||||||
uses: ./.github/workflows/build-gpgui-linux.yaml
|
uses: ./.github/workflows/build-gpgui-linux.yaml
|
||||||
with:
|
with:
|
||||||
gp_ref: ${{ needs.validate-inputs.outputs.gp_sha }}
|
gp_ref: ${{ github.event_name == 'workflow_dispatch' && inputs.gp_branch || github.ref }}
|
||||||
gpgui_ref: ${{ needs.validate-inputs.outputs.gpgui_sha }}
|
gpgui_ref: ${{ github.event_name == 'workflow_dispatch' && inputs.gpgui_branch || github.ref_name }}
|
||||||
channel: ${{ github.event_name == 'workflow_dispatch' && inputs.channel || 'stable' }}
|
channel: ${{ github.event_name == 'workflow_dispatch' && inputs.channel || 'stable' }}
|
||||||
builder: gpgui-builder-tauri2
|
builder: gpgui-builder-tauri2
|
||||||
verify_desktop_assets: true
|
verify_desktop_assets: true
|
||||||
@@ -447,26 +347,16 @@ jobs:
|
|||||||
name: build-gpgui (musl)
|
name: build-gpgui (musl)
|
||||||
uses: ./.github/workflows/build-gpgui-linux.yaml
|
uses: ./.github/workflows/build-gpgui-linux.yaml
|
||||||
with:
|
with:
|
||||||
gp_ref: ${{ needs.validate-inputs.outputs.gp_sha }}
|
gp_ref: ${{ github.event_name == 'workflow_dispatch' && inputs.gp_branch || github.ref }}
|
||||||
gpgui_ref: ${{ needs.validate-inputs.outputs.gpgui_sha }}
|
gpgui_ref: ${{ github.event_name == 'workflow_dispatch' && inputs.gpgui_branch || github.ref_name }}
|
||||||
channel: ${{ github.event_name == 'workflow_dispatch' && inputs.channel || 'stable' }}
|
channel: ${{ github.event_name == 'workflow_dispatch' && inputs.channel || 'stable' }}
|
||||||
builder: gpgui-alpine-builder-tauri2
|
builder: gpgui-alpine-builder-tauri2
|
||||||
artifact_suffix: -musl
|
artifact_suffix: -musl
|
||||||
secrets:
|
secrets:
|
||||||
GH_PAT: ${{ secrets.GH_PAT }}
|
GH_PAT: ${{ secrets.GH_PAT }}
|
||||||
|
|
||||||
build-gpgui-nsh:
|
|
||||||
needs: validate-inputs
|
|
||||||
uses: ./.github/workflows/build-gpgui-nsh-linux.yaml
|
|
||||||
with:
|
|
||||||
gp_ref: ${{ needs.validate-inputs.outputs.gp_sha }}
|
|
||||||
gpgui_ref: ${{ needs.validate-inputs.outputs.gpgui_sha }}
|
|
||||||
channel: ${{ github.event_name == 'workflow_dispatch' && inputs.channel || 'stable' }}
|
|
||||||
secrets:
|
|
||||||
GH_PAT: ${{ secrets.GH_PAT }}
|
|
||||||
|
|
||||||
nix-source:
|
nix-source:
|
||||||
needs: [validate-inputs, build-gpgui-glibc]
|
needs: [build-gpgui-glibc]
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
@@ -487,7 +377,7 @@ jobs:
|
|||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.GH_PAT }}
|
token: ${{ secrets.GH_PAT }}
|
||||||
ref: ${{ needs.validate-inputs.outputs.gp_sha }}
|
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.gp_branch || github.ref }}
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
path: gp
|
path: gp
|
||||||
- name: Download current GUI artifact
|
- name: Download current GUI artifact
|
||||||
@@ -515,7 +405,7 @@ jobs:
|
|||||||
--extra-experimental-features "nix-command flakes" --print-build-logs
|
--extra-experimental-features "nix-command flakes" --print-build-logs
|
||||||
|
|
||||||
nix-prebuilt:
|
nix-prebuilt:
|
||||||
needs: [validate-inputs, build-gp, build-gpgui-glibc]
|
needs: [build-gp, build-gpgui-glibc]
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
@@ -537,7 +427,7 @@ jobs:
|
|||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.GH_PAT }}
|
token: ${{ secrets.GH_PAT }}
|
||||||
ref: ${{ needs.validate-inputs.outputs.gp_sha }}
|
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.gp_branch || github.ref }}
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
path: gp
|
path: gp
|
||||||
- name: Download current Linux binary artifact
|
- name: Download current Linux binary artifact
|
||||||
@@ -577,300 +467,94 @@ jobs:
|
|||||||
nix build --impure --file gp/nix/ci.nix runtime-prebuilt \
|
nix build --impure --file gp/nix/ci.nix runtime-prebuilt \
|
||||||
--extra-experimental-features "nix-command flakes" --print-build-logs
|
--extra-experimental-features "nix-command flakes" --print-build-logs
|
||||||
|
|
||||||
build-macos:
|
trigger-gpgui-macos:
|
||||||
name: build-macos
|
needs: test-gp
|
||||||
needs: [validate-inputs, test-gp, test-gpgui, check-nsh]
|
if: ${{ (github.event_name == 'workflow_dispatch' && inputs.build_macos) || (startsWith(github.ref, 'refs/tags/') && vars.BUILD_MACOS_ON_TAG == 'true') }}
|
||||||
if: >-
|
|
||||||
${{ !cancelled() &&
|
|
||||||
needs.validate-inputs.result == 'success' &&
|
|
||||||
needs.test-gp.result == 'success' && needs.test-gpgui.result == 'success' &&
|
|
||||||
(needs.check-nsh.result == 'success' || needs.check-nsh.result == 'skipped') &&
|
|
||||||
((github.event_name == 'workflow_dispatch' && inputs.build_macos) ||
|
|
||||||
(startsWith(github.ref, 'refs/tags/') && vars.BUILD_MACOS_ON_TAG == 'true')) }}
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
concurrency:
|
runs-on: ubuntu-latest
|
||||||
group: macos-build
|
name: trigger private macOS build
|
||||||
cancel-in-progress: false
|
outputs:
|
||||||
runs-on: ${{ vars.MACOS_RUNNER || 'macos-15' }}
|
run_id: ${{ steps.dispatch.outputs.run_id }}
|
||||||
environment: macos-release
|
run_url: ${{ steps.dispatch.outputs.run_url }}
|
||||||
timeout-minutes: 120
|
|
||||||
env:
|
|
||||||
MACOS_GUI: ${{ github.event_name == 'workflow_dispatch' && inputs.macos_gui || 'nsh' }}
|
|
||||||
steps:
|
steps:
|
||||||
- name: Verify runner architecture
|
- name: Dispatch private macOS build
|
||||||
run: test "$(uname -m)" = arm64
|
id: dispatch
|
||||||
|
|
||||||
- name: Select Xcode toolchain
|
|
||||||
env:
|
|
||||||
DEVELOPER_DIR: /Applications/Xcode_26.3.app/Contents/Developer
|
|
||||||
run: |
|
|
||||||
set -euo pipefail
|
|
||||||
xcodebuild -version
|
|
||||||
xcrun swift --version
|
|
||||||
echo "DEVELOPER_DIR=$DEVELOPER_DIR" >> "$GITHUB_ENV"
|
|
||||||
|
|
||||||
- uses: pnpm/action-setup@v5
|
|
||||||
with:
|
|
||||||
version: 9.15.1
|
|
||||||
|
|
||||||
- name: Checkout CI helpers
|
|
||||||
uses: actions/checkout@v6
|
|
||||||
with:
|
|
||||||
path: .ci
|
|
||||||
persist-credentials: false
|
|
||||||
- name: Checkout gpgui source
|
|
||||||
uses: ./.ci/.github/actions/checkout-private
|
|
||||||
with:
|
|
||||||
token: ${{ secrets.GH_PAT }}
|
|
||||||
ref: ${{ needs.validate-inputs.outputs.gpgui_sha }}
|
|
||||||
path: source/gpgui
|
|
||||||
|
|
||||||
- name: Checkout GlobalProtect-openconnect source
|
|
||||||
uses: actions/checkout@v6
|
|
||||||
with:
|
|
||||||
repository: yuezk/GlobalProtect-openconnect
|
|
||||||
ref: ${{ needs.validate-inputs.outputs.gp_sha }}
|
|
||||||
path: source/gp
|
|
||||||
submodules: recursive
|
|
||||||
|
|
||||||
- name: Verify stable source commits
|
|
||||||
if: ${{ (github.event_name == 'workflow_dispatch' && inputs.channel || 'stable') == 'stable' }}
|
|
||||||
env:
|
|
||||||
GH_TOKEN: ${{ secrets.GH_PAT }}
|
|
||||||
RELEASE_TAG: ${{ (github.event_name == 'workflow_dispatch' && (inputs.channel == 'stable' && inputs.gp_branch || 'snapshot') || github.ref_name) }}
|
|
||||||
run: |
|
|
||||||
trap 'status=$?; if [ "$status" -ne 0 ]; then echo "::error::Stable source tag verification failed; diagnostics suppressed."; fi' EXIT
|
|
||||||
(
|
|
||||||
set -euo pipefail
|
|
||||||
git -C source/gp fetch --no-tags origin "refs/tags/$RELEASE_TAG"
|
|
||||||
test "$(git -C source/gp rev-parse HEAD)" = "$(git -C source/gp rev-parse 'FETCH_HEAD^{commit}')"
|
|
||||||
tagged_gui_commit="$(gh api "repos/yuezk/gpgui/commits/$RELEASE_TAG" --jq .sha)"
|
|
||||||
test "$(git -C source/gpgui rev-parse HEAD)" = "$tagged_gui_commit"
|
|
||||||
) >/dev/null 2>&1
|
|
||||||
echo "Stable source tags verified."
|
|
||||||
|
|
||||||
- uses: actions/setup-node@v6
|
|
||||||
with:
|
|
||||||
node-version: 22
|
|
||||||
|
|
||||||
- name: Prepare release metadata
|
|
||||||
env:
|
|
||||||
FEED_URL: ${{ vars.SPARKLE_FEED_URL }}
|
|
||||||
CHANNEL: ${{ (github.event_name == 'workflow_dispatch' && inputs.channel || 'stable') }}
|
|
||||||
RELEASE_TAG: ${{ (github.event_name == 'workflow_dispatch' && (inputs.channel == 'stable' && inputs.gp_branch || 'snapshot') || github.ref_name) }}
|
|
||||||
BUILD_VERSION: ${{ format('{0}.{1}', github.run_number, github.run_attempt) }}
|
|
||||||
run: |
|
|
||||||
set -euo pipefail
|
|
||||||
|
|
||||||
gp_version="$(sed -n 's/^version = "\([^"]*\)"/\1/p' source/gp/Cargo.toml | head -1)"
|
|
||||||
gpgui_version="$(sed -n 's/^version = "\([^"]*\)"/\1/p' source/gpgui/Cargo.toml | head -1)"
|
|
||||||
if [[ -z "$gp_version" || "$gp_version" != "$gpgui_version" ]]; then
|
|
||||||
echo "gp and gpgui versions must match: gp=$gp_version, gpgui=$gpgui_version" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
if [[ "$FEED_URL" != https://*/appcast.xml ]]; then
|
|
||||||
echo "SPARKLE_FEED_URL must be an HTTPS URL ending in /appcast.xml" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ "$CHANNEL" == "stable" ]]; then
|
|
||||||
artifact_version="$gpgui_version"
|
|
||||||
if [[ "$RELEASE_TAG" != "v$gpgui_version" ]]; then
|
|
||||||
echo "Release tag does not match gpgui version $gpgui_version" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
artifact_version="${gpgui_version}-snapshot.${BUILD_VERSION}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
{
|
|
||||||
echo "MACOS_BUILD_NUMBER=$BUILD_VERSION"
|
|
||||||
echo "MACOS_ARTIFACT_VERSION=$artifact_version"
|
|
||||||
echo "SPARKLE_FEED_URL=$FEED_URL"
|
|
||||||
echo "SPARKLE_UPDATE_CHANNEL=$CHANNEL"
|
|
||||||
} >> "$GITHUB_ENV"
|
|
||||||
|
|
||||||
- name: Install build dependencies
|
|
||||||
run: |
|
|
||||||
brew install \
|
|
||||||
autoconf \
|
|
||||||
automake \
|
|
||||||
create-dmg \
|
|
||||||
dylibbundler \
|
|
||||||
gettext \
|
|
||||||
libtool \
|
|
||||||
meson \
|
|
||||||
ninja \
|
|
||||||
pkgconf \
|
|
||||||
python
|
|
||||||
rustup toolchain install 1.97.0 --profile minimal
|
|
||||||
|
|
||||||
- name: Prepare cached native dependencies
|
|
||||||
uses: ./.ci/.github/actions/macos-native-deps
|
|
||||||
with:
|
|
||||||
gpgui-directory: source/gpgui
|
|
||||||
|
|
||||||
- name: Import signing identity
|
|
||||||
env:
|
|
||||||
MACOS_CERTIFICATE_P12: ${{ secrets.MACOS_CERTIFICATE_P12 }}
|
|
||||||
MACOS_CERTIFICATE_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }}
|
|
||||||
APPLE_NOTARY_KEY_P8: ${{ secrets.APPLE_NOTARY_KEY_P8 }}
|
|
||||||
APPLE_NOTARY_KEY_ID: ${{ secrets.APPLE_NOTARY_KEY_ID }}
|
|
||||||
APPLE_NOTARY_ISSUER_ID: ${{ secrets.APPLE_NOTARY_ISSUER_ID }}
|
|
||||||
run: |
|
|
||||||
set -euo pipefail
|
|
||||||
|
|
||||||
for variable in \
|
|
||||||
MACOS_CERTIFICATE_P12 \
|
|
||||||
MACOS_CERTIFICATE_PASSWORD; do
|
|
||||||
if [[ -z "${!variable:-}" ]]; then
|
|
||||||
echo "$variable is not configured" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
for variable in \
|
|
||||||
APPLE_NOTARY_KEY_P8 \
|
|
||||||
APPLE_NOTARY_KEY_ID \
|
|
||||||
APPLE_NOTARY_ISSUER_ID; do
|
|
||||||
if [[ -z "${!variable:-}" ]]; then
|
|
||||||
echo "$variable is not configured" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
keychain="$RUNNER_TEMP/gp-connect.keychain-db"
|
|
||||||
keychain_password="$(uuidgen)"
|
|
||||||
certificate="$RUNNER_TEMP/signing-identity.p12"
|
|
||||||
printf '%s' "$MACOS_CERTIFICATE_P12" | base64 -D > "$certificate"
|
|
||||||
chmod 600 "$certificate"
|
|
||||||
|
|
||||||
security create-keychain -p "$keychain_password" "$keychain"
|
|
||||||
security set-keychain-settings -lut 21600 "$keychain"
|
|
||||||
security unlock-keychain -p "$keychain_password" "$keychain"
|
|
||||||
security import "$certificate" -k "$keychain" \
|
|
||||||
-P "$MACOS_CERTIFICATE_PASSWORD" -A -t cert -f pkcs12
|
|
||||||
security set-key-partition-list -S apple-tool:,apple: \
|
|
||||||
-s -k "$keychain_password" "$keychain"
|
|
||||||
security list-keychains -d user -s "$keychain" login.keychain-db
|
|
||||||
|
|
||||||
identity="$(security find-identity -v -p codesigning "$keychain" \
|
|
||||||
| sed -n 's/.*"\(Developer ID Application:.*\)"/\1/p' | head -1)"
|
|
||||||
if [[ -z "$identity" ]]; then
|
|
||||||
echo "A Developer ID Application signing identity was not found" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
{
|
|
||||||
echo "CI_KEYCHAIN=$keychain"
|
|
||||||
echo "MACOS_SIGN_IDENTITY=$identity"
|
|
||||||
} >> "$GITHUB_ENV"
|
|
||||||
notary_key="$RUNNER_TEMP/AuthKey.p8"
|
|
||||||
notary_profile="gp-connect-ci"
|
|
||||||
printf '%s' "$APPLE_NOTARY_KEY_P8" > "$notary_key"
|
|
||||||
chmod 600 "$notary_key"
|
|
||||||
xcrun notarytool store-credentials "$notary_profile" \
|
|
||||||
--key "$notary_key" \
|
|
||||||
--key-id "$APPLE_NOTARY_KEY_ID" \
|
|
||||||
--issuer "$APPLE_NOTARY_ISSUER_ID" \
|
|
||||||
--keychain "$keychain"
|
|
||||||
{
|
|
||||||
echo "APPLE_NOTARY_PROFILE=$notary_profile"
|
|
||||||
echo "APPLE_NOTARY_KEYCHAIN=$keychain"
|
|
||||||
} >> "$GITHUB_ENV"
|
|
||||||
|
|
||||||
- name: Build macOS release artifacts
|
|
||||||
env:
|
env:
|
||||||
|
GH_TOKEN: ${{ secrets.GPGUI_ACTIONS_TOKEN }}
|
||||||
|
PUBLIC_GH_TOKEN: ${{ github.token }}
|
||||||
CHANNEL: ${{ github.event_name == 'workflow_dispatch' && inputs.channel || 'stable' }}
|
CHANNEL: ${{ github.event_name == 'workflow_dispatch' && inputs.channel || 'stable' }}
|
||||||
GPGUI_GIT_COMMIT: ${{ needs.validate-inputs.outputs.gpgui_sha }}
|
RELEASE_TAG: ${{ github.event_name == 'workflow_dispatch' && (inputs.channel == 'stable' && inputs.gp_branch || 'snapshot') || github.ref_name }}
|
||||||
SPARKLE_PUBLIC_KEY: ${{ vars.SPARKLE_PUBLIC_KEY }}
|
GP_REF: ${{ github.event_name == 'workflow_dispatch' && inputs.gp_branch || github.ref_name }}
|
||||||
GPGUI_LICENSE_SIGNING_KEYS: ${{ vars.GPGUI_LICENSE_SIGNING_KEYS }}
|
GPGUI_REF: ${{ github.event_name == 'workflow_dispatch' && inputs.gpgui_branch || github.ref_name }}
|
||||||
run: |
|
BUILD_VERSION: ${{ github.run_number }}.${{ github.run_attempt }}
|
||||||
set -euo pipefail
|
REQUEST_ID: ${{ github.run_id }}.${{ github.run_attempt }}.macos
|
||||||
trap 'status=$?; if [ "$status" -ne 0 ]; then echo "::error::Private operation failed; diagnostics suppressed."; fi' EXIT
|
|
||||||
(
|
|
||||||
set -euo pipefail
|
|
||||||
if [[ "$CHANNEL" == "snapshot" ]]; then
|
|
||||||
export GPGUI_RELEASE_DEVTOOLS=1
|
|
||||||
fi
|
|
||||||
source/gpgui/scripts/build-macos.sh dmg release --gui "$MACOS_GUI"
|
|
||||||
) 2>&1 | awk '
|
|
||||||
/^MACOS_STAGE: (Native dependencies|Components|Frontend|Application|Bundle|Bundle icons|Bundle metadata|Bundle licenses|Bundle libraries|Bundle frameworks|Bundle optimization|Signing|Validation|App notarization|Update archive|Disk image|Disk image notarization|Complete)$/ {
|
|
||||||
print "::notice::" $0
|
|
||||||
fflush()
|
|
||||||
}
|
|
||||||
'
|
|
||||||
echo "Private operation passed."
|
|
||||||
|
|
||||||
- name: Prepare release assets
|
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
artifact_dir="release-assets"
|
if [[ -z "${GH_TOKEN:-}" ]]; then
|
||||||
rm -rf "$artifact_dir"
|
echo "GPGUI_ACTIONS_TOKEN is not configured" >&2
|
||||||
mkdir -p "$artifact_dir"
|
|
||||||
dmg_name="GPConnect_${MACOS_ARTIFACT_VERSION}_arm64.dmg"
|
|
||||||
archive_name="GPConnect_${MACOS_ARTIFACT_VERSION}_arm64.zip"
|
|
||||||
mv "source/gpgui/target/release/bundle/dmg/GP Connect.dmg" \
|
|
||||||
"$artifact_dir/$dmg_name"
|
|
||||||
mv "source/gpgui/target/release/bundle/sparkle/$archive_name" \
|
|
||||||
"$artifact_dir/$archive_name"
|
|
||||||
(
|
|
||||||
cd "$artifact_dir"
|
|
||||||
for file in *; do
|
|
||||||
shasum -a 256 "$file" > "$file.sha256"
|
|
||||||
done
|
|
||||||
)
|
|
||||||
|
|
||||||
- name: Record build identity
|
|
||||||
env:
|
|
||||||
CHANNEL: ${{ (github.event_name == 'workflow_dispatch' && inputs.channel || 'stable') }}
|
|
||||||
RELEASE_TAG: ${{ (github.event_name == 'workflow_dispatch' && (inputs.channel == 'stable' && inputs.gp_branch || 'snapshot') || github.ref_name) }}
|
|
||||||
REQUEST_ID: ${{ format('{0}.{1}.macos', github.run_id, github.run_attempt) }}
|
|
||||||
BUILD_VERSION: ${{ format('{0}.{1}', github.run_number, github.run_attempt) }}
|
|
||||||
WORKFLOW_SHA: ${{ github.sha }}
|
|
||||||
run: |
|
|
||||||
set -euo pipefail
|
|
||||||
GP_REF="$(git -C source/gp rev-parse HEAD)"
|
|
||||||
GPGUI_REF="$(git -C source/gpgui rev-parse HEAD)"
|
|
||||||
GUI="$(plutil -extract GPDesktopShell raw 'source/gpgui/target/release/bundle/macos/GP Connect.app/Contents/Info.plist')"
|
|
||||||
if [[ "$GUI" != "$MACOS_GUI" ]]; then
|
|
||||||
echo "Built desktop shell does not match the selected GUI" >&2
|
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
export GP_REF GPGUI_REF GUI
|
|
||||||
python3 - <<'PYTHON'
|
|
||||||
import hashlib
|
|
||||||
import json
|
|
||||||
import os
|
|
||||||
from pathlib import Path
|
|
||||||
directory = Path("release-assets")
|
|
||||||
metadata = {key.lower(): os.environ[key] for key in (
|
|
||||||
"CHANNEL", "RELEASE_TAG", "GP_REF", "GPGUI_REF", "REQUEST_ID", "BUILD_VERSION", "WORKFLOW_SHA", "GUI")}
|
|
||||||
metadata["artifact_version"] = os.environ["MACOS_ARTIFACT_VERSION"]
|
|
||||||
metadata["assets"] = {
|
|
||||||
file.name: hashlib.sha256(file.read_bytes()).hexdigest()
|
|
||||||
for file in directory.iterdir() if file.is_file()
|
|
||||||
}
|
|
||||||
(directory / "release-build.json").write_text(json.dumps(metadata, indent=2) + "\n")
|
|
||||||
PYTHON
|
|
||||||
|
|
||||||
- name: Upload macOS build artifact
|
gp_ref_path="$(jq -rn --arg ref "$GP_REF" '$ref | @uri')"
|
||||||
uses: actions/upload-artifact@v7
|
gpgui_ref_path="$(jq -rn --arg ref "$GPGUI_REF" '$ref | @uri')"
|
||||||
with:
|
gp_sha="$(GH_TOKEN="$PUBLIC_GH_TOKEN" gh api \
|
||||||
name: macos-release-${{ format('{0}.{1}.macos', github.run_id, github.run_attempt) }}
|
"repos/yuezk/GlobalProtect-openconnect/commits/$gp_ref_path" --jq .sha)"
|
||||||
if-no-files-found: error
|
gpgui_sha="$(gh api "repos/yuezk/gpgui/commits/$gpgui_ref_path" --jq .sha)"
|
||||||
overwrite: true
|
if [[ -z "$gp_sha" || -z "$gpgui_sha" ]]; then
|
||||||
retention-days: 30
|
echo "Could not resolve release source refs" >&2
|
||||||
path: release-assets/*
|
exit 1
|
||||||
|
|
||||||
- name: Remove signing keychain
|
|
||||||
if: ${{ always() }}
|
|
||||||
run: |
|
|
||||||
if [[ -n "${CI_KEYCHAIN:-}" && -f "$CI_KEYCHAIN" ]]; then
|
|
||||||
security delete-keychain "$CI_KEYCHAIN"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
expected_title="macOS build $CHANNEL $RELEASE_TAG ($REQUEST_ID)"
|
||||||
|
jq -n \
|
||||||
|
--arg workflow_ref "$GPGUI_REF" \
|
||||||
|
--arg request_id "$REQUEST_ID" \
|
||||||
|
--arg build_version "$BUILD_VERSION" \
|
||||||
|
--arg channel "$CHANNEL" \
|
||||||
|
--arg release_tag "$RELEASE_TAG" \
|
||||||
|
--arg gp_ref "$gp_sha" \
|
||||||
|
--arg gpgui_ref "$gpgui_sha" \
|
||||||
|
'{
|
||||||
|
ref: $workflow_ref,
|
||||||
|
inputs: {
|
||||||
|
request_id: $request_id,
|
||||||
|
build_version: $build_version,
|
||||||
|
channel: $channel,
|
||||||
|
release_tag: $release_tag,
|
||||||
|
gp_ref: $gp_ref,
|
||||||
|
gpgui_ref: $gpgui_ref
|
||||||
|
}
|
||||||
|
}' | gh api --method POST \
|
||||||
|
repos/yuezk/gpgui/actions/workflows/build-macos.yaml/dispatches \
|
||||||
|
--input -
|
||||||
|
|
||||||
|
run_id=""
|
||||||
|
run_url=""
|
||||||
|
for _ in {1..40}; do
|
||||||
|
runs="$(gh api \
|
||||||
|
'repos/yuezk/gpgui/actions/workflows/build-macos.yaml/runs?event=workflow_dispatch&per_page=50')"
|
||||||
|
run_id="$(jq -r --arg title "$expected_title" \
|
||||||
|
'[.workflow_runs[] | select(.display_title == $title)] | first | .id // empty' \
|
||||||
|
<<<"$runs")"
|
||||||
|
run_url="$(jq -r --arg title "$expected_title" \
|
||||||
|
'[.workflow_runs[] | select(.display_title == $title)] | first | .html_url // empty' \
|
||||||
|
<<<"$runs")"
|
||||||
|
if [[ -n "$run_id" ]]; then
|
||||||
|
{
|
||||||
|
echo "run_id=$run_id"
|
||||||
|
echo "run_url=$run_url"
|
||||||
|
} >> "$GITHUB_OUTPUT"
|
||||||
|
echo "Triggered private workflow: $run_url"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
sleep 3
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "Could not locate the dispatched private workflow run" >&2
|
||||||
|
exit 1
|
||||||
|
|
||||||
setup-bsd-matrix:
|
setup-bsd-matrix:
|
||||||
needs: validate-inputs
|
needs: validate-inputs
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -916,7 +600,7 @@ jobs:
|
|||||||
PY
|
PY
|
||||||
|
|
||||||
build-gpgui-frontend:
|
build-gpgui-frontend:
|
||||||
needs: [validate-inputs, setup-bsd-matrix]
|
needs: setup-bsd-matrix
|
||||||
if: ${{ needs.setup-bsd-matrix.outputs.enabled == 'true' }}
|
if: ${{ needs.setup-bsd-matrix.outputs.enabled == 'true' }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
@@ -930,31 +614,21 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
token: ${{ secrets.GH_PAT }}
|
token: ${{ secrets.GH_PAT }}
|
||||||
repository: yuezk/GlobalProtect-openconnect
|
repository: yuezk/GlobalProtect-openconnect
|
||||||
ref: ${{ needs.validate-inputs.outputs.gp_sha }}
|
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.gp_branch || github.ref }}
|
||||||
path: gpgui-frontend/gp
|
path: gpgui-frontend/gp
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
- name: Checkout CI helpers
|
- name: Checkout gpgui
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v6
|
||||||
with:
|
|
||||||
path: .ci
|
|
||||||
persist-credentials: false
|
|
||||||
- name: Checkout gpgui
|
|
||||||
uses: ./.ci/.github/actions/checkout-private
|
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.GH_PAT }}
|
token: ${{ secrets.GH_PAT }}
|
||||||
ref: ${{ needs.validate-inputs.outputs.gpgui_sha }}
|
repository: yuezk/gpgui
|
||||||
|
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.gpgui_branch || github.ref_name }}
|
||||||
path: gpgui-frontend/gpgui
|
path: gpgui-frontend/gpgui
|
||||||
- name: Build gpgui frontend
|
- name: Build gpgui frontend
|
||||||
run: |
|
run: |
|
||||||
trap 'status=$?; if [ "$status" -ne 0 ]; then echo "::error::Private operation failed; diagnostics suppressed."; fi' EXIT
|
|
||||||
(
|
|
||||||
set -euo pipefail
|
|
||||||
cd gpgui-frontend/gpgui/apps/desktop
|
cd gpgui-frontend/gpgui/apps/desktop
|
||||||
pnpm install --frozen-lockfile
|
pnpm install --frozen-lockfile
|
||||||
pnpm build
|
pnpm build
|
||||||
) >/dev/null 2>&1
|
|
||||||
echo "Private operation passed."
|
|
||||||
|
|
||||||
- name: Upload gpgui frontend
|
- name: Upload gpgui frontend
|
||||||
uses: actions/upload-artifact@v7
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
@@ -964,7 +638,6 @@ jobs:
|
|||||||
|
|
||||||
build-bsd:
|
build-bsd:
|
||||||
needs:
|
needs:
|
||||||
- validate-inputs
|
|
||||||
- setup-bsd-matrix
|
- setup-bsd-matrix
|
||||||
- build-gpgui-frontend
|
- build-gpgui-frontend
|
||||||
if: ${{ needs.setup-bsd-matrix.outputs.enabled == 'true' }}
|
if: ${{ needs.setup-bsd-matrix.outputs.enabled == 'true' }}
|
||||||
@@ -981,19 +654,15 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
token: ${{ secrets.GH_PAT }}
|
token: ${{ secrets.GH_PAT }}
|
||||||
repository: yuezk/GlobalProtect-openconnect
|
repository: yuezk/GlobalProtect-openconnect
|
||||||
ref: ${{ needs.validate-inputs.outputs.gp_sha }}
|
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.gp_branch || github.ref }}
|
||||||
path: ${{ matrix.workspace }}/gp
|
path: ${{ matrix.workspace }}/gp
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
- name: Checkout CI helpers
|
- name: Checkout gpgui
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v6
|
||||||
with:
|
|
||||||
path: .ci
|
|
||||||
persist-credentials: false
|
|
||||||
- name: Checkout gpgui
|
|
||||||
uses: ./.ci/.github/actions/checkout-private
|
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.GH_PAT }}
|
token: ${{ secrets.GH_PAT }}
|
||||||
ref: ${{ needs.validate-inputs.outputs.gpgui_sha }}
|
repository: yuezk/gpgui
|
||||||
|
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.gpgui_branch || github.ref_name }}
|
||||||
path: ${{ matrix.workspace }}/gpgui
|
path: ${{ matrix.workspace }}/gpgui
|
||||||
- name: Download gpgui frontend
|
- name: Download gpgui frontend
|
||||||
uses: actions/download-artifact@v8
|
uses: actions/download-artifact@v8
|
||||||
@@ -1020,7 +689,6 @@ jobs:
|
|||||||
gmake \
|
gmake \
|
||||||
pkgconf \
|
pkgconf \
|
||||||
libxml2 \
|
libxml2 \
|
||||||
liblz4 \
|
|
||||||
gnutls \
|
gnutls \
|
||||||
p11-kit \
|
p11-kit \
|
||||||
nettle \
|
nettle \
|
||||||
@@ -1029,44 +697,19 @@ jobs:
|
|||||||
libayatana-appindicator \
|
libayatana-appindicator \
|
||||||
polkit \
|
polkit \
|
||||||
webkit2-gtk_41
|
webkit2-gtk_41
|
||||||
pkgconf --exists libxml-2.0 liblz4 gnutls p11-kit-1 hogweed nettle gmp
|
|
||||||
run: |
|
run: |
|
||||||
set -eu
|
|
||||||
exec 3>&1
|
|
||||||
(
|
|
||||||
set -eu
|
set -eu
|
||||||
export GPGUI_BUILD_VERSION=${{ github.run_number }}.${{ github.run_attempt }}
|
export GPGUI_BUILD_VERSION=${{ github.run_number }}.${{ github.run_attempt }}
|
||||||
export GPGUI_UPDATE_CHANNEL=${{ github.event_name == 'workflow_dispatch' && inputs.channel || 'stable' }}
|
export GPGUI_UPDATE_CHANNEL=${{ github.event_name == 'workflow_dispatch' && inputs.channel || 'stable' }}
|
||||||
export GPGUI_LICENSE_SIGNING_KEYS='${{ vars.GPGUI_LICENSE_SIGNING_KEYS }}'
|
export GPGUI_LICENSE_SIGNING_KEYS='${{ vars.GPGUI_LICENSE_SIGNING_KEYS }}'
|
||||||
|
|
||||||
cd "${{ matrix.workspace }}/gp"
|
cd "${{ matrix.workspace }}/gp"
|
||||||
echo "BSD public components: started." >&3
|
cargo build --release --workspace
|
||||||
cargo build --release --workspace >&3 2>&3
|
|
||||||
echo "BSD public components: passed." >&3
|
|
||||||
|
|
||||||
cd ../gpgui/apps/desktop/src-tauri
|
cd ../gpgui/apps/desktop/src-tauri
|
||||||
echo "BSD desktop: started." >&3
|
cargo build --release --workspace
|
||||||
diagnostics="$(mktemp)"
|
|
||||||
trap 'rm -f "$diagnostics" || true' EXIT
|
|
||||||
if cargo build --release -p gpgui >"$diagnostics" 2>&1; then
|
|
||||||
echo "BSD desktop: passed." >&3
|
|
||||||
else
|
|
||||||
status=$?
|
|
||||||
sed -n 's/.*\(error\[E[0-9][0-9][0-9][0-9]\]\).*/::error::BSD Rust diagnostic: \1/p' "$diagnostics" | sort -u >&3 || true
|
|
||||||
if grep -q 'No space left on device' "$diagnostics"; then
|
|
||||||
echo "::error::BSD desktop compilation: insufficient disk space." >&3
|
|
||||||
fi
|
|
||||||
if grep -Eq 'signal: 9, SIGKILL|ld terminated with signal 9|Killed signal terminated program' "$diagnostics"; then
|
|
||||||
echo "::error::BSD desktop compilation: compiler or linker killed by SIGKILL." >&3
|
|
||||||
fi
|
|
||||||
if grep -Eq 'undefined reference to|undefined symbol:' "$diagnostics"; then
|
|
||||||
echo "::error::BSD desktop compilation: unresolved linker symbols." >&3
|
|
||||||
fi
|
|
||||||
exit "$status"
|
|
||||||
fi
|
|
||||||
|
|
||||||
cd ../../../../gp
|
cd ../../../../gp
|
||||||
echo "BSD packaging: started." >&3
|
|
||||||
gmake "${{ matrix.package_target }}" GPGUI_BINARY=../gpgui/target/release/gpgui
|
gmake "${{ matrix.package_target }}" GPGUI_BINARY=../gpgui/target/release/gpgui
|
||||||
pkg install -y ".build/${{ matrix.artifact_dir }}"/artifacts/*.pkg
|
pkg install -y ".build/${{ matrix.artifact_dir }}"/artifacts/*.pkg
|
||||||
gpclient --version
|
gpclient --version
|
||||||
@@ -1074,9 +717,6 @@ jobs:
|
|||||||
gpgui --version
|
gpgui --version
|
||||||
rm -rf target ../gpgui/target
|
rm -rf target ../gpgui/target
|
||||||
find ".build/${{ matrix.artifact_dir }}" -mindepth 1 -maxdepth 1 ! -name artifacts -exec rm -rf {} +
|
find ".build/${{ matrix.artifact_dir }}" -mindepth 1 -maxdepth 1 ! -name artifacts -exec rm -rf {} +
|
||||||
echo "BSD packaging: passed." >&3
|
|
||||||
) >/dev/null 2>&1
|
|
||||||
echo "BSD build passed."
|
|
||||||
- name: Build on OpenBSD
|
- name: Build on OpenBSD
|
||||||
if: ${{ matrix.os == 'openbsd' }}
|
if: ${{ matrix.os == 'openbsd' }}
|
||||||
uses: vmactions/openbsd-vm@v1
|
uses: vmactions/openbsd-vm@v1
|
||||||
@@ -1113,9 +753,6 @@ jobs:
|
|||||||
ln -sf /usr/local/bin/aclocal-1.17 /usr/local/bin/aclocal
|
ln -sf /usr/local/bin/aclocal-1.17 /usr/local/bin/aclocal
|
||||||
ln -sf /usr/local/bin/automake-1.17 /usr/local/bin/automake
|
ln -sf /usr/local/bin/automake-1.17 /usr/local/bin/automake
|
||||||
run: |
|
run: |
|
||||||
set -eu
|
|
||||||
exec 3>&1
|
|
||||||
(
|
|
||||||
set -eu
|
set -eu
|
||||||
export AUTOCONF_VERSION=2.72
|
export AUTOCONF_VERSION=2.72
|
||||||
export AUTOMAKE_VERSION=1.17
|
export AUTOMAKE_VERSION=1.17
|
||||||
@@ -1124,33 +761,12 @@ jobs:
|
|||||||
export GPGUI_LICENSE_SIGNING_KEYS='${{ vars.GPGUI_LICENSE_SIGNING_KEYS }}'
|
export GPGUI_LICENSE_SIGNING_KEYS='${{ vars.GPGUI_LICENSE_SIGNING_KEYS }}'
|
||||||
|
|
||||||
cd "${{ matrix.workspace }}/gp"
|
cd "${{ matrix.workspace }}/gp"
|
||||||
echo "BSD public components: started." >&3
|
cargo build --release --workspace
|
||||||
cargo build --release --workspace >&3 2>&3
|
|
||||||
echo "BSD public components: passed." >&3
|
|
||||||
|
|
||||||
cd ../gpgui/apps/desktop/src-tauri
|
cd ../gpgui/apps/desktop/src-tauri
|
||||||
echo "BSD desktop: started." >&3
|
cargo build --release --workspace
|
||||||
diagnostics="$(mktemp)"
|
|
||||||
trap 'rm -f "$diagnostics" || true' EXIT
|
|
||||||
if cargo build --release -p gpgui >"$diagnostics" 2>&1; then
|
|
||||||
echo "BSD desktop: passed." >&3
|
|
||||||
else
|
|
||||||
status=$?
|
|
||||||
sed -n 's/.*\(error\[E[0-9][0-9][0-9][0-9]\]\).*/::error::BSD Rust diagnostic: \1/p' "$diagnostics" | sort -u >&3 || true
|
|
||||||
if grep -q 'No space left on device' "$diagnostics"; then
|
|
||||||
echo "::error::BSD desktop compilation: insufficient disk space." >&3
|
|
||||||
fi
|
|
||||||
if grep -Eq 'signal: 9, SIGKILL|ld terminated with signal 9|Killed signal terminated program' "$diagnostics"; then
|
|
||||||
echo "::error::BSD desktop compilation: compiler or linker killed by SIGKILL." >&3
|
|
||||||
fi
|
|
||||||
if grep -Eq 'undefined reference to|undefined symbol:' "$diagnostics"; then
|
|
||||||
echo "::error::BSD desktop compilation: unresolved linker symbols." >&3
|
|
||||||
fi
|
|
||||||
exit "$status"
|
|
||||||
fi
|
|
||||||
|
|
||||||
cd ../../../../gp
|
cd ../../../../gp
|
||||||
echo "BSD packaging: started." >&3
|
|
||||||
gmake "${{ matrix.package_target }}" GPGUI_BINARY=../gpgui/target/release/gpgui
|
gmake "${{ matrix.package_target }}" GPGUI_BINARY=../gpgui/target/release/gpgui
|
||||||
pkg_add -D unsigned ".build/${{ matrix.artifact_dir }}"/artifacts/*.tgz
|
pkg_add -D unsigned ".build/${{ matrix.artifact_dir }}"/artifacts/*.tgz
|
||||||
gpclient --version
|
gpclient --version
|
||||||
@@ -1158,9 +774,6 @@ jobs:
|
|||||||
gpgui --version
|
gpgui --version
|
||||||
rm -rf target ../gpgui/target
|
rm -rf target ../gpgui/target
|
||||||
find ".build/${{ matrix.artifact_dir }}" -mindepth 1 -maxdepth 1 ! -name artifacts -exec rm -rf {} +
|
find ".build/${{ matrix.artifact_dir }}" -mindepth 1 -maxdepth 1 ! -name artifacts -exec rm -rf {} +
|
||||||
echo "BSD packaging: passed." >&3
|
|
||||||
) >/dev/null 2>&1
|
|
||||||
echo "BSD build passed."
|
|
||||||
- name: Upload BSD package
|
- name: Upload BSD package
|
||||||
uses: actions/upload-artifact@v7
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
@@ -1179,9 +792,7 @@ jobs:
|
|||||||
attestations: write
|
attestations: write
|
||||||
artifact-metadata: write
|
artifact-metadata: write
|
||||||
needs:
|
needs:
|
||||||
- validate-inputs
|
|
||||||
- test-gp
|
- test-gp
|
||||||
- test-gpgui
|
|
||||||
- nix-source
|
- nix-source
|
||||||
- nix-prebuilt
|
- nix-prebuilt
|
||||||
- tarball
|
- tarball
|
||||||
@@ -1190,7 +801,6 @@ jobs:
|
|||||||
- build-docker-image
|
- build-docker-image
|
||||||
- build-gpgui-glibc
|
- build-gpgui-glibc
|
||||||
- build-gpgui-musl
|
- build-gpgui-musl
|
||||||
- build-gpgui-nsh
|
|
||||||
- setup-bsd-matrix
|
- setup-bsd-matrix
|
||||||
- build-gpgui-frontend
|
- build-gpgui-frontend
|
||||||
- build-bsd
|
- build-bsd
|
||||||
@@ -1238,7 +848,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
token: ${{ secrets.GH_PAT }}
|
token: ${{ secrets.GH_PAT }}
|
||||||
repository: yuezk/GlobalProtect-openconnect
|
repository: yuezk/GlobalProtect-openconnect
|
||||||
ref: ${{ needs.validate-inputs.outputs.gp_sha }}
|
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.gp_branch || github.ref }}
|
||||||
path: gh-release/gp
|
path: gh-release/gp
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
|
|
||||||
@@ -1286,11 +896,48 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
cd gh-release/gp/scripts && ./gh-release.sh "$RELEASE_TAG"
|
cd gh-release/gp/scripts && ./gh-release.sh "$RELEASE_TAG"
|
||||||
|
|
||||||
|
wait-gpgui-macos:
|
||||||
|
if: ${{ !cancelled() && needs.trigger-gpgui-macos.result == 'success' }}
|
||||||
|
needs:
|
||||||
|
- trigger-gpgui-macos
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 130
|
||||||
|
steps:
|
||||||
|
- name: Wait for private macOS build
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ secrets.GPGUI_ACTIONS_TOKEN }}
|
||||||
|
PRIVATE_RUN_ID: ${{ needs.trigger-gpgui-macos.outputs.run_id }}
|
||||||
|
PRIVATE_RUN_URL: ${{ needs.trigger-gpgui-macos.outputs.run_url }}
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
if [[ -z "$PRIVATE_RUN_ID" ]]; then
|
||||||
|
echo "The private macOS workflow was not started" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
for _ in $(seq 1 480); do
|
||||||
|
run="$(gh api "repos/yuezk/gpgui/actions/runs/$PRIVATE_RUN_ID")"
|
||||||
|
status="$(jq -r '.status' <<<"$run")"
|
||||||
|
conclusion="$(jq -r '.conclusion // ""' <<<"$run")"
|
||||||
|
if [[ "$status" == "completed" ]]; then
|
||||||
|
echo "Private macOS build completed: $PRIVATE_RUN_URL"
|
||||||
|
if [[ "$conclusion" != "success" ]]; then
|
||||||
|
echo "Private macOS build concluded with: $conclusion" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
sleep 15
|
||||||
|
done
|
||||||
|
|
||||||
|
gh api --method POST \
|
||||||
|
"repos/yuezk/gpgui/actions/runs/$PRIVATE_RUN_ID/cancel" >/dev/null || true
|
||||||
|
echo "Private macOS build timed out: $PRIVATE_RUN_URL" >&2
|
||||||
|
exit 1
|
||||||
|
|
||||||
publish-docker-image:
|
publish-docker-image:
|
||||||
needs:
|
needs:
|
||||||
- validate-inputs
|
|
||||||
- test-gp
|
- test-gp
|
||||||
- test-gpgui
|
|
||||||
- build-docker-image
|
- build-docker-image
|
||||||
if: ${{ (github.event_name == 'workflow_dispatch' && !inputs.build_only) || (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) }}
|
if: ${{ (github.event_name == 'workflow_dispatch' && !inputs.build_only) || (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|||||||
@@ -1,67 +0,0 @@
|
|||||||
name: Check macOS native dependency cache
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
gpgui_ref:
|
|
||||||
description: Full gpgui commit SHA
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
workflow_call:
|
|
||||||
inputs:
|
|
||||||
gpgui_ref:
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
secrets:
|
|
||||||
GH_PAT:
|
|
||||||
required: true
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
check:
|
|
||||||
runs-on: ${{ vars.MACOS_RUNNER || 'macos-15' }}
|
|
||||||
timeout-minutes: 30
|
|
||||||
steps:
|
|
||||||
- name: Require immutable source ref
|
|
||||||
env:
|
|
||||||
GPGUI_REF: ${{ inputs.gpgui_ref }}
|
|
||||||
run: test "${#GPGUI_REF}" -eq 40 && [[ "$GPGUI_REF" != *[!0-9a-f]* ]]
|
|
||||||
|
|
||||||
- uses: actions/checkout@v6
|
|
||||||
with:
|
|
||||||
path: .ci
|
|
||||||
persist-credentials: false
|
|
||||||
|
|
||||||
- name: Checkout gpgui quietly
|
|
||||||
uses: ./.ci/.github/actions/checkout-private
|
|
||||||
with:
|
|
||||||
token: ${{ secrets.GH_PAT }}
|
|
||||||
ref: ${{ inputs.gpgui_ref }}
|
|
||||||
path: source/gpgui
|
|
||||||
|
|
||||||
- name: Select release toolchain and install native build tools
|
|
||||||
env:
|
|
||||||
DEVELOPER_DIR: /Applications/Xcode_26.3.app/Contents/Developer
|
|
||||||
run: |
|
|
||||||
test "$(uname -m)" = arm64
|
|
||||||
xcodebuild -version
|
|
||||||
echo "DEVELOPER_DIR=$DEVELOPER_DIR" >> "$GITHUB_ENV"
|
|
||||||
brew install autoconf automake gettext libtool meson ninja pkgconf
|
|
||||||
|
|
||||||
- name: Prepare cached native dependencies
|
|
||||||
id: native
|
|
||||||
uses: ./.ci/.github/actions/macos-native-deps
|
|
||||||
with:
|
|
||||||
gpgui-directory: source/gpgui
|
|
||||||
|
|
||||||
- name: Record cache result
|
|
||||||
env:
|
|
||||||
CACHE_HIT: ${{ steps.native.outputs.cache-hit }}
|
|
||||||
run: |
|
|
||||||
if [[ "$CACHE_HIT" == true ]]; then
|
|
||||||
echo "Validated an exact native dependency cache hit." >> "$GITHUB_STEP_SUMMARY"
|
|
||||||
else
|
|
||||||
echo "Built and validated native dependencies after a cache miss." >> "$GITHUB_STEP_SUMMARY"
|
|
||||||
fi
|
|
||||||
@@ -1,139 +0,0 @@
|
|||||||
name: Check NSH
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
gp_ref:
|
|
||||||
description: 'Full GlobalProtect-openconnect commit SHA'
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
gpgui_ref:
|
|
||||||
description: 'Full gpgui commit SHA'
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
|
|
||||||
workflow_call:
|
|
||||||
inputs:
|
|
||||||
gp_ref:
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
gpgui_ref:
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
secrets:
|
|
||||||
GH_PAT:
|
|
||||||
required: true
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
check:
|
|
||||||
name: NSH (${{ matrix.platform }})
|
|
||||||
runs-on: ${{ matrix.runner }}
|
|
||||||
timeout-minutes: 90
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- platform: linux
|
|
||||||
runner: ubuntu-24.04
|
|
||||||
- platform: macos
|
|
||||||
runner: ${{ vars.MACOS_RUNNER || 'macos-15' }}
|
|
||||||
env:
|
|
||||||
CARGO_INCREMENTAL: '0'
|
|
||||||
CARGO_BUILD_JOBS: '2'
|
|
||||||
steps:
|
|
||||||
- name: Require immutable source refs
|
|
||||||
env:
|
|
||||||
GP_REF: ${{ inputs.gp_ref }}
|
|
||||||
GPGUI_REF: ${{ inputs.gpgui_ref }}
|
|
||||||
run: |
|
|
||||||
[[ "$GP_REF" =~ ^[0-9a-f]{40}$ && "$GPGUI_REF" =~ ^[0-9a-f]{40}$ ]] || {
|
|
||||||
echo "Both source refs must be full commit SHAs."
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
- name: Checkout GlobalProtect-openconnect
|
|
||||||
uses: actions/checkout@v6
|
|
||||||
with:
|
|
||||||
ref: ${{ inputs.gp_ref }}
|
|
||||||
path: source/gp
|
|
||||||
submodules: recursive
|
|
||||||
persist-credentials: false
|
|
||||||
- name: Checkout CI helpers
|
|
||||||
uses: actions/checkout@v6
|
|
||||||
with:
|
|
||||||
path: .ci
|
|
||||||
persist-credentials: false
|
|
||||||
- name: Checkout gpgui
|
|
||||||
uses: ./.ci/.github/actions/checkout-private
|
|
||||||
with:
|
|
||||||
token: ${{ secrets.GH_PAT }}
|
|
||||||
ref: ${{ inputs.gpgui_ref }}
|
|
||||||
path: source/gpgui
|
|
||||||
|
|
||||||
- name: Install Linux dependencies
|
|
||||||
if: matrix.platform == 'linux'
|
|
||||||
run: |
|
|
||||||
sudo apt-get update
|
|
||||||
sudo apt-get install -y autoconf automake gettext libtool pkg-config \
|
|
||||||
clang libclang-dev libgtk-4-dev libxml2-dev \
|
|
||||||
libgnutls28-dev liblz4-dev libwayland-dev libxkbcommon-dev libdbus-1-dev
|
|
||||||
pkg-config --exists gtk4 gnutls dbus-1 wayland-client xkbcommon
|
|
||||||
- name: Install macOS dependencies
|
|
||||||
if: matrix.platform == 'macos'
|
|
||||||
env:
|
|
||||||
DEVELOPER_DIR: /Applications/Xcode_26.3.app/Contents/Developer
|
|
||||||
run: |
|
|
||||||
xcodebuild -version
|
|
||||||
echo "DEVELOPER_DIR=$DEVELOPER_DIR" >> "$GITHUB_ENV"
|
|
||||||
brew install autoconf automake gettext libtool pkgconf gnutls libxml2 lz4
|
|
||||||
echo "$(brew --prefix gettext)/bin" >> "$GITHUB_PATH"
|
|
||||||
echo "ACLOCAL_PATH=$(brew --prefix gettext)/share/aclocal" >> "$GITHUB_ENV"
|
|
||||||
echo "PKG_CONFIG_PATH=$(brew --prefix libxml2)/lib/pkgconfig:$(brew --prefix gnutls)/lib/pkgconfig" >> "$GITHUB_ENV"
|
|
||||||
- name: Install the NSH compiler
|
|
||||||
run: rustup toolchain install 1.97.0 --profile minimal
|
|
||||||
- name: Cache public crate downloads
|
|
||||||
uses: actions/cache@v5
|
|
||||||
with:
|
|
||||||
# Private source and build outputs stay out of the public cache.
|
|
||||||
path: |
|
|
||||||
~/.cargo/registry/cache
|
|
||||||
~/.cargo/registry/index
|
|
||||||
key: nsh-crates-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('source/gpgui/apps/desktop-nsh/Cargo.lock') }}
|
|
||||||
restore-keys: nsh-crates-${{ runner.os }}-${{ runner.arch }}-
|
|
||||||
|
|
||||||
- name: Check demo-free NSH production
|
|
||||||
timeout-minutes: 30
|
|
||||||
run: |
|
|
||||||
diagnostics="$(mktemp)"
|
|
||||||
trap 'code=$?; if [ "$code" -ne 0 ]; then echo "::error::NSH production check failed; diagnostics suppressed."; python3 .ci/scripts/private-ci-diagnostics.py compile "$diagnostics" || true; fi; rm -f "$diagnostics"' EXIT
|
|
||||||
(
|
|
||||||
set -euo pipefail
|
|
||||||
cd source/gpgui
|
|
||||||
cargo +1.97.0 check --manifest-path apps/desktop-nsh/Cargo.toml --locked --bin gpgui-nsh
|
|
||||||
) >"$diagnostics" 2>&1
|
|
||||||
echo "NSH production check passed."
|
|
||||||
- name: Compile NSH tests
|
|
||||||
timeout-minutes: 30
|
|
||||||
run: |
|
|
||||||
diagnostics="$(mktemp)"
|
|
||||||
trap 'code=$?; if [ "$code" -ne 0 ]; then echo "::error::NSH test compilation failed; diagnostics suppressed."; python3 .ci/scripts/private-ci-diagnostics.py compile "$diagnostics" || true; fi; rm -f "$diagnostics"' EXIT
|
|
||||||
(
|
|
||||||
set -euo pipefail
|
|
||||||
cd source/gpgui
|
|
||||||
cargo +1.97.0 test --manifest-path apps/desktop-nsh/Cargo.toml --locked --features demo --no-run
|
|
||||||
) >"$diagnostics" 2>&1
|
|
||||||
echo "NSH test compilation passed."
|
|
||||||
- name: Run NSH tests
|
|
||||||
timeout-minutes: 10
|
|
||||||
run: |
|
|
||||||
diagnostics="$(mktemp)"
|
|
||||||
trap 'code=$?; if [ "$code" -ne 0 ]; then echo "::error::NSH tests failed; diagnostics suppressed."; python3 .ci/scripts/private-ci-diagnostics.py tests "$diagnostics" || true; fi; rm -f "$diagnostics"' EXIT
|
|
||||||
(
|
|
||||||
set -euo pipefail
|
|
||||||
cd source/gpgui
|
|
||||||
cargo +1.97.0 test --manifest-path apps/desktop-nsh/Cargo.toml --locked --features demo -- --test-threads=1
|
|
||||||
) >"$diagnostics" 2>&1
|
|
||||||
echo "NSH tests passed."
|
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
name: Desktop icon compatibility
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
paths:
|
|
||||||
- '.github/workflows/desktop-icons.yaml'
|
|
||||||
- 'scripts/tests/test_desktop_icon.py'
|
|
||||||
- 'packaging/files/usr/share/icons/**'
|
|
||||||
- 'apps/gpgui-helper/src-tauri/icons/**'
|
|
||||||
push:
|
|
||||||
branches: [main]
|
|
||||||
paths:
|
|
||||||
- '.github/workflows/desktop-icons.yaml'
|
|
||||||
- 'scripts/tests/test_desktop_icon.py'
|
|
||||||
- 'packaging/files/usr/share/icons/**'
|
|
||||||
- 'apps/gpgui-helper/src-tauri/icons/**'
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
render:
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
os: [ubuntu-22.04, ubuntu-24.04]
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v6
|
|
||||||
- name: Install the distro SVG loader
|
|
||||||
run: |
|
|
||||||
sudo apt-get update
|
|
||||||
sudo apt-get install -y python3-gi gir1.2-gdkpixbuf-2.0 librsvg2-common
|
|
||||||
- name: Render desktop icons
|
|
||||||
run: /usr/bin/python3 -m unittest discover -s scripts/tests -p test_desktop_icon.py
|
|
||||||
@@ -3,8 +3,6 @@ name: Nix
|
|||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
paths:
|
paths:
|
||||||
- "Cargo.toml"
|
|
||||||
- "scripts/validate-release-version.py"
|
|
||||||
- "flake.nix"
|
- "flake.nix"
|
||||||
- "flake.lock"
|
- "flake.lock"
|
||||||
- "nix/**"
|
- "nix/**"
|
||||||
@@ -13,8 +11,6 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
paths:
|
paths:
|
||||||
- "Cargo.toml"
|
|
||||||
- "scripts/validate-release-version.py"
|
|
||||||
- "flake.nix"
|
- "flake.nix"
|
||||||
- "flake.lock"
|
- "flake.lock"
|
||||||
- "nix/**"
|
- "nix/**"
|
||||||
@@ -48,9 +44,6 @@ jobs:
|
|||||||
--extra-experimental-features "nix-command flakes" \
|
--extra-experimental-features "nix-command flakes" \
|
||||||
--print-build-logs
|
--print-build-logs
|
||||||
|
|
||||||
- name: Check installed release versions
|
|
||||||
run: python3 scripts/validate-release-version.py --package result
|
|
||||||
|
|
||||||
- name: Inspect prebuilt package
|
- name: Inspect prebuilt package
|
||||||
run: |
|
run: |
|
||||||
test -x result/bin/gpclient
|
test -x result/bin/gpclient
|
||||||
@@ -116,9 +109,6 @@ jobs:
|
|||||||
package
|
package
|
||||||
'
|
'
|
||||||
|
|
||||||
- name: Check installed release versions
|
|
||||||
run: python3 scripts/validate-release-version.py --package result
|
|
||||||
|
|
||||||
- name: Inspect module package
|
- name: Inspect module package
|
||||||
run: |
|
run: |
|
||||||
test -x result/bin/gpclient
|
test -x result/bin/gpclient
|
||||||
|
|||||||
@@ -63,6 +63,7 @@ jobs:
|
|||||||
make \
|
make \
|
||||||
namcap \
|
namcap \
|
||||||
nettle \
|
nettle \
|
||||||
|
openssl \
|
||||||
patch \
|
patch \
|
||||||
pkgconf \
|
pkgconf \
|
||||||
librsvg \
|
librsvg \
|
||||||
|
|||||||
@@ -1,143 +0,0 @@
|
|||||||
name: Publish macOS assets
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
build_run_id:
|
|
||||||
description: 'Public gp Build run ID with a successful build-macos job'
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
release_tag:
|
|
||||||
description: 'Existing public release tag (vX.Y.Z or snapshot)'
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
|
|
||||||
expected_gui:
|
|
||||||
description: 'Expected macOS shell in the selected build artifact'
|
|
||||||
required: true
|
|
||||||
default: nsh
|
|
||||||
type: choice
|
|
||||||
options: [tauri, nsh]
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: publish-macos-assets
|
|
||||||
cancel-in-progress: false
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
actions: read
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
publish:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
environment: macos-release
|
|
||||||
timeout-minutes: 15
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v6
|
|
||||||
- name: Check completed build and public release
|
|
||||||
id: build
|
|
||||||
env:
|
|
||||||
GH_TOKEN: ${{ github.token }}
|
|
||||||
BUILD_REPOSITORY: yuezk/GlobalProtect-openconnect
|
|
||||||
BUILD_RUN_ID: ${{ inputs.build_run_id }}
|
|
||||||
RELEASE_TAG: ${{ inputs.release_tag }}
|
|
||||||
run: |
|
|
||||||
set -euo pipefail
|
|
||||||
[[ "$BUILD_RUN_ID" =~ ^[0-9]+$ ]]
|
|
||||||
[[ "$RELEASE_TAG" == snapshot || "$RELEASE_TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]
|
|
||||||
run="$(gh api "repos/$BUILD_REPOSITORY/actions/runs/$BUILD_RUN_ID")"
|
|
||||||
jq -e '(.event == "workflow_dispatch" or .event == "push") and
|
|
||||||
.path == ".github/workflows/build.yaml"' <<<"$run" >/dev/null
|
|
||||||
attempt="$(jq -r '.run_attempt' <<<"$run")"
|
|
||||||
artifact_name="$(bash scripts/select-macos-artifact.sh "$BUILD_REPOSITORY" "$BUILD_RUN_ID" "$attempt")"
|
|
||||||
{
|
|
||||||
echo "artifact=$artifact_name"
|
|
||||||
echo "workflow_commit=$(jq -r '.head_sha' <<<"$run")"
|
|
||||||
} >> "$GITHUB_OUTPUT"
|
|
||||||
gh release view "$RELEASE_TAG" \
|
|
||||||
--repo yuezk/GlobalProtect-openconnect --json isDraft,isPrerelease \
|
|
||||||
--jq 'select(.isDraft == false and .isPrerelease == false)' | jq -e .
|
|
||||||
|
|
||||||
- name: Download completed build artifacts
|
|
||||||
uses: actions/download-artifact@v8
|
|
||||||
with:
|
|
||||||
repository: yuezk/GlobalProtect-openconnect
|
|
||||||
github-token: ${{ github.token }}
|
|
||||||
run-id: ${{ inputs.build_run_id }}
|
|
||||||
name: ${{ steps.build.outputs.artifact }}
|
|
||||||
path: release-assets
|
|
||||||
|
|
||||||
- name: Validate build identity and checksums
|
|
||||||
id: metadata
|
|
||||||
env:
|
|
||||||
RELEASE_TAG: ${{ inputs.release_tag }}
|
|
||||||
WORKFLOW_COMMIT: ${{ steps.build.outputs.workflow_commit }}
|
|
||||||
ARTIFACT_NAME: ${{ steps.build.outputs.artifact }}
|
|
||||||
EXPECTED_GUI: ${{ inputs.expected_gui }}
|
|
||||||
run: |
|
|
||||||
set -euo pipefail
|
|
||||||
metadata="$(python3 scripts/validate-macos-release.py release-assets \
|
|
||||||
--release-tag "$RELEASE_TAG" --workflow-commit "$WORKFLOW_COMMIT" --gui "$EXPECTED_GUI")"
|
|
||||||
[[ "$ARTIFACT_NAME" == "macos-release-$(jq -r '.request_id' <<<"$metadata")" ]]
|
|
||||||
{
|
|
||||||
echo "gp_ref=$(jq -r '.gp_ref' <<<"$metadata")"
|
|
||||||
echo "gpgui_ref=$(jq -r '.gpgui_ref' <<<"$metadata")"
|
|
||||||
echo "channel=$(jq -r '.channel' <<<"$metadata")"
|
|
||||||
} >> "$GITHUB_OUTPUT"
|
|
||||||
|
|
||||||
- name: Checkout public upload helper
|
|
||||||
uses: actions/checkout@v6
|
|
||||||
with:
|
|
||||||
repository: yuezk/GlobalProtect-openconnect
|
|
||||||
ref: ${{ steps.metadata.outputs.gp_ref }}
|
|
||||||
path: gp-release
|
|
||||||
|
|
||||||
- name: Check stable tags
|
|
||||||
if: ${{ steps.metadata.outputs.channel == 'stable' }}
|
|
||||||
env:
|
|
||||||
GH_TOKEN: ${{ secrets.GH_PAT }}
|
|
||||||
RELEASE_TAG: ${{ inputs.release_tag }}
|
|
||||||
GP_REF: ${{ steps.metadata.outputs.gp_ref }}
|
|
||||||
GPGUI_REF: ${{ steps.metadata.outputs.gpgui_ref }}
|
|
||||||
run: |
|
|
||||||
set -euo pipefail
|
|
||||||
git -C gp-release fetch --no-tags origin "refs/tags/$RELEASE_TAG"
|
|
||||||
if [[ "$(git -C gp-release rev-parse 'FETCH_HEAD^{commit}')" != "$GP_REF" ]]; then
|
|
||||||
echo "gp source commit does not match $RELEASE_TAG" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
if ! tagged_gui_commit="$(gh api "repos/yuezk/gpgui/commits/$RELEASE_TAG" --jq .sha 2>/dev/null)"; then
|
|
||||||
echo "Private source tag verification failed; diagnostics suppressed." >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
if [[ "$tagged_gui_commit" != "$GPGUI_REF" ]]; then
|
|
||||||
echo "gpgui source commit does not match $RELEASE_TAG" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Publish and verify macOS assets
|
|
||||||
env:
|
|
||||||
GH_TOKEN: ${{ github.token }}
|
|
||||||
RELEASE_REPOSITORY: yuezk/GlobalProtect-openconnect
|
|
||||||
RELEASE_TAG: ${{ inputs.release_tag }}
|
|
||||||
CHANNEL: ${{ steps.metadata.outputs.channel }}
|
|
||||||
run: |
|
|
||||||
set -euo pipefail
|
|
||||||
files=(release-assets/*.dmg release-assets/*.zip release-assets/*.sha256)
|
|
||||||
args=()
|
|
||||||
if [[ "$CHANNEL" == snapshot ]]; then
|
|
||||||
args+=(--clobber)
|
|
||||||
fi
|
|
||||||
gp-release/scripts/upload-release-assets.sh "${args[@]}" "$RELEASE_TAG" "${files[@]}"
|
|
||||||
gh release download "$RELEASE_TAG" --repo yuezk/GlobalProtect-openconnect \
|
|
||||||
--pattern 'GPConnect_*_arm64.*' --dir published-assets
|
|
||||||
python3 - <<'PY'
|
|
||||||
import hashlib
|
|
||||||
import json
|
|
||||||
from pathlib import Path
|
|
||||||
metadata = json.loads(Path("release-assets/release-build.json").read_text())
|
|
||||||
for name, digest in metadata["assets"].items():
|
|
||||||
if hashlib.sha256((Path("published-assets") / name).read_bytes()).hexdigest() != digest:
|
|
||||||
raise SystemExit(f"Published asset checksum mismatch: {name}")
|
|
||||||
PY
|
|
||||||
echo "Published verified macOS assets to $RELEASE_TAG" >> "$GITHUB_STEP_SUMMARY"
|
|
||||||
@@ -1,642 +0,0 @@
|
|||||||
name: Publish update feeds
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_call:
|
|
||||||
secrets:
|
|
||||||
GH_PAT:
|
|
||||||
required: true
|
|
||||||
CLOUDFLARE_ACCOUNT_ID:
|
|
||||||
required: false
|
|
||||||
CLOUDFLARE_API_TOKEN:
|
|
||||||
required: false
|
|
||||||
SPARKLE_PRIVATE_KEY:
|
|
||||||
required: false
|
|
||||||
inputs:
|
|
||||||
gpgui_ref:
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
channel:
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
release_tag:
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
archive_name:
|
|
||||||
required: false
|
|
||||||
type: string
|
|
||||||
gp_ref:
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
expected_gui:
|
|
||||||
required: false
|
|
||||||
default: nsh
|
|
||||||
type: string
|
|
||||||
highlights:
|
|
||||||
required: false
|
|
||||||
type: string
|
|
||||||
unix_platforms:
|
|
||||||
required: false
|
|
||||||
default: linux,freebsd,openbsd
|
|
||||||
type: string
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
gpgui_ref:
|
|
||||||
description: gpgui ref containing the update feed Worker
|
|
||||||
required: true
|
|
||||||
default: main
|
|
||||||
type: string
|
|
||||||
channel:
|
|
||||||
description: Update channel
|
|
||||||
required: true
|
|
||||||
type: choice
|
|
||||||
options:
|
|
||||||
- stable
|
|
||||||
- snapshot
|
|
||||||
release_tag:
|
|
||||||
description: Release containing the macOS update archive
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
archive_name:
|
|
||||||
description: Exact ZIP asset name; leave empty when the release has one macOS update archive
|
|
||||||
required: false
|
|
||||||
type: string
|
|
||||||
gp_ref:
|
|
||||||
description: GlobalProtect-openconnect ref containing release helpers
|
|
||||||
required: true
|
|
||||||
default: main
|
|
||||||
type: string
|
|
||||||
expected_gui:
|
|
||||||
description: Expected macOS shell in the selected update archive
|
|
||||||
required: true
|
|
||||||
default: nsh
|
|
||||||
type: choice
|
|
||||||
options: [tauri, nsh]
|
|
||||||
highlights:
|
|
||||||
description: Stable release highlights, one per line
|
|
||||||
required: false
|
|
||||||
type: string
|
|
||||||
unix_platforms:
|
|
||||||
description: Comma-separated Unix platforms with published assets (linux,freebsd,openbsd)
|
|
||||||
required: true
|
|
||||||
default: linux,freebsd,openbsd
|
|
||||||
type: string
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: update-feeds
|
|
||||||
cancel-in-progress: false
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
publish:
|
|
||||||
runs-on: ${{ vars.MACOS_RUNNER || 'macos-15' }}
|
|
||||||
environment: macos-release
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
env:
|
|
||||||
REPOSITORY: yuezk/GlobalProtect-openconnect
|
|
||||||
RELEASE_TAG: ${{ inputs.release_tag }}
|
|
||||||
CHANNEL: ${{ inputs.channel }}
|
|
||||||
REQUESTED_ARCHIVE: ${{ inputs.archive_name }}
|
|
||||||
FEED_URL: ${{ vars.SPARKLE_FEED_URL }}
|
|
||||||
EXPECTED_TEAM_ID: ${{ vars.MACOS_TEAM_ID }}
|
|
||||||
EXPECTED_GUI: ${{ inputs.expected_gui }}
|
|
||||||
UPDATES_WORKER_NAME: ${{ vars.UPDATES_WORKER_NAME || 'gp-updates' }}
|
|
||||||
SPARKLE_VERSION: 2.9.2
|
|
||||||
UPDATE_HIGHLIGHTS: ${{ inputs.highlights }}
|
|
||||||
UNIX_PLATFORMS: ${{ inputs.unix_platforms }}
|
|
||||||
SPARKLE_ARCHIVE_SHA256: b83e37436774556ed055e0244b297ef2c790e0737393bf65bf495fcbba6eed65
|
|
||||||
steps:
|
|
||||||
- name: Validate inputs
|
|
||||||
env:
|
|
||||||
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
|
||||||
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
|
||||||
SPARKLE_PRIVATE_KEY: ${{ secrets.SPARKLE_PRIVATE_KEY }}
|
|
||||||
run: |
|
|
||||||
set -euo pipefail
|
|
||||||
|
|
||||||
if [[ "$CHANNEL" != "stable" && "$CHANNEL" != "snapshot" ]]; then
|
|
||||||
echo "channel must be stable or snapshot" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
if [[ "$EXPECTED_GUI" != "tauri" && "$EXPECTED_GUI" != "nsh" ]]; then
|
|
||||||
echo "expected_gui must be tauri or nsh" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
if [[ ! "$UNIX_PLATFORMS" =~ ^(linux|freebsd|openbsd)(,(linux|freebsd|openbsd))*$ ]]; then
|
|
||||||
echo "unix_platforms must list published Unix targets separated by commas" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
if [[ "$CHANNEL" == "snapshot" && "$RELEASE_TAG" != "snapshot" ]]; then
|
|
||||||
echo "The snapshot channel must publish to the snapshot release" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
if [[ "$CHANNEL" == "stable" && "$RELEASE_TAG" == "snapshot" ]]; then
|
|
||||||
echo "The stable channel cannot publish to the snapshot release" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
if [[ "$CHANNEL" == "stable" && -z "${UPDATE_HIGHLIGHTS//[$'\t\r\n ']/}" ]]; then
|
|
||||||
echo "Stable updates require at least one release highlight" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
if [[ -z "$SPARKLE_PRIVATE_KEY" ]]; then
|
|
||||||
echo "SPARKLE_PRIVATE_KEY is not configured" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
if [[ -z "$EXPECTED_TEAM_ID" ]]; then
|
|
||||||
echo "MACOS_TEAM_ID is not configured" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
for variable in CLOUDFLARE_ACCOUNT_ID CLOUDFLARE_API_TOKEN; do
|
|
||||||
if [[ -z "${!variable:-}" ]]; then
|
|
||||||
echo "$variable is not configured" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
if [[ "$FEED_URL" != https://*/appcast.xml ]]; then
|
|
||||||
echo "SPARKLE_FEED_URL must be an HTTPS URL ending in /appcast.xml" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Checkout release infrastructure
|
|
||||||
uses: actions/checkout@v6
|
|
||||||
|
|
||||||
- name: Checkout public release helpers
|
|
||||||
uses: actions/checkout@v6
|
|
||||||
with:
|
|
||||||
repository: yuezk/GlobalProtect-openconnect
|
|
||||||
ref: ${{ inputs.gp_ref }}
|
|
||||||
path: gp-release
|
|
||||||
|
|
||||||
- name: Checkout update feed Worker
|
|
||||||
uses: ./.github/actions/checkout-private
|
|
||||||
with:
|
|
||||||
token: ${{ secrets.GH_PAT }}
|
|
||||||
ref: ${{ inputs.gpgui_ref }}
|
|
||||||
path: gpgui
|
|
||||||
|
|
||||||
- uses: pnpm/action-setup@v5
|
|
||||||
with:
|
|
||||||
version: 9.15.1
|
|
||||||
|
|
||||||
- uses: actions/setup-node@v6
|
|
||||||
with:
|
|
||||||
node-version: 22
|
|
||||||
|
|
||||||
- name: Install Worker tooling
|
|
||||||
run: |
|
|
||||||
trap 'status=$?; if [ "$status" -ne 0 ]; then echo "::error::Private operation failed; diagnostics suppressed."; fi' EXIT
|
|
||||||
(
|
|
||||||
set -euo pipefail
|
|
||||||
pnpm --dir gpgui/apps/update-feed-worker install --frozen-lockfile --ignore-scripts
|
|
||||||
) >/dev/null 2>&1
|
|
||||||
echo "Private operation passed."
|
|
||||||
|
|
||||||
|
|
||||||
- name: Prepare Sparkle tools
|
|
||||||
run: |
|
|
||||||
set -euo pipefail
|
|
||||||
|
|
||||||
archive="$RUNNER_TEMP/Sparkle.zip"
|
|
||||||
curl --fail --location --silent --show-error \
|
|
||||||
"https://github.com/sparkle-project/Sparkle/releases/download/$SPARKLE_VERSION/Sparkle-for-Swift-Package-Manager.zip" \
|
|
||||||
--output "$archive"
|
|
||||||
echo "$SPARKLE_ARCHIVE_SHA256 $archive" | shasum -a 256 --check
|
|
||||||
ditto -x -k "$archive" "$RUNNER_TEMP/sparkle"
|
|
||||||
test -x "$RUNNER_TEMP/sparkle/bin/generate_appcast"
|
|
||||||
|
|
||||||
- name: Validate GitHub release
|
|
||||||
id: release
|
|
||||||
env:
|
|
||||||
GH_TOKEN: ${{ github.token }}
|
|
||||||
run: |
|
|
||||||
set -euo pipefail
|
|
||||||
|
|
||||||
release="$(gh release view "$RELEASE_TAG" --repo "$REPOSITORY" \
|
|
||||||
--json tagName,isDraft,isPrerelease,publishedAt)"
|
|
||||||
if [[ "$(jq -r '.tagName' <<<"$release")" != "$RELEASE_TAG" ]] || \
|
|
||||||
[[ "$(jq -r '.isDraft' <<<"$release")" != "false" ]]; then
|
|
||||||
echo "Release must be published with the requested tag" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
is_prerelease="$(jq -r '.isPrerelease' <<<"$release")"
|
|
||||||
if [[ "$is_prerelease" != "false" ]]; then
|
|
||||||
echo "Updates require a non-prerelease GitHub release" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
published_at="$(jq -r '.publishedAt' <<<"$release")"
|
|
||||||
if [[ ! "$published_at" =~ ^[0-9]{4}-[0-9]{2}-[0-9]{2}T ]]; then
|
|
||||||
echo "Release has no valid publication date" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
echo "released_at=${published_at%%T*}" >> "$GITHUB_OUTPUT"
|
|
||||||
|
|
||||||
- name: Download update archive
|
|
||||||
id: archive
|
|
||||||
env:
|
|
||||||
GH_TOKEN: ${{ github.token }}
|
|
||||||
run: |
|
|
||||||
set -euo pipefail
|
|
||||||
|
|
||||||
mkdir -p "$RUNNER_TEMP/updates"
|
|
||||||
archive_name="$REQUESTED_ARCHIVE"
|
|
||||||
if [[ -z "$archive_name" ]]; then
|
|
||||||
archive_name="$(gh release view "$RELEASE_TAG" --repo "$REPOSITORY" --json assets \
|
|
||||||
--jq '[.assets[] | select(.name | test("^GPConnect_[0-9A-Za-z._-]+_arm64\\.zip$"))] | sort_by(.createdAt) | last | .name // ""')"
|
|
||||||
if [[ -z "$archive_name" ]]; then
|
|
||||||
echo "No macOS update archive found on $RELEASE_TAG" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ ! "$archive_name" =~ ^GPConnect_[0-9A-Za-z._-]+_arm64\.zip$ ]]; then
|
|
||||||
echo "Invalid macOS update archive name: $archive_name" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
gh release download "$RELEASE_TAG" --repo "$REPOSITORY" \
|
|
||||||
--pattern "$archive_name" \
|
|
||||||
--pattern "$archive_name.sha256" \
|
|
||||||
--dir "$RUNNER_TEMP/updates"
|
|
||||||
{
|
|
||||||
echo "name=$archive_name"
|
|
||||||
echo "path=$RUNNER_TEMP/updates/$archive_name"
|
|
||||||
echo "checksum_path=$RUNNER_TEMP/updates/$archive_name.sha256"
|
|
||||||
} >> "$GITHUB_OUTPUT"
|
|
||||||
|
|
||||||
- name: Verify update archive
|
|
||||||
id: bundle
|
|
||||||
env:
|
|
||||||
ARCHIVE_PATH: ${{ steps.archive.outputs.path }}
|
|
||||||
CHECKSUM_PATH: ${{ steps.archive.outputs.checksum_path }}
|
|
||||||
run: |
|
|
||||||
set -euo pipefail
|
|
||||||
|
|
||||||
expected_digest="$(awk 'NR == 1 { print $1 }' "$CHECKSUM_PATH")"
|
|
||||||
actual_digest="$(shasum -a 256 "$ARCHIVE_PATH" | awk '{ print $1 }')"
|
|
||||||
if [[ -z "$expected_digest" || "$actual_digest" != "$expected_digest" ]]; then
|
|
||||||
echo "Update archive checksum does not match its release checksum" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
extract_dir="$RUNNER_TEMP/extracted"
|
|
||||||
ditto -x -k "$ARCHIVE_PATH" "$extract_dir"
|
|
||||||
app="$extract_dir/GP Connect.app"
|
|
||||||
test -d "$app"
|
|
||||||
codesign --verify --deep --strict --verbose=2 "$app"
|
|
||||||
|
|
||||||
signing_info="$(codesign -d --verbose=4 "$app" 2>&1)"
|
|
||||||
xcrun stapler validate "$app"
|
|
||||||
grep -q '^Authority=Developer ID Application:' <<<"$signing_info"
|
|
||||||
grep -q '^CodeDirectory .*flags=.*runtime' <<<"$signing_info"
|
|
||||||
team_identifier="$(sed -n 's/^TeamIdentifier=//p' <<<"$signing_info")"
|
|
||||||
if [[ "$team_identifier" != "$EXPECTED_TEAM_ID" ]]; then
|
|
||||||
echo "Unexpected Apple Team Identifier: $team_identifier" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
identifier="$(sed -n 's/^Identifier=//p' <<<"$signing_info")"
|
|
||||||
if [[ "$identifier" != "com.yuezk.gpgui" ]]; then
|
|
||||||
echo "Unexpected bundle identifier: $identifier" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
file "$app/Contents/MacOS/gpgui" | grep -q 'arm64'
|
|
||||||
|
|
||||||
desktop_shell="$(plutil -extract GPDesktopShell raw "$app/Contents/Info.plist")"
|
|
||||||
if [[ "$desktop_shell" != "$EXPECTED_GUI" ]]; then
|
|
||||||
echo "Update archive desktop shell does not match the selected GUI" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
feed_url="$(plutil -extract SUFeedURL raw "$app/Contents/Info.plist")"
|
|
||||||
if [[ "$feed_url" != "$FEED_URL" ]]; then
|
|
||||||
echo "Unexpected Sparkle feed URL: $feed_url" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
update_channel="$(plutil -extract GPUpdateChannel raw "$app/Contents/Info.plist")"
|
|
||||||
if [[ "$update_channel" != "$CHANNEL" ]]; then
|
|
||||||
echo "Unexpected update channel: $update_channel" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
bundle_version="$(plutil -extract CFBundleVersion raw "$app/Contents/Info.plist")"
|
|
||||||
short_version="$(plutil -extract CFBundleShortVersionString raw "$app/Contents/Info.plist")"
|
|
||||||
if [[ ! "$bundle_version" =~ ^[0-9]+(\.[0-9]+){0,2}$ ]]; then
|
|
||||||
echo "Invalid bundle version: $bundle_version" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
if [[ "$CHANNEL" == "stable" ]]; then
|
|
||||||
expected_tag="v$short_version"
|
|
||||||
expected_archive="GPConnect_${short_version}_arm64.zip"
|
|
||||||
else
|
|
||||||
expected_tag="snapshot"
|
|
||||||
expected_archive="GPConnect_${short_version}-snapshot.${bundle_version}_arm64.zip"
|
|
||||||
fi
|
|
||||||
if [[ "$RELEASE_TAG" != "$expected_tag" ]]; then
|
|
||||||
echo "Release tag $RELEASE_TAG does not match $expected_tag" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
if [[ "${{ steps.archive.outputs.name }}" != "$expected_archive" ]]; then
|
|
||||||
echo "Archive name does not match packaged version: $expected_archive" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
echo "version=$bundle_version" >> "$GITHUB_OUTPUT"
|
|
||||||
echo "short_version=$short_version" >> "$GITHUB_OUTPUT"
|
|
||||||
|
|
||||||
- name: Prepare Unix update manifest
|
|
||||||
env:
|
|
||||||
RELEASED_AT: ${{ steps.release.outputs.released_at }}
|
|
||||||
run: |
|
|
||||||
set -euo pipefail
|
|
||||||
|
|
||||||
manifest="$RUNNER_TEMP/updates/latest.json"
|
|
||||||
current_manifest="$RUNNER_TEMP/current-latest.json"
|
|
||||||
latest_url="${FEED_URL%/appcast.xml}/latest.json"
|
|
||||||
status="$(curl --location --silent --show-error \
|
|
||||||
--output "$current_manifest" --write-out '%{http_code}' "$latest_url")"
|
|
||||||
generate_args=(
|
|
||||||
--repository "$REPOSITORY"
|
|
||||||
--channel "$CHANNEL"
|
|
||||||
--version "${{ steps.bundle.outputs.short_version }}"
|
|
||||||
)
|
|
||||||
IFS=',' read -r -a platforms <<<"$UNIX_PLATFORMS"
|
|
||||||
for platform in "${platforms[@]}"; do
|
|
||||||
generate_args+=(--platform "$platform")
|
|
||||||
done
|
|
||||||
case "$status" in
|
|
||||||
200)
|
|
||||||
python3 scripts/validate-update-manifest.py validate "$current_manifest" \
|
|
||||||
--repository "$REPOSITORY"
|
|
||||||
generate_args+=(--input "$current_manifest")
|
|
||||||
;;
|
|
||||||
404)
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "Could not check the current Unix update manifest: HTTP $status" >&2
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
highlights="$RUNNER_TEMP/update-highlights.txt"
|
|
||||||
if [[ "$CHANNEL" == "stable" ]]; then
|
|
||||||
printf '%s\n' "$UPDATE_HIGHLIGHTS" > "$highlights"
|
|
||||||
released_at="$RELEASED_AT"
|
|
||||||
else
|
|
||||||
printf 'Development snapshot after %s.\n' \
|
|
||||||
"${{ steps.bundle.outputs.short_version }}" > "$highlights"
|
|
||||||
generate_args+=(--build "${{ steps.bundle.outputs.version }}")
|
|
||||||
released_at="$(date -u +%F)"
|
|
||||||
fi
|
|
||||||
|
|
||||||
python3 scripts/validate-update-manifest.py generate \
|
|
||||||
"${generate_args[@]}" \
|
|
||||||
--released-at "$released_at" \
|
|
||||||
--highlights-file "$highlights" \
|
|
||||||
--output "$manifest"
|
|
||||||
|
|
||||||
- name: Fetch current appcast
|
|
||||||
id: current-appcast
|
|
||||||
env:
|
|
||||||
ARCHIVE_NAME: ${{ steps.archive.outputs.name }}
|
|
||||||
run: |
|
|
||||||
set -euo pipefail
|
|
||||||
|
|
||||||
appcast="$RUNNER_TEMP/updates/appcast.xml"
|
|
||||||
archive_url="https://github.com/$REPOSITORY/releases/download/$RELEASE_TAG/$ARCHIVE_NAME"
|
|
||||||
status="$(curl --location --silent --show-error \
|
|
||||||
--output "$appcast" --write-out '%{http_code}' "$FEED_URL")"
|
|
||||||
case "$status" in
|
|
||||||
200)
|
|
||||||
test -s "$appcast"
|
|
||||||
decision="$(python3 scripts/validate-macos-appcast.py status "$appcast" \
|
|
||||||
--repository "$REPOSITORY" \
|
|
||||||
--build-version "${{ steps.bundle.outputs.version }}")"
|
|
||||||
if [[ "$decision" == "older" ]]; then
|
|
||||||
echo "Candidate build is older than the published appcast" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
if [[ "$decision" == "same" ]]; then
|
|
||||||
python3 scripts/validate-macos-appcast.py validate "$appcast" \
|
|
||||||
--repository "$REPOSITORY" \
|
|
||||||
--build-version "${{ steps.bundle.outputs.version }}" \
|
|
||||||
--short-version "${{ steps.bundle.outputs.short_version }}" \
|
|
||||||
--channel "$CHANNEL" \
|
|
||||||
--archive-url "$archive_url"
|
|
||||||
fi
|
|
||||||
echo "decision=$decision" >> "$GITHUB_OUTPUT"
|
|
||||||
;;
|
|
||||||
404)
|
|
||||||
rm -f "$appcast"
|
|
||||||
echo "decision=newer" >> "$GITHUB_OUTPUT"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "Could not fetch the current appcast: HTTP $status" >&2
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
- name: Generate appcast
|
|
||||||
if: ${{ steps.current-appcast.outputs.decision == 'newer' }}
|
|
||||||
env:
|
|
||||||
ARCHIVE_NAME: ${{ steps.archive.outputs.name }}
|
|
||||||
SPARKLE_PRIVATE_KEY: ${{ secrets.SPARKLE_PRIVATE_KEY }}
|
|
||||||
run: |
|
|
||||||
set -euo pipefail
|
|
||||||
|
|
||||||
embedded_public_key="$(plutil -extract SUPublicEDKey raw \
|
|
||||||
"$RUNNER_TEMP/extracted/GP Connect.app/Contents/Info.plist")"
|
|
||||||
derived_public_key="$(swift -e '
|
|
||||||
import Foundation
|
|
||||||
import CryptoKit
|
|
||||||
let encoded = ProcessInfo.processInfo.environment["SPARKLE_PRIVATE_KEY"]!
|
|
||||||
.trimmingCharacters(in: .whitespacesAndNewlines)
|
|
||||||
let privateKey = try Curve25519.Signing.PrivateKey(
|
|
||||||
rawRepresentation: Data(base64Encoded: encoded)!)
|
|
||||||
print(privateKey.publicKey.rawRepresentation.base64EncodedString())
|
|
||||||
')"
|
|
||||||
if [[ "$derived_public_key" != "$embedded_public_key" ]]; then
|
|
||||||
echo "Sparkle private key does not match the public key embedded in the application" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
download_prefix="https://github.com/$REPOSITORY/releases/download/$RELEASE_TAG/"
|
|
||||||
generate_args=(
|
|
||||||
--download-url-prefix "$download_prefix"
|
|
||||||
--full-release-notes-url "https://github.com/$REPOSITORY/releases/tag/$RELEASE_TAG"
|
|
||||||
--maximum-deltas 0
|
|
||||||
--maximum-versions 1
|
|
||||||
--versions "${{ steps.bundle.outputs.version }}"
|
|
||||||
--ed-key-file -
|
|
||||||
)
|
|
||||||
if [[ "$CHANNEL" == "snapshot" ]]; then
|
|
||||||
generate_args+=(--channel snapshot)
|
|
||||||
fi
|
|
||||||
printf '%s' "$SPARKLE_PRIVATE_KEY" | \
|
|
||||||
"$RUNNER_TEMP/sparkle/bin/generate_appcast" \
|
|
||||||
"${generate_args[@]}" "$RUNNER_TEMP/updates"
|
|
||||||
|
|
||||||
appcast="$RUNNER_TEMP/updates/appcast.xml"
|
|
||||||
test -s "$appcast"
|
|
||||||
python3 scripts/validate-macos-appcast.py validate "$appcast" \
|
|
||||||
--repository "$REPOSITORY" \
|
|
||||||
--build-version "${{ steps.bundle.outputs.version }}" \
|
|
||||||
--short-version "${{ steps.bundle.outputs.short_version }}" \
|
|
||||||
--channel "$CHANNEL" \
|
|
||||||
--archive-url "$download_prefix$ARCHIVE_NAME"
|
|
||||||
|
|
||||||
- name: Publish appcast
|
|
||||||
env:
|
|
||||||
GH_TOKEN: ${{ github.token }}
|
|
||||||
run: |
|
|
||||||
set -euo pipefail
|
|
||||||
|
|
||||||
appcast="$RUNNER_TEMP/updates/appcast.xml"
|
|
||||||
archive_url="https://github.com/$REPOSITORY/releases/download/$RELEASE_TAG/${{ steps.archive.outputs.name }}"
|
|
||||||
if [[ "$CHANNEL" == "stable" ]] && \
|
|
||||||
gh release view "$RELEASE_TAG" --repo "$REPOSITORY" --json assets \
|
|
||||||
--jq '.assets[].name' | grep -Fx appcast.xml >/dev/null; then
|
|
||||||
existing="$RUNNER_TEMP/existing-release-appcast.xml"
|
|
||||||
gh release download "$RELEASE_TAG" --repo "$REPOSITORY" \
|
|
||||||
--pattern appcast.xml --output "$existing"
|
|
||||||
python3 scripts/validate-macos-appcast.py validate "$existing" \
|
|
||||||
--repository "$REPOSITORY" \
|
|
||||||
--build-version "${{ steps.bundle.outputs.version }}" \
|
|
||||||
--short-version "${{ steps.bundle.outputs.short_version }}" \
|
|
||||||
--channel "$CHANNEL" \
|
|
||||||
--archive-url "$archive_url"
|
|
||||||
cp "$existing" "$appcast"
|
|
||||||
else
|
|
||||||
if [[ "$CHANNEL" == "snapshot" ]]; then
|
|
||||||
RELEASE_REPOSITORY="$REPOSITORY" \
|
|
||||||
gp-release/scripts/upload-release-assets.sh \
|
|
||||||
--clobber "$RELEASE_TAG" "$appcast"
|
|
||||||
else
|
|
||||||
RELEASE_REPOSITORY="$REPOSITORY" \
|
|
||||||
gp-release/scripts/upload-release-assets.sh "$RELEASE_TAG" "$appcast"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Validate final appcast
|
|
||||||
env:
|
|
||||||
ARCHIVE_NAME: ${{ steps.archive.outputs.name }}
|
|
||||||
run: |
|
|
||||||
python3 scripts/validate-macos-appcast.py validate \
|
|
||||||
"$RUNNER_TEMP/updates/appcast.xml" \
|
|
||||||
--repository "$REPOSITORY" \
|
|
||||||
--build-version "${{ steps.bundle.outputs.version }}" \
|
|
||||||
--short-version "${{ steps.bundle.outputs.short_version }}" \
|
|
||||||
--channel "$CHANNEL" \
|
|
||||||
--archive-url "https://github.com/$REPOSITORY/releases/download/$RELEASE_TAG/$ARCHIVE_NAME"
|
|
||||||
|
|
||||||
- name: Deploy update feed worker
|
|
||||||
env:
|
|
||||||
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
|
||||||
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
|
||||||
run: |
|
|
||||||
trap 'status=$?; if [ "$status" -ne 0 ]; then echo "::error::Private operation failed; diagnostics suppressed."; fi' EXIT
|
|
||||||
(
|
|
||||||
set -euo pipefail
|
|
||||||
|
|
||||||
cp "$RUNNER_TEMP/updates/appcast.xml" gpgui/apps/update-feed-worker/public/appcast.xml
|
|
||||||
if [[ -f "$RUNNER_TEMP/updates/latest.json" ]]; then
|
|
||||||
cp "$RUNNER_TEMP/updates/latest.json" gpgui/apps/update-feed-worker/public/latest.json
|
|
||||||
fi
|
|
||||||
pnpm --dir gpgui/apps/update-feed-worker exec wrangler deploy \
|
|
||||||
--config wrangler.jsonc \
|
|
||||||
--name "$UPDATES_WORKER_NAME"
|
|
||||||
) >/dev/null 2>&1
|
|
||||||
echo "Private operation passed."
|
|
||||||
|
|
||||||
- name: Verify published appcast
|
|
||||||
env:
|
|
||||||
ARCHIVE_NAME: ${{ steps.archive.outputs.name }}
|
|
||||||
run: |
|
|
||||||
set -euo pipefail
|
|
||||||
|
|
||||||
published_appcast="$RUNNER_TEMP/published-appcast.xml"
|
|
||||||
for _ in 1 2 3 4 5 6 7 8 9 10; do
|
|
||||||
if curl --fail --location --silent --show-error \
|
|
||||||
--output "$published_appcast" "$FEED_URL" && \
|
|
||||||
python3 scripts/validate-macos-appcast.py validate "$published_appcast" \
|
|
||||||
--repository "$REPOSITORY" \
|
|
||||||
--build-version "${{ steps.bundle.outputs.version }}" \
|
|
||||||
--short-version "${{ steps.bundle.outputs.short_version }}" \
|
|
||||||
--channel "$CHANNEL" \
|
|
||||||
--archive-url "https://github.com/$REPOSITORY/releases/download/$RELEASE_TAG/$ARCHIVE_NAME"; then
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
sleep 3
|
|
||||||
done
|
|
||||||
echo "Published appcast did not become available at $FEED_URL" >&2
|
|
||||||
exit 1
|
|
||||||
|
|
||||||
- name: Verify published Unix update manifest
|
|
||||||
run: |
|
|
||||||
set -euo pipefail
|
|
||||||
|
|
||||||
latest_url="${FEED_URL%/appcast.xml}/latest.json"
|
|
||||||
published_manifest="$RUNNER_TEMP/published-latest.json"
|
|
||||||
expected=(
|
|
||||||
--channel "$CHANNEL"
|
|
||||||
--version "${{ steps.bundle.outputs.short_version }}"
|
|
||||||
)
|
|
||||||
if [[ "$CHANNEL" == "snapshot" ]]; then
|
|
||||||
expected+=(--build "${{ steps.bundle.outputs.version }}")
|
|
||||||
fi
|
|
||||||
for _ in 1 2 3 4 5 6 7 8 9 10; do
|
|
||||||
if curl --fail --location --silent --show-error \
|
|
||||||
--output "$published_manifest" "$latest_url" && \
|
|
||||||
python3 scripts/validate-update-manifest.py validate "$published_manifest" \
|
|
||||||
--repository "$REPOSITORY" "${expected[@]}"; then
|
|
||||||
if ! cmp --silent "$RUNNER_TEMP/updates/latest.json" "$published_manifest"; then
|
|
||||||
sleep 3
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
sleep 3
|
|
||||||
done
|
|
||||||
echo "Published Unix update manifest did not become available at $latest_url" >&2
|
|
||||||
exit 1
|
|
||||||
|
|
||||||
- name: Prune expired snapshot assets
|
|
||||||
if: ${{ inputs.channel == 'snapshot' }}
|
|
||||||
env:
|
|
||||||
GH_TOKEN: ${{ github.token }}
|
|
||||||
run: |
|
|
||||||
set -euo pipefail
|
|
||||||
|
|
||||||
assets="$RUNNER_TEMP/snapshot-assets.json"
|
|
||||||
delete_list="$RUNNER_TEMP/delete-snapshot-assets.txt"
|
|
||||||
gh release view snapshot --repo "$REPOSITORY" --json assets > "$assets"
|
|
||||||
ASSETS="$assets" python3 - <<'PY' > "$delete_list"
|
|
||||||
import json
|
|
||||||
import os
|
|
||||||
import re
|
|
||||||
|
|
||||||
with open(os.environ["ASSETS"], encoding="utf-8") as file:
|
|
||||||
assets = json.load(file)["assets"]
|
|
||||||
|
|
||||||
archive_pattern = re.compile(
|
|
||||||
r"^(GPConnect_.+-snapshot\.(\d+(?:\.\d+){1,2}))_arm64\.zip$"
|
|
||||||
)
|
|
||||||
asset_pattern = re.compile(
|
|
||||||
r"^(GPConnect_.+-snapshot\.\d+(?:\.\d+){1,2})_arm64\.(?:zip|dmg)(?:\.sha256)?$"
|
|
||||||
)
|
|
||||||
builds = []
|
|
||||||
for asset in assets:
|
|
||||||
match = archive_pattern.match(asset["name"])
|
|
||||||
if match:
|
|
||||||
builds.append((tuple(map(int, match.group(2).split("."))), match.group(1)))
|
|
||||||
keep = {stem for _, stem in sorted(builds, reverse=True)[:2]}
|
|
||||||
for asset in assets:
|
|
||||||
match = asset_pattern.match(asset["name"])
|
|
||||||
if match and not any(asset["name"].startswith(stem + "_arm64.") for stem in keep):
|
|
||||||
print(asset["name"])
|
|
||||||
PY
|
|
||||||
|
|
||||||
while IFS= read -r asset; do
|
|
||||||
if [[ -n "$asset" ]] && ! gh release delete-asset snapshot "$asset" \
|
|
||||||
--repo "$REPOSITORY" --yes; then
|
|
||||||
echo "::warning::Could not remove expired snapshot asset: $asset" >&2
|
|
||||||
fi
|
|
||||||
done < "$delete_list"
|
|
||||||
@@ -4,44 +4,18 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
paths:
|
paths:
|
||||||
- '.github/workflows/**'
|
- '.github/workflows/**'
|
||||||
- '.github/actions/**'
|
|
||||||
- 'scripts/record-build-sources.py'
|
|
||||||
- 'scripts/validate-release-version.py'
|
|
||||||
- 'scripts/publish-flake-test-branch.sh'
|
|
||||||
- 'scripts/prepare-release-promotion.sh'
|
|
||||||
- 'scripts/tests/test_release_flow.py'
|
|
||||||
- 'scripts/select-macos-artifact.sh'
|
|
||||||
- 'scripts/test-private-desktop.sh'
|
|
||||||
- 'scripts/tests/test_private_ci.py'
|
|
||||||
- 'scripts/wait-for-publication.py'
|
- 'scripts/wait-for-publication.py'
|
||||||
- 'scripts/select-publication-targets.py'
|
- 'scripts/select-publication-targets.py'
|
||||||
- 'scripts/verify-docker-publication.sh'
|
- 'scripts/verify-docker-publication.sh'
|
||||||
- 'scripts/tests/test_*publication.py'
|
- 'scripts/tests/test_*publication.py'
|
||||||
- 'scripts/validate-macos-release.py'
|
|
||||||
- 'scripts/validate-macos-appcast.py'
|
|
||||||
- 'scripts/validate-update-manifest.py'
|
|
||||||
- 'scripts/tests/test_validate_*.py'
|
|
||||||
push:
|
push:
|
||||||
branches: [main]
|
branches: [main]
|
||||||
paths:
|
paths:
|
||||||
- '.github/workflows/**'
|
- '.github/workflows/**'
|
||||||
- '.github/actions/**'
|
|
||||||
- 'scripts/record-build-sources.py'
|
|
||||||
- 'scripts/validate-release-version.py'
|
|
||||||
- 'scripts/publish-flake-test-branch.sh'
|
|
||||||
- 'scripts/prepare-release-promotion.sh'
|
|
||||||
- 'scripts/tests/test_release_flow.py'
|
|
||||||
- 'scripts/select-macos-artifact.sh'
|
|
||||||
- 'scripts/test-private-desktop.sh'
|
|
||||||
- 'scripts/tests/test_private_ci.py'
|
|
||||||
- 'scripts/wait-for-publication.py'
|
- 'scripts/wait-for-publication.py'
|
||||||
- 'scripts/select-publication-targets.py'
|
- 'scripts/select-publication-targets.py'
|
||||||
- 'scripts/verify-docker-publication.sh'
|
- 'scripts/verify-docker-publication.sh'
|
||||||
- 'scripts/tests/test_*publication.py'
|
- 'scripts/tests/test_*publication.py'
|
||||||
- 'scripts/validate-macos-release.py'
|
|
||||||
- 'scripts/validate-macos-appcast.py'
|
|
||||||
- 'scripts/validate-update-manifest.py'
|
|
||||||
- 'scripts/tests/test_validate_*.py'
|
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
@@ -62,16 +36,3 @@ jobs:
|
|||||||
shellcheck scripts/verify-docker-publication.sh
|
shellcheck scripts/verify-docker-publication.sh
|
||||||
- name: Test publication verification
|
- name: Test publication verification
|
||||||
run: python3 -m unittest discover -s scripts/tests -p 'test_*publication.py'
|
run: python3 -m unittest discover -s scripts/tests -p 'test_*publication.py'
|
||||||
- name: Test macOS publication and update feed validation
|
|
||||||
run: python3 -m unittest discover -s scripts/tests -p 'test_validate_*.py'
|
|
||||||
- name: Check private CI and macOS artifact selection
|
|
||||||
run: |
|
|
||||||
bash -n scripts/select-macos-artifact.sh
|
|
||||||
shellcheck scripts/select-macos-artifact.sh scripts/test-private-desktop.sh
|
|
||||||
bash -n scripts/test-private-desktop.sh
|
|
||||||
python3 -m unittest discover -s scripts/tests -p 'test_private_ci.py'
|
|
||||||
- name: Test release promotion and source selection
|
|
||||||
run: |
|
|
||||||
bash -n scripts/prepare-release-promotion.sh scripts/publish-flake-test-branch.sh
|
|
||||||
shellcheck scripts/prepare-release-promotion.sh scripts/publish-flake-test-branch.sh
|
|
||||||
python3 -m unittest discover -s scripts/tests -p 'test_release_flow.py'
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
name: Release version consistency
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
branches: [main]
|
|
||||||
push:
|
|
||||||
branches: [main]
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
release-version:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
# The default PR checkout is the candidate merged with the current base.
|
|
||||||
- uses: actions/checkout@v6
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
- name: Check main release version
|
|
||||||
env:
|
|
||||||
BASE_REF: ${{ github.event.pull_request.base.sha || github.event.before }}
|
|
||||||
run: python3 scripts/validate-release-version.py --base-ref "$BASE_REF"
|
|
||||||
@@ -73,7 +73,6 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
outputs:
|
outputs:
|
||||||
matrix: ${{ steps.set-matrix.outputs.result }}
|
matrix: ${{ steps.set-matrix.outputs.result }}
|
||||||
docker_matrix: ${{ steps.set-matrix.outputs.docker_matrix }}
|
|
||||||
steps:
|
steps:
|
||||||
- name: Set up matrix
|
- name: Set up matrix
|
||||||
id: set-matrix
|
id: set-matrix
|
||||||
@@ -89,12 +88,6 @@ jobs:
|
|||||||
"arm64": ["ubuntu-24.04-arm"]
|
"arm64": ["ubuntu-24.04-arm"]
|
||||||
}
|
}
|
||||||
|
|
||||||
const docker = [
|
|
||||||
{ runner: 'ubuntu-latest', platform: 'linux/amd64' },
|
|
||||||
{ runner: 'ubuntu-24.04-arm', platform: 'linux/arm64' },
|
|
||||||
].filter(item => osMap[arch].includes(item.runner))
|
|
||||||
core.setOutput('docker_matrix', JSON.stringify({ include: docker }))
|
|
||||||
|
|
||||||
const package = Object.entries(inputs)
|
const package = Object.entries(inputs)
|
||||||
.filter(([key, value]) => key.startsWith('release-') && key !== 'release-docker' && value)
|
.filter(([key, value]) => key.startsWith('release-') && key !== 'release-docker' && value)
|
||||||
.map(([key, value]) => key.replace('release-', ''))
|
.map(([key, value]) => key.replace('release-', ''))
|
||||||
@@ -152,11 +145,15 @@ jobs:
|
|||||||
build-docker-image:
|
build-docker-image:
|
||||||
needs:
|
needs:
|
||||||
- check
|
- check
|
||||||
- setup-matrix
|
|
||||||
if: ${{ inputs.release-docker }}
|
if: ${{ inputs.release-docker }}
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix: ${{ fromJson(needs.setup-matrix.outputs.docker_matrix) }}
|
matrix:
|
||||||
|
include:
|
||||||
|
- runner: ubuntu-latest
|
||||||
|
platform: linux/amd64
|
||||||
|
- runner: ubuntu-24.04-arm
|
||||||
|
platform: linux/arm64
|
||||||
runs-on: ${{ matrix.runner }}
|
runs-on: ${{ matrix.runner }}
|
||||||
steps:
|
steps:
|
||||||
- name: Prepare
|
- name: Prepare
|
||||||
@@ -238,17 +235,6 @@ jobs:
|
|||||||
IMAGE: yuezk/globalprotect-openconnect
|
IMAGE: yuezk/globalprotect-openconnect
|
||||||
TAG: ${{ inputs.tag }}
|
TAG: ${{ inputs.tag }}
|
||||||
run: |
|
run: |
|
||||||
# Reject an incomplete or unexpected selection before writing any tag.
|
|
||||||
shopt -s nullglob
|
|
||||||
digest_files=(*)
|
|
||||||
expected_count=1
|
|
||||||
if [[ "${{ inputs.arch }}" == all ]]; then
|
|
||||||
expected_count=2
|
|
||||||
fi
|
|
||||||
[[ ${#digest_files[@]} -eq $expected_count ]]
|
|
||||||
for digest in "${digest_files[@]}"; do
|
|
||||||
[[ "$digest" =~ ^[0-9a-f]{64}$ ]]
|
|
||||||
done
|
|
||||||
VERSION="${TAG#v}"
|
VERSION="${TAG#v}"
|
||||||
tags=(-t "$IMAGE:$TAG")
|
tags=(-t "$IMAGE:$TAG")
|
||||||
|
|
||||||
@@ -349,6 +335,7 @@ jobs:
|
|||||||
if: ${{ inputs.release-binary && inputs.arch == 'all' && needs.gh-release.outputs.stable_version != '' }}
|
if: ${{ inputs.release-binary && inputs.arch == 'all' && needs.gh-release.outputs.stable_version != '' }}
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
|
pull-requests: write
|
||||||
uses: ./.github/workflows/update-flake-hashes.yaml
|
uses: ./.github/workflows/update-flake-hashes.yaml
|
||||||
with:
|
with:
|
||||||
version: ${{ needs.gh-release.outputs.stable_version }}
|
version: ${{ needs.gh-release.outputs.stable_version }}
|
||||||
|
|||||||
@@ -20,47 +20,14 @@ on:
|
|||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
|
pull-requests: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
update-flake-hashes:
|
update-flake-hashes:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
outputs:
|
|
||||||
version: ${{ steps.release.outputs.version }}
|
|
||||||
release_tag: ${{ steps.release.outputs.release_tag }}
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout GlobalProtect-openconnect
|
- name: Checkout GlobalProtect-openconnect
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v6
|
||||||
with:
|
|
||||||
ref: ${{ github.sha }}
|
|
||||||
|
|
||||||
- name: Resolve candidate release
|
|
||||||
id: release
|
|
||||||
env:
|
|
||||||
RELEASE_VERSION: ${{ inputs.version }}
|
|
||||||
RELEASE_TAG: ${{ inputs.release_tag }}
|
|
||||||
run: |
|
|
||||||
python3 - <<'PYRELEASE'
|
|
||||||
import json, os, re, runpy, subprocess
|
|
||||||
from pathlib import Path
|
|
||||||
helpers = runpy.run_path('scripts/validate-release-version.py')
|
|
||||||
version = os.environ['RELEASE_VERSION'].removeprefix('v') or helpers['cargo_version'](Path('.'))
|
|
||||||
tag = os.environ['RELEASE_TAG'] or f'v{version}'
|
|
||||||
if not re.fullmatch(r'(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)', version) or tag not in (f'v{version}', 'snapshot'):
|
|
||||||
raise SystemExit('Expected a stable version and its matching release tag, or snapshot')
|
|
||||||
source_slug = re.sub(r'[^A-Za-z0-9._-]', '', re.sub(r'[/\s]+', '-', os.environ['GITHUB_REF_NAME'])).strip('-')
|
|
||||||
test_branch = f'chore/flake-{source_slug}'
|
|
||||||
expected_head = ''
|
|
||||||
if tag == 'snapshot':
|
|
||||||
remote = subprocess.check_output(['git', 'ls-remote', '--heads', 'origin', f'refs/heads/{test_branch}'], text=True)
|
|
||||||
expected_head = remote.split()[0] if remote.strip() else ''
|
|
||||||
with open(os.environ['GITHUB_OUTPUT'], 'a') as output:
|
|
||||||
output.write(f'version={version}\nrelease_tag={tag}\n')
|
|
||||||
Path('release-candidate.json').write_text(json.dumps({
|
|
||||||
'version': version, 'releaseTag': tag, 'sourceSha': os.environ['GITHUB_SHA'],
|
|
||||||
'workflowRunId': os.environ['GITHUB_RUN_ID'],
|
|
||||||
'testBranch': test_branch, 'expectedTestHead': expected_head,
|
|
||||||
}, indent=2) + '\n')
|
|
||||||
PYRELEASE
|
|
||||||
|
|
||||||
- name: Install Nix
|
- name: Install Nix
|
||||||
uses: cachix/install-nix-action@v31
|
uses: cachix/install-nix-action@v31
|
||||||
@@ -72,8 +39,8 @@ jobs:
|
|||||||
|
|
||||||
- name: Update flake hashes
|
- name: Update flake hashes
|
||||||
env:
|
env:
|
||||||
RELEASE_VERSION: ${{ steps.release.outputs.version }}
|
RELEASE_VERSION: ${{ inputs.version }}
|
||||||
RELEASE_TAG: ${{ steps.release.outputs.release_tag }}
|
RELEASE_TAG: ${{ inputs.release_tag }}
|
||||||
run: |
|
run: |
|
||||||
if [[ -n "$RELEASE_VERSION" ]]; then
|
if [[ -n "$RELEASE_VERSION" ]]; then
|
||||||
scripts/update-flake-hashes.sh "$RELEASE_VERSION" "$RELEASE_TAG"
|
scripts/update-flake-hashes.sh "$RELEASE_VERSION" "$RELEASE_TAG"
|
||||||
@@ -88,7 +55,6 @@ jobs:
|
|||||||
path: |
|
path: |
|
||||||
flake.nix
|
flake.nix
|
||||||
flake.lock
|
flake.lock
|
||||||
release-candidate.json
|
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
|
|
||||||
validate-nix-prebuilt:
|
validate-nix-prebuilt:
|
||||||
@@ -113,8 +79,6 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Checkout GlobalProtect-openconnect
|
- name: Checkout GlobalProtect-openconnect
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v6
|
||||||
with:
|
|
||||||
ref: ${{ github.sha }}
|
|
||||||
|
|
||||||
- name: Download updated flake
|
- name: Download updated flake
|
||||||
uses: actions/download-artifact@v8
|
uses: actions/download-artifact@v8
|
||||||
@@ -140,12 +104,6 @@ jobs:
|
|||||||
--print-build-logs
|
--print-build-logs
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Validate installed release versions
|
|
||||||
run: |
|
|
||||||
python3 scripts/validate-release-version.py \
|
|
||||||
--version '${{ needs.update-flake-hashes.outputs.version }}' \
|
|
||||||
--release-tag '${{ needs.update-flake-hashes.outputs.release_tag }}' --package result
|
|
||||||
|
|
||||||
- name: Inspect prebuilt Nix package
|
- name: Inspect prebuilt Nix package
|
||||||
run: |
|
run: |
|
||||||
test -x result/bin/gpclient
|
test -x result/bin/gpclient
|
||||||
@@ -168,15 +126,13 @@ jobs:
|
|||||||
- name: Verify desktop authorization runs on the host
|
- name: Verify desktop authorization runs on the host
|
||||||
run: bash scripts/tests/nix-desktop-authorization.sh result
|
run: bash scripts/tests/nix-desktop-authorization.sh result
|
||||||
|
|
||||||
publish-test-branch:
|
open-pull-request:
|
||||||
if: needs.update-flake-hashes.outputs.release_tag == 'snapshot'
|
needs:
|
||||||
needs: [update-flake-hashes, validate-nix-prebuilt]
|
- validate-nix-prebuilt
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout GlobalProtect-openconnect
|
- name: Checkout GlobalProtect-openconnect
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v6
|
||||||
with:
|
|
||||||
ref: ${{ github.sha }}
|
|
||||||
|
|
||||||
- name: Download updated flake
|
- name: Download updated flake
|
||||||
uses: actions/download-artifact@v8
|
uses: actions/download-artifact@v8
|
||||||
@@ -184,7 +140,9 @@ jobs:
|
|||||||
name: updated-flake
|
name: updated-flake
|
||||||
path: .
|
path: .
|
||||||
|
|
||||||
- name: Publish branch for snapshot testing
|
- name: Open pull request
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ github.token }}
|
GH_TOKEN: ${{ github.token }}
|
||||||
run: scripts/publish-flake-test-branch.sh
|
RELEASE_VERSION: ${{ inputs.version }}
|
||||||
|
RELEASE_TAG: ${{ inputs.release_tag }}
|
||||||
|
run: scripts/open-flake-hashes-pr.sh "$RELEASE_VERSION" "$RELEASE_TAG"
|
||||||
@@ -16,6 +16,3 @@ gen
|
|||||||
|
|
||||||
# Nix files
|
# Nix files
|
||||||
result
|
result
|
||||||
|
|
||||||
# Packages & test assets
|
|
||||||
*.ipa
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
[workspace]
|
[workspace]
|
||||||
resolver = "3"
|
resolver = "2"
|
||||||
|
|
||||||
members = [
|
members = [
|
||||||
"crates/*",
|
"crates/*",
|
||||||
@@ -11,7 +11,7 @@ members = [
|
|||||||
|
|
||||||
[workspace.package]
|
[workspace.package]
|
||||||
rust-version = "1.91"
|
rust-version = "1.91"
|
||||||
version = "3.3.0"
|
version = "3.0.6"
|
||||||
authors = ["Kevin Yue <[email protected]>"]
|
authors = ["Kevin Yue <[email protected]>"]
|
||||||
homepage = "https://github.com/yuezk/GlobalProtect-openconnect"
|
homepage = "https://github.com/yuezk/GlobalProtect-openconnect"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
@@ -32,7 +32,7 @@ is_executable = "1.0"
|
|||||||
log = "0.4"
|
log = "0.4"
|
||||||
# RUST_LOG accepts user-supplied Unicode property filters through env_logger.
|
# RUST_LOG accepts user-supplied Unicode property filters through env_logger.
|
||||||
regex = { version = "1", default-features = false, features = ["std", "perf", "unicode"] }
|
regex = { version = "1", default-features = false, features = ["std", "perf", "unicode"] }
|
||||||
reqwest = { version = "0.13", default-features = false, features = ["rustls-no-provider", "charset", "http2", "system-proxy", "json", "form", "query"] }
|
reqwest = { version = "0.13", default-features = false, features = ["native-tls", "charset", "http2", "system-proxy", "json", "form", "query"] }
|
||||||
openssl = "0.10"
|
openssl = "0.10"
|
||||||
pem = "4"
|
pem = "4"
|
||||||
xmltree = { version = "0.12", features = ["attribute-order"] }
|
xmltree = { version = "0.12", features = ["attribute-order"] }
|
||||||
@@ -43,7 +43,6 @@ sysinfo = { version = "0.38.4", default-features = false, features = ["system"]
|
|||||||
tempfile = "3.8"
|
tempfile = "3.8"
|
||||||
tokio = { version = "1" }
|
tokio = { version = "1" }
|
||||||
tokio-util = "0.7"
|
tokio-util = "0.7"
|
||||||
tokio-tungstenite = "0.30"
|
|
||||||
url = "2.4"
|
url = "2.4"
|
||||||
urlencoding = "2.1.3"
|
urlencoding = "2.1.3"
|
||||||
axum = { version = "0.8", default-features = false, features = ["http1", "tokio"] }
|
axum = { version = "0.8", default-features = false, features = ["http1", "tokio"] }
|
||||||
@@ -58,7 +57,7 @@ md5 = "0.8"
|
|||||||
sha2 = { version = "0.11", default-features = false }
|
sha2 = { version = "0.11", default-features = false }
|
||||||
which = "8"
|
which = "8"
|
||||||
uuid = "1"
|
uuid = "1"
|
||||||
netdev = "0.47"
|
netdev = "0.46.3"
|
||||||
humantime = "2"
|
humantime = "2"
|
||||||
snow = { version = "0.10", default-features = false, features = ["use-getrandom", "use-curve25519", "use-chacha20poly1305", "use-sha2"] }
|
snow = { version = "0.10", default-features = false, features = ["use-getrandom", "use-curve25519", "use-chacha20poly1305", "use-sha2"] }
|
||||||
zeroize = "1"
|
zeroize = "1"
|
||||||
@@ -69,10 +68,10 @@ specta = "=2.0.0-rc.20"
|
|||||||
proptest = "1"
|
proptest = "1"
|
||||||
|
|
||||||
[patch.crates-io]
|
[patch.crates-io]
|
||||||
# Restore BSD GTK resize hit testing and apply fixed-size windows before first configure.
|
# Restore BSD GTK resize hit testing until https://github.com/tauri-apps/tao/pull/1356 is released.
|
||||||
tao = { git = "https://github.com/yuezk/tao", rev = "bba0f1c4e86d697b173c75280d1651f408b8023c" }
|
tao = { git = "https://github.com/yuezk/tao", rev = "1452ae7a42c9f134296ba199f91f514fc9077f61" }
|
||||||
# Use one macro source for Tao and Wry so Cargo can vendor the workspace.
|
# Use one macro source for Tao and Wry so Cargo can vendor the workspace.
|
||||||
tao-macros = { git = "https://github.com/yuezk/tao", rev = "bba0f1c4e86d697b173c75280d1651f408b8023c" }
|
tao-macros = { git = "https://github.com/yuezk/tao", rev = "1452ae7a42c9f134296ba199f91f514fc9077f61" }
|
||||||
|
|
||||||
[profile.release]
|
[profile.release]
|
||||||
opt-level = 'z' # Optimize for size
|
opt-level = 'z' # Optimize for size
|
||||||
|
|||||||
@@ -190,7 +190,8 @@ install-unix: install-gpclient-unix
|
|||||||
set -e; if [ -f "$(GPGUI_BINARY)" ]; then \
|
set -e; if [ -f "$(GPGUI_BINARY)" ]; then \
|
||||||
install -m 755 "$(GPGUI_BINARY)" "$(DESTDIR)$(PREFIX)/bin/gpgui"; \
|
install -m 755 "$(GPGUI_BINARY)" "$(DESTDIR)$(PREFIX)/bin/gpgui"; \
|
||||||
fi
|
fi
|
||||||
set -e; for file in packaging/files/usr/share/icons/hicolor/*/apps/gpgui.*; do \
|
set -e; for file in packaging/files/usr/share/icons/hicolor/*/apps/gpgui.* \
|
||||||
|
packaging/files/usr/share/icons/hicolor/scalable/status/gpgui-*.svg; do \
|
||||||
destination="$(DESTDIR)$(PREFIX)/$${file#packaging/files/usr/}"; \
|
destination="$(DESTDIR)$(PREFIX)/$${file#packaging/files/usr/}"; \
|
||||||
install -d "$$(dirname "$$destination")"; \
|
install -d "$$(dirname "$$destination")"; \
|
||||||
install -m 644 "$$file" "$$destination"; \
|
install -m 644 "$$file" "$$destination"; \
|
||||||
@@ -199,8 +200,6 @@ install-unix: install-gpclient-unix
|
|||||||
install-linux: install-unix
|
install-linux: install-unix
|
||||||
@echo "Installing Linux integration under $(PREFIX)..."
|
@echo "Installing Linux integration under $(PREFIX)..."
|
||||||
set -e; for file in share/applications/gpgui.desktop \
|
set -e; for file in share/applications/gpgui.desktop \
|
||||||
share/applications/gpgui-helper.desktop \
|
|
||||||
share/applications/gpauth.desktop \
|
|
||||||
share/polkit-1/actions/com.yuezk.gpgui.policy \
|
share/polkit-1/actions/com.yuezk.gpgui.policy \
|
||||||
lib/NetworkManager/dispatcher.d/pre-down.d/gpclient.down \
|
lib/NetworkManager/dispatcher.d/pre-down.d/gpclient.down \
|
||||||
lib/NetworkManager/dispatcher.d/gpclient-nm-hook; do \
|
lib/NetworkManager/dispatcher.d/gpclient-nm-hook; do \
|
||||||
@@ -214,7 +213,7 @@ install-linux: install-unix
|
|||||||
install-bsd: install-unix
|
install-bsd: install-unix
|
||||||
@echo "Installing BSD integration under $(PREFIX)..."
|
@echo "Installing BSD integration under $(PREFIX)..."
|
||||||
install -d "$(DESTDIR)$(PREFIX)/share/applications" "$(DESTDIR)$(PREFIX)/share/polkit-1/actions"
|
install -d "$(DESTDIR)$(PREFIX)/share/applications" "$(DESTDIR)$(PREFIX)/share/polkit-1/actions"
|
||||||
install -m 644 packaging/bsd/gpgui.desktop packaging/bsd/gpgui-helper.desktop packaging/bsd/gpauth.desktop "$(DESTDIR)$(PREFIX)/share/applications/"
|
install -m 644 packaging/bsd/gpgui.desktop "$(DESTDIR)$(PREFIX)/share/applications/"
|
||||||
install -m 644 packaging/bsd/com.yuezk.gpgui.policy "$(DESTDIR)$(PREFIX)/share/polkit-1/actions/"
|
install -m 644 packaging/bsd/com.yuezk.gpgui.policy "$(DESTDIR)$(PREFIX)/share/polkit-1/actions/"
|
||||||
sh scripts/relocate-install-paths.sh "$(PREFIX)" /usr/local "$(DESTDIR)$(PREFIX)"
|
sh scripts/relocate-install-paths.sh "$(PREFIX)" /usr/local "$(DESTDIR)$(PREFIX)"
|
||||||
|
|
||||||
@@ -260,9 +259,7 @@ package-openbsd: clean-bsd-package
|
|||||||
$(MAKE) install-bsd DESTDIR=$(CURDIR)/.build/openbsd/pkgroot PREFIX=$(PREFIX) GPGUI_BINARY="$(GPGUI_BINARY)"
|
$(MAKE) install-bsd DESTDIR=$(CURDIR)/.build/openbsd/pkgroot PREFIX=$(PREFIX) GPGUI_BINARY="$(GPGUI_BINARY)"
|
||||||
cp packaging/bsd/openbsd/COMMENT .build/openbsd/+COMMENT
|
cp packaging/bsd/openbsd/COMMENT .build/openbsd/+COMMENT
|
||||||
cp packaging/bsd/openbsd/DESC .build/openbsd/+DESC
|
cp packaging/bsd/openbsd/DESC .build/openbsd/+DESC
|
||||||
sh scripts/openbsd-library-dependencies.sh .build/openbsd/pkgroot > .build/openbsd/WANTLIB
|
|
||||||
{ \
|
{ \
|
||||||
cat .build/openbsd/WANTLIB; \
|
|
||||||
echo '@unexec-delete /bin/rm -f /usr/local/libexec/gpclient/gpgui /var/db/gpclient/scripts/vpnc-script /var/db/gpclient/scripts/vpnc-script.metadata || echo "Warning: failed to remove gpclient runtime files" >&2'; \
|
echo '@unexec-delete /bin/rm -f /usr/local/libexec/gpclient/gpgui /var/db/gpclient/scripts/vpnc-script /var/db/gpclient/scripts/vpnc-script.metadata || echo "Warning: failed to remove gpclient runtime files" >&2'; \
|
||||||
echo '@unexec-delete /bin/rmdir /usr/local/libexec/gpclient 2>/dev/null || true'; \
|
echo '@unexec-delete /bin/rmdir /usr/local/libexec/gpclient 2>/dev/null || true'; \
|
||||||
echo '@unexec-delete /bin/rmdir /var/db/gpclient/scripts 2>/dev/null || true'; \
|
echo '@unexec-delete /bin/rmdir /var/db/gpclient/scripts 2>/dev/null || true'; \
|
||||||
@@ -317,12 +314,11 @@ uninstall-unix:
|
|||||||
set -e; for file in gp-hip-script-installer gp-vpnc-script-installer vpnc-script; do \
|
set -e; for file in gp-hip-script-installer gp-vpnc-script-installer vpnc-script; do \
|
||||||
rm -f "$(DESTDIR)$(PREFIX)/libexec/gpclient/$$file"; \
|
rm -f "$(DESTDIR)$(PREFIX)/libexec/gpclient/$$file"; \
|
||||||
done
|
done
|
||||||
set -e; for file in packaging/files/usr/share/icons/hicolor/*/apps/gpgui.*; do \
|
set -e; for file in packaging/files/usr/share/icons/hicolor/*/apps/gpgui.* \
|
||||||
|
packaging/files/usr/share/icons/hicolor/scalable/status/gpgui-*.svg; do \
|
||||||
rm -f "$(DESTDIR)$(PREFIX)/$${file#packaging/files/usr/}"; \
|
rm -f "$(DESTDIR)$(PREFIX)/$${file#packaging/files/usr/}"; \
|
||||||
done
|
done
|
||||||
rm -f "$(DESTDIR)$(PREFIX)/share/applications/gpgui.desktop" \
|
rm -f "$(DESTDIR)$(PREFIX)/share/applications/gpgui.desktop" \
|
||||||
"$(DESTDIR)$(PREFIX)/share/applications/gpgui-helper.desktop" \
|
|
||||||
"$(DESTDIR)$(PREFIX)/share/applications/gpauth.desktop" \
|
|
||||||
"$(DESTDIR)$(PREFIX)/share/polkit-1/actions/com.yuezk.gpgui.policy"
|
"$(DESTDIR)$(PREFIX)/share/polkit-1/actions/com.yuezk.gpgui.policy"
|
||||||
rmdir "$(DESTDIR)$(PREFIX)/libexec/gpclient" 2>/dev/null || true
|
rmdir "$(DESTDIR)$(PREFIX)/libexec/gpclient" 2>/dev/null || true
|
||||||
|
|
||||||
@@ -330,7 +326,6 @@ uninstall-linux: uninstall-unix
|
|||||||
rm -f "$(DESTDIR)$(PREFIX)/lib/NetworkManager/dispatcher.d/pre-down.d/gpclient.down" \
|
rm -f "$(DESTDIR)$(PREFIX)/lib/NetworkManager/dispatcher.d/pre-down.d/gpclient.down" \
|
||||||
"$(DESTDIR)$(PREFIX)/lib/NetworkManager/dispatcher.d/gpclient-nm-hook"
|
"$(DESTDIR)$(PREFIX)/lib/NetworkManager/dispatcher.d/gpclient-nm-hook"
|
||||||
rm -f "$(DESTDIR)/var/lib/gpclient/gpgui" \
|
rm -f "$(DESTDIR)/var/lib/gpclient/gpgui" \
|
||||||
"$(DESTDIR)/var/lib/gpclient/gpgui-nsh" \
|
|
||||||
"$(DESTDIR)/var/lib/gpclient/scripts/vpnc-script" \
|
"$(DESTDIR)/var/lib/gpclient/scripts/vpnc-script" \
|
||||||
"$(DESTDIR)/var/lib/gpclient/scripts/vpnc-script.metadata"
|
"$(DESTDIR)/var/lib/gpclient/scripts/vpnc-script.metadata"
|
||||||
rmdir "$(DESTDIR)/var/lib/gpclient/scripts" "$(DESTDIR)/var/lib/gpclient" 2>/dev/null || true
|
rmdir "$(DESTDIR)/var/lib/gpclient/scripts" "$(DESTDIR)/var/lib/gpclient" 2>/dev/null || true
|
||||||
|
|||||||
@@ -1,15 +1,9 @@
|
|||||||
# GlobalProtect-openconnect
|
# GlobalProtect-openconnect
|
||||||
|
|
||||||
A GlobalProtect VPN client built on OpenConnect. It provides command-line tools (`gpclient`) and the GP Connect desktop application for macOS, Linux, FreeBSD, and OpenBSD.
|
A GlobalProtect VPN client built on OpenConnect with support for SSO authentication. It provides command-line tools and the GP Connect desktop application for macOS, Linux, FreeBSD, and OpenBSD.
|
||||||
|
|
||||||
> **Disclaimer**: GP Connect is an independent third-party client for GlobalProtect VPN networks. It is not affiliated with or endorsed by Palo Alto Networks, Inc.
|
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<picture>
|
<img width="300" src="https://github.com/user-attachments/assets/2fb6116c-dc57-43f2-af75-9c3d97ab7122">
|
||||||
<source media="(prefers-color-scheme: dark)" srcset="docs/images/gp-connect-showcase-dark.png">
|
|
||||||
<source media="(prefers-color-scheme: light)" srcset="docs/images/gp-connect-showcase-light.png">
|
|
||||||
<img alt="GP Connect Desktop" src="docs/images/gp-connect-showcase-light.png" width="640">
|
|
||||||
</picture>
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
> **Inspired by** [gp-saml-gui](https://github.com/dlenski/gp-saml-gui)
|
> **Inspired by** [gp-saml-gui](https://github.com/dlenski/gp-saml-gui)
|
||||||
@@ -24,89 +18,146 @@ A GlobalProtect VPN client built on OpenConnect. It provides command-line tools
|
|||||||
- [macOS](#macos)
|
- [macOS](#macos)
|
||||||
- [Debian / Ubuntu](#debian--ubuntu)
|
- [Debian / Ubuntu](#debian--ubuntu)
|
||||||
- [Arch Linux / Manjaro](#arch-linux--manjaro)
|
- [Arch Linux / Manjaro](#arch-linux--manjaro)
|
||||||
- [Fedora / RHEL](#fedora--rhel)
|
- [Fedora 38+ / Rawhide](#fedora-38--rawhide)
|
||||||
- [openSUSE](#opensuse)
|
- [openSUSE Leap 15.6+ / Tumbleweed](#opensuse-leap-156--tumbleweed)
|
||||||
|
- [Other RPM-based Distributions](#other-rpm-based-distributions)
|
||||||
- [Alpine Linux](#alpine-linux)
|
- [Alpine Linux](#alpine-linux)
|
||||||
- [FreeBSD](#freebsd)
|
- [FreeBSD](#freebsd)
|
||||||
- [OpenBSD](#openbsd)
|
- [OpenBSD](#openbsd)
|
||||||
- [Gentoo](#gentoo)
|
- [Gentoo](#gentoo)
|
||||||
- [NixOS](#nixos)
|
- [NixOS](#nixos)
|
||||||
- [Docker](#docker)
|
- [Official Docker Image](#official-docker-image)
|
||||||
- [Other Distributions](#other-distributions)
|
- [Other Distributions](#other-distributions)
|
||||||
- [Building from Source](#building-from-source)
|
- [Building from Source](#building-from-source)
|
||||||
- [Troubleshooting](#troubleshooting)
|
- [Frequently Asked Questions](#frequently-asked-questions)
|
||||||
- [NetworkManager Integration](#networkmanager-integration)
|
- [NetworkManager Integration](#networkmanager-integration)
|
||||||
- [Licensing](#licensing)
|
- [Licensing](#licensing)
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
- **Multi-Platform** – macOS (Apple silicon), Linux, FreeBSD, and OpenBSD
|
- **Desktop Platform Support** – macOS, Linux, FreeBSD, and OpenBSD
|
||||||
- **Dual Interfaces** – Fast terminal CLI (`gpclient`) and desktop GUI (**GP Connect**)
|
- **Dual Interface** – Available as both CLI and GUI applications
|
||||||
- **Native Shell on Linux** – Ultra-low-memory native desktop GUI alongside the webview interface
|
- **Flexible Authentication** – Supports SSO, non-SSO, FIDO2 (e.g., YubiKey), and client certificate authentication
|
||||||
- **Flexible Routing** – Full System VPN tunnel or local SOCKS5 proxy mode
|
- **Browser Integration** – Authenticate using your default browser or any specified browser
|
||||||
- **Modern Authentication** – SAML / SSO, MFA, FIDO2 (YubiKey), client certificates, and external browser login
|
- **Multi-Portal Support** – Connect to multiple portals and gateways
|
||||||
- **Automated HIP Reports** – Built-in HIP report generation or custom scripts
|
- **Direct Gateway Connection** – Bypass portal selection when needed
|
||||||
- **Multi-Portal & Direct Gateway** – Manage multiple saved portals or connect directly to a gateway
|
- **Auto-Connect** – Automatically connect on system startup
|
||||||
- **Desktop Integration** – Theme-aware system tray icon, auto-connect on launch, and reconnect on wake
|
- **System Tray Integration** – Convenient system tray icon (requires [gnome-shell-extension-appindicator](https://extensions.gnome.org/extension/615/appindicator-support/) on GNOME)
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
### Command-Line Interface
|
### Command-Line Interface
|
||||||
|
|
||||||
The open-source `gpclient` CLI handles authentication, connection lifecycle, and HIP generation:
|
The CLI is free and open source. Use it to authenticate, connect to portals or gateways, and generate HIP reports from the terminal.
|
||||||
|
|
||||||
|
#### Basic Commands
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Connect to a portal server
|
Usage: gpclient [OPTIONS] <COMMAND>
|
||||||
sudo gpclient connect <portal>
|
|
||||||
|
|
||||||
# Connect using browser authentication (SSO / SAML)
|
Commands:
|
||||||
sudo gpclient connect <portal> --browser
|
connect Connect to a portal server
|
||||||
|
disconnect Disconnect from the server
|
||||||
|
launch-gui Launch the GUI
|
||||||
|
hip Generate HIP report
|
||||||
|
help Print this message or the help of the given subcommand(s)
|
||||||
|
|
||||||
# Connect directly to a gateway server
|
Options:
|
||||||
sudo gpclient connect <gateway> --as-gateway
|
--fix-openssl Uses extended compatibility mode for OpenSSL operations to support a broader range of systems and formats.
|
||||||
|
--ignore-tls-errors Ignore the TLS errors
|
||||||
# Connect with automatic HIP report generation
|
--lock-file <LOCK_FILE> Path to the gpclient PID lock file
|
||||||
sudo gpclient connect <portal> --hip
|
--log-format <LOG_FORMAT> Log output format. JSON is intended for non-interactive consumers; interactive prompts remain text. [default: text] [possible values: text, json]
|
||||||
|
-v, --verbose... Enable verbose output, -v for debug, -vv for trace
|
||||||
# Headless / remote server authentication (prints auth URL to open in any browser)
|
-q, --quiet... Decrease logging verbosity, -q for warnings, -qq for errors
|
||||||
sudo gpclient connect <portal> --browser manual
|
-h, --help Print help (see more with '--help')
|
||||||
|
-V, --version Print version
|
||||||
# Disconnect
|
|
||||||
sudo gpclient disconnect
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Run `gpclient --help` or `gpclient <command> --help` to view all available commands and options.
|
The `--fix-openssl` option is available on Linux, FreeBSD, and OpenBSD. macOS uses native TLS and GnuTLS and does not accept this option.
|
||||||
|
|
||||||
|
> **Tip:** Use `gpclient help <command>` for detailed information on a specific command.
|
||||||
|
|
||||||
|
#### HIP reports
|
||||||
|
|
||||||
|
HIP is disabled in the CLI unless enabled explicitly. Use `--hip` to generate reports inside `gpclient`, including later reports requested by the gateway:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo gpclient connect <portal> --hip
|
||||||
|
```
|
||||||
|
|
||||||
|
Use `--hip=/absolute/path/to/script` for a custom executable. It runs as the `gpclient` process user unless `--hip-user` specifies another user. No installed HIP script is discovered automatically. `--hip-user` applies only to custom executables.
|
||||||
|
|
||||||
|
`gpclient hip` generates a report on demand for inspection; see `gpclient hip --help` for report inputs. The GUI's HIP tab supports generated reports, edited XML, and HIP Off on all desktop platforms. Linux, FreeBSD, and OpenBSD also support desktop-user scripts and explicitly approved root scripts.
|
||||||
|
|
||||||
|
#### External Browser Authentication
|
||||||
|
|
||||||
|
Use `gpclient` directly for browser-based authentication. It opens the browser as your normal desktop user while keeping VPN tunnel setup privileged:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo gpclient connect <portal> --browser
|
||||||
|
```
|
||||||
|
|
||||||
|
For standalone CLI installations, use `--browser manual` (`--browser remote` before v3.0.6): open the printed URL and paste the resulting `globalprotectcallback:…` data into the terminal.
|
||||||
|
|
||||||
|
To reuse a saved portal cookie for later connections, add `--cookie-cache`:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo gpclient connect <portal> --browser --cookie-cache
|
||||||
|
```
|
||||||
|
|
||||||
|
Add `--gateway <gateway>` to select a particular gateway. Cookie caching is handled by `gpclient`. Its default cache file is `$HOME/.config/gpclient/cookie.json`, which normally belongs to root when running with `sudo`. To choose a predictable location, specify the path explicitly:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo gpclient connect <portal> --browser --cookie-cache=/absolute/path/to/cookie.json
|
||||||
|
```
|
||||||
|
|
||||||
|
**Browser Options:**
|
||||||
|
|
||||||
|
- Use `--browser` to automatically select an available browser
|
||||||
|
- Use `--browser <browser>` to specify a browser (e.g., `firefox`, `chrome`)
|
||||||
|
- Use `--browser manual` for standalone CLI installations or headless servers
|
||||||
|
|
||||||
### Graphical User Interface
|
### Graphical User Interface
|
||||||
|
|
||||||
- **macOS**: Open **GP Connect** from Applications.
|
GP Connect provides a desktop interface for managing VPN connections. On macOS, open GP Connect from Applications. On Linux, FreeBSD, and OpenBSD, launch it from your application menu or via the terminal:
|
||||||
- **Linux / BSD**: Launch GP Connect from your application menu or run:
|
|
||||||
```bash
|
```bash
|
||||||
gpclient launch-gui
|
gpclient launch-gui
|
||||||
```
|
```
|
||||||
|
|
||||||
> [!TIP]
|
> [!Note]
|
||||||
> **On Linux, try Native Shell for lower memory usage.** Switch between Native Shell and Tauri in **Settings → General → Interface**.
|
>
|
||||||
|
> The GUI version is partially open source. The background service ([gpservice](./apps/gpservice/)) is open source, while the GUI wrapper is proprietary.
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
|
> [!Note]
|
||||||
|
>
|
||||||
|
> For older Linux distributions, use [v2.3.13](https://github.com/yuezk/GlobalProtect-openconnect/releases/tag/v2.3.13) instead of the latest release. It provides release assets for common distro families, including Debian/Ubuntu (`.deb`), Arch Linux / Manjaro (`.pkg.tar.zst`), RPM-based distros such as Fedora / RHEL / Rocky / AlmaLinux / CentOS (`.rpm`), and generic Linux tarballs (`.bin.tar.xz`).
|
||||||
|
|
||||||
### macOS
|
### macOS
|
||||||
|
|
||||||
Requires Apple silicon and macOS 13+. Includes both GP Connect and the `gpclient` CLI.
|
GP Connect requires Apple silicon and macOS 13 or later. The macOS app includes both the desktop application and the free `gpclient` CLI. The CLI does not require a GUI license.
|
||||||
|
|
||||||
#### Option 1: Homebrew (Recommended)
|
#### Option 1: Install with Homebrew
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
brew install --cask yuezk/gp-connect/gp-connect
|
brew install --cask yuezk/gp-connect/gp-connect
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Option 2: DMG Installer
|
Open GP Connect from Applications, or connect from the terminal:
|
||||||
|
|
||||||
Download the `.dmg` from the [releases](https://github.com/yuezk/GlobalProtect-openconnect/releases) page and drag GP Connect into Applications.
|
```bash
|
||||||
|
sudo gpclient connect <portal> --browser
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Option 2: Install from DMG
|
||||||
|
|
||||||
|
Download the GP Connect `.dmg` from the [releases](https://github.com/yuezk/GlobalProtect-openconnect/releases) page, open it, and drag GP Connect into Applications.
|
||||||
|
|
||||||
### Debian / Ubuntu
|
### Debian / Ubuntu
|
||||||
|
|
||||||
#### Option 1: PPA (Recommended)
|
#### Option 1: Install from PPA (Recommended)
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
sudo add-apt-repository ppa:yuezk/globalprotect-openconnect
|
sudo add-apt-repository ppa:yuezk/globalprotect-openconnect
|
||||||
@@ -114,152 +165,384 @@ sudo apt-get update
|
|||||||
sudo apt-get install globalprotect-openconnect
|
sudo apt-get install globalprotect-openconnect
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Option 2: DEB Package
|
> [!Note]
|
||||||
|
>
|
||||||
|
> **For Linux Mint users:** If you encounter a GPG key error, import the key manually:
|
||||||
|
> ```bash
|
||||||
|
> sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 7937C393082992E5D6E4A60453FC26B43838D761
|
||||||
|
> ```
|
||||||
|
|
||||||
Download the latest `.deb` from the [releases](https://github.com/yuezk/GlobalProtect-openconnect/releases) page:
|
#### Option 2: Install from DEB Package
|
||||||
|
|
||||||
|
Download the latest `.deb` package from the [releases](https://github.com/yuezk/GlobalProtect-openconnect/releases) page, then install:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
sudo apt install ./globalprotect-openconnect_*.deb
|
sudo apt install --fix-broken ./globalprotect-openconnect_*.deb
|
||||||
```
|
```
|
||||||
|
|
||||||
### Arch Linux / Manjaro
|
### Arch Linux / Manjaro
|
||||||
|
|
||||||
```bash
|
#### Option 1: Install from AUR
|
||||||
# Official Extra repository
|
|
||||||
sudo pacman -S globalprotect-openconnect
|
|
||||||
|
|
||||||
# AUR (git main)
|
Package: [globalprotect-openconnect-git](https://aur.archlinux.org/packages/globalprotect-openconnect-git/)
|
||||||
|
|
||||||
|
You can install it using an AUR helper like [`yay`](https://github.com/Jguer/yay):
|
||||||
|
|
||||||
|
```bash
|
||||||
yay -S globalprotect-openconnect-git
|
yay -S globalprotect-openconnect-git
|
||||||
```
|
```
|
||||||
|
|
||||||
### Fedora / RHEL
|
#### Option 2: Install from the Official Extra Repository
|
||||||
|
|
||||||
Enable the COPR repository:
|
The package is also available in the official Arch Linux Extra repository.
|
||||||
|
|
||||||
|
Package: [globalprotect-openconnect](https://archlinux.org/packages/extra/x86_64/globalprotect-openconnect/)
|
||||||
|
|
||||||
|
> [!Note]
|
||||||
|
>
|
||||||
|
> Since the official package does not include the system tray support dependency, you need to install `libappindicator` manually:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo pacman -S libappindicator globalprotect-openconnect
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Option 3: Install from Package
|
||||||
|
|
||||||
|
Download the latest package from the [releases](https://github.com/yuezk/GlobalProtect-openconnect/releases) page, then install:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo pacman -U globalprotect-openconnect-*.pkg.tar.zst
|
||||||
|
```
|
||||||
|
|
||||||
|
### Fedora 38+ / Rawhide
|
||||||
|
|
||||||
|
#### Install from COPR
|
||||||
|
|
||||||
|
The package is available on [COPR](https://copr.fedorainfracloud.org/coprs/yuezk/globalprotect-openconnect/) for RPM-based distributions:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
sudo dnf copr enable yuezk/globalprotect-openconnect
|
sudo dnf copr enable yuezk/globalprotect-openconnect
|
||||||
sudo dnf install globalprotect-openconnect
|
sudo dnf install globalprotect-openconnect
|
||||||
```
|
```
|
||||||
|
|
||||||
### openSUSE
|
### openSUSE Leap 15.6+ / Tumbleweed
|
||||||
|
|
||||||
Packages are available on the [openSUSE Build Service](https://build.opensuse.org/package/show/home:yuezk/globalprotect-openconnect). Follow the [OBS instructions](https://software.opensuse.org/download.html?project=home%3Ayuezk&package=globalprotect-openconnect) for your distribution.
|
#### Install from OBS (openSUSE Build Service)
|
||||||
|
|
||||||
|
Packages are available on the [openSUSE Build Service](https://build.opensuse.org/package/show/home:yuezk/globalprotect-openconnect). Follow the [installation instructions](https://software.opensuse.org//download.html?project=home%3Ayuezk&package=globalprotect-openconnect) for your distribution.
|
||||||
|
|
||||||
|
### Other RPM-based Distributions
|
||||||
|
|
||||||
|
#### Install from RPM Package
|
||||||
|
|
||||||
|
Download the latest RPM package from the [releases](https://github.com/yuezk/GlobalProtect-openconnect/releases) page:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo rpm -i globalprotect-openconnect-*.rpm
|
||||||
|
```
|
||||||
|
|
||||||
### Alpine Linux
|
### Alpine Linux
|
||||||
|
|
||||||
Download the latest `.apk` package from the [releases](https://github.com/yuezk/GlobalProtect-openconnect/releases) page:
|
Download the latest `.apk` package from the [releases](https://github.com/yuezk/GlobalProtect-openconnect/releases) page, then install:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
sudo apk add --allow-untrusted globalprotect-openconnect-*.apk
|
sudo apk add --allow-untrusted globalprotect-openconnect-*.apk
|
||||||
```
|
```
|
||||||
|
|
||||||
*(Requires `community` repository enabled for WebKitGTK and AppIndicator dependencies).*
|
The package uses Alpine's native musl build. Make sure the `community` repository is enabled so GUI dependencies such as `webkit2gtk-4.1`, `libsecret`, and `libayatana-appindicator` can be resolved. GUI-launched connections use polkit, and VPN tunnel creation requires `/dev/net/tun`.
|
||||||
|
|
||||||
### FreeBSD
|
### FreeBSD
|
||||||
|
|
||||||
Download the latest FreeBSD package from the [releases](https://github.com/yuezk/GlobalProtect-openconnect/releases) page:
|
Download the latest FreeBSD package from the [releases](https://github.com/yuezk/GlobalProtect-openconnect/releases) page, then install:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
sudo pkg install ./globalprotect-openconnect-*-freebsd-*.pkg
|
sudo pkg install ./globalprotect-openconnect-*-freebsd-*.pkg
|
||||||
```
|
```
|
||||||
|
|
||||||
|
To build from source, see [Building from Source on FreeBSD and OpenBSD](./docs/bsd-source-build.md).
|
||||||
|
|
||||||
### OpenBSD
|
### OpenBSD
|
||||||
|
|
||||||
Download the latest OpenBSD package from the [releases](https://github.com/yuezk/GlobalProtect-openconnect/releases) page:
|
Download the latest OpenBSD package from the [releases](https://github.com/yuezk/GlobalProtect-openconnect/releases) page, then install:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
doas pkg_add -D unsigned ./globalprotect-openconnect-*-openbsd-*.tgz
|
doas pkg_add -D unsigned ./globalprotect-openconnect-*-openbsd-*.tgz
|
||||||
```
|
```
|
||||||
|
|
||||||
|
To build from source, see [Building from Source on FreeBSD and OpenBSD](./docs/bsd-source-build.md).
|
||||||
|
|
||||||
### Gentoo
|
### Gentoo
|
||||||
|
|
||||||
Available via the `guru` repository:
|
Available via the `guru` and `lamdness` overlays:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
sudo eselect repository enable guru
|
sudo eselect repository enable guru
|
||||||
sudo emerge --sync guru
|
sudo emerge --sync guru
|
||||||
sudo emerge --ask net-vpn/GlobalProtect-openconnect
|
sudo emerge --ask --verbose net-vpn/GlobalProtect-openconnect
|
||||||
```
|
```
|
||||||
|
|
||||||
### NixOS
|
### NixOS
|
||||||
|
|
||||||
Add the flake to your `flake.nix`:
|
This repository includes a flake for NixOS integration.
|
||||||
|
|
||||||
|
#### Installation Steps
|
||||||
|
|
||||||
|
Add the flake input and NixOS module to your `flake.nix`:
|
||||||
|
|
||||||
|
The module builds the package with your NixOS configuration's `pkgs`, so the
|
||||||
|
GlobalProtect GUI and the system use the same Nixpkgs dependency versions.
|
||||||
|
It also enables Polkit and its setuid `pkexec` wrapper for privileged operations.
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
{
|
{
|
||||||
inputs.globalprotect-openconnect.url = "github:yuezk/GlobalProtect-openconnect";
|
inputs = {
|
||||||
|
# ... other inputs
|
||||||
|
globalprotect-openconnect.url = "github:yuezk/GlobalProtect-openconnect";
|
||||||
|
};
|
||||||
|
|
||||||
|
outputs = { self, nixpkgs, globalprotect-openconnect, ... }:
|
||||||
|
let
|
||||||
|
system = "x86_64-linux"; # or "aarch64-linux" for ARM64
|
||||||
|
hostname = "<your-host>";
|
||||||
|
in {
|
||||||
|
nixosConfigurations.${hostname} = nixpkgs.lib.nixosSystem {
|
||||||
|
inherit system;
|
||||||
|
|
||||||
outputs = { self, nixpkgs, globalprotect-openconnect, ... }: {
|
|
||||||
nixosConfigurations.<hostname> = nixpkgs.lib.nixosSystem {
|
|
||||||
modules = [
|
modules = [
|
||||||
|
./configuration.nix
|
||||||
globalprotect-openconnect.nixosModules.default
|
globalprotect-openconnect.nixosModules.default
|
||||||
{
|
{
|
||||||
programs.globalprotect-openconnect.enable = true;
|
programs.globalprotect-openconnect.enable = true;
|
||||||
|
|
||||||
|
environment.systemPackages = [
|
||||||
|
nixpkgs.legacyPackages.${system}.gnomeExtensions.appindicator
|
||||||
|
];
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
Apply changes:
|
Apply:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
sudo nixos-rebuild switch
|
sudo nixos-rebuild switch
|
||||||
|
loginctl terminate-user "$USER"
|
||||||
```
|
```
|
||||||
|
|
||||||
### Docker
|
After logging back in to GNOME, enable AppIndicator support if needed:
|
||||||
|
|
||||||
Run the CLI client in an official Alpine container:
|
```bash
|
||||||
|
gnome-extensions enable [email protected]
|
||||||
|
```
|
||||||
|
|
||||||
|
NixOS does not run an imperative package-uninstall hook when a package is
|
||||||
|
removed from the system configuration. Remove an installed replacement VPN
|
||||||
|
script from the app settings before removing the package.
|
||||||
|
|
||||||
|
The `prebuilt` package and NixOS module use the published release pinned in `flake.nix`. Both `prebuilt` and `fromSource` run natively on the host with packaged dependencies and installer paths. The `fromSource` package builds the current flake checkout, including its Git submodules:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git submodule update --init --recursive
|
||||||
|
nix build "git+file://$PWD?submodules=1#fromSource"
|
||||||
|
```
|
||||||
|
|
||||||
|
Local source builds require initialized Git submodules and a flake URL with `submodules=1`, as shown above. For a remote source flake, use a Git URL with submodules enabled, such as `git+https://github.com/yuezk/GlobalProtect-openconnect?submodules=1#fromSource`. The `prebuilt` package and NixOS module do not require Git submodules. Build output (`target`, `.build`, and `node_modules`) is excluded from the source input. Updating release asset hashes changes the prebuilt package, independently of source builds.
|
||||||
|
|
||||||
|
### Official Docker Image
|
||||||
|
|
||||||
|
The [official Docker image](https://hub.docker.com/r/yuezk/globalprotect-openconnect) provides the CLI tools on Alpine Linux:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker pull yuezk/globalprotect-openconnect:<version>
|
||||||
|
```
|
||||||
|
|
||||||
|
Release images are tagged as `vX.Y.Z`, `X.Y.Z`, and `latest`.
|
||||||
|
|
||||||
|
Run it with access to the TUN device:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker run --rm -it --cap-add=NET_ADMIN --device=/dev/net/tun \
|
docker run --rm -it --cap-add=NET_ADMIN --device=/dev/net/tun \
|
||||||
yuezk/globalprotect-openconnect:latest \
|
yuezk/globalprotect-openconnect:<version> \
|
||||||
|
connect <portal>
|
||||||
|
```
|
||||||
|
|
||||||
|
For browser authentication in a headless environment, use manual browser authentication:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker run --rm -it --cap-add=NET_ADMIN --device=/dev/net/tun \
|
||||||
|
yuezk/globalprotect-openconnect:<version> \
|
||||||
connect <portal> --browser manual
|
connect <portal> --browser manual
|
||||||
```
|
```
|
||||||
|
|
||||||
*(Add `--network host` on Linux if VPN routes should apply to the host network).*
|
On a host with multiple network interfaces, use `--browser-listen` to select the IP address reachable from the browser machine:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
gpclient connect <portal> --browser manual --browser-listen 192.168.107.15
|
||||||
|
```
|
||||||
|
|
||||||
|
On a Linux host, add host networking if the VPN routes should affect the host network namespace:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker run --rm -it --network host --cap-add=NET_ADMIN --device=/dev/net/tun \
|
||||||
|
yuezk/globalprotect-openconnect:<version> \
|
||||||
|
connect <portal> --browser manual
|
||||||
|
```
|
||||||
|
|
||||||
|
Without `--network host`, the VPN connection stays inside the container's network namespace. Docker Desktop on macOS and Windows does not make the host use the VPN through `--network host`; run `gpclient` on the host or use a container gateway setup for host traffic.
|
||||||
|
|
||||||
|
The image includes `gpclient` and `gpauth` only. It does not include embedded webview authentication, `gpgui-helper`, or `gpgui`.
|
||||||
|
|
||||||
### Other Distributions
|
### Other Distributions
|
||||||
|
|
||||||
Download `globalprotect-openconnect_${version}_${arch}.bin.tar.xz` from the [releases](https://github.com/yuezk/GlobalProtect-openconnect/releases) page:
|
#### Manual Installation
|
||||||
|
|
||||||
|
1. **Install dependencies:**
|
||||||
|
- WebKitGTK 4.1 (for example, `libwebkit2gtk-4.1-0` on Debian/Ubuntu)
|
||||||
|
- `libsecret`
|
||||||
|
- `libayatana-appindicator` or `libappindicator-gtk3`
|
||||||
|
- polkit (`pkexec`) for GUI-launched VPN connections
|
||||||
|
|
||||||
|
2. **Download and extract:**
|
||||||
|
Download `globalprotect-openconnect_${version}_${arch}.bin.tar.xz` from the [releases](https://github.com/yuezk/GlobalProtect-openconnect/releases) page:
|
||||||
|
```bash
|
||||||
|
tar -xJf globalprotect-openconnect_${version}_${arch}.bin.tar.xz
|
||||||
|
cd globalprotect-openconnect_${version}
|
||||||
|
```
|
||||||
|
|
||||||
|
3. **Install:**
|
||||||
```bash
|
```bash
|
||||||
tar -xJf globalprotect-openconnect_*.bin.tar.xz
|
|
||||||
cd globalprotect-openconnect_*
|
|
||||||
sudo make install
|
sudo make install
|
||||||
```
|
```
|
||||||
|
|
||||||
## Building from Source
|
## Building from Source
|
||||||
|
|
||||||
### Prerequisites (Linux)
|
The instructions below build the open-source components on Linux. For FreeBSD and OpenBSD, see [Building from Source on FreeBSD and OpenBSD](./docs/bsd-source-build.md).
|
||||||
|
|
||||||
- [Rust](https://www.rust-lang.org/tools/install) 1.91 or later
|
### Method 1: Using DevContainer
|
||||||
- Build tools: `make`, `pkg-config`, `autoconf`, `automake`, `libtool`, `gettext`
|
|
||||||
- Libraries: `gmp`, `gnutls`, `nettle`, `libxml2`, `zlib`, `lz4`, `p11-kit`, `libsecret`, and `webkit2gtk-4.1` (or GTK 4 for Native Shell)
|
|
||||||
- Polkit (`pkexec`) for privileged tunnel setup
|
|
||||||
|
|
||||||
*(For FreeBSD and OpenBSD instructions, see [Building from Source on FreeBSD and OpenBSD](docs/bsd-source-build.md)).*
|
This project includes a DevContainer configuration for Linux development. The repository's `rust-toolchain.toml` selects the Rust toolchain; rustup may need to download it on the first build.
|
||||||
|
|
||||||
### Build Steps
|
#### Prerequisites
|
||||||
|
|
||||||
|
- [Docker](https://docs.docker.com/get-docker/)
|
||||||
|
- [Visual Studio Code](https://code.visualstudio.com/) (optional, for IDE support)
|
||||||
|
- [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) (if using VS Code)
|
||||||
|
|
||||||
|
#### Build Steps
|
||||||
|
|
||||||
|
1. **Clone the repository:**
|
||||||
```bash
|
```bash
|
||||||
git clone --recursive https://github.com/yuezk/GlobalProtect-openconnect.git
|
git clone https://github.com/yuezk/GlobalProtect-openconnect.git
|
||||||
cd GlobalProtect-openconnect
|
cd GlobalProtect-openconnect
|
||||||
|
git submodule update --init --recursive
|
||||||
|
```
|
||||||
|
|
||||||
|
2. **Build the DevContainer image:**
|
||||||
|
```bash
|
||||||
|
docker build -t gpoc-devcontainer .devcontainer/
|
||||||
|
```
|
||||||
|
|
||||||
|
3. **Build the project:**
|
||||||
|
|
||||||
|
To build the open-source components, including the GUI helper, run:
|
||||||
|
```bash
|
||||||
|
docker run --privileged --cap-add=NET_ADMIN --device=/dev/net/tun \
|
||||||
|
--tty -v "$(pwd)":/workspace -w /workspace gpoc-devcontainer \
|
||||||
|
bash -c "export PATH=/usr/local/cargo/bin:\$PATH && make build"
|
||||||
|
```
|
||||||
|
To build without the GUI helper run the same command as above, but with `BUILD_GUI_HELPER=0` passed as an argument to `make`.
|
||||||
|
|
||||||
|
4. **Locate build artifacts:**
|
||||||
|
|
||||||
|
The compiled binaries will be available in `target/release/`:
|
||||||
|
- `gpclient` – CLI client
|
||||||
|
- `gpservice` – Background service
|
||||||
|
- `gpauth` – Authentication helper
|
||||||
|
- `gpgui-helper` – GUI helper
|
||||||
|
- `gp-hip-script-installer` – Privileged HIP script installer
|
||||||
|
- `gp-vpnc-script-installer` – Privileged VPN script installer
|
||||||
|
|
||||||
|
The proprietary GP Connect desktop application is distributed separately. Use `INCLUDE_GUI=1` with `make build` to download its matching published Linux build for installation.
|
||||||
|
|
||||||
|
#### Alternative: Using VS Code
|
||||||
|
|
||||||
|
1. Open the project in VS Code
|
||||||
|
2. When prompted, click "Reopen in Container" (or run **Dev Containers: Reopen in Container**)
|
||||||
|
3. Once the container is ready, open a terminal and run:
|
||||||
|
```bash
|
||||||
make build
|
make build
|
||||||
|
```
|
||||||
|
|
||||||
|
### Method 2: Local Development Build
|
||||||
|
|
||||||
|
#### Prerequisites
|
||||||
|
|
||||||
|
- [Rust 1.91 or later](https://www.rust-lang.org/tools/install)
|
||||||
|
- [Tauri dependencies](https://tauri.app/start/prerequisites/)
|
||||||
|
- OpenConnect source-build dependencies: `autoconf`, `automake`, `autopoint`/`gettext`, `libtool`, `patch`, `pkg-config`, `libxml2`, `zlib`, `lz4`, `gnutls`, `p11-kit`, `nettle`, and `gmp` development packages
|
||||||
|
- `pkexec` and `gnome-keyring` (or `pam_kwallet` on KDE)
|
||||||
|
- Node.js and pnpm if rebuilding the GUI helper frontend
|
||||||
|
|
||||||
|
#### Build Steps
|
||||||
|
|
||||||
|
1. **Download source code:**
|
||||||
|
|
||||||
|
Download `globalprotect-openconnect-${version}.tar.gz` from the [releases](https://github.com/yuezk/GlobalProtect-openconnect/releases) page.
|
||||||
|
|
||||||
|
2. **Extract and build:**
|
||||||
|
```bash
|
||||||
|
tar -xzf globalprotect-openconnect-${version}.tar.gz
|
||||||
|
cd globalprotect-openconnect-${version}
|
||||||
|
make build
|
||||||
|
```
|
||||||
|
|
||||||
|
3. **Install:**
|
||||||
|
```bash
|
||||||
sudo make install
|
sudo make install
|
||||||
```
|
```
|
||||||
|
|
||||||
**Build Options:**
|
To stage the files for packaging instead of installing them into the system, use `make install DESTDIR=/absolute/path/to/staging`.
|
||||||
|
|
||||||
- `INCLUDE_GUI=1` – Download and install the matching desktop application bundle.
|
### Testing Your Build
|
||||||
- `BUILD_WEBVIEW_AUTH=0` – Build `gpauth` without embedded browser authentication (uses external browser or manual mode).
|
|
||||||
- `BUILD_GUI_HELPER=0` – Skip building the helper UI.
|
|
||||||
|
|
||||||
## Troubleshooting
|
Verify the CLI client is working correctly:
|
||||||
|
|
||||||
- **Headless / Remote Login**: When running without a desktop display or over SSH, use `--browser manual`. Open the printed URL in any browser and paste the callback URL back into the terminal.
|
```bash
|
||||||
- **Diagnostics**: If you encounter issues, run `gpclient diagnostics` or follow the [diagnostics guide](docs/diagnostics.md) when opening an issue.
|
./target/release/gpclient --help
|
||||||
|
```
|
||||||
|
|
||||||
|
### Build Options
|
||||||
|
|
||||||
|
- `BUILD_GUI_HELPER=0` – Skip building and installing the GUI helper
|
||||||
|
- `BUILD_WEBVIEW_AUTH=0` – Build `gpauth` without embedded browser authentication; use an external browser or manual authentication
|
||||||
|
- `INCLUDE_GUI=1` – Download the matching published Linux desktop application for installation
|
||||||
|
- `OFFLINE=1` – Build in offline mode using vendored dependencies
|
||||||
|
|
||||||
|
## Frequently Asked Questions
|
||||||
|
|
||||||
|
When reporting a problem, follow the [diagnostics collection instructions](docs/diagnostics.md). A standalone script is available for versions without the diagnostics command; you do not need to upgrade first.
|
||||||
|
|
||||||
|
### Q: How do I resolve the "Secure Storage not ready" error?
|
||||||
|
|
||||||
|
Unlock your desktop keyring and ensure the application can access it. On Linux and BSD, check that a keyring service such as GNOME Keyring is installed and running in your desktop session. On macOS, check Keychain access.
|
||||||
|
|
||||||
|
Linux and BSD can use file storage when secure storage is unavailable during initial setup. An existing configuration that uses the keyring still needs access to that keyring.
|
||||||
|
|
||||||
|
See related issues: [#321](https://github.com/yuezk/GlobalProtect-openconnect/issues/321), [#316](https://github.com/yuezk/GlobalProtect-openconnect/issues/316)
|
||||||
|
|
||||||
|
### Q: How do I fix the "cannot open display" error when using CLI?
|
||||||
|
|
||||||
|
Run the client from a terminal in your normal desktop session and use an external browser:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo gpclient connect <portal> --browser
|
||||||
|
```
|
||||||
|
|
||||||
|
See related issue: [#316](https://github.com/yuezk/GlobalProtect-openconnect/issues/316)
|
||||||
|
|
||||||
|
On a headless server, use `--browser manual` and complete authentication from another machine.
|
||||||
|
|
||||||
## NetworkManager Integration
|
## NetworkManager Integration
|
||||||
|
|
||||||
@@ -268,10 +551,14 @@ sudo make install
|
|||||||
|
|
||||||
## Licensing
|
## Licensing
|
||||||
|
|
||||||
- **CLI (`gpclient`)**: Free and open source (GPL-3.0).
|
### Trial and Pricing
|
||||||
- **GUI (GP Connect)**: Commercial desktop application with a free trial.
|
|
||||||
|
|
||||||
### Open Source Components
|
The **CLI version** is completely free and open source.
|
||||||
|
The **GUI version** is a paid application with a **7-day trial**. Start the trial in the app by verifying your email address with a one-time code. Installing the app alone does not start the trial.
|
||||||
|
|
||||||
|
### Open Source Licenses
|
||||||
|
|
||||||
|
This project consists of multiple components, each with its own license:
|
||||||
|
|
||||||
| Component | Type | License |
|
| Component | Type | License |
|
||||||
|-----------|------|---------|
|
|-----------|------|---------|
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ clap.workspace = true
|
|||||||
log.workspace = true
|
log.workspace = true
|
||||||
serde_json.workspace = true
|
serde_json.workspace = true
|
||||||
tokio = { workspace = true, features = ["rt-multi-thread"] }
|
tokio = { workspace = true, features = ["rt-multi-thread"] }
|
||||||
|
tempfile.workspace = true
|
||||||
compile-time.workspace = true
|
compile-time.workspace = true
|
||||||
|
|
||||||
home = "0.5.12"
|
home = "0.5.12"
|
||||||
@@ -32,6 +33,3 @@ tauri = { workspace = true, optional = true }
|
|||||||
default = ["webview-auth"]
|
default = ["webview-auth"]
|
||||||
webview-auth = ["auth/webview-auth", "dep:tauri", "dep:tauri-build"]
|
webview-auth = ["auth/webview-auth", "dep:tauri", "dep:tauri-build"]
|
||||||
release-devtools = ["auth/release-devtools"]
|
release-devtools = ["auth/release-devtools"]
|
||||||
|
|
||||||
[dev-dependencies]
|
|
||||||
tempfile.workspace = true
|
|
||||||
|
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 8.0 KiB After Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 38 KiB |
|
Before Width: | Height: | Size: 58 KiB After Width: | Height: | Size: 56 KiB |
@@ -6,6 +6,8 @@ use clap::Parser;
|
|||||||
use clap::Subcommand;
|
use clap::Subcommand;
|
||||||
#[cfg(feature = "webview-auth")]
|
#[cfg(feature = "webview-auth")]
|
||||||
use gpapi::auth::AuthWindowTheme;
|
use gpapi::auth::AuthWindowTheme;
|
||||||
|
#[cfg(not(target_os = "macos"))]
|
||||||
|
use gpapi::utils::openssl;
|
||||||
use gpapi::{
|
use gpapi::{
|
||||||
auth::{AuthenticationCancelled, SamlAuthData, SamlAuthResult},
|
auth::{AuthenticationCancelled, SamlAuthData, SamlAuthResult},
|
||||||
clap::{Args, InfoLevelVerbosity, args::Os, handle_error},
|
clap::{Args, InfoLevelVerbosity, args::Os, handle_error},
|
||||||
@@ -18,6 +20,8 @@ use gpapi::{
|
|||||||
use log::info;
|
use log::info;
|
||||||
use serde_json::json;
|
use serde_json::json;
|
||||||
use std::net::IpAddr;
|
use std::net::IpAddr;
|
||||||
|
#[cfg(not(target_os = "macos"))]
|
||||||
|
use tempfile::NamedTempFile;
|
||||||
|
|
||||||
const VERSION: &str = concat!(
|
const VERSION: &str = concat!(
|
||||||
env!("CARGO_PKG_VERSION"),
|
env!("CARGO_PKG_VERSION"),
|
||||||
@@ -85,7 +89,7 @@ struct Cli {
|
|||||||
key_password: Option<String>,
|
key_password: Option<String>,
|
||||||
|
|
||||||
#[cfg(not(target_os = "macos"))]
|
#[cfg(not(target_os = "macos"))]
|
||||||
#[arg(long, hide = true)]
|
#[arg(long, help = "Get around the OpenSSL `unsafe legacy renegotiation` error")]
|
||||||
fix_openssl: bool,
|
fix_openssl: bool,
|
||||||
|
|
||||||
#[arg(long, help = "Ignore TLS errors")]
|
#[arg(long, help = "Ignore TLS errors")]
|
||||||
@@ -145,6 +149,11 @@ enum CliCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Args for Cli {
|
impl Args for Cli {
|
||||||
|
#[cfg(not(target_os = "macos"))]
|
||||||
|
fn fix_openssl(&self) -> bool {
|
||||||
|
self.fix_openssl
|
||||||
|
}
|
||||||
|
|
||||||
fn ignore_tls_errors(&self) -> bool {
|
fn ignore_tls_errors(&self) -> bool {
|
||||||
self.ignore_tls_errors
|
self.ignore_tls_errors
|
||||||
}
|
}
|
||||||
@@ -155,12 +164,19 @@ impl Args for Cli {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Cli {
|
impl Cli {
|
||||||
async fn run(&self) -> anyhow::Result<()> {
|
|
||||||
#[cfg(not(target_os = "macos"))]
|
#[cfg(not(target_os = "macos"))]
|
||||||
|
fn prepare_openssl(&self) -> anyhow::Result<Option<NamedTempFile>> {
|
||||||
if self.fix_openssl {
|
if self.fix_openssl {
|
||||||
log::warn!("--fix-openssl is deprecated and has no effect. It will be removed in a future release.");
|
info!("Fixing OpenSSL environment");
|
||||||
|
let file = openssl::fix_openssl_env()?;
|
||||||
|
|
||||||
|
return Ok(Some(file));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Ok(None)
|
||||||
|
}
|
||||||
|
|
||||||
|
async fn run(&self) -> anyhow::Result<()> {
|
||||||
if self.browser_listen.is_some()
|
if self.browser_listen.is_some()
|
||||||
&& !matches!(self.browser.as_deref(), Some(browser) if browser.eq_ignore_ascii_case("manual") || browser.eq_ignore_ascii_case("remote"))
|
&& !matches!(self.browser.as_deref(), Some(browser) if browser.eq_ignore_ascii_case("manual") || browser.eq_ignore_ascii_case("remote"))
|
||||||
{
|
{
|
||||||
@@ -173,6 +189,8 @@ impl Cli {
|
|||||||
|
|
||||||
#[cfg(feature = "webview-auth")]
|
#[cfg(feature = "webview-auth")]
|
||||||
gpapi::utils::env_utils::patch_gui_runtime_env(self.hidpi);
|
gpapi::utils::env_utils::patch_gui_runtime_env(self.hidpi);
|
||||||
|
#[cfg(not(target_os = "macos"))]
|
||||||
|
let openssl_conf = self.prepare_openssl()?;
|
||||||
|
|
||||||
let server = normalize_server(self.server.as_deref().expect("server is required for authentication"))?;
|
let server = normalize_server(self.server.as_deref().expect("server is required for authentication"))?;
|
||||||
let gp_params = self.build_gp_params();
|
let gp_params = self.build_gp_params();
|
||||||
@@ -212,6 +230,8 @@ impl Cli {
|
|||||||
|
|
||||||
print_auth_result(auth_result, Some(&auth_host_id));
|
print_auth_result(auth_result, Some(&auth_host_id));
|
||||||
|
|
||||||
|
#[cfg(not(target_os = "macos"))]
|
||||||
|
drop(openssl_conf);
|
||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -223,6 +243,8 @@ impl Cli {
|
|||||||
self.clean,
|
self.clean,
|
||||||
self.window_title.clone(),
|
self.window_title.clone(),
|
||||||
self.window_theme,
|
self.window_theme,
|
||||||
|
#[cfg(not(target_os = "macos"))]
|
||||||
|
openssl_conf,
|
||||||
)
|
)
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
@@ -241,10 +263,13 @@ impl Cli {
|
|||||||
|
|
||||||
fn build_os_profile(&self) -> OsProfile {
|
fn build_os_profile(&self) -> OsProfile {
|
||||||
let mut builder = OsProfile::builder(ClientOs::from(self.os));
|
let mut builder = OsProfile::builder(ClientOs::from(self.os));
|
||||||
|
if let Some(host_id) = self.host_id.as_deref() {
|
||||||
|
builder = builder.host_id_override(host_id);
|
||||||
|
}
|
||||||
if let Some(client_version) = self.client_version.as_deref() {
|
if let Some(client_version) = self.client_version.as_deref() {
|
||||||
builder = builder.client_version(client_version);
|
builder = builder.client_version(client_version);
|
||||||
}
|
}
|
||||||
gpapi::os_profile::desktop::collect_profile(builder, self.host_id.as_deref())
|
builder.build()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn external_browser_requested(&self) -> bool {
|
fn external_browser_requested(&self) -> bool {
|
||||||
@@ -316,13 +341,9 @@ mod tests {
|
|||||||
use super::*;
|
use super::*;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn deprecated_openssl_option_remains_supported_but_hidden() {
|
fn openssl_option_is_available_only_on_supported_platforms() {
|
||||||
let result = Cli::try_parse_from(["gpauth", "portal.example.com", "--fix-openssl"]);
|
let result = Cli::try_parse_from(["gpauth", "portal.example.com", "--fix-openssl"]);
|
||||||
assert_eq!(result.is_ok(), !cfg!(target_os = "macos"));
|
assert_eq!(result.is_ok(), !cfg!(target_os = "macos"));
|
||||||
for flag in ["-h", "--help"] {
|
|
||||||
let help = Cli::try_parse_from(["gpauth", flag]).err().unwrap().to_string();
|
|
||||||
assert!(!help.contains("--fix-openssl"));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -330,12 +351,12 @@ mod tests {
|
|||||||
use gpapi::error::ServerTlsErrorKind;
|
use gpapi::error::ServerTlsErrorKind;
|
||||||
let tls = ServerTlsError {
|
let tls = ServerTlsError {
|
||||||
server: "https://vpn.example.com".into(),
|
server: "https://vpn.example.com".into(),
|
||||||
kind: ServerTlsErrorKind::Certificate,
|
kind: ServerTlsErrorKind::LegacyRenegotiation,
|
||||||
};
|
};
|
||||||
let outcome = auth_outcome(Err(anyhow::Error::new(tls).context("retry failed")), None);
|
let outcome = auth_outcome(Err(anyhow::Error::new(tls).context("retry failed")), None);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
serde_json::to_value(outcome).unwrap(),
|
serde_json::to_value(outcome).unwrap(),
|
||||||
json!({"serverTlsError": {"server": "https://vpn.example.com", "kind": "certificate"}})
|
json!({"serverTlsError": {"server": "https://vpn.example.com", "kind": "legacyRenegotiation"}})
|
||||||
);
|
);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
serde_json::to_value(auth_outcome(Err(anyhow::anyhow!("rejected")), None)).unwrap(),
|
serde_json::to_value(auth_outcome(Err(anyhow::anyhow!("rejected")), None)).unwrap(),
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
use auth::{WebviewAuthenticator, apply_auth_theme};
|
use auth::{WebviewAuthenticator, apply_auth_theme};
|
||||||
use gpapi::{auth::AuthWindowTheme, gp_params::GpParams};
|
use gpapi::{auth::AuthWindowTheme, gp_params::GpParams};
|
||||||
|
#[cfg(not(target_os = "macos"))]
|
||||||
|
use log::info;
|
||||||
|
#[cfg(not(target_os = "macos"))]
|
||||||
|
use tauri::RunEvent;
|
||||||
|
#[cfg(not(target_os = "macos"))]
|
||||||
|
use tempfile::NamedTempFile;
|
||||||
|
|
||||||
use crate::cli::print_auth_result;
|
use crate::cli::print_auth_result;
|
||||||
|
|
||||||
@@ -10,6 +16,7 @@ pub async fn authenticate(
|
|||||||
clean: bool,
|
clean: bool,
|
||||||
window_title: Option<String>,
|
window_title: Option<String>,
|
||||||
window_theme: AuthWindowTheme,
|
window_theme: AuthWindowTheme,
|
||||||
|
#[cfg(not(target_os = "macos"))] mut openssl_conf: Option<NamedTempFile>,
|
||||||
) -> anyhow::Result<()> {
|
) -> anyhow::Result<()> {
|
||||||
let auth_host_id = gp_params.os_profile().host_identity().host_id().to_string();
|
let auth_host_id = gp_params.os_profile().host_identity().host_id().to_string();
|
||||||
|
|
||||||
@@ -39,7 +46,16 @@ pub async fn authenticate(
|
|||||||
Ok(())
|
Ok(())
|
||||||
})
|
})
|
||||||
.build(crate::tauri_context::get())?
|
.build(crate::tauri_context::get())?
|
||||||
.run(|_, _| {});
|
.run(move |_app_handle, _event| {
|
||||||
|
#[cfg(not(target_os = "macos"))]
|
||||||
|
if let RunEvent::Exit = _event {
|
||||||
|
if let Some(file) = openssl_conf.take() {
|
||||||
|
if let Err(err) = file.close() {
|
||||||
|
info!("Error closing OpenSSL config file: {}", err);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
#![cfg(not(target_os = "macos"))]
|
|
||||||
|
|
||||||
use std::process::Command;
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn deprecated_flag_warns_without_changing_auth_output_or_configuration() {
|
|
||||||
const WARNING: &str = "--fix-openssl is deprecated and has no effect. It will be removed in a future release.";
|
|
||||||
let directory = tempfile::tempdir().unwrap();
|
|
||||||
let configuration = directory.path().join("openssl.cnf");
|
|
||||||
std::fs::write(&configuration, "existing user configuration").unwrap();
|
|
||||||
for deprecated in [false, true] {
|
|
||||||
let mut command = Command::new(env!("CARGO_BIN_EXE_gpauth"));
|
|
||||||
command.arg("portal.example.com");
|
|
||||||
if deprecated {
|
|
||||||
command.arg("--fix-openssl");
|
|
||||||
}
|
|
||||||
// Reject invalid options before authentication, without making a network request.
|
|
||||||
let output = command
|
|
||||||
.args(["--browser-listen", "127.0.0.1", "--log-format", "json"])
|
|
||||||
.env("OPENSSL_CONF", &configuration)
|
|
||||||
.output()
|
|
||||||
.unwrap();
|
|
||||||
assert!(!output.status.success());
|
|
||||||
assert!(output.stdout.is_empty());
|
|
||||||
let logs = String::from_utf8(output.stderr).unwrap();
|
|
||||||
let records = logs
|
|
||||||
.lines()
|
|
||||||
.map(|line| serde_json::from_str::<serde_json::Value>(line).unwrap())
|
|
||||||
.collect::<Vec<_>>();
|
|
||||||
assert_eq!(
|
|
||||||
records.iter().filter(|record| record["message"] == WARNING).count(),
|
|
||||||
usize::from(deprecated)
|
|
||||||
);
|
|
||||||
assert!(logs.contains("requires '--browser manual'"));
|
|
||||||
assert_eq!(
|
|
||||||
std::fs::read_to_string(&configuration).unwrap(),
|
|
||||||
"existing user configuration"
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -28,6 +28,8 @@ sysinfo.workspace = true
|
|||||||
serde.workspace = true
|
serde.workspace = true
|
||||||
serde_json.workspace = true
|
serde_json.workspace = true
|
||||||
whoami.workspace = true
|
whoami.workspace = true
|
||||||
|
tempfile.workspace = true
|
||||||
|
reqwest.workspace = true
|
||||||
directories.workspace = true
|
directories.workspace = true
|
||||||
compile-time.workspace = true
|
compile-time.workspace = true
|
||||||
uzers.workspace = true
|
uzers.workspace = true
|
||||||
@@ -38,6 +40,3 @@ webview-auth = ["gpapi/webview-auth"]
|
|||||||
|
|
||||||
[target.'cfg(target_os = "macos")'.dependencies]
|
[target.'cfg(target_os = "macos")'.dependencies]
|
||||||
gpvpnc = { path = "../../crates/gpvpnc" }
|
gpvpnc = { path = "../../crates/gpvpnc" }
|
||||||
|
|
||||||
[dev-dependencies]
|
|
||||||
tempfile.workspace = true
|
|
||||||
@@ -2,7 +2,6 @@
|
|||||||
//! No process is forked after authentication or OpenConnect has started its threads.
|
//! No process is forked after authentication or OpenConnect has started its threads.
|
||||||
|
|
||||||
use std::{
|
use std::{
|
||||||
cell::RefCell,
|
|
||||||
ffi::OsString,
|
ffi::OsString,
|
||||||
fs::{File, OpenOptions},
|
fs::{File, OpenOptions},
|
||||||
io::{self, Write},
|
io::{self, Write},
|
||||||
@@ -28,8 +27,7 @@ use tokio::{io::AsyncReadExt, process::Command};
|
|||||||
const READY: u8 = 1;
|
const READY: u8 = 1;
|
||||||
|
|
||||||
pub(crate) struct BackgroundWorker {
|
pub(crate) struct BackgroundWorker {
|
||||||
// Consumed after detachment; later tunnels stay in the same background session.
|
ready: UnixStream,
|
||||||
ready: RefCell<Option<UnixStream>>,
|
|
||||||
log: File,
|
log: File,
|
||||||
input: File,
|
input: File,
|
||||||
}
|
}
|
||||||
@@ -84,17 +82,10 @@ impl BackgroundWorker {
|
|||||||
"Background log must not be readable or writable by other users"
|
"Background log must not be readable or writable by other users"
|
||||||
);
|
);
|
||||||
let input = File::open("/dev/null")?;
|
let input = File::open("/dev/null")?;
|
||||||
Ok(Self {
|
Ok(Self { ready, log, input })
|
||||||
ready: RefCell::new(Some(ready)),
|
|
||||||
log,
|
|
||||||
input,
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn redirect_stdio(&self) -> anyhow::Result<BackgroundStdio> {
|
pub(crate) fn redirect_stdio(&self) -> anyhow::Result<BackgroundStdio> {
|
||||||
if self.ready.borrow().is_none() {
|
|
||||||
return Ok(BackgroundStdio { saved: None });
|
|
||||||
}
|
|
||||||
io::stdout().flush()?;
|
io::stdout().flush()?;
|
||||||
io::stderr().flush()?;
|
io::stderr().flush()?;
|
||||||
let save = |fd| -> anyhow::Result<OwnedFd> {
|
let save = |fd| -> anyhow::Result<OwnedFd> {
|
||||||
@@ -116,18 +107,13 @@ impl BackgroundWorker {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn detach(&self, stdio: &mut BackgroundStdio) -> anyhow::Result<()> {
|
pub(crate) fn detach(&self, stdio: &mut BackgroundStdio) -> anyhow::Result<()> {
|
||||||
let mut ready = self.ready.borrow_mut();
|
|
||||||
let Some(socket) = ready.as_mut() else {
|
|
||||||
return Ok(());
|
|
||||||
};
|
|
||||||
// The worker inherited the launcher's foreground group, so it can prompt normally.
|
// The worker inherited the launcher's foreground group, so it can prompt normally.
|
||||||
// It becomes a session leader only when sign-in and tunnel configuration are done.
|
// It becomes a session leader only when sign-in and tunnel configuration are done.
|
||||||
setsid().context("Cannot detach the VPN session from the terminal")?;
|
setsid().context("Cannot detach the VPN session from the terminal")?;
|
||||||
socket
|
(&self.ready)
|
||||||
.write_all(&[READY])
|
.write_all(&[READY])
|
||||||
.context("Background launcher exited before tunnel setup")?;
|
.context("Background launcher exited before tunnel setup")?;
|
||||||
stdio.saved.take();
|
stdio.saved.take();
|
||||||
ready.take();
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -219,13 +205,12 @@ mod tests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn detached_worker_reconnects_after_launcher_exits() {
|
async fn detached_worker_survives_launcher_and_disconnects_by_pid() {
|
||||||
let directory = tempfile::tempdir().unwrap();
|
let directory = tempfile::tempdir().unwrap();
|
||||||
tokio::time::timeout(Duration::from_secs(5), launch(fixture(directory.path()), &[]))
|
tokio::time::timeout(Duration::from_secs(5), launch(fixture(directory.path()), &[]))
|
||||||
.await
|
.await
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.unwrap();
|
.unwrap();
|
||||||
std::fs::write(directory.path().join("reconnect"), "").unwrap();
|
|
||||||
let pid = std::fs::read_to_string(directory.path().join("pid"))
|
let pid = std::fs::read_to_string(directory.path().join("pid"))
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.parse::<i32>()
|
.parse::<i32>()
|
||||||
@@ -237,19 +222,18 @@ mod tests {
|
|||||||
"Worker must own a terminal-independent session"
|
"Worker must own a terminal-independent session"
|
||||||
);
|
);
|
||||||
kill(pid, None).unwrap();
|
kill(pid, None).unwrap();
|
||||||
let reconnected = tokio::time::timeout(Duration::from_secs(5), async {
|
tokio::time::timeout(Duration::from_secs(5), async {
|
||||||
while !std::fs::read_to_string(directory.path().join("worker.log"))
|
while !std::fs::read_to_string(directory.path().join("worker.log"))
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.contains("reconnected-output")
|
.contains("helper-output")
|
||||||
{
|
{
|
||||||
tokio::time::sleep(Duration::from_millis(10)).await;
|
tokio::time::sleep(Duration::from_millis(10)).await;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.await;
|
.await
|
||||||
|
.unwrap();
|
||||||
let log = std::fs::read_to_string(directory.path().join("worker.log")).unwrap();
|
let log = std::fs::read_to_string(directory.path().join("worker.log")).unwrap();
|
||||||
assert!(reconnected.is_ok(), "Worker did not reconnect:\n{log}");
|
|
||||||
assert!(log.contains("failed-attempt-output"));
|
assert!(log.contains("failed-attempt-output"));
|
||||||
assert!(log.contains("helper-output"));
|
|
||||||
assert!(!log.contains("restored-foreground-output"));
|
assert!(!log.contains("restored-foreground-output"));
|
||||||
#[derive(clap::Parser)]
|
#[derive(clap::Parser)]
|
||||||
struct Disconnect {
|
struct Disconnect {
|
||||||
@@ -311,20 +295,8 @@ mod tests {
|
|||||||
worker.detach(&mut stdio).unwrap();
|
worker.detach(&mut stdio).unwrap();
|
||||||
println!("detached-output");
|
println!("detached-output");
|
||||||
io::stdout().flush().unwrap();
|
io::stdout().flush().unwrap();
|
||||||
tokio::time::timeout(Duration::from_secs(5), async {
|
|
||||||
while !directory.join("reconnect").exists() {
|
|
||||||
tokio::time::sleep(Duration::from_millis(10)).await;
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.await
|
|
||||||
.unwrap();
|
|
||||||
helper.wait().unwrap();
|
|
||||||
let mut stdio = worker.redirect_stdio().unwrap();
|
|
||||||
worker.detach(&mut stdio).unwrap();
|
|
||||||
assert_eq!(getsid(None).unwrap(), getpid());
|
|
||||||
println!("reconnected-output");
|
|
||||||
io::stdout().flush().unwrap();
|
|
||||||
interrupt.recv().await;
|
interrupt.recv().await;
|
||||||
|
helper.wait().unwrap();
|
||||||
std::fs::write(directory.join("stopped"), "stopped").unwrap();
|
std::fs::write(directory.join("stopped"), "stopped").unwrap();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -5,12 +5,16 @@ use std::{
|
|||||||
|
|
||||||
use anyhow::bail;
|
use anyhow::bail;
|
||||||
use clap::{Parser, Subcommand};
|
use clap::{Parser, Subcommand};
|
||||||
|
#[cfg(not(target_os = "macos"))]
|
||||||
|
use gpapi::utils::openssl;
|
||||||
use gpapi::{
|
use gpapi::{
|
||||||
clap::{Args, InfoLevelVerbosity, handle_error},
|
clap::{Args, InfoLevelVerbosity, handle_error},
|
||||||
log_format::{LogFormat, write_json_record},
|
log_format::{LogFormat, write_json_record},
|
||||||
};
|
};
|
||||||
use log::info;
|
use log::info;
|
||||||
use sysinfo::{Pid, System};
|
use sysinfo::{Pid, System};
|
||||||
|
#[cfg(not(target_os = "macos"))]
|
||||||
|
use tempfile::NamedTempFile;
|
||||||
use tokio::fs;
|
use tokio::fs;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
@@ -32,6 +36,8 @@ const VERSION: &str = concat!(
|
|||||||
);
|
);
|
||||||
|
|
||||||
pub(crate) struct SharedArgs<'a> {
|
pub(crate) struct SharedArgs<'a> {
|
||||||
|
#[cfg(not(target_os = "macos"))]
|
||||||
|
pub(crate) fix_openssl: bool,
|
||||||
pub(crate) ignore_tls_errors: bool,
|
pub(crate) ignore_tls_errors: bool,
|
||||||
pub(crate) lock_file: &'a Path,
|
pub(crate) lock_file: &'a Path,
|
||||||
pub(crate) verbose: &'a InfoLevelVerbosity,
|
pub(crate) verbose: &'a InfoLevelVerbosity,
|
||||||
@@ -90,7 +96,10 @@ struct Cli {
|
|||||||
command: CliCommand,
|
command: CliCommand,
|
||||||
|
|
||||||
#[cfg(not(target_os = "macos"))]
|
#[cfg(not(target_os = "macos"))]
|
||||||
#[arg(long, hide = true)]
|
#[arg(
|
||||||
|
long,
|
||||||
|
help = "Uses extended compatibility mode for OpenSSL operations to support a broader range of systems and formats."
|
||||||
|
)]
|
||||||
fix_openssl: bool,
|
fix_openssl: bool,
|
||||||
#[arg(long, help = "Ignore the TLS errors")]
|
#[arg(long, help = "Ignore the TLS errors")]
|
||||||
ignore_tls_errors: bool,
|
ignore_tls_errors: bool,
|
||||||
@@ -118,6 +127,11 @@ struct Cli {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Args for Cli {
|
impl Args for Cli {
|
||||||
|
#[cfg(not(target_os = "macos"))]
|
||||||
|
fn fix_openssl(&self) -> bool {
|
||||||
|
self.fix_openssl
|
||||||
|
}
|
||||||
|
|
||||||
fn ignore_tls_errors(&self) -> bool {
|
fn ignore_tls_errors(&self) -> bool {
|
||||||
self.ignore_tls_errors
|
self.ignore_tls_errors
|
||||||
}
|
}
|
||||||
@@ -155,14 +169,17 @@ impl Cli {
|
|||||||
.unwrap_or(false)
|
.unwrap_or(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn run(&self) -> anyhow::Result<()> {
|
|
||||||
#[cfg(not(target_os = "macos"))]
|
#[cfg(not(target_os = "macos"))]
|
||||||
if self.fix_openssl
|
fn fix_openssl(&self) -> anyhow::Result<Option<NamedTempFile>> {
|
||||||
&& !(matches!(&self.command, CliCommand::Connect(args) if args.background) && self.background_worker_fd.is_none())
|
if self.fix_openssl {
|
||||||
{
|
let file = openssl::fix_openssl_env()?;
|
||||||
log::warn!("--fix-openssl is deprecated and has no effect. It will be removed in a future release.");
|
return Ok(Some(file));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Ok(None)
|
||||||
|
}
|
||||||
|
|
||||||
|
async fn run(&self) -> anyhow::Result<()> {
|
||||||
if let CliCommand::Connect(args) = &self.command {
|
if let CliCommand::Connect(args) = &self.command {
|
||||||
if args.dashboard {
|
if args.dashboard {
|
||||||
crate::dashboard::validate(self.log_format)?;
|
crate::dashboard::validate(self.log_format)?;
|
||||||
@@ -197,7 +214,13 @@ impl Cli {
|
|||||||
None
|
None
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// The temp file will be dropped automatically when the file handle is dropped
|
||||||
|
// So, declare it here to ensure it's not dropped
|
||||||
|
#[cfg(not(target_os = "macos"))]
|
||||||
|
let _file = self.fix_openssl()?;
|
||||||
let shared_args = SharedArgs {
|
let shared_args = SharedArgs {
|
||||||
|
#[cfg(not(target_os = "macos"))]
|
||||||
|
fix_openssl: self.fix_openssl,
|
||||||
ignore_tls_errors: self.ignore_tls_errors,
|
ignore_tls_errors: self.ignore_tls_errors,
|
||||||
lock_file: &self.lock_file,
|
lock_file: &self.lock_file,
|
||||||
verbose: &self.verbose,
|
verbose: &self.verbose,
|
||||||
@@ -220,7 +243,7 @@ impl Cli {
|
|||||||
CliCommand::Hip(args) => HipHandler::new(args).handle().await,
|
CliCommand::Hip(args) => HipHandler::new(args).handle().await,
|
||||||
CliCommand::Diagnostics(_) => unreachable!("diagnostics is dispatched before VPN setup"),
|
CliCommand::Diagnostics(_) => unreachable!("diagnostics is dispatched before VPN setup"),
|
||||||
CliCommand::DetectInternalHost { address, hostname } => {
|
CliCommand::DetectInternalHost { address, hostname } => {
|
||||||
let internal = gpapi::session::desktop::network::native::detect_in_helper(*address, hostname)?;
|
let internal = gpapi::session::network::native::detect_in_helper(*address, hostname)?;
|
||||||
println!("{}", serde_json::to_string(&internal)?);
|
println!("{}", serde_json::to_string(&internal)?);
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
@@ -229,7 +252,7 @@ impl Cli {
|
|||||||
port,
|
port,
|
||||||
disable_ipv6,
|
disable_ipv6,
|
||||||
} => {
|
} => {
|
||||||
let addresses = gpapi::session::desktop::network::native::lookup_in_helper(host, *port, *disable_ipv6)?;
|
let addresses = gpapi::session::network::native::lookup_in_helper(host, *port, *disable_ipv6)?;
|
||||||
println!("{}", serde_json::to_string(&addresses)?);
|
println!("{}", serde_json::to_string(&addresses)?);
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
@@ -347,13 +370,9 @@ mod tests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn deprecated_openssl_option_remains_supported_but_hidden() {
|
fn openssl_option_is_available_only_on_supported_platforms() {
|
||||||
let result = Cli::try_parse_from(["gpclient", "--fix-openssl", "diagnostics"]);
|
let result = Cli::try_parse_from(["gpclient", "--fix-openssl", "diagnostics"]);
|
||||||
assert_eq!(result.is_ok(), !cfg!(target_os = "macos"));
|
assert_eq!(result.is_ok(), !cfg!(target_os = "macos"));
|
||||||
for flag in ["-h", "--help"] {
|
|
||||||
let help = Cli::try_parse_from(["gpclient", flag]).err().unwrap().to_string();
|
|
||||||
assert!(!help.contains("--fix-openssl"));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|||||||
@@ -112,15 +112,7 @@ pub(crate) struct ConnectArgs {
|
|||||||
#[arg(short, long, help = "Request MTU from server (legacy servers only)")]
|
#[arg(short, long, help = "Request MTU from server (legacy servers only)")]
|
||||||
pub(super) mtu: Option<u32>,
|
pub(super) mtu: Option<u32>,
|
||||||
|
|
||||||
#[arg(
|
#[arg(long, help = "Do not ask for IPv6 connectivity")]
|
||||||
long,
|
|
||||||
value_enum,
|
|
||||||
default_value = "auto",
|
|
||||||
help = "Choose which IP version to try first when connecting to the gateway"
|
|
||||||
)]
|
|
||||||
pub(super) ip_preference: gpapi::gateway::GatewayIpPreference,
|
|
||||||
|
|
||||||
#[arg(long, help = "Use only IPv4 for traffic inside the VPN tunnel")]
|
|
||||||
pub(super) disable_ipv6: bool,
|
pub(super) disable_ipv6: bool,
|
||||||
|
|
||||||
#[arg(long = "user-agent", hide = true)]
|
#[arg(long = "user-agent", hide = true)]
|
||||||
@@ -203,7 +195,10 @@ pub(super) fn build_os_profile_with_host_id(args: &ConnectArgs, host_id: Option<
|
|||||||
if let Some(local_hostname) = args.local_hostname.as_deref() {
|
if let Some(local_hostname) = args.local_hostname.as_deref() {
|
||||||
builder = builder.computer_name_override(local_hostname.to_string());
|
builder = builder.computer_name_override(local_hostname.to_string());
|
||||||
}
|
}
|
||||||
gpapi::os_profile::desktop::collect_profile(builder, host_id)
|
if let Some(host_id) = host_id {
|
||||||
|
builder = builder.host_id_override(host_id);
|
||||||
|
}
|
||||||
|
builder.build()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(super) fn cookie_cache_path(args: &ConnectArgs) -> Option<PathBuf> {
|
pub(super) fn cookie_cache_path(args: &ConnectArgs) -> Option<PathBuf> {
|
||||||
@@ -474,23 +469,4 @@ mod tests {
|
|||||||
|
|
||||||
assert!(!cli.args.cookie_only);
|
assert!(!cli.args.cookie_only);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn ip_preference_parses_independently_of_tunnel_ipv6() {
|
|
||||||
use clap::Parser;
|
|
||||||
use gpapi::gateway::GatewayIpPreference;
|
|
||||||
let default = ConnectArgsTestCli::try_parse_from(["test", "portal.example.com"]).unwrap();
|
|
||||||
assert_eq!(default.args.ip_preference, GatewayIpPreference::Auto);
|
|
||||||
for (value, expected) in [
|
|
||||||
("auto", GatewayIpPreference::Auto),
|
|
||||||
("ipv4", GatewayIpPreference::Ipv4),
|
|
||||||
("ipv6", GatewayIpPreference::Ipv6),
|
|
||||||
] {
|
|
||||||
let cli =
|
|
||||||
ConnectArgsTestCli::try_parse_from(["test", "portal.example.com", "--ip-preference", value, "--disable-ipv6"])
|
|
||||||
.unwrap();
|
|
||||||
assert_eq!(cli.args.ip_preference, expected);
|
|
||||||
assert!(cli.args.disable_ipv6);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -138,6 +138,9 @@ impl ConnectHandler<'_> {
|
|||||||
.log_format(self.shared_args.log_format)
|
.log_format(self.shared_args.log_format)
|
||||||
.verbose(verbose);
|
.verbose(verbose);
|
||||||
|
|
||||||
|
#[cfg(not(target_os = "macos"))]
|
||||||
|
let auth_launcher = auth_launcher.fix_openssl(self.shared_args.fix_openssl);
|
||||||
|
|
||||||
#[cfg(feature = "webview-auth")]
|
#[cfg(feature = "webview-auth")]
|
||||||
let use_default_browser = external_browser_supported && self.args.default_browser;
|
let use_default_browser = external_browser_supported && self.args.default_browser;
|
||||||
#[cfg(feature = "webview-auth")]
|
#[cfg(feature = "webview-auth")]
|
||||||
|
|||||||
@@ -98,6 +98,8 @@ async fn cached_tunnel_authentication_does_not_require_portal_discovery() {
|
|||||||
let lock = directory.path().join("client.pid");
|
let lock = directory.path().join("client.pid");
|
||||||
let verbose = gpapi::clap::InfoLevelVerbosity::new(0, 0);
|
let verbose = gpapi::clap::InfoLevelVerbosity::new(0, 0);
|
||||||
let shared = SharedArgs {
|
let shared = SharedArgs {
|
||||||
|
#[cfg(not(target_os = "macos"))]
|
||||||
|
fix_openssl: false,
|
||||||
ignore_tls_errors: true,
|
ignore_tls_errors: true,
|
||||||
lock_file: &lock,
|
lock_file: &lock,
|
||||||
verbose: &verbose,
|
verbose: &verbose,
|
||||||
@@ -142,6 +144,8 @@ async fn internal_tunnel_keeps_gateway_authentication_after_portal_cookie_reject
|
|||||||
let lock = directory.path().join("client.pid");
|
let lock = directory.path().join("client.pid");
|
||||||
let verbose = gpapi::clap::InfoLevelVerbosity::new(0, 0);
|
let verbose = gpapi::clap::InfoLevelVerbosity::new(0, 0);
|
||||||
let shared = SharedArgs {
|
let shared = SharedArgs {
|
||||||
|
#[cfg(not(target_os = "macos"))]
|
||||||
|
fix_openssl: false,
|
||||||
ignore_tls_errors: true,
|
ignore_tls_errors: true,
|
||||||
lock_file: &lock,
|
lock_file: &lock,
|
||||||
verbose: &verbose,
|
verbose: &verbose,
|
||||||
@@ -188,6 +192,8 @@ async fn rendering_recovery_fetches_new_prelogin_metadata_and_preserves_gateway_
|
|||||||
let lock = directory.path().join("client.pid");
|
let lock = directory.path().join("client.pid");
|
||||||
let verbose = gpapi::clap::InfoLevelVerbosity::new(0, 0);
|
let verbose = gpapi::clap::InfoLevelVerbosity::new(0, 0);
|
||||||
let shared = SharedArgs {
|
let shared = SharedArgs {
|
||||||
|
#[cfg(not(target_os = "macos"))]
|
||||||
|
fix_openssl: false,
|
||||||
ignore_tls_errors: true,
|
ignore_tls_errors: true,
|
||||||
lock_file: &lock,
|
lock_file: &lock,
|
||||||
verbose: &verbose,
|
verbose: &verbose,
|
||||||
@@ -221,6 +227,8 @@ async fn cancellation_during_recovery_prelogin_stops_request() {
|
|||||||
let lock = directory.path().join("client.pid");
|
let lock = directory.path().join("client.pid");
|
||||||
let verbose = gpapi::clap::InfoLevelVerbosity::new(0, 0);
|
let verbose = gpapi::clap::InfoLevelVerbosity::new(0, 0);
|
||||||
let shared = SharedArgs {
|
let shared = SharedArgs {
|
||||||
|
#[cfg(not(target_os = "macos"))]
|
||||||
|
fix_openssl: false,
|
||||||
ignore_tls_errors: true,
|
ignore_tls_errors: true,
|
||||||
lock_file: &lock,
|
lock_file: &lock,
|
||||||
verbose: &verbose,
|
verbose: &verbose,
|
||||||
@@ -287,6 +295,8 @@ async fn auth_crash_uses_fresh_saml_and_clean_once_with_shared_budget() {
|
|||||||
let lock = directory.path().join("client.pid");
|
let lock = directory.path().join("client.pid");
|
||||||
let verbose = gpapi::clap::InfoLevelVerbosity::new(0, 0);
|
let verbose = gpapi::clap::InfoLevelVerbosity::new(0, 0);
|
||||||
let shared = SharedArgs {
|
let shared = SharedArgs {
|
||||||
|
#[cfg(not(target_os = "macos"))]
|
||||||
|
fix_openssl: false,
|
||||||
ignore_tls_errors: true,
|
ignore_tls_errors: true,
|
||||||
lock_file: &lock,
|
lock_file: &lock,
|
||||||
verbose: &verbose,
|
verbose: &verbose,
|
||||||
@@ -345,6 +355,8 @@ async fn exhausted_auth_recovery_is_terminal_before_portal_gateway_fallback() {
|
|||||||
let lock = directory.path().join("client.pid");
|
let lock = directory.path().join("client.pid");
|
||||||
let verbose = gpapi::clap::InfoLevelVerbosity::new(0, 0);
|
let verbose = gpapi::clap::InfoLevelVerbosity::new(0, 0);
|
||||||
let shared = SharedArgs {
|
let shared = SharedArgs {
|
||||||
|
#[cfg(not(target_os = "macos"))]
|
||||||
|
fix_openssl: false,
|
||||||
ignore_tls_errors: true,
|
ignore_tls_errors: true,
|
||||||
lock_file: &lock,
|
lock_file: &lock,
|
||||||
verbose: &verbose,
|
verbose: &verbose,
|
||||||
@@ -491,6 +503,8 @@ printf '%s\n' '{"success":{"username":"alice","preloginCookie":"new-cookie"}}'
|
|||||||
let lock = directory.join("client.pid");
|
let lock = directory.join("client.pid");
|
||||||
let verbose = gpapi::clap::InfoLevelVerbosity::new(0, 0);
|
let verbose = gpapi::clap::InfoLevelVerbosity::new(0, 0);
|
||||||
let shared = SharedArgs {
|
let shared = SharedArgs {
|
||||||
|
#[cfg(not(target_os = "macos"))]
|
||||||
|
fix_openssl: false,
|
||||||
ignore_tls_errors: true,
|
ignore_tls_errors: true,
|
||||||
lock_file: &lock,
|
lock_file: &lock,
|
||||||
verbose: &verbose,
|
verbose: &verbose,
|
||||||
|
|||||||
@@ -360,26 +360,22 @@ impl ConnectHandler<'_> {
|
|||||||
match login {
|
match login {
|
||||||
GatewayLogin::Authenticated(authentication) => {
|
GatewayLogin::Authenticated(authentication) => {
|
||||||
let descriptor = Gateway::new(gateway.to_string(), gateway.to_string());
|
let descriptor = Gateway::new(gateway.to_string(), gateway.to_string());
|
||||||
self
|
client.register_session(
|
||||||
.sessions
|
descriptor.clone(),
|
||||||
.borrow_mut()
|
authentication.clone(),
|
||||||
.register_login(descriptor.clone(), authentication.clone(), &client);
|
&mut self.sessions.borrow_mut(),
|
||||||
|
);
|
||||||
self.check_cancelled()?;
|
self.check_cancelled()?;
|
||||||
let binding = if internal && authentication.mode() == SessionMode::NonTunnel && !self.args.cookie_only {
|
if internal && authentication.mode() == SessionMode::NonTunnel && !self.args.cookie_only {
|
||||||
Some(
|
client
|
||||||
self
|
.bind_non_tunnel(self.args.disable_ipv6, None, &cancellation)
|
||||||
.sessions
|
|
||||||
.borrow_mut()
|
|
||||||
.bind_non_tunnel(&descriptor, &client, self.args.disable_ipv6, None, &cancellation)
|
|
||||||
.await
|
.await
|
||||||
.map_err(|error| error.context(gpapi::gateway::GatewayLoginProtocolError))?,
|
.map_err(|error| error.context(gpapi::gateway::GatewayLoginProtocolError))?;
|
||||||
)
|
client.update_registered_session(&descriptor, &authentication, &mut self.sessions.borrow_mut());
|
||||||
} else {
|
}
|
||||||
None
|
|
||||||
};
|
|
||||||
return Ok(GatewayLoginSession {
|
return Ok(GatewayLoginSession {
|
||||||
authentication,
|
authentication,
|
||||||
extension_auth: SessionExtensionAuth::new(cred.clone(), client).with_binding(binding),
|
extension_auth: SessionExtensionAuth::new(cred.clone(), client),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
GatewayLogin::Mfa(message, input_str) => {
|
GatewayLogin::Mfa(message, input_str) => {
|
||||||
@@ -456,11 +452,6 @@ impl ConnectHandler<'_> {
|
|||||||
.reconnect_timeout(self.args.reconnect_timeout)
|
.reconnect_timeout(self.args.reconnect_timeout)
|
||||||
.mtu(mtu)
|
.mtu(mtu)
|
||||||
.disable_ipv6(self.args.disable_ipv6)
|
.disable_ipv6(self.args.disable_ipv6)
|
||||||
.gateway_ip_preference(match self.args.ip_preference {
|
|
||||||
gpapi::gateway::GatewayIpPreference::Auto => openconnect::GatewayIpPreference::Auto,
|
|
||||||
gpapi::gateway::GatewayIpPreference::Ipv4 => openconnect::GatewayIpPreference::Ipv4,
|
|
||||||
gpapi::gateway::GatewayIpPreference::Ipv6 => openconnect::GatewayIpPreference::Ipv6,
|
|
||||||
})
|
|
||||||
.no_dtls(self.args.no_dtls)
|
.no_dtls(self.args.no_dtls)
|
||||||
.local_hostname(self.args.local_hostname.clone())
|
.local_hostname(self.args.local_hostname.clone())
|
||||||
.dpd_interval(self.args.dpd_interval.unwrap_or(0))
|
.dpd_interval(self.args.dpd_interval.unwrap_or(0))
|
||||||
|
|||||||
@@ -2,14 +2,14 @@ use std::sync::Arc;
|
|||||||
|
|
||||||
use anyhow::{Context, bail, ensure};
|
use anyhow::{Context, bail, ensure};
|
||||||
use gpapi::{
|
use gpapi::{
|
||||||
collection::CollectionControl,
|
|
||||||
credential::AuthCookieCredential,
|
credential::AuthCookieCredential,
|
||||||
gateway::{Gateway, GatewayLoginContext, GatewaySelection},
|
gateway::{Gateway, GatewayLoginContext, GatewaySelection},
|
||||||
portal::PortalConfig,
|
portal::PortalConfig,
|
||||||
|
process::collection::CollectionControl,
|
||||||
session::{
|
session::{
|
||||||
MaintenanceState, SessionEndReason, SessionMode,
|
MaintenanceState, SessionEndReason, SessionMode,
|
||||||
desktop::network::PhysicalNetwork,
|
network::PhysicalNetwork,
|
||||||
desktop::non_tunnel::{SessionCallbacks, SessionExit, maintain_non_tunnel_sessions},
|
non_tunnel::{SessionCallbacks, SessionExit, maintain_non_tunnel_sessions},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
use log::{info, warn};
|
use log::{info, warn};
|
||||||
|
|||||||
@@ -19,8 +19,8 @@ use gpapi::{
|
|||||||
gateway::GatewaySelection,
|
gateway::GatewaySelection,
|
||||||
gp_params::GpParams,
|
gp_params::GpParams,
|
||||||
os_profile::OsProfile,
|
os_profile::OsProfile,
|
||||||
portal::{PreloginOptions, discovery::discover, prelogin},
|
portal::{PreloginOptions, prelogin, retrieve_config},
|
||||||
session::desktop::GatewaySessions,
|
session::GatewaySessions,
|
||||||
utils::request::RequestIdentityError,
|
utils::request::RequestIdentityError,
|
||||||
};
|
};
|
||||||
use inquire::{Password, PasswordDisplayMode, Select};
|
use inquire::{Password, PasswordDisplayMode, Select};
|
||||||
@@ -185,11 +185,11 @@ impl<'a> ConnectHandler<'a> {
|
|||||||
|
|
||||||
match identity_error {
|
match identity_error {
|
||||||
RequestIdentityError::UnsupportedEncryption
|
RequestIdentityError::UnsupportedEncryption
|
||||||
|
| RequestIdentityError::LegacyKeyConversion(_)
|
||||||
| RequestIdentityError::UnsupportedKeyFormat
|
| RequestIdentityError::UnsupportedKeyFormat
|
||||||
| RequestIdentityError::InvalidKey
|
| RequestIdentityError::InvalidKey
|
||||||
| RequestIdentityError::InvalidCertificate
|
| RequestIdentityError::InvalidCertificate
|
||||||
| RequestIdentityError::IncompletePkcs12
|
| RequestIdentityError::IncompletePkcs12
|
||||||
| RequestIdentityError::AmbiguousPkcs12
|
|
||||||
| RequestIdentityError::InvalidPkcs12(_) => return Err(err),
|
| RequestIdentityError::InvalidPkcs12(_) => return Err(err),
|
||||||
RequestIdentityError::NoKey => {
|
RequestIdentityError::NoKey => {
|
||||||
let format = self.shared_args.log_format;
|
let format = self.shared_args.log_format;
|
||||||
@@ -282,7 +282,7 @@ impl<'a> ConnectHandler<'a> {
|
|||||||
|
|
||||||
let cached = self.cached_portal_credential(portal);
|
let cached = self.cached_portal_credential(portal);
|
||||||
let cached_config = match cached {
|
let cached_config = match cached {
|
||||||
Some(cred) => match discover(portal, &cred, &gp_params, &self.cancellation).await {
|
Some(cred) => match retrieve_config(portal, &cred, &gp_params, &self.cancellation).await {
|
||||||
Ok(config) => Some((cred, config)),
|
Ok(config) => Some((cred, config)),
|
||||||
Err(error) => {
|
Err(error) => {
|
||||||
self.check_cancelled()?;
|
self.check_cancelled()?;
|
||||||
@@ -301,7 +301,7 @@ impl<'a> ConnectHandler<'a> {
|
|||||||
.await?;
|
.await?;
|
||||||
prelogin = replacement;
|
prelogin = replacement;
|
||||||
self.check_cancelled()?;
|
self.check_cancelled()?;
|
||||||
let config = discover(portal, &cred, &gp_params, &self.cancellation).await?;
|
let config = retrieve_config(portal, &cred, &gp_params, &self.cancellation).await?;
|
||||||
(cred, config)
|
(cred, config)
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
//! Dashboard presentation only; connection ownership and sampling stay outside this module.
|
//! Dashboard presentation only; connection ownership and sampling stay outside this module.
|
||||||
use crossterm::event::KeyCode;
|
use crossterm::event::KeyCode;
|
||||||
use gpapi::session::desktop::tunnel::{
|
use gpapi::session::tunnel::{TunnelList, TunnelPhase, TunnelState, TunnelStatisticsSnapshot, TunnelStatisticsState};
|
||||||
TunnelList, TunnelPhase, TunnelState, TunnelStatisticsSnapshot, TunnelStatisticsState,
|
|
||||||
};
|
|
||||||
use ratatui::{
|
use ratatui::{
|
||||||
Frame,
|
Frame,
|
||||||
buffer::Buffer,
|
buffer::Buffer,
|
||||||
@@ -340,7 +338,7 @@ pub(super) fn render_tunnel(
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use gpapi::session::desktop::tunnel::{TunnelStatistics, TunnelStatisticsView, TunnelTransport};
|
use gpapi::session::tunnel::{TunnelStatistics, TunnelStatisticsView, TunnelTransport};
|
||||||
use ratatui::{Terminal, backend::TestBackend};
|
use ratatui::{Terminal, backend::TestBackend};
|
||||||
|
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ use crossterm::{
|
|||||||
execute,
|
execute,
|
||||||
terminal::{EnterAlternateScreen, LeaveAlternateScreen, disable_raw_mode, enable_raw_mode},
|
terminal::{EnterAlternateScreen, LeaveAlternateScreen, disable_raw_mode, enable_raw_mode},
|
||||||
};
|
};
|
||||||
use gpapi::session::desktop::tunnel::TunnelPhase;
|
use gpapi::session::tunnel::TunnelPhase;
|
||||||
use log::Level;
|
use log::Level;
|
||||||
use nix::unistd::{getpgrp, tcgetpgrp};
|
use nix::unistd::{getpgrp, tcgetpgrp};
|
||||||
use ratatui::{
|
use ratatui::{
|
||||||
@@ -317,7 +317,7 @@ fn footer_text(logs: bool, ending: &str, scrollable: bool, width: u16) -> Paragr
|
|||||||
fn notice_for_status(
|
fn notice_for_status(
|
||||||
notice: Option<Notice>,
|
notice: Option<Notice>,
|
||||||
phase: TunnelPhase,
|
phase: TunnelPhase,
|
||||||
transport: gpapi::session::desktop::tunnel::TunnelTransport,
|
transport: gpapi::session::tunnel::TunnelTransport,
|
||||||
) -> Notice {
|
) -> Notice {
|
||||||
notice.unwrap_or_else(|| Notice {
|
notice.unwrap_or_else(|| Notice {
|
||||||
level: Level::Info,
|
level: Level::Info,
|
||||||
@@ -345,7 +345,7 @@ mod tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn status_transitions_cannot_overwrite_an_existing_warning() {
|
fn status_transitions_cannot_overwrite_an_existing_warning() {
|
||||||
use gpapi::session::desktop::tunnel::TunnelTransport;
|
use gpapi::session::tunnel::TunnelTransport;
|
||||||
let warning = Notice {
|
let warning = Notice {
|
||||||
level: Level::Warn,
|
level: Level::Warn,
|
||||||
message: "ESP unavailable; using SSL".into(),
|
message: "ESP unavailable; using SSL".into(),
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ use std::time::Duration;
|
|||||||
use clap::Args;
|
use clap::Args;
|
||||||
use gpapi::{
|
use gpapi::{
|
||||||
clap::args::Os,
|
clap::args::Os,
|
||||||
collection::CollectionBudget,
|
|
||||||
os_profile::{ClientOs, OsProfileBuilder},
|
os_profile::{ClientOs, OsProfileBuilder},
|
||||||
|
process::collection::CollectionBudget,
|
||||||
};
|
};
|
||||||
use gphip::{ReportContext, ReportInput, generate_report_with_control};
|
use gphip::{ReportContext, ReportInput, generate_report_with_control};
|
||||||
|
|
||||||
@@ -51,12 +51,11 @@ impl<'a> HipHandler<'a> {
|
|||||||
if let Some(os_version) = self.args.os_version.as_deref() {
|
if let Some(os_version) = self.args.os_version.as_deref() {
|
||||||
builder = builder.os_version(os_version);
|
builder = builder.os_version(os_version);
|
||||||
}
|
}
|
||||||
|
if let Some(host_id) = self.args.host_id.as_deref() {
|
||||||
|
builder = builder.host_id_override(host_id);
|
||||||
|
}
|
||||||
let input = ReportInput {
|
let input = ReportInput {
|
||||||
profile: gpapi::os_profile::desktop::collect_profile_with_control(
|
profile: builder.build_with_control(&budget)?,
|
||||||
builder,
|
|
||||||
self.args.host_id.as_deref(),
|
|
||||||
&budget,
|
|
||||||
)?,
|
|
||||||
context: ReportContext::Connected {
|
context: ReportContext::Connected {
|
||||||
cookie: self.args.cookie.clone(),
|
cookie: self.args.cookie.clone(),
|
||||||
client_ip: self.args.client_ip.clone(),
|
client_ip: self.args.client_ip.clone(),
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ use clap::Args;
|
|||||||
#[cfg(any(target_os = "linux", target_os = "freebsd", target_os = "openbsd", test))]
|
#[cfg(any(target_os = "linux", target_os = "freebsd", target_os = "openbsd", test))]
|
||||||
use common::binary_paths;
|
use common::binary_paths;
|
||||||
use directories::ProjectDirs;
|
use directories::ProjectDirs;
|
||||||
use gpapi::process::desktop_launcher::DesktopLauncher;
|
use gpapi::{process::desktop_launcher::DesktopLauncher, utils::endpoint::http_endpoint};
|
||||||
use log::info;
|
use log::info;
|
||||||
|
|
||||||
#[derive(Args)]
|
#[derive(Args)]
|
||||||
@@ -61,7 +61,7 @@ impl<'a> LaunchGuiHandler<'a> {
|
|||||||
return forward_auth_callback(callback);
|
return forward_auth_callback(callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
if DesktopLauncher::activate_existing().await.is_ok() {
|
if try_active_gui().await.is_ok() {
|
||||||
info!("The GUI is already running");
|
info!("The GUI is already running");
|
||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
@@ -115,6 +115,18 @@ fn parse_auth_callback(callback: &str) -> Result<String, String> {
|
|||||||
.ok_or_else(|| "callback URL must use the globalprotectcallback scheme".to_owned())
|
.ok_or_else(|| "callback URL must use the globalprotectcallback scheme".to_owned())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async fn try_active_gui() -> anyhow::Result<()> {
|
||||||
|
let service_endpoint = http_endpoint().await?;
|
||||||
|
|
||||||
|
reqwest::Client::default()
|
||||||
|
.post(format!("{}/active-gui", service_endpoint))
|
||||||
|
.send()
|
||||||
|
.await?
|
||||||
|
.error_for_status()?;
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
fn get_log_file() -> anyhow::Result<PathBuf> {
|
fn get_log_file() -> anyhow::Result<PathBuf> {
|
||||||
let dirs = ProjectDirs::from("com.yuezk", "GlobalProtect-openconnect", "gpclient")
|
let dirs = ProjectDirs::from("com.yuezk", "GlobalProtect-openconnect", "gpclient")
|
||||||
.ok_or_else(|| anyhow::anyhow!("Failed to get project dirs"))?;
|
.ok_or_else(|| anyhow::anyhow!("Failed to get project dirs"))?;
|
||||||
|
|||||||
@@ -182,10 +182,9 @@ mod tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn builds_session_context_from_os_profile() {
|
fn builds_session_context_from_os_profile() {
|
||||||
let profile = gpapi::os_profile::desktop::collect_profile(
|
let profile = OsProfile::builder(gpapi::os_profile::ClientOs::Mac)
|
||||||
OsProfile::builder(gpapi::os_profile::ClientOs::Mac).client_version("6.3.1-12".to_string()),
|
.client_version("6.3.1-12".to_string())
|
||||||
None,
|
.build();
|
||||||
);
|
|
||||||
let expected_user_agent = profile.user_agent().to_string();
|
let expected_user_agent = profile.user_agent().to_string();
|
||||||
|
|
||||||
let ctx = build_session_context(SessionContextInput {
|
let ctx = build_session_context(SessionContextInput {
|
||||||
|
|||||||
@@ -1,38 +0,0 @@
|
|||||||
#![cfg(not(target_os = "macos"))]
|
|
||||||
|
|
||||||
use std::process::Command;
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn background_worker_warns_once_for_the_deprecated_flag() {
|
|
||||||
const WARNING: &str = "--fix-openssl is deprecated and has no effect. It will be removed in a future release.";
|
|
||||||
let directory = tempfile::tempdir().unwrap();
|
|
||||||
for deprecated in [false, true] {
|
|
||||||
let log = directory.path().join(format!("background-{deprecated}.log"));
|
|
||||||
let mut command = Command::new(env!("CARGO_BIN_EXE_gpclient"));
|
|
||||||
if deprecated {
|
|
||||||
command.arg("--fix-openssl");
|
|
||||||
}
|
|
||||||
let output = command
|
|
||||||
.arg("--lock-file")
|
|
||||||
.arg(directory.path().join("client.pid"))
|
|
||||||
.args([
|
|
||||||
"--log-format",
|
|
||||||
"json",
|
|
||||||
"connect",
|
|
||||||
"vpn.example.test",
|
|
||||||
"--background",
|
|
||||||
"--certificate",
|
|
||||||
])
|
|
||||||
// Fail identity preparation before authentication or a network connection.
|
|
||||||
.arg(directory.path().join("missing.pem"))
|
|
||||||
.arg("--log-file")
|
|
||||||
.arg(&log)
|
|
||||||
.output()
|
|
||||||
.unwrap();
|
|
||||||
assert!(!output.status.success());
|
|
||||||
let mut records = String::from_utf8(output.stderr).unwrap();
|
|
||||||
records.push_str(&std::fs::read_to_string(log).unwrap());
|
|
||||||
assert!(records.contains("Failed to read client identity"), "{records}");
|
|
||||||
assert_eq!(records.matches(WARNING).count(), usize::from(deprecated), "{records}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -73,11 +73,5 @@ async fn embedded_collector_reports_missing_helpers_without_recursing_or_exposin
|
|||||||
report["fields"]["env.XDG_CURRENT_DESKTOP"]["value"],
|
report["fields"]["env.XDG_CURRENT_DESKTOP"]["value"],
|
||||||
"TestDesktop Injected: secret"
|
"TestDesktop Injected: secret"
|
||||||
);
|
);
|
||||||
#[cfg(not(target_os = "macos"))]
|
assert!(!String::from_utf8_lossy(&output.stderr).contains("Using 'UnsafeLegacyServerConnect'"));
|
||||||
assert_eq!(
|
|
||||||
String::from_utf8_lossy(&output.stderr)
|
|
||||||
.matches("--fix-openssl is deprecated and has no effect. It will be removed in a future release.")
|
|
||||||
.count(),
|
|
||||||
1
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
@@ -1,36 +1,7 @@
|
|||||||
# GP Connect download helper
|
# Tauri + React + Typescript
|
||||||
|
|
||||||
The desktop supervisor launches this window when the selected GUI is missing or
|
This template should help get you started developing with Tauri, React and Typescript in Vite.
|
||||||
has an incompatible version. It downloads the selected Tauri or Native Shell
|
|
||||||
interface and requests installation through the service. Launches require the
|
|
||||||
existing service credential and lifetime channel on stdin.
|
|
||||||
|
|
||||||
## Appearance
|
## Recommended IDE Setup
|
||||||
|
|
||||||
`--theme system|light|dark` controls this window only. The default is `system`,
|
- [VS Code](https://code.visualstudio.com/) + [Tauri](https://marketplace.visualstudio.com/items?itemName=tauri-apps.tauri-vscode) + [rust-analyzer](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer)
|
||||||
which follows system appearance and changes while the window is open. Explicit
|
|
||||||
`light` and `dark` modes override system appearance for that launch. Nothing is
|
|
||||||
saved by the helper.
|
|
||||||
|
|
||||||
Initial downloads follow the system. During Linux Tauri/Native Shell switches,
|
|
||||||
Desktop Core supplies the running app's saved theme choice to the supervisor,
|
|
||||||
which forwards it to the helper. There is no `--helper-theme` option on
|
|
||||||
`gpclient launch-gui`.
|
|
||||||
|
|
||||||
The native window and web content use the selected appearance before the window
|
|
||||||
is shown. Browser previews follow the system when no native mode is supplied.
|
|
||||||
|
|
||||||
## Development
|
|
||||||
|
|
||||||
```sh
|
|
||||||
pnpm build
|
|
||||||
pnpm test
|
|
||||||
```
|
|
||||||
|
|
||||||
The built `dist/` assets are tracked and must be rebuilt after frontend changes.
|
|
||||||
Run Rust checks and helper tests from the `gp` repository:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
cargo check -p gpgui-helper
|
|
||||||
cargo test -p gpgui-helper --lib
|
|
||||||
```
|
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="1024" height="1024" viewBox="0 0 1024 1024">
|
||||||
|
<defs>
|
||||||
|
<linearGradient id="ocean" x1="245" y1="170" x2="770" y2="770" gradientUnits="userSpaceOnUse">
|
||||||
|
<stop stop-color="#579bc1"/>
|
||||||
|
<stop offset=".52" stop-color="#438fbd"/>
|
||||||
|
<stop offset="1" stop-color="#2f719e"/>
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient id="land" x1="260" y1="190" x2="750" y2="735" gradientUnits="userSpaceOnUse">
|
||||||
|
<stop stop-color="#56c78a"/>
|
||||||
|
<stop offset=".55" stop-color="#3bbf78"/>
|
||||||
|
<stop offset="1" stop-color="#279b5d"/>
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient id="lock" x1="385" y1="400" x2="650" y2="700" gradientUnits="userSpaceOnUse">
|
||||||
|
<stop stop-color="#f3b84c"/>
|
||||||
|
<stop offset=".55" stop-color="#e8a12f"/>
|
||||||
|
<stop offset="1" stop-color="#d4871e"/>
|
||||||
|
</linearGradient>
|
||||||
|
<clipPath id="globe-clip">
|
||||||
|
<circle cx="512" cy="455" r="315"/>
|
||||||
|
</clipPath>
|
||||||
|
</defs>
|
||||||
|
|
||||||
|
<g transform="translate(512 512) scale(1.3) translate(-512 -455)">
|
||||||
|
<circle cx="512" cy="455" r="315" fill="url(#ocean)"/>
|
||||||
|
<g clip-path="url(#globe-clip)" fill="url(#land)">
|
||||||
|
<path d="M177 326c74-121 177-185 302-190-13 51-49 84-105 98-4 45-32 79-86 101-37 17-75 14-111-9Z"/>
|
||||||
|
<path d="M564 135c129 18 229 103 273 220-69-3-121 15-157 54-51-14-83-50-95-107-38-36-45-92-21-167Z"/>
|
||||||
|
<path d="M189 467c63-39 125-34 187 16 57 25 73 73 48 144-45 90-108 146-189 166-58-88-73-197-46-326Z"/>
|
||||||
|
<path d="M612 572c78-38 157-18 238 59-45 89-122 144-231 164-20-67-22-122-7-165-22-17-22-36 0-58Z"/>
|
||||||
|
</g>
|
||||||
|
<circle cx="512" cy="455" r="308" fill="none" stroke="#9ccde2" stroke-width="11" stroke-opacity=".4"/>
|
||||||
|
|
||||||
|
<g transform="translate(512 490) scale(.82) translate(-512 -490)">
|
||||||
|
<path d="M405 429v-75c0-142 214-142 214 0v75" fill="none" stroke="#eef1f2" stroke-width="58" stroke-linecap="round"/>
|
||||||
|
<rect x="340" y="403" width="344" height="278" rx="62" fill="url(#lock)"/>
|
||||||
|
<rect x="346" y="409" width="332" height="266" rx="56" fill="none" stroke="#f7cb75" stroke-width="10" stroke-opacity=".45"/>
|
||||||
|
<g fill="#85500f" opacity=".85">
|
||||||
|
<path d="M501 538h22l16 69h-54Z"/>
|
||||||
|
<circle cx="512" cy="521" r="27"/>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 2.2 KiB |
@@ -1,44 +0,0 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" width="1024" height="1024" viewBox="0 0 1024 1024">
|
|
||||||
<defs>
|
|
||||||
<linearGradient id="ocean" x1="210.49524" y1="190.80952" x2="802.16190" y2="867.00000" gradientUnits="userSpaceOnUse">
|
|
||||||
<stop stop-color="#579bc1"/>
|
|
||||||
<stop offset=".52" stop-color="#438fbd"/>
|
|
||||||
<stop offset="1" stop-color="#2f719e"/>
|
|
||||||
</linearGradient>
|
|
||||||
<linearGradient id="land" x1="227.40000" y1="213.34921" x2="779.62222" y2="827.55556" gradientUnits="userSpaceOnUse">
|
|
||||||
<stop stop-color="#56c78a"/>
|
|
||||||
<stop offset=".55" stop-color="#3bbf78"/>
|
|
||||||
<stop offset="1" stop-color="#279b5d"/>
|
|
||||||
</linearGradient>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<linearGradient id="shipped-lock" x1="385" y1="400" x2="650" y2="700" gradientUnits="userSpaceOnUse">
|
|
||||||
<stop stop-color="#f3b84c"/>
|
|
||||||
<stop offset=".55" stop-color="#e8a12f"/>
|
|
||||||
<stop offset="1" stop-color="#d4871e"/>
|
|
||||||
</linearGradient>
|
|
||||||
</defs>
|
|
||||||
<g transform="translate(512 512) scale(1.1535211267605634) translate(-511.4 -512)">
|
|
||||||
<g>
|
|
||||||
<circle cx="511.4" cy="512" r="355" fill="url(#ocean)"/>
|
|
||||||
<path d="m341.5 202.8c-83.71 44.8-148.5 123-170.9 210.4 10.88 28.67 32.13 48.77 54.14 63.49 13.18 8.96 18.94 19.84 17.15 31.87-3.84 26.5-46.85 37.89-50.3 71.3-2.688 27.78 17.54 52.74 46.46 67.71 21.76 11.39 35.2 25.73 41.34 44.29 13.44 39.17 32.64 82.56 68.99 105.5 30.08 18.94 46.85 12.67 41.09-1.92-6.144-15.36-26.37-32.13-26.24-53.63 0.128-27.39 26.5-41.98 31.49-62.72v-87.3c-18.69-0.896-30.59-9.216-40.19-19.71-16.51-17.41-37.76-29.44-55.68-36.86-10.37-4.352-12.67-12.8-13.7-22.66-0.896-11.39-6.144-20.74-15.1-28.16-12.8-10.62-19.97-22.53-18.3-34.82 1.92-15.62 17.28-26.5 36.74-29.44 37.25-6.144 70.53-34.69 74.11-63.49 1.792-14.46-5.504-24.32-2.816-33.66 4.864-21.12 34.18-38.14 65.02-51.71 24.83-10.88 45.7-20.61 45.95-39.81 0.256-20.22-20.74-32.9-60.03-33.41-22.53 0.128-46.08 2.56-69.25 4.736z" fill="url(#land)"/>
|
|
||||||
<path d="m663.7 191.5c-50.43 5.376-89.34 38.4-89.34 68.61 0 26.75 27.78 42.88 62.98 46.98 31.36 3.712 48.9 15.36 49.79 34.18 0.896 20.74-17.15 34.18-16.77 51.71 0.512 36.35 51.84 71.04 107.4 71.17 31.74 0.128 62.59-11.39 79.74-28.54-24.32-107.8-99.2-199.3-193.8-244.1z" fill="url(#land)"/>
|
|
||||||
<path d="m866.2 532c-19.46-9.216-42.62-13.7-66.18-13.7-57.47 0-102.1 34.05-102.1 60.8 0 11.9 6.144 19.97 13.06 26.75 11.52 11.52 17.66 25.73 17.66 42.24 0 29.18-22.53 45.06-22.53 73.34 0 26.88 18.69 47.36 39.04 57.73 71.42-61.31 117.6-154.6 121.1-247.2z" fill="url(#land)"/>
|
|
||||||
<circle cx="511.4" cy="512" r="347.111111" fill="none" stroke="#9ccde2" stroke-width="12.396825" stroke-opacity=".4"/>
|
|
||||||
|
|
||||||
</g>
|
|
||||||
</g>
|
|
||||||
<g transform="translate(512 512) scale(1.3) translate(-512 -455)">
|
|
||||||
<g transform="translate(512 490) scale(.82) translate(-512 -490)">
|
|
||||||
<path d="M405 429v-75c0-142 214-142 214 0v75" fill="none" stroke="#eef1f2" stroke-width="58" stroke-linecap="round"/>
|
|
||||||
<rect x="340" y="403" width="344" height="278" rx="62" fill="url(#shipped-lock)"/>
|
|
||||||
<rect x="346" y="409" width="332" height="266" rx="56" fill="none" stroke="#f7cb75" stroke-width="10" stroke-opacity=".3"/>
|
|
||||||
<g fill="#85500f" opacity=".78" transform="translate(512 550.5) scale(1.2) translate(-512 -550.5)">
|
|
||||||
<path d="M501 538h22l16 69h-54Z"/>
|
|
||||||
<circle cx="512" cy="521" r="27"/>
|
|
||||||
</g>
|
|
||||||
</g>
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 3.2 KiB |
@@ -1,9 +1,9 @@
|
|||||||
var e=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports);(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var t=e((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function ee(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,x||(x=!0,ie());else{var t=n(l);t!==null&&se(ee,t.startTime-e)}}}var x=!1,te=-1,ne=5,S=-1;function re(){return g?!0:!(e.unstable_now()-S<ne)}function C(){if(g=!1,x){var t=e.unstable_now();S=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(te),te=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&re());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&se(ee,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?ie():x=!1}}}var ie;if(typeof y==`function`)ie=function(){y(C)};else if(typeof MessageChannel<`u`){var ae=new MessageChannel,oe=ae.port2;ae.port1.onmessage=C,ie=function(){oe.postMessage(null)}}else ie=function(){_(C,0)};function se(t,n){te=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):ne=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(te),te=-1):h=!0,se(ee,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,x||(x=!0,ie()))),r},e.unstable_shouldYield=re,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),n=e(((e,n)=>{n.exports=t()})),r=e((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};functionLine truncated
|
var e=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports);(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var t=e((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function ee(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,x||(x=!0,ie());else{var t=n(l);t!==null&&se(ee,t.startTime-e)}}}var x=!1,te=-1,ne=5,S=-1;function re(){return g?!0:!(e.unstable_now()-S<ne)}function C(){if(g=!1,x){var t=e.unstable_now();S=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(te),te=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&re());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&se(ee,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?ie():x=!1}}}var ie;if(typeof y==`function`)ie=function(){y(C)};else if(typeof MessageChannel<`u`){var ae=new MessageChannel,oe=ae.port2;ae.port1.onmessage=C,ie=function(){oe.postMessage(null)}}else ie=function(){_(C,0)};function se(t,n){te=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):ne=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(te),te=-1):h=!0,se(ee,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,x||(x=!0,ie()))),r},e.unstable_shouldYield=re,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),n=e(((e,n)=>{n.exports=t()})),r=e((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){Line truncated
|
||||||
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
||||||
`+ze+e+Be}var He=!1;function Ue(e,t){if(!e||He)return``;He=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}n=!1;try{var i=Object.getOwnPropertyDescriptor(e.prototype,`props`);Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),n=!0,new e}finally{n&&(i===void 0?delete e.prototype.props:Object.defineProperty(e.prototype,"props",i))}}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
|
`+ze+e+Be}var He=!1;function Ue(e,t){if(!e||He)return``;He=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}n=!1;try{var i=Object.getOwnPropertyDescriptor(e.prototype,`props`);Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),n=!0,new e}finally{n&&(i===void 0?delete e.prototype.props:Object.defineProperty(e.prototype,"props",i))}}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
|
||||||
`),l=s.split(`
|
`),l=s.split(`
|
||||||
`);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
|
`);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
|
||||||
`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{He=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Ve(n):``}function We(e,t){switch(e.tag){case 26:case 27:case 5:return Ve(e.type);case 16:return Ve(`Lazy`);case 13:return e.child!==t&&t!==null?Ve(`Suspense Fallback`):Ve(`Suspense`);case 19:return Ve(`SuspenseList`);case 0:case 15:return Ue(e.type,!1);case 11:return Ue(e.type.render,!1);case 1:return Ue(e.type,!0);case 31:return Ve(`Activity`);case 30:return Ve(`ViewTransition`);default:return``}}function Ge(e){try{var t=``,n=null;do t+=We(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{He=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Ve(n):``}function We(e,t){switch(e.tag){case 26:case 27:case 5:return Ve(e.type);case 16:return Ve(`Lazy`);case 13:return e.child!==t&&t!==null?Ve(`Suspense Fallback`):Ve(`Suspense`);case 19:return Ve(`SuspenseList`);case 0:case 15:return Ue(e.type,!1);case 11:return Ue(e.type.render,!1);case 1:return Ue(e.type,!0);case 31:return Ve(`Activity`);case 30:return Ve(`ViewTransition`);default:return``}}function Ge(e){try{var t=``,n=null;do t+=We(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
||||||
Error generating stack: `+e.message+`
|
Error generating stack: `+e.message+`
|
||||||
`+e.stack}}var Ke=Object.prototype.hasOwnProperty,qe=t.unstable_scheduleCallback,Je=t.unstable_cancelCallback,Ye=t.unstable_shouldYield,Xe=t.unstable_requestPaint,Ze=t.unstable_now,Qe=t.unstable_getCurrentPriorityLevel,$e=t.unstable_ImmediatePriority,et=t.unstable_UserBlockingPriority,tt=t.unstable_NormalPriority,nt=t.unstable_LowPriority,rt=t.unstable_IdlePriority,it=t.log,at=t.unstable_setDisableYieldValue,ot=null,st=null;function ct(e){if(typeof it==`function`&&at(e),st&&typeof st.setStrictMode==`function`)try{st.setStrictMode(ot,e)}catch{}}var lt=Math.clz32?Math.clz32:ft,ut=Math.log,dt=Math.LN2;function ft(e){return e>>>=0,e===0?32:31-(ut(e)/dt|0)|0}var pt=256,mt=262144,ht=4194304;function gt(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function _t(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=gt(n))):i=gt(o):i=gt(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=gt(n))):i=gt(o)):i=gt(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function vt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function yt(e,t){t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var r=31-lt(n),i=1<<r;t|=e[r],n&=~i}return t}function bt(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function xt(){var e=ht;return ht<<=1,!(ht&62914560)&&(ht=4194304),e}function St(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ct(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function wt(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-lt(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&Tt(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function Tt(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-lt(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function Et(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-lt(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function Dt(e,t){var n=t&-t;return n=n&42?1:Ot(n),(n&(e.suspendedLanes|t))===0?n:0}function Ot(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function kt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function At(){var e=E.p;return e===0?(e=window.event,e===void 0?32:Ch(e.type)):e}function jt(e,t){var n=E.p;try{return E.p=e,t()}finally{E.p=n}}var Mt=Math.random().toString(36).slice(2),Nt=`__reactFiber$`+Mt,Pt=`__reactProps$`+Mt,Ft=`__reactContainer$`+Mt,It=`__reactEvents$`+Mt,Lt=`__reactListeners$`+Mt,Rt=`__reactHandles$`+Mt,zt=`__reactResources$`+Mt,Bt=`__reactMarker$`+Mt,Vt=`__reactLoad$`+Mt;function Ht(e){delete e[Nt],delete e[Pt],delete e[Lt],delete e[Rt]}function Ut(e){var t;if(t=e[Nt])return t;for(var n=e.parentNode;n;){if(t=n[Ft]||n[Nt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=fm(e);e!==null;){if(n=e[Nt])return n;e=fm(e)}return t}e=n,n=e.parentNode}return null}function Wt(e){if(e=e[Nt]||e[Ft]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Gt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(s(33))}function Kt(e){var t=e[zt];return t||=e[zt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function qt(e){e[Bt]=!0}function Jt(e){e[Vt]=void 0}var Yt=new Set,Xt={};function Zt(e,t){Qt(e,t),Qt(e+`Capture`,t)}function Qt(e,t){for(Xt[e]=t,e=0;e<t.le
Line truncated
|
`+e.stack}}var Ke=Object.prototype.hasOwnProperty,qe=t.unstable_scheduleCallback,Je=t.unstable_cancelCallback,Ye=t.unstable_shouldYield,Xe=t.unstable_requestPaint,Ze=t.unstable_now,Qe=t.unstable_getCurrentPriorityLevel,$e=t.unstable_ImmediatePriority,et=t.unstable_UserBlockingPriority,tt=t.unstable_NormalPriority,nt=t.unstable_LowPriority,rt=t.unstable_IdlePriority,it=t.log,at=t.unstable_setDisableYieldValue,ot=null,st=null;function ct(e){if(typeof it==`function`&&at(e),st&&typeof st.setStrictMode==`function`)try{st.setStrictMode(ot,e)}catch{}}var lt=Math.clz32?Math.clz32:ft,ut=Math.log,dt=Math.LN2;function ft(e){return e>>>=0,e===0?32:31-(ut(e)/dt|0)|0}var pt=256,mt=262144,ht=4194304;function gt(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function _t(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=gt(n))):i=gt(o):i=gt(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=gt(n))):i=gt(o)):i=gt(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function vt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function yt(e,t){t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var r=31-lt(n),i=1<<r;t|=e[r],n&=~i}return t}function bt(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function xt(){var e=ht;return ht<<=1,!(ht&62914560)&&(ht=4194304),e}function St(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ct(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function wt(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-lt(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&Tt(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function Tt(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-lt(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function Et(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-lt(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function Dt(e,t){var n=t&-t;return n=n&42?1:Ot(n),(n&(e.suspendedLanes|t))===0?n:0}function Ot(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function kt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function At(){var e=E.p;return e===0?(e=window.event,e===void 0?32:Ch(e.type)):e}function jt(e,t){var n=E.p;try{return E.p=e,t()}finally{E.p=n}}var Mt=Math.random().toString(36).slice(2),Nt=`__reactFiber$`+Mt,Pt=`__reactProps$`+Mt,Ft=`__reactContainer$`+Mt,It=`__reactEvents$`+Mt,Lt=`__reactListeners$`+Mt,Rt=`__reactHandles$`+Mt,zt=`__reactResources$`+Mt,Bt=`__reactMarker$`+Mt,Vt=`__reactLoad$`+Mt;function Ht(e){delete e[Nt],delete e[Pt],delete e[Lt],delete e[Rt]}function Ut(e){var t;if(t=e[Nt])return t;for(var n=e.parentNode;n;){if(t=n[Ft]||n[Nt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=fm(e);e!==null;){if(n=e[Nt])return n;e=fm(e)}return t}e=n,n=e.parentNode}return null}function Wt(e){if(e=e[Nt]||e[Ft]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Gt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(s(33))}function Kt(e){var t=e[zt];return t||=e[zt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function qt(e){e[Bt]=!0}function Jt(e){e[Vt]=void 0}var Yt=new Set,Xt={};function Zt(e,t){Qt(e,t),Qt(e+`Capture`,t)}function Qt(e,t){for(Xt[e]=t,e=0;e<t.le
Line truncated
|
||||||
`).replace(Qf,``)}function ep(e,t){return t=$f(t),$f(e)===t}function $(e,t,n,r,i,a){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||xn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&xn(e,``+r);else return;break;case`className`:on(e,`class`,r);break;case`tabIndex`:on(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:on(e,n,r);break;case`style`:wn(e,r,a);return;case`data`:if(t!==`object`){on(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)||r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=On(r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}if(typeof a==`function`&&(n===`formAction`?(t!==`input`&&$(e,t,`name`,i.name,i,null),$(e,t,`formEncType`,i.formEncType,i,null),$(e,t,`formMethod`,i.formMethod,i,null),$(e,t,`formTarget`,i.formTarget,i,null)):($(e,t,`encType`,i.encType,i,null),$(e,t,`method`,i.method,i,null),$(e,t,`target`,i.target,i,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=On(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=kn);return;case`onScroll`:r!=null&&Q(`scroll`,e);return;case`onScrollEnd`:r!=null&&Q(`scrollend`,e);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(s(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(s(60));a?.__html!==n&&(e.innerHTML=n)}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=On(r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`credentialless`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Q(`beforetoggle`,e),Q(`toggle`,e),an(e,`popover`,r);break;case`xlinkActuate`:sn(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:sn(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:sn(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:sn(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:sn(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:sn(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:sn(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:sn(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:sn(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:an(e,`is`,r);break;case`innerText`:case`textContent`:return;default:if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)n=En.get(n)||n,an(e,n,r);else return}O=!0}function tp(e,t,n,r,i,a){switch(n){case`style`:wn(e,r,a);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(s(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(s(60));a?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)xn(e,r);else if(typeof r==`number`||typeof r==`bigint`)xn(e,``+r);else return;break;case`onScroll`:r!=null&&Q(`scroll`,e);return;case`onScrollEnd`:r!=null&&Q(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=kn);return;case`suppressContent
Line truncated
|
`).replace(Qf,``)}function ep(e,t){return t=$f(t),$f(e)===t}function $(e,t,n,r,i,a){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||xn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&xn(e,``+r);else return;break;case`className`:on(e,`class`,r);break;case`tabIndex`:on(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:on(e,n,r);break;case`style`:wn(e,r,a);return;case`data`:if(t!==`object`){on(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)||r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=On(r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}if(typeof a==`function`&&(n===`formAction`?(t!==`input`&&$(e,t,`name`,i.name,i,null),$(e,t,`formEncType`,i.formEncType,i,null),$(e,t,`formMethod`,i.formMethod,i,null),$(e,t,`formTarget`,i.formTarget,i,null)):($(e,t,`encType`,i.encType,i,null),$(e,t,`method`,i.method,i,null),$(e,t,`target`,i.target,i,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=On(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=kn);return;case`onScroll`:r!=null&&Q(`scroll`,e);return;case`onScrollEnd`:r!=null&&Q(`scrollend`,e);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(s(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(s(60));a?.__html!==n&&(e.innerHTML=n)}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=On(r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`credentialless`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Q(`beforetoggle`,e),Q(`toggle`,e),an(e,`popover`,r);break;case`xlinkActuate`:sn(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:sn(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:sn(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:sn(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:sn(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:sn(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:sn(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:sn(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:sn(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:an(e,`is`,r);break;case`innerText`:case`textContent`:return;default:if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)n=En.get(n)||n,an(e,n,r);else return}O=!0}function tp(e,t,n,r,i,a){switch(n){case`style`:wn(e,r,a);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(s(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(s(60));a?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)xn(e,r);else if(typeof r==`number`||typeof r==`bigint`)xn(e,``+r);else return;break;case`onScroll`:r!=null&&Q(`scroll`,e);return;case`onScrollEnd`:r!=null&&Q(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=kn);return;case`suppressContent
Line truncated
|
||||||
@@ -1 +0,0 @@
|
|||||||
:root{--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light;--background:#f6f5f4;--foreground:#2e3436;--muted-foreground:#5e5c64;--progress-label:#3d3846;--progress-track:#d5d3d1;--progress-fill:#3584e4;--error:#9c2f2f;--button:#1c71d8;--button-hover:#1a5fb4;--button-active:#174a8b;--focus-ring:#1a5fb4}:root[data-theme=dark]{--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark;--background:#242424;--foreground:#fff;--muted-foreground:#c0bfbc;--progress-label:#deddda;--progress-track:#454545;--progress-fill:#78aeed;--error:#ffb4ab;--button:#1c71d8;--button-hover:#3584e4;--button-active:#1a5fb4;--focus-ring:#78aeed}html,body,#root{box-sizing:border-box;-webkit-user-select:none;user-select:none;cursor:default;height:100%;margin:0;padding:0;overflow:hidden}body{background:var(--background);color:var(--foreground);font-family:Inter,ui-sans-serif,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif}button{font:inherit}.update-window{box-sizing:border-box;background:var(--background);align-items:center;gap:15px;width:100%;height:100%;padding:16px 18px;display:flex}.update-logo{flex:none;width:48px;height:48px}.update-content,.update-status{width:100%;min-width:0}.update-title{color:var(--foreground);letter-spacing:-.01em;margin:0;font-size:16px;font-weight:600;line-height:1.25}.update-description{color:var(--muted-foreground);margin:3px 0 0;font-size:12px;line-height:1.4}.progress-summary{justify-content:space-between;align-items:baseline;gap:12px;margin-top:3px;display:flex}.progress-summary .update-description{margin:0}.progress-bar{background-color:var(--progress-track);border-radius:3px;width:100%;height:6px;margin-top:9px;position:relative;overflow:hidden}.progress-fill{background:var(--progress-fill);border-radius:3px;height:100%;transition:width .18s ease-out}.progress-bar-indeterminate .progress-fill{width:35%;animation:1.4s ease-in-out infinite progress-indeterminate}@keyframes progress-indeterminate{0%{transform:translate(-110%)}to{transform:translate(300%)}}@media (prefers-reduced-motion:reduce){.progress-fill{transition:none}.progress-bar-indeterminate .progress-fill{animation:none;transform:translate(90%)}}.progress-label{color:var(--progress-label);font-variant-numeric:tabular-nums;text-align:right;white-space:nowrap;flex:none;font-size:12px;font-weight:500}.error-status{justify-content:space-between;align-items:center;gap:16px;display:flex}.error-status .update-title{color:var(--error)}.error-copy{min-width:0}.retry-button{background:var(--button);color:#fff;cursor:default;border:0;border-radius:8px;min-width:68px;padding:4px 14px;font-size:12px;font-weight:600;line-height:1.5}.retry-button:hover{background:var(--button-hover)}.retry-button:active{background:var(--button-active)}.retry-button:focus-visible{outline:2px solid var(--focus-ring);outline-offset:2px}
|
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
html,body,#root{box-sizing:border-box;-webkit-user-select:none;user-select:none;cursor:default;height:100%;margin:0;padding:0;overflow:hidden}body{color:#2e3436;background:#f6f5f4;font-family:Inter,ui-sans-serif,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif}button{font:inherit}.update-window{box-sizing:border-box;background:#f6f5f4;align-items:center;gap:15px;width:100%;height:100%;padding:16px 18px;display:flex}.update-logo{flex:none;width:48px;height:48px}.update-content,.update-status{width:100%;min-width:0}.update-title{color:#2e3436;letter-spacing:-.01em;margin:0;font-size:16px;font-weight:600;line-height:1.25}.update-description{color:#5e5c64;margin:3px 0 0;font-size:12px;line-height:1.4}.progress-summary{justify-content:space-between;align-items:baseline;gap:12px;margin-top:3px;display:flex}.progress-summary .update-description{margin:0}.progress-bar{background-color:#d5d3d1;border-radius:3px;width:100%;height:6px;margin-top:9px;position:relative;overflow:hidden}.progress-fill{background:#3584e4;border-radius:3px;height:100%;transition:width .18s ease-out}.progress-bar-indeterminate .progress-fill{width:35%;animation:1.4s ease-in-out infinite progress-indeterminate}@keyframes progress-indeterminate{0%{transform:translate(-110%)}to{transform:translate(300%)}}@media (prefers-reduced-motion:reduce){.progress-fill{transition:none}.progress-bar-indeterminate .progress-fill{animation:none;transform:translate(90%)}}.progress-label{color:#3d3846;font-variant-numeric:tabular-nums;text-align:right;white-space:nowrap;flex:none;font-size:12px;font-weight:500}.error-status{justify-content:space-between;align-items:center;gap:16px;display:flex}.error-status .update-title{color:#9c2f2f}.error-copy{min-width:0}.retry-button{color:#fff;cursor:pointer;background:#1c71d8;border:0;border-radius:8px;min-width:68px;padding:4px 14px;font-size:12px;font-weight:600;line-height:1.5}.retry-button:hover{background:#1a5fb4}.retry-button:active{background:#174a8b}.retry-button:focus-visible{outline-offset:2px;outline:2px solid #1a5fb4}
|
||||||
@@ -2,21 +2,11 @@
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<script>
|
<link rel="icon" type="image/svg+xml" href="/assets/icon-small-BO4dlTNl.svg" />
|
||||||
const theme = window.__GP_HELPER_THEME__ || "system";
|
|
||||||
const systemTheme = matchMedia("(prefers-color-scheme: dark)");
|
|
||||||
const applyTheme = () => {
|
|
||||||
document.documentElement.dataset.theme =
|
|
||||||
theme === "system" ? (systemTheme.matches ? "dark" : "light") : theme;
|
|
||||||
};
|
|
||||||
applyTheme();
|
|
||||||
if (theme === "system") systemTheme.addEventListener("change", applyTheme);
|
|
||||||
</script>
|
|
||||||
<link rel="icon" type="image/svg+xml" href="/assets/icon-small-DFuJkDph.svg" />
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
<title>GPGUI Downloader</title>
|
<title>GPGUI Downloader</title>
|
||||||
<script type="module" crossorigin src="/assets/main-BJvLW_Ih.js"></script>
|
<script type="module" crossorigin src="/assets/main-BU3mus1z.js"></script>
|
||||||
<link rel="stylesheet" crossorigin href="/assets/main-CVTp2z3I.css">
|
<link rel="stylesheet" crossorigin href="/assets/main-DiWGniCh.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<script>
|
<script>
|
||||||
|
|||||||
@@ -2,16 +2,6 @@
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<script>
|
|
||||||
const theme = window.__GP_HELPER_THEME__ || "system";
|
|
||||||
const systemTheme = matchMedia("(prefers-color-scheme: dark)");
|
|
||||||
const applyTheme = () => {
|
|
||||||
document.documentElement.dataset.theme =
|
|
||||||
theme === "system" ? (systemTheme.matches ? "dark" : "light") : theme;
|
|
||||||
};
|
|
||||||
applyTheme();
|
|
||||||
if (theme === "system") systemTheme.addEventListener("change", applyTheme);
|
|
||||||
</script>
|
|
||||||
<link rel="icon" type="image/svg+xml" href="/src/assets/icon-small.svg" />
|
<link rel="icon" type="image/svg+xml" href="/src/assets/icon-small.svg" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
<title>GPGUI Downloader</title>
|
<title>GPGUI Downloader</title>
|
||||||
|
|||||||
@@ -5,22 +5,21 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
"build": "tsc && vite build",
|
"build": "tsc && vite build",
|
||||||
"test": "node --test tests/*.test.mjs",
|
|
||||||
"preview": "vite preview",
|
"preview": "vite preview",
|
||||||
"tauri": "tauri"
|
"tauri": "tauri"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@tauri-apps/api": "^2.12.4",
|
"@tauri-apps/api": "^2.12.3",
|
||||||
"react": "^19.3.1",
|
"react": "^19.3.0",
|
||||||
"react-dom": "^19.3.1"
|
"react-dom": "^19.3.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@tauri-apps/cli": "^2.12.4",
|
"@tauri-apps/cli": "^2.12.2",
|
||||||
"@types/node": "^26.6.6",
|
"@types/node": "^26.6.5",
|
||||||
"@types/react": "^19.3.0",
|
"@types/react": "^19.3.0",
|
||||||
"@types/react-dom": "^19.3.0",
|
"@types/react-dom": "^19.3.0",
|
||||||
"@typescript-eslint/eslint-plugin": "^8.72.1",
|
"@typescript-eslint/eslint-plugin": "^8.71.2",
|
||||||
"@typescript-eslint/parser": "^8.72.1",
|
"@typescript-eslint/parser": "^8.71.2",
|
||||||
"@vitejs/plugin-react": "^6.1.2",
|
"@vitejs/plugin-react": "^6.1.2",
|
||||||
"eslint": "^9.39.5",
|
"eslint": "^9.39.5",
|
||||||
"eslint-config-prettier": "^10.1.8",
|
"eslint-config-prettier": "^10.1.8",
|
||||||
@@ -28,7 +27,7 @@
|
|||||||
"eslint-plugin-react-hooks": "^7.1.1",
|
"eslint-plugin-react-hooks": "^7.1.1",
|
||||||
"prettier": "3.9.10",
|
"prettier": "3.9.10",
|
||||||
"typescript": "^6.0.3",
|
"typescript": "^6.0.3",
|
||||||
"vite": "^8.3.5"
|
"vite": "^8.3.4"
|
||||||
},
|
},
|
||||||
"packageManager": "[email protected]"
|
"packageManager": "[email protected]"
|
||||||
}
|
}
|
||||||
@@ -9,21 +9,21 @@ importers:
|
|||||||
.:
|
.:
|
||||||
dependencies:
|
dependencies:
|
||||||
'@tauri-apps/api':
|
'@tauri-apps/api':
|
||||||
specifier: ^2.12.4
|
specifier: ^2.12.3
|
||||||
version: 2.12.4
|
version: 2.12.3
|
||||||
react:
|
react:
|
||||||
specifier: ^19.3.1
|
specifier: ^19.3.0
|
||||||
version: 19.3.1
|
version: 19.3.0
|
||||||
react-dom:
|
react-dom:
|
||||||
specifier: ^19.3.1
|
specifier: ^19.3.0
|
||||||
version: 19.3.1([email protected].1)
|
version: 19.3.0([email protected].0)
|
||||||
devDependencies:
|
devDependencies:
|
||||||
'@tauri-apps/cli':
|
'@tauri-apps/cli':
|
||||||
specifier: ^2.12.4
|
specifier: ^2.12.2
|
||||||
version: 2.12.4
|
version: 2.12.2
|
||||||
'@types/node':
|
'@types/node':
|
||||||
specifier: ^26.6.6
|
specifier: ^26.6.5
|
||||||
version: 26.6.6
|
version: 26.6.5
|
||||||
'@types/react':
|
'@types/react':
|
||||||
specifier: ^19.3.0
|
specifier: ^19.3.0
|
||||||
version: 19.3.0
|
version: 19.3.0
|
||||||
@@ -31,14 +31,14 @@ importers:
|
|||||||
specifier: ^19.3.0
|
specifier: ^19.3.0
|
||||||
version: 19.3.0(@types/[email protected])
|
version: 19.3.0(@types/[email protected])
|
||||||
'@typescript-eslint/eslint-plugin':
|
'@typescript-eslint/eslint-plugin':
|
||||||
specifier: ^8.72.1
|
specifier: ^8.71.2
|
||||||
version: 8.72.1(@typescript-eslint/[email protected]2.1([email protected])([email protected]))([email protected])([email protected])
|
version: 8.71.2(@typescript-eslint/[email protected]1.2([email protected])([email protected]))([email protected])([email protected])
|
||||||
'@typescript-eslint/parser':
|
'@typescript-eslint/parser':
|
||||||
specifier: ^8.72.1
|
specifier: ^8.71.2
|
||||||
version: 8.72.1([email protected])([email protected])
|
version: 8.71.2([email protected])([email protected])
|
||||||
'@vitejs/plugin-react':
|
'@vitejs/plugin-react':
|
||||||
specifier: ^6.1.2
|
specifier: ^6.1.2
|
||||||
version: 6.1.2([email protected].5(@types/[email protected].6)([email protected]))
|
version: 6.1.2([email protected].4(@types/[email protected].5)([email protected]))
|
||||||
eslint:
|
eslint:
|
||||||
specifier: ^9.39.5
|
specifier: ^9.39.5
|
||||||
version: 9.39.5
|
version: 9.39.5
|
||||||
@@ -58,8 +58,8 @@ importers:
|
|||||||
specifier: ^6.0.3
|
specifier: ^6.0.3
|
||||||
version: 6.0.3
|
version: 6.0.3
|
||||||
vite:
|
vite:
|
||||||
specifier: ^8.3.5
|
specifier: ^8.3.4
|
||||||
version: 8.3.5(@types/[email protected].6)([email protected])
|
version: 8.3.4(@types/[email protected].5)([email protected])
|
||||||
|
|
||||||
packages:
|
packages:
|
||||||
|
|
||||||
@@ -360,95 +360,95 @@ packages:
|
|||||||
'@jridgewell/[email protected]':
|
'@jridgewell/[email protected]':
|
||||||
resolution: {integrity: sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==}
|
resolution: {integrity: sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==}
|
||||||
|
|
||||||
'@oxc-project/[email protected]6.0':
|
'@oxc-project/[email protected]3.0':
|
||||||
resolution: {integrity: sha512-1Duyg48TdJNdyhEB8Xn1L36bT9Pv6GUtlKjHxOys8xkaF/rQq3XJE+bAurSK/AgIz5mGFsb77cn9Pb20+WCScw==}
|
resolution: {integrity: sha512-jSNrRIyvPVLL5E1z/tS5zLAprosGz/FuI1PWwEOz59j3E4TTTzSpqKb/RDGqJhhW0QHYISGXxq582wGx6T11Tw==}
|
||||||
|
|
||||||
'@rolldown/[email protected]6':
|
'@rolldown/[email protected]3':
|
||||||
resolution: {integrity: sha512-ia3DwAs0OsMGS7+IConptSiyk9pEXkOx/AbJ2n/lAGxH3QkWQus1t8d7gnAT38FCU2sQu8lUbeR6AiZFv4JxaA==}
|
resolution: {integrity: sha512-Vu/NICrgdRvUOeaJZIyB2FP63s6fO/4ud5l8dXmxDx9yDyn+mN0y+gsvsVviSli+T361Aqo0h46EuMoobrwawA==}
|
||||||
engines: {node: ^20.19.0 || >=22.12.0}
|
engines: {node: ^20.19.0 || >=22.12.0}
|
||||||
cpu: [arm]
|
cpu: [arm]
|
||||||
os: [android]
|
os: [android]
|
||||||
|
|
||||||
'@rolldown/[email protected]6':
|
'@rolldown/[email protected]3':
|
||||||
resolution: {integrity: sha512-kx5wBiMB6E7TEvpl2B9gjLU004BkvEm2Dr941BFjx/SontPwSzNuQUIoVKxHHoSjpFIfHMmcguyLOtyn0hObRg==}
|
resolution: {integrity: sha512-6LEoIrGy5vvCd2boNnv2soPSUZj/PRvhp8R/t9KlX+mIZxThIE/ZqxrGXxmuNX0FuvQFvLdZr7S4HrYpYBVhEQ==}
|
||||||
engines: {node: ^20.19.0 || >=22.12.0}
|
engines: {node: ^20.19.0 || >=22.12.0}
|
||||||
cpu: [arm64]
|
cpu: [arm64]
|
||||||
os: [android]
|
os: [android]
|
||||||
|
|
||||||
'@rolldown/[email protected]6':
|
'@rolldown/[email protected]3':
|
||||||
resolution: {integrity: sha512-qslZrXnKJU4cUpjoAmtAo/KQM9e2IRMlmpig6Zpwj+8KWxW8v+nkAf9216Bsek9lOC1jvg2yCjygCFo2f83msQ==}
|
resolution: {integrity: sha512-CaJSRzlQ6Q+zkDMVA9OkVxBjVoPRCDEE3v0FSJ9kIQBgRjFApA3Si4ijhbNVUji7ZJt+PfO0e46qy4nPInHUPA==}
|
||||||
engines: {node: ^20.19.0 || >=22.12.0}
|
engines: {node: ^20.19.0 || >=22.12.0}
|
||||||
cpu: [arm64]
|
cpu: [arm64]
|
||||||
os: [darwin]
|
os: [darwin]
|
||||||
|
|
||||||
'@rolldown/[email protected]6':
|
'@rolldown/[email protected]3':
|
||||||
resolution: {integrity: sha512-FdF+y48ND13eAyM2mQn+85kvAqNlvRWROy2rhgA463X/0Gv4vGtazZtfaF1mRBLscYvtOlh4QnLjOWiFzX69OQ==}
|
resolution: {integrity: sha512-e4r340I5hxSzJkD3YJBxgzq/rJ3wwxwdLLb2FPt1Zpyem20nrQPT11DDEEkazwxaHumH8wpglsp/Ozgj/wT6mw==}
|
||||||
engines: {node: ^20.19.0 || >=22.12.0}
|
engines: {node: ^20.19.0 || >=22.12.0}
|
||||||
cpu: [x64]
|
cpu: [x64]
|
||||||
os: [darwin]
|
os: [darwin]
|
||||||
|
|
||||||
'@rolldown/[email protected]6':
|
'@rolldown/[email protected]3':
|
||||||
resolution: {integrity: sha512-ddjqFM5e95AgLbUPtKIS7V1KTVlA0RUgCVr5mn+/IEhsdy3pr+Vuj/HZ7nlMN2FyxIwUktOH1LEPIQXO1v9y1Q==}
|
resolution: {integrity: sha512-hoBWDZ4/K/mJKVMbsgUd1jfpA2DiOrJ54mpegObU9TBHBBrtX4FLIXJJQRDPZ/2Dn91GvPob+Z2hwKJzf4E5SQ==}
|
||||||
engines: {node: ^20.19.0 || >=22.12.0}
|
engines: {node: ^20.19.0 || >=22.12.0}
|
||||||
cpu: [x64]
|
cpu: [x64]
|
||||||
os: [freebsd]
|
os: [freebsd]
|
||||||
|
|
||||||
'@rolldown/[email protected]6':
|
'@rolldown/[email protected]3':
|
||||||
resolution: {integrity: sha512-tHdKWbFkFBI687iim3LIyIvyL7j66VvQYkDPss5Stn/qyE2tWkR1YD0dXmXPFKKqT/o5ZEJVsaRsWS2meQwGOA==}
|
resolution: {integrity: sha512-oF9fZu3vTWnTiVAkDFxU9PJLt1nh20K9RRpuHsR7ZnE2L7XookBbDBVLojCVSLGbvtSlxeUNnjAj6DbNsKyzbg==}
|
||||||
engines: {node: ^20.19.0 || >=22.12.0}
|
engines: {node: ^20.19.0 || >=22.12.0}
|
||||||
cpu: [arm]
|
cpu: [arm]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
|
|
||||||
'@rolldown/[email protected]6':
|
'@rolldown/[email protected]3':
|
||||||
resolution: {integrity: sha512-FJiLGAblPBMlBEdbOqw6kW6QcXDWAf/oJu7gYs9ZJZwmg+K+/zjFLxPTIY9izJUzxzc24FHvmseyA0IvJSl17w==}
|
resolution: {integrity: sha512-DTpb/+jMiqWMPgphn4ksW1zW+XLJ6dJJ9FMvnIk9I291LhCctMPhMYJrP5t9p6C9qa3KXadDdUEZHBaPh3kNxQ==}
|
||||||
engines: {node: ^20.19.0 || >=22.12.0}
|
engines: {node: ^20.19.0 || >=22.12.0}
|
||||||
cpu: [arm64]
|
cpu: [arm64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
|
|
||||||
'@rolldown/[email protected]6':
|
'@rolldown/[email protected]3':
|
||||||
resolution: {integrity: sha512-hrJpblMsrQ58U9veWpbXzkhV5zStunds6HWLprqq1qauvgBr1E6P+24kLj6lSLI9vjRn/RYpjprhkHQPKGWpNg==}
|
resolution: {integrity: sha512-xU+Kvv9N2A3SY35zFh1FWWNjxbadE/BKeqnkXe7vScU4GZsw757BlVmDLITZEq8DPpk6m7uoDYkK7P+x/uU5Ow==}
|
||||||
engines: {node: ^20.19.0 || >=22.12.0}
|
engines: {node: ^20.19.0 || >=22.12.0}
|
||||||
cpu: [arm64]
|
cpu: [arm64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
|
|
||||||
'@rolldown/[email protected]6':
|
'@rolldown/[email protected]3':
|
||||||
resolution: {integrity: sha512-qJd/dC6j6CwLG9/s/RP2nb1RZ0GIgj7Ioj7x/SYa3RzjVrlzrmH0fhIOpfvqQDeIsdP0loi+kHaMhJzY1PBIaA==}
|
resolution: {integrity: sha512-XMk/hnhh25oQ756Lclb1Q11h4ll0xC0Esa5w4Vzp+mAE2S3AGJgeM0SonrIgY8fHhjarb6hcoTuwoFG0VVP2ig==}
|
||||||
engines: {node: ^20.19.0 || >=22.12.0}
|
engines: {node: ^20.19.0 || >=22.12.0}
|
||||||
cpu: [ppc64]
|
cpu: [ppc64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
|
|
||||||
'@rolldown/[email protected]6':
|
'@rolldown/[email protected]3':
|
||||||
resolution: {integrity: sha512-Vx7Xg5uUJuNcujJjI70OICaH0EYj80BtOLZTSN7uOYg8QOLlyKnaG0IW7Fn/J0IpJsaKzmDKMhOQv1JBM9m9vg==}
|
resolution: {integrity: sha512-U1BoTHYmlywE2n3HUWjzZ+8EQsKr+OwpxYuDWaubx42tUL8QSL7nOqRz/NVHanibbFP3M1Rxuprz/wNcbMKjqw==}
|
||||||
engines: {node: ^20.19.0 || >=22.12.0}
|
engines: {node: ^20.19.0 || >=22.12.0}
|
||||||
cpu: [s390x]
|
cpu: [s390x]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
|
|
||||||
'@rolldown/[email protected]6':
|
'@rolldown/[email protected]3':
|
||||||
resolution: {integrity: sha512-TNKhgE3uJTsTzatUSSYt0Kgo+Oa2uSlSjz4r1aEIea7HX6ULBym4fAlYUhG1i6pjNf2njfCUAfKwr6C3E9Xg1w==}
|
resolution: {integrity: sha512-J4cm80Pc6wEwV5AZ42o62sIQgDk+Y7R2s646jIwuvO+4V46QB58N4vVuMPWCBaNgursXLpmUWJV//WQAkPvHBQ==}
|
||||||
engines: {node: ^20.19.0 || >=22.12.0}
|
engines: {node: ^20.19.0 || >=22.12.0}
|
||||||
cpu: [x64]
|
cpu: [x64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
|
|
||||||
'@rolldown/[email protected]6':
|
'@rolldown/[email protected]3':
|
||||||
resolution: {integrity: sha512-7chXdpjXZ8qG0+mIxECN3cT9kvhZ3/oZhMX6Pp876P7CDrIy8nJswva6Mq357JR7eYXfuskwZxMeV1SzoZdHrA==}
|
resolution: {integrity: sha512-W0euZS40U4V6JkmEnVCIX9mcsL6cbXQ4X8c2w+MMOIjFg68TXUW+u3RT+2e1t1pv9mg/EP3pDtK3POXdQ7Rxyw==}
|
||||||
engines: {node: ^20.19.0 || >=22.12.0}
|
engines: {node: ^20.19.0 || >=22.12.0}
|
||||||
cpu: [x64]
|
cpu: [x64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
|
|
||||||
'@rolldown/[email protected]6':
|
'@rolldown/[email protected]3':
|
||||||
resolution: {integrity: sha512-Kwjt+7uNTJK5/MDkGWGVO2KQPnj8yAV75dMpfwyHZrJSXWHrniOB0aUEWlVYf3H1hOqFLIStLdM5QXq6bnKmOQ==}
|
resolution: {integrity: sha512-do/AF/4n9MRshia3a5aXoy8xM2c6mgfT6D7H/dY6my5z+hfCIR4ab7mk4IRj++nsEQpKy39kd0DQnDq+r692tw==}
|
||||||
engines: {node: ^20.19.0 || >=22.12.0}
|
engines: {node: ^20.19.0 || >=22.12.0}
|
||||||
cpu: [arm64]
|
cpu: [arm64]
|
||||||
os: [openharmony]
|
os: [openharmony]
|
||||||
|
|
||||||
'@rolldown/[email protected]6':
|
'@rolldown/[email protected]3':
|
||||||
resolution: {integrity: sha512-/LH6WfjDRXXJz/p5xl4TmU+jpcnwcxbKEQBW/GZE0JHfN0lGIyTtsUEGaQ/q/GikkGJ2yLKe6pwm7AnEWO8pdw==}
|
resolution: {integrity: sha512-6FtUf2cJZobutJdxnGYX8z0vtbgqU0b2v8vfBhkXb9wp2MppMFtkunE+IaOntyi01rkIQoPW2GHABtfzsC0BRQ==}
|
||||||
engines: {node: ^20.19.0 || >=22.12.0}
|
engines: {node: ^20.19.0 || >=22.12.0}
|
||||||
cpu: [arm64]
|
cpu: [arm64]
|
||||||
os: [win32]
|
os: [win32]
|
||||||
|
|
||||||
'@rolldown/[email protected]6':
|
'@rolldown/[email protected]3':
|
||||||
resolution: {integrity: sha512-1lv1KvX0Z871zfk7vw+dnXMMnHNyDwMzWG8Kv3HxDXMOhzCX4SHc7HK319fInP0i+0p9D8brkfzL7pJOaGl+tw==}
|
resolution: {integrity: sha512-UKhFaZTeTcbKrb3iU82m17jVcPEAoqDkCN5MBqgPyZSwp/cQmib21crTS0DdH7T1B7wZRWEI89YQAOJMet5yhg==}
|
||||||
engines: {node: ^20.19.0 || >=22.12.0}
|
engines: {node: ^20.19.0 || >=22.12.0}
|
||||||
cpu: [x64]
|
cpu: [x64]
|
||||||
os: [win32]
|
os: [win32]
|
||||||
@@ -456,77 +456,77 @@ packages:
|
|||||||
'@rolldown/[email protected]':
|
'@rolldown/[email protected]':
|
||||||
resolution: {integrity: sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw==}
|
resolution: {integrity: sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw==}
|
||||||
|
|
||||||
'@tauri-apps/[email protected].4':
|
'@tauri-apps/[email protected].3':
|
||||||
resolution: {integrity: sha512-pVmfis+4zT8H0Qhp3xPZx9Ju7kpzvA6rr/PSJPyuwfvucTQ8sVt61NYU9KMkK703UFlYadFmjKA4HhybOtN0gg==}
|
resolution: {integrity: sha512-9s0PKw0p4r3kFq92jhpivYSp+cSht15o0gXpZxuQd0+dV9KCexEVkNaLELVoLdJWyoH4KlfQo5h3W2LIM8siJg==}
|
||||||
|
|
||||||
'@tauri-apps/[email protected].4':
|
'@tauri-apps/[email protected].2':
|
||||||
resolution: {integrity: sha512-OxqKSckIkoJ6vX2AjifIJpTasFC0Hbdoo7gEiCmAjauABO3U8m2MRsLWe+QTiBwDx1mIrvgA+rvI7tvDnbnHVg==}
|
resolution: {integrity: sha512-Lk3zaBTfzNvA7670Al5PNgo2M/95uaDPe1yp+ILJeDOmol87XiYuK5E5+FUbK5e6U6OORx9qpZdOo2U+5tETtQ==}
|
||||||
engines: {node: '>= 10'}
|
engines: {node: '>= 10'}
|
||||||
cpu: [arm64]
|
cpu: [arm64]
|
||||||
os: [darwin]
|
os: [darwin]
|
||||||
|
|
||||||
'@tauri-apps/[email protected].4':
|
'@tauri-apps/[email protected].2':
|
||||||
resolution: {integrity: sha512-fz76/77wMMJOaaUN6n3CybRG0P/MTEjjqYk81mGPyhi9m6Ue5T+LWBnJP/AkPooNatBPI2vtulGqomyMJ44lCQ==}
|
resolution: {integrity: sha512-2CyYjJ833JB3sKRz4B0W/Tv4oOVC16ws1bxdSCWj1XvrmanWwvZi99e5tNIoCHwHhcOm0jh+sh0PCGQyls6Z+w==}
|
||||||
engines: {node: '>= 10'}
|
engines: {node: '>= 10'}
|
||||||
cpu: [x64]
|
cpu: [x64]
|
||||||
os: [darwin]
|
os: [darwin]
|
||||||
|
|
||||||
'@tauri-apps/[email protected].4':
|
'@tauri-apps/[email protected].2':
|
||||||
resolution: {integrity: sha512-K0w8Bof6Lt8QKLAYhRy0yy36ZH5iA/35VuSOvnxyjvCUZ+A3JKsUTlALviH/sVgAlisaPzzmeJSH8XOn4Q2HBA==}
|
resolution: {integrity: sha512-uvt2xbone4JftKarelssi86Kqnl7JiG1Smh5+Ae+nZmtM+JUhTGmqkcqfUPXRW8Ygwog92POZvd4oGDN9j8eXQ==}
|
||||||
engines: {node: '>= 10'}
|
engines: {node: '>= 10'}
|
||||||
cpu: [arm]
|
cpu: [arm]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
|
|
||||||
'@tauri-apps/[email protected].4':
|
'@tauri-apps/[email protected].2':
|
||||||
resolution: {integrity: sha512-j5rOnjmRUwWrm1oosf0zBYl4D+fqydgUROFCk0hvKZxvbTT8SOERes0QB7rBV/XWNy+kM6pCKzb3oSm2sRglzg==}
|
resolution: {integrity: sha512-DZlDJ24u3tlocKOYqzR+b2M+Qr+5WFcoMBZ7EfdhHN5j3ZXwBBpms4G4gyNvPCrak5vMzmdZ65ecBXPJcC+5sA==}
|
||||||
engines: {node: '>= 10'}
|
engines: {node: '>= 10'}
|
||||||
cpu: [arm64]
|
cpu: [arm64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
|
|
||||||
'@tauri-apps/[email protected].4':
|
'@tauri-apps/[email protected].2':
|
||||||
resolution: {integrity: sha512-aOue3Fy6Jb7+oWcfAVUsVHfeTybSCt2CZoU06aO4jv4d2Ks/KnaTPwMAK3CLEduGOvBLY1lbBBrIyomqLLH5Sg==}
|
resolution: {integrity: sha512-pb+RTZUYH/p0gR4j4ecCCq+FNfz3W3eKuUQvVEBn7MQZx6DzfLO7FaYzt2NyDKWpdNN3lP10mdzOvw3R5P5aAQ==}
|
||||||
engines: {node: '>= 10'}
|
engines: {node: '>= 10'}
|
||||||
cpu: [arm64]
|
cpu: [arm64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
|
|
||||||
'@tauri-apps/[email protected].4':
|
'@tauri-apps/[email protected].2':
|
||||||
resolution: {integrity: sha512-Fx6GShY/RvST+t6LMlTHAwd66+1tEaAAGrnU7cysVfaiRP1BKng5Vl6rVmO6rSLOA1Sp1dRzNYM4f0OWQGb7qA==}
|
resolution: {integrity: sha512-nidEvDUJyHYNbIv9MUk6KiEix8IXfRh4Wj2G2SA5g8nFmgbBCwazUNWYiG/LhNeNbfZpBMLerRBUtoQ5K0GidA==}
|
||||||
engines: {node: '>= 10'}
|
engines: {node: '>= 10'}
|
||||||
cpu: [riscv64]
|
cpu: [riscv64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
|
|
||||||
'@tauri-apps/[email protected].4':
|
'@tauri-apps/[email protected].2':
|
||||||
resolution: {integrity: sha512-tNzZSa79Z1nRpHxEpQ38lsAFpKlFlYvoXzjTV+lRRn/zSf3wrdUC3wnLcq2XEadchPu4ttK0zivhYzr+XGD19Q==}
|
resolution: {integrity: sha512-gkXyYn3w+Xfc8nz/DleEbkm1M7bBuU2cejqUXNmI98cA2P5kp+oPmS4ALTorb1FaNWjpsKoYZBWsbS9BXxYFkQ==}
|
||||||
engines: {node: '>= 10'}
|
engines: {node: '>= 10'}
|
||||||
cpu: [x64]
|
cpu: [x64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
|
|
||||||
'@tauri-apps/[email protected].4':
|
'@tauri-apps/[email protected].2':
|
||||||
resolution: {integrity: sha512-jmZ1pr0xEqUhuEusWtt9Yt+GF6lCnGHUmIL+KIknpbjK/XQ2qkhDBhaxK/JMHM2A8dAacVXCxXJk2EXpwhQUfA==}
|
resolution: {integrity: sha512-MrjgoZ09s8Hsn99XvxSNvK8NQTZxi7XiyK3FxxytzfHgz2jb3qUT69CZtsokRkN/zdi9rCgrMtq+w9XNICjcfQ==}
|
||||||
engines: {node: '>= 10'}
|
engines: {node: '>= 10'}
|
||||||
cpu: [x64]
|
cpu: [x64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
|
|
||||||
'@tauri-apps/[email protected].4':
|
'@tauri-apps/[email protected].2':
|
||||||
resolution: {integrity: sha512-fGo8pgEHZxdSYgZ/J98m1usJ7NHKmKbq7k6uT0x1rpOq6Bg2YVzzpaAblWk710f5LHYBJIL5QIFS5IrD+4gmTg==}
|
resolution: {integrity: sha512-BR+CYM7iF3lkfyTtVkwMQU/s9hwegLpj3UqDjaxKCPmixQCa1csBBPy3C75V+FhLtOjIXNna4Gt6Vm9oxbV+qA==}
|
||||||
engines: {node: '>= 10'}
|
engines: {node: '>= 10'}
|
||||||
cpu: [arm64]
|
cpu: [arm64]
|
||||||
os: [win32]
|
os: [win32]
|
||||||
|
|
||||||
'@tauri-apps/[email protected].4':
|
'@tauri-apps/[email protected].2':
|
||||||
resolution: {integrity: sha512-ezl8sQIcjYsye3TUnTH5VcWmWzccZASlQm7hlZt0dYyj1XD0qpVW47u2xYVrIKui0F8uQv/7QGZixdWiClBsbg==}
|
resolution: {integrity: sha512-zODJo9l3TbNBM+GrO/yPqGeELNMK5cjIc+QHh1WQc3l8tD+jDZGTQyYuAxViCsM6Uh5uWJ//RnCZG9LXrvsXww==}
|
||||||
engines: {node: '>= 10'}
|
engines: {node: '>= 10'}
|
||||||
cpu: [ia32]
|
cpu: [ia32]
|
||||||
os: [win32]
|
os: [win32]
|
||||||
|
|
||||||
'@tauri-apps/[email protected].4':
|
'@tauri-apps/[email protected].2':
|
||||||
resolution: {integrity: sha512-DJhDeCqjLDNMWYFy7ZS8cfeAHX2RK0RbQMLiA3bMVVkXRDJ4NBYiHriGqsUhsr9iG41aTb+dJGkFPmPw1gWwVw==}
|
resolution: {integrity: sha512-cQXI2ZaZmwBDt0XATCqASVanYizxkEE3ceQVlVHXaQ51HzsQUWA04c9Nz7LrrY2lgAu3jFMyat+8Yz3Z2R2qBA==}
|
||||||
engines: {node: '>= 10'}
|
engines: {node: '>= 10'}
|
||||||
cpu: [x64]
|
cpu: [x64]
|
||||||
os: [win32]
|
os: [win32]
|
||||||
|
|
||||||
'@tauri-apps/[email protected].4':
|
'@tauri-apps/[email protected].2':
|
||||||
resolution: {integrity: sha512-JI9bHfudSRJikGOrjbXEm6RjzzvmKuLc+JixB1NE8hNzQkNlCCIC3pTES3uypkR9lxHrsbxzcnSwhI2IxBQphw==}
|
resolution: {integrity: sha512-PMSppzAnlT+BvZtRKuidxjRSm2r5t8kDpJ/czmmQUa0AtDNTwrjLE8vApK3phCWGg7isfnYL46Dl1jB4ArI0hA==}
|
||||||
engines: {node: '>= 10'}
|
engines: {node: '>= 10'}
|
||||||
hasBin: true
|
hasBin: true
|
||||||
|
|
||||||
@@ -536,8 +536,8 @@ packages:
|
|||||||
'@types/[email protected]':
|
'@types/[email protected]':
|
||||||
resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==}
|
resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==}
|
||||||
|
|
||||||
'@types/[email protected].6':
|
'@types/[email protected].5':
|
||||||
resolution: {integrity: sha512-MzQj+8Kx3XI40OmUAE6Qoh58ZMNstNNMwn2nfd3qWsfe7nDNSqJNzes4njhz6AHwrSHOffSLwXU6yb474Q4aog==}
|
resolution: {integrity: sha512-uMzsv9stDdofIZBx4UGh4Z9ZgXnGC9seRDscilBcTHAeOFk67MZg/k9bWVfO+bk4qZmG+l52hRnLwUiH2LnJTg==}
|
||||||
|
|
||||||
'@types/[email protected]':
|
'@types/[email protected]':
|
||||||
resolution: {integrity: sha512-ZI7bU42mZXXKHn/qNLEw2IrbiINU7X5+vfgdixBHkCNpYWXjKgfQ/P+uyGb5CjOLB9UcnTeg3rylQtV2hym44Q==}
|
resolution: {integrity: sha512-ZI7bU42mZXXKHn/qNLEw2IrbiINU7X5+vfgdixBHkCNpYWXjKgfQ/P+uyGb5CjOLB9UcnTeg3rylQtV2hym44Q==}
|
||||||
@@ -547,63 +547,63 @@ packages:
|
|||||||
'@types/[email protected]':
|
'@types/[email protected]':
|
||||||
resolution: {integrity: sha512-N0rFCuH9YoxG9/m61l9MfpJKfmLOVU0em7ipIz6TRgSSkvReLB9vL85GB+yr8Bs5leqpvg96JSwF4ZS1s4viQg==}
|
resolution: {integrity: sha512-N0rFCuH9YoxG9/m61l9MfpJKfmLOVU0em7ipIz6TRgSSkvReLB9vL85GB+yr8Bs5leqpvg96JSwF4ZS1s4viQg==}
|
||||||
|
|
||||||
'@typescript-eslint/[email protected]2.1':
|
'@typescript-eslint/[email protected]1.2':
|
||||||
resolution: {integrity: sha512-5CokTWXpmbylfFabsbvHC0CAw3XLaGnoa+nFJX5FR592h/LoZsENUE6p/rg5xvkKrFEXz6pYmgI29AgXc2N3BQ==}
|
resolution: {integrity: sha512-K72/pvT7qpm8q3k8G5u93NCSN1RcLxX5h7Gw0bQpbMXviBHeY6Nx1WEwmk9wP+eKTSQ8ecxvcgt/ZX/rB938xQ==}
|
||||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
'@typescript-eslint/parser': ^8.72.1
|
'@typescript-eslint/parser': ^8.71.2
|
||||||
eslint: ^8.57.0 || ^9.0.0 || ^10.0.0
|
eslint: ^8.57.0 || ^9.0.0 || ^10.0.0
|
||||||
typescript: '>=4.8.4 <6.1.0'
|
typescript: '>=4.8.4 <6.1.0'
|
||||||
|
|
||||||
'@typescript-eslint/[email protected]2.1':
|
'@typescript-eslint/[email protected]1.2':
|
||||||
resolution: {integrity: sha512-ZGwZP4OCfyA0AQTpEAMWz+rtX01DRhQWW5hB0ucKDEIX5U7jdmPSaMx94rQfaPAQzIYz2BimOgKOJtjfpRFQ9g==}
|
resolution: {integrity: sha512-aTtmZjp/x3gsGHkDs04/1I8kNogBJkpQaeGaN0PfiG43NzDEmW2n+OP5im9wfsvyX0yP1UZWBrAGtDBfH9jEVw==}
|
||||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
eslint: ^8.57.0 || ^9.0.0 || ^10.0.0
|
eslint: ^8.57.0 || ^9.0.0 || ^10.0.0
|
||||||
typescript: '>=4.8.4 <6.1.0'
|
typescript: '>=4.8.4 <6.1.0'
|
||||||
|
|
||||||
'@typescript-eslint/[email protected]2.1':
|
'@typescript-eslint/[email protected]1.2':
|
||||||
resolution: {integrity: sha512-fAuVMkwdO/huI8nyo/WKnNKf6Gag93S56Rh3Ts5mGcavwSdaN8tRg1gCeIGX8PF+nzp1BjGfO4gHhGzW1J6jTg==}
|
resolution: {integrity: sha512-Pd68GsLVh5ZXlcEccFPdhSOvtHZ/2WU0XsA8zmXOS3F158lVlcTLhfQ6qvtL1RzbMie0Kp8xtbVwAg4nejKPHw==}
|
||||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
typescript: '>=4.8.4 <6.1.0'
|
typescript: '>=4.8.4 <6.1.0'
|
||||||
|
|
||||||
'@typescript-eslint/[email protected]2.1':
|
'@typescript-eslint/[email protected]1.2':
|
||||||
resolution: {integrity: sha512-lC/t6eMCZZQAAKZEYGL6RDVSuFehpdmMT6h+nJIjIa6oylN/PwDgDVtEIbB7O9xFfZYtZAYLoLlDNWKJhtF+uQ==}
|
resolution: {integrity: sha512-YF4wgg5iUX5Obywoac27B56FhozMNFhdJSbh11H5GBAwmBtfyRhmgTQqW9tRNNmHDvsZ2CX6UGzoz+YfYn2Leg==}
|
||||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||||
|
|
||||||
'@typescript-eslint/[email protected]2.1':
|
'@typescript-eslint/[email protected]1.2':
|
||||||
resolution: {integrity: sha512-e4D5R5vpeAEPBxT2BAzsFQL3sbwyeeeo5+aczgNSRK1V734jE7pTqaGFU+fXapWEQwnZbpFaTn32+Z8DwS6OTg==}
|
resolution: {integrity: sha512-jz49TAWokm/7yWD9/o837nYax9DyALxIPOImdImvVzo6canBCZYzin8zJyqNR5k1j9K1DE0bVvr0XYB+99uAdg==}
|
||||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
typescript: '>=4.8.4 <6.1.0'
|
typescript: '>=4.8.4 <6.1.0'
|
||||||
|
|
||||||
'@typescript-eslint/[email protected]2.1':
|
'@typescript-eslint/[email protected]1.2':
|
||||||
resolution: {integrity: sha512-iY2wlmyrXJmx4yxUGP3aYCFF3cA/6ShddOKmLU2dx7LnEykbAM8WThlxZEfd1NddqceF6eJmZUayxx9oKIYNlg==}
|
resolution: {integrity: sha512-cC8UaalCViJkb3rH/xLIvidEwoFRtMZMUqDjjJMGEKaTFwYRHYBcoczlEGHuvkHEO8svRDrgZ0yQgOArFmwang==}
|
||||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
eslint: ^8.57.0 || ^9.0.0 || ^10.0.0
|
eslint: ^8.57.0 || ^9.0.0 || ^10.0.0
|
||||||
typescript: '>=4.8.4 <6.1.0'
|
typescript: '>=4.8.4 <6.1.0'
|
||||||
|
|
||||||
'@typescript-eslint/[email protected]2.1':
|
'@typescript-eslint/[email protected]1.2':
|
||||||
resolution: {integrity: sha512-LmE5IhQet1BWOWEXqBrVtBPsMAOQ6Nzk35d+WLh3mk4EUF33sqlfxjio1MdYeSvKSG5skactKKuixBIKXhL4Rw==}
|
resolution: {integrity: sha512-y5Ukl3oVp7e/VGxqIoEXoeb/Roj71PAJ4WG/N/RGj+eeDvKRLM15kGr9MijLbN0i03S52zxu31Z98E5gWChJKw==}
|
||||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||||
|
|
||||||
'@typescript-eslint/[email protected]2.1':
|
'@typescript-eslint/[email protected]1.2':
|
||||||
resolution: {integrity: sha512-DAlUoUV93hIvrtIQLwCbmZQYVZwOMhiHJrOVUUIWicFZaIYjTRqlY3I/NZevfkLmSqkNHRu2qYDcq9lrn16oOQ==}
|
resolution: {integrity: sha512-DgNOEsl4pdYzwSL+N/Cl33tX1Hlw3FvId73LnKXfq7jnrF2viOEn7X+P7RBkkSWCVm92gnWd28GIC5vJuLREeA==}
|
||||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
typescript: '>=4.8.4 <6.1.0'
|
typescript: '>=4.8.4 <6.1.0'
|
||||||
|
|
||||||
'@typescript-eslint/[email protected]2.1':
|
'@typescript-eslint/[email protected]1.2':
|
||||||
resolution: {integrity: sha512-5v5liypurJBFHCBNqh/RjsymAD+VWcE0djuGY/BUqp5fC3Qn+luWDEksjuTtWjPn6i5zQlUtkZCRG/CYG0yCkA==}
|
resolution: {integrity: sha512-RyKa1G1M9rKHDhrk+HJtiF1MvLD5Ux2JW3TSkzw+02pRALdpJb+QzG1Y5em+LvCgzGwgg8H7mBRFKljNz7ImPw==}
|
||||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
eslint: ^8.57.0 || ^9.0.0 || ^10.0.0
|
eslint: ^8.57.0 || ^9.0.0 || ^10.0.0
|
||||||
typescript: '>=4.8.4 <6.1.0'
|
typescript: '>=4.8.4 <6.1.0'
|
||||||
|
|
||||||
'@typescript-eslint/[email protected]2.1':
|
'@typescript-eslint/[email protected]1.2':
|
||||||
resolution: {integrity: sha512-SB8xqipSzZHUePCCLNeYxqnxq83X61/qzNhjQGbTfjxGZIeOEP7tBgWYX05Tcd6CgE02WdTJnh5b8kMZJ/+bnQ==}
|
resolution: {integrity: sha512-zozlN0UA32bSG2zkKAgQyRYSbEISVoyU6vvkKYo2aSny74D8Jh4e+POkJ6Lk0dlezZi5x7TtD+88Xb06IB8nhg==}
|
||||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||||
|
|
||||||
'@vitejs/[email protected]':
|
'@vitejs/[email protected]':
|
||||||
@@ -1031,8 +1031,8 @@ packages:
|
|||||||
resolution: {integrity: sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==}
|
resolution: {integrity: sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==}
|
||||||
engines: {node: '>= 4'}
|
engines: {node: '>= 4'}
|
||||||
|
|
||||||
[email protected]4:
|
[email protected]2:
|
||||||
resolution: {integrity: sha512-wCBiZ77u1tuWde6G/nfOtLaCTYcFDU5yCzARzK10y+rLhzYoL7a7yEemcopcc2Mzow7gZOIjnV2ym1NYmdiJOQ==}
|
resolution: {integrity: sha512-/8UvqAPU9DGTI9k4mxtf49U37Isfwr8Uts96+SBHIkFxPJnHS0Ew4f00sM4Scd8V8EjM0jUNtVDdv1kPdt35lg==}
|
||||||
engines: {node: '>= 4'}
|
engines: {node: '>= 4'}
|
||||||
|
|
||||||
[email protected]:
|
[email protected]:
|
||||||
@@ -1378,8 +1378,8 @@ packages:
|
|||||||
resolution: {integrity: sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg==}
|
resolution: {integrity: sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg==}
|
||||||
engines: {node: '>= 0.4'}
|
engines: {node: '>= 0.4'}
|
||||||
|
|
||||||
[email protected].32:
|
[email protected]9:
|
||||||
resolution: {integrity: sha512-LJlKCCAUFKOuZxipUdYw1NzIITEsPcgyOG9LkvRJvuKj/bRzbuRY0ARXvL0pWGpsZvn8jku+LMep2eU0seHp8g==}
|
resolution: {integrity: sha512-49cGhUbXj8Qenv0iTMxA1cFBzxXoctpC9Ujd77t1WcbJIr6nF/eI7g/8MgxrYldFRuAXvja7xQRwavoW7kgrxQ==}
|
||||||
engines: {node: ^10 || ^12 || >=14}
|
engines: {node: ^10 || ^12 || >=14}
|
||||||
|
|
||||||
[email protected]:
|
[email protected]:
|
||||||
@@ -1398,16 +1398,16 @@ packages:
|
|||||||
resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==}
|
resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==}
|
||||||
engines: {node: '>=6'}
|
engines: {node: '>=6'}
|
||||||
|
|
||||||
[email protected].1:
|
[email protected].0:
|
||||||
resolution: {integrity: sha512-Y0bARz53lhEC1NMCASs0/j+faB/zqt3R8hpvg1e8+61ZVJ4UL0UdC4cBbXfZMcIuhrfgeILTLe+ZeBCavQPtKQ==}
|
resolution: {integrity: sha512-JDk8dgif51OjFoDE70+OT9ICyYr+69HlmihNwp1+Nsfbna3t5sIiCa9ZJktDmQ4/1b/rn26hIAR2uYXDMr5r0Q==}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
react: ^19.3.1
|
react: ^19.3.0
|
||||||
|
|
||||||
[email protected]:
|
[email protected]:
|
||||||
resolution: {integrity: sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==}
|
resolution: {integrity: sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==}
|
||||||
|
|
||||||
[email protected].1:
|
[email protected].0:
|
||||||
resolution: {integrity: sha512-QNhWdt7nrgVWWQG58QuGsAR3jv3Hbe4mb4vz7w2csnHavciZJgda1CPNaldF6eVxv90ud3jUXpKlHL69gO38yw==}
|
resolution: {integrity: sha512-E8LUcbtBWt20bbl2YoHfx4ZDBdxVTfOKtCZn9cDSJ4l6/nuoApcpIBcj47t2wZoVX8g2ZHuMHbiShgCR1T5Sog==}
|
||||||
engines: {node: '>=0.10.0'}
|
engines: {node: '>=0.10.0'}
|
||||||
|
|
||||||
[email protected]:
|
[email protected]:
|
||||||
@@ -1427,8 +1427,8 @@ packages:
|
|||||||
engines: {node: '>= 0.4'}
|
engines: {node: '>= 0.4'}
|
||||||
hasBin: true
|
hasBin: true
|
||||||
|
|
||||||
[email protected]6:
|
[email protected]3:
|
||||||
resolution: {integrity: sha512-bWvlMpFKiTfDKfnK7FC2MPgPeWCf/Kpwsq49ApdW+FQaBZb6O6dZ4MAPbPUjp7hYQrw/RobqCzn64BRrQecGHw==}
|
resolution: {integrity: sha512-/5apOkwWxtACcQtZ5WlrAsKS4JwXVThQPJZ3RqIruRY9UG9M8e0VlXN068xum/JRKA4aIUoJ13ghe/kGCvidiQ==}
|
||||||
engines: {node: ^20.19.0 || >=22.12.0}
|
engines: {node: ^20.19.0 || >=22.12.0}
|
||||||
hasBin: true
|
hasBin: true
|
||||||
|
|
||||||
@@ -1582,13 +1582,13 @@ packages:
|
|||||||
[email protected]:
|
[email protected]:
|
||||||
resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==}
|
resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==}
|
||||||
|
|
||||||
[email protected].5:
|
[email protected].4:
|
||||||
resolution: {integrity: sha512-z1YpjieJ9g0ebTmQpLBv/oq9E3F9EIlOe+7LahW8SrE3LTiG3udBRUXQOlYXP9b+IC2q2phHeVxj9xGlw34OEQ==}
|
resolution: {integrity: sha512-IftLE8phJhdNRIGNEV4JCCvfNScoZQVfcXaN8TQropWGJtOHcu+iAB9pHcuGvmEb/kddw0LBe/jS8ztdC6xdiQ==}
|
||||||
engines: {node: ^20.19.0 || >=22.12.0}
|
engines: {node: ^20.19.0 || >=22.12.0}
|
||||||
hasBin: true
|
hasBin: true
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
'@types/node': ^20.19.0 || >=22.12.0
|
'@types/node': ^20.19.0 || >=22.12.0
|
||||||
'@vitejs/devtools': ^0.7.1 || ^0.8.0
|
'@vitejs/devtools': ^0.7.1
|
||||||
esbuild: ^0.27.0 || ^0.28.0
|
esbuild: ^0.27.0 || ^0.28.0
|
||||||
jiti: '>=1.21.0'
|
jiti: '>=1.21.0'
|
||||||
less: ^4.0.0
|
less: ^4.0.0
|
||||||
@@ -1927,109 +1927,109 @@ snapshots:
|
|||||||
'@jridgewell/resolve-uri': 3.1.2
|
'@jridgewell/resolve-uri': 3.1.2
|
||||||
'@jridgewell/sourcemap-codec': 1.6.0
|
'@jridgewell/sourcemap-codec': 1.6.0
|
||||||
|
|
||||||
'@oxc-project/[email protected]6.0': {}
|
'@oxc-project/[email protected]3.0': {}
|
||||||
|
|
||||||
'@rolldown/[email protected]6':
|
'@rolldown/[email protected]3':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@rolldown/[email protected]6':
|
'@rolldown/[email protected]3':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@rolldown/[email protected]6':
|
'@rolldown/[email protected]3':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@rolldown/[email protected]6':
|
'@rolldown/[email protected]3':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@rolldown/[email protected]6':
|
'@rolldown/[email protected]3':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@rolldown/[email protected]6':
|
'@rolldown/[email protected]3':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@rolldown/[email protected]6':
|
'@rolldown/[email protected]3':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@rolldown/[email protected]6':
|
'@rolldown/[email protected]3':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@rolldown/[email protected]6':
|
'@rolldown/[email protected]3':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@rolldown/[email protected]6':
|
'@rolldown/[email protected]3':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@rolldown/[email protected]6':
|
'@rolldown/[email protected]3':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@rolldown/[email protected]6':
|
'@rolldown/[email protected]3':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@rolldown/[email protected]6':
|
'@rolldown/[email protected]3':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@rolldown/[email protected]6':
|
'@rolldown/[email protected]3':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@rolldown/[email protected]6':
|
'@rolldown/[email protected]3':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@rolldown/[email protected]': {}
|
'@rolldown/[email protected]': {}
|
||||||
|
|
||||||
'@tauri-apps/[email protected].4': {}
|
'@tauri-apps/[email protected].3': {}
|
||||||
|
|
||||||
'@tauri-apps/[email protected].4':
|
'@tauri-apps/[email protected].2':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@tauri-apps/[email protected].4':
|
'@tauri-apps/[email protected].2':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@tauri-apps/[email protected].4':
|
'@tauri-apps/[email protected].2':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@tauri-apps/[email protected].4':
|
'@tauri-apps/[email protected].2':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@tauri-apps/[email protected].4':
|
'@tauri-apps/[email protected].2':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@tauri-apps/[email protected].4':
|
'@tauri-apps/[email protected].2':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@tauri-apps/[email protected].4':
|
'@tauri-apps/[email protected].2':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@tauri-apps/[email protected].4':
|
'@tauri-apps/[email protected].2':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@tauri-apps/[email protected].4':
|
'@tauri-apps/[email protected].2':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@tauri-apps/[email protected].4':
|
'@tauri-apps/[email protected].2':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@tauri-apps/[email protected].4':
|
'@tauri-apps/[email protected].2':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@tauri-apps/[email protected].4':
|
'@tauri-apps/[email protected].2':
|
||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
'@tauri-apps/cli-darwin-arm64': 2.12.4
|
'@tauri-apps/cli-darwin-arm64': 2.12.2
|
||||||
'@tauri-apps/cli-darwin-x64': 2.12.4
|
'@tauri-apps/cli-darwin-x64': 2.12.2
|
||||||
'@tauri-apps/cli-linux-arm-gnueabihf': 2.12.4
|
'@tauri-apps/cli-linux-arm-gnueabihf': 2.12.2
|
||||||
'@tauri-apps/cli-linux-arm64-gnu': 2.12.4
|
'@tauri-apps/cli-linux-arm64-gnu': 2.12.2
|
||||||
'@tauri-apps/cli-linux-arm64-musl': 2.12.4
|
'@tauri-apps/cli-linux-arm64-musl': 2.12.2
|
||||||
'@tauri-apps/cli-linux-riscv64-gnu': 2.12.4
|
'@tauri-apps/cli-linux-riscv64-gnu': 2.12.2
|
||||||
'@tauri-apps/cli-linux-x64-gnu': 2.12.4
|
'@tauri-apps/cli-linux-x64-gnu': 2.12.2
|
||||||
'@tauri-apps/cli-linux-x64-musl': 2.12.4
|
'@tauri-apps/cli-linux-x64-musl': 2.12.2
|
||||||
'@tauri-apps/cli-win32-arm64-msvc': 2.12.4
|
'@tauri-apps/cli-win32-arm64-msvc': 2.12.2
|
||||||
'@tauri-apps/cli-win32-ia32-msvc': 2.12.4
|
'@tauri-apps/cli-win32-ia32-msvc': 2.12.2
|
||||||
'@tauri-apps/cli-win32-x64-msvc': 2.12.4
|
'@tauri-apps/cli-win32-x64-msvc': 2.12.2
|
||||||
|
|
||||||
'@types/[email protected]': {}
|
'@types/[email protected]': {}
|
||||||
|
|
||||||
'@types/[email protected]': {}
|
'@types/[email protected]': {}
|
||||||
|
|
||||||
'@types/[email protected].6':
|
'@types/[email protected].5':
|
||||||
dependencies:
|
dependencies:
|
||||||
undici-types: 8.9.0
|
undici-types: 8.9.0
|
||||||
|
|
||||||
@@ -2041,57 +2041,57 @@ snapshots:
|
|||||||
dependencies:
|
dependencies:
|
||||||
csstype: 3.2.3
|
csstype: 3.2.3
|
||||||
|
|
||||||
'@typescript-eslint/[email protected]2.1(@typescript-eslint/[email protected]2.1([email protected])([email protected]))([email protected])([email protected])':
|
'@typescript-eslint/[email protected]1.2(@typescript-eslint/[email protected]1.2([email protected])([email protected]))([email protected])([email protected])':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@eslint-community/regexpp': 4.12.2
|
'@eslint-community/regexpp': 4.12.2
|
||||||
'@typescript-eslint/parser': 8.72.1([email protected])([email protected])
|
'@typescript-eslint/parser': 8.71.2([email protected])([email protected])
|
||||||
'@typescript-eslint/scope-manager': 8.72.1
|
'@typescript-eslint/scope-manager': 8.71.2
|
||||||
'@typescript-eslint/type-utils': 8.72.1([email protected])([email protected])
|
'@typescript-eslint/type-utils': 8.71.2([email protected])([email protected])
|
||||||
'@typescript-eslint/utils': 8.72.1([email protected])([email protected])
|
'@typescript-eslint/utils': 8.71.2([email protected])([email protected])
|
||||||
'@typescript-eslint/visitor-keys': 8.72.1
|
'@typescript-eslint/visitor-keys': 8.71.2
|
||||||
eslint: 9.39.5
|
eslint: 9.39.5
|
||||||
ignore: 7.0.14
|
ignore: 7.0.12
|
||||||
natural-compare: 1.4.0
|
natural-compare: 1.4.0
|
||||||
ts-api-utils: 2.5.0([email protected])
|
ts-api-utils: 2.5.0([email protected])
|
||||||
typescript: 6.0.3
|
typescript: 6.0.3
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- supports-color
|
- supports-color
|
||||||
|
|
||||||
'@typescript-eslint/[email protected]2.1([email protected])([email protected])':
|
'@typescript-eslint/[email protected]1.2([email protected])([email protected])':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@typescript-eslint/scope-manager': 8.72.1
|
'@typescript-eslint/scope-manager': 8.71.2
|
||||||
'@typescript-eslint/types': 8.72.1
|
'@typescript-eslint/types': 8.71.2
|
||||||
'@typescript-eslint/typescript-estree': 8.72.1([email protected])
|
'@typescript-eslint/typescript-estree': 8.71.2([email protected])
|
||||||
'@typescript-eslint/visitor-keys': 8.72.1
|
'@typescript-eslint/visitor-keys': 8.71.2
|
||||||
debug: 4.4.3
|
debug: 4.4.3
|
||||||
eslint: 9.39.5
|
eslint: 9.39.5
|
||||||
typescript: 6.0.3
|
typescript: 6.0.3
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- supports-color
|
- supports-color
|
||||||
|
|
||||||
'@typescript-eslint/[email protected]2.1([email protected])':
|
'@typescript-eslint/[email protected]1.2([email protected])':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@typescript-eslint/tsconfig-utils': 8.72.1([email protected])
|
'@typescript-eslint/tsconfig-utils': 8.71.2([email protected])
|
||||||
'@typescript-eslint/types': 8.72.1
|
'@typescript-eslint/types': 8.71.2
|
||||||
debug: 4.4.3
|
debug: 4.4.3
|
||||||
typescript: 6.0.3
|
typescript: 6.0.3
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- supports-color
|
- supports-color
|
||||||
|
|
||||||
'@typescript-eslint/[email protected]2.1':
|
'@typescript-eslint/[email protected]1.2':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@typescript-eslint/types': 8.72.1
|
'@typescript-eslint/types': 8.71.2
|
||||||
'@typescript-eslint/visitor-keys': 8.72.1
|
'@typescript-eslint/visitor-keys': 8.71.2
|
||||||
|
|
||||||
'@typescript-eslint/[email protected]2.1([email protected])':
|
'@typescript-eslint/[email protected]1.2([email protected])':
|
||||||
dependencies:
|
dependencies:
|
||||||
typescript: 6.0.3
|
typescript: 6.0.3
|
||||||
|
|
||||||
'@typescript-eslint/[email protected]2.1([email protected])([email protected])':
|
'@typescript-eslint/[email protected]1.2([email protected])([email protected])':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@typescript-eslint/types': 8.72.1
|
'@typescript-eslint/types': 8.71.2
|
||||||
'@typescript-eslint/typescript-estree': 8.72.1([email protected])
|
'@typescript-eslint/typescript-estree': 8.71.2([email protected])
|
||||||
'@typescript-eslint/utils': 8.72.1([email protected])([email protected])
|
'@typescript-eslint/utils': 8.71.2([email protected])([email protected])
|
||||||
debug: 4.4.3
|
debug: 4.4.3
|
||||||
eslint: 9.39.5
|
eslint: 9.39.5
|
||||||
ts-api-utils: 2.5.0([email protected])
|
ts-api-utils: 2.5.0([email protected])
|
||||||
@@ -2099,14 +2099,14 @@ snapshots:
|
|||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- supports-color
|
- supports-color
|
||||||
|
|
||||||
'@typescript-eslint/[email protected]2.1': {}
|
'@typescript-eslint/[email protected]1.2': {}
|
||||||
|
|
||||||
'@typescript-eslint/[email protected]2.1([email protected])':
|
'@typescript-eslint/[email protected]1.2([email protected])':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@typescript-eslint/project-service': 8.72.1([email protected])
|
'@typescript-eslint/project-service': 8.71.2([email protected])
|
||||||
'@typescript-eslint/tsconfig-utils': 8.72.1([email protected])
|
'@typescript-eslint/tsconfig-utils': 8.71.2([email protected])
|
||||||
'@typescript-eslint/types': 8.72.1
|
'@typescript-eslint/types': 8.71.2
|
||||||
'@typescript-eslint/visitor-keys': 8.72.1
|
'@typescript-eslint/visitor-keys': 8.71.2
|
||||||
debug: 4.4.3
|
debug: 4.4.3
|
||||||
minimatch: 10.2.6
|
minimatch: 10.2.6
|
||||||
semver: 7.8.5
|
semver: 7.8.5
|
||||||
@@ -2116,26 +2116,26 @@ snapshots:
|
|||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- supports-color
|
- supports-color
|
||||||
|
|
||||||
'@typescript-eslint/[email protected]2.1([email protected])([email protected])':
|
'@typescript-eslint/[email protected]1.2([email protected])([email protected])':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@eslint-community/eslint-utils': 4.10.1([email protected])
|
'@eslint-community/eslint-utils': 4.10.1([email protected])
|
||||||
'@typescript-eslint/scope-manager': 8.72.1
|
'@typescript-eslint/scope-manager': 8.71.2
|
||||||
'@typescript-eslint/types': 8.72.1
|
'@typescript-eslint/types': 8.71.2
|
||||||
'@typescript-eslint/typescript-estree': 8.72.1([email protected])
|
'@typescript-eslint/typescript-estree': 8.71.2([email protected])
|
||||||
eslint: 9.39.5
|
eslint: 9.39.5
|
||||||
typescript: 6.0.3
|
typescript: 6.0.3
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- supports-color
|
- supports-color
|
||||||
|
|
||||||
'@typescript-eslint/[email protected]2.1':
|
'@typescript-eslint/[email protected]1.2':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@typescript-eslint/types': 8.72.1
|
'@typescript-eslint/types': 8.71.2
|
||||||
eslint-visitor-keys: 5.0.1
|
eslint-visitor-keys: 5.0.1
|
||||||
|
|
||||||
'@vitejs/[email protected]([email protected].5(@types/[email protected].6)([email protected]))':
|
'@vitejs/[email protected]([email protected].4(@types/[email protected].5)([email protected]))':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@rolldown/pluginutils': 1.0.1
|
'@rolldown/pluginutils': 1.0.1
|
||||||
vite: 8.3.5(@types/[email protected].6)([email protected])
|
vite: 8.3.4(@types/[email protected].5)([email protected])
|
||||||
|
|
||||||
[email protected]([email protected]):
|
[email protected]([email protected]):
|
||||||
dependencies:
|
dependencies:
|
||||||
@@ -2706,7 +2706,7 @@ snapshots:
|
|||||||
|
|
||||||
[email protected]: {}
|
[email protected]: {}
|
||||||
|
|
||||||
[email protected]4: {}
|
[email protected]2: {}
|
||||||
|
|
||||||
[email protected]:
|
[email protected]:
|
||||||
dependencies:
|
dependencies:
|
||||||
@@ -3040,7 +3040,7 @@ snapshots:
|
|||||||
|
|
||||||
[email protected]: {}
|
[email protected]: {}
|
||||||
|
|
||||||
[email protected].32:
|
[email protected]9:
|
||||||
dependencies:
|
dependencies:
|
||||||
nanoid: 3.3.20
|
nanoid: 3.3.20
|
||||||
picocolors: 1.1.1
|
picocolors: 1.1.1
|
||||||
@@ -3058,14 +3058,14 @@ snapshots:
|
|||||||
|
|
||||||
[email protected]: {}
|
[email protected]: {}
|
||||||
|
|
||||||
[email protected].1([email protected].1):
|
[email protected].0([email protected].0):
|
||||||
dependencies:
|
dependencies:
|
||||||
react: 19.3.1
|
react: 19.3.0
|
||||||
scheduler: 0.28.0
|
scheduler: 0.28.0
|
||||||
|
|
||||||
[email protected]: {}
|
[email protected]: {}
|
||||||
|
|
||||||
[email protected].1: {}
|
[email protected].0: {}
|
||||||
|
|
||||||
[email protected]:
|
[email protected]:
|
||||||
dependencies:
|
dependencies:
|
||||||
@@ -3098,26 +3098,26 @@ snapshots:
|
|||||||
path-parse: 1.0.7
|
path-parse: 1.0.7
|
||||||
supports-preserve-symlinks-flag: 1.0.0
|
supports-preserve-symlinks-flag: 1.0.0
|
||||||
|
|
||||||
[email protected]6:
|
[email protected]3:
|
||||||
dependencies:
|
dependencies:
|
||||||
'@oxc-project/types': 0.156.0
|
'@oxc-project/types': 0.153.0
|
||||||
'@rolldown/pluginutils': 1.0.1
|
'@rolldown/pluginutils': 1.0.1
|
||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
'@rolldown/binding-android-arm-eabi': 1.2.16
|
'@rolldown/binding-android-arm-eabi': 1.2.13
|
||||||
'@rolldown/binding-android-arm64': 1.2.16
|
'@rolldown/binding-android-arm64': 1.2.13
|
||||||
'@rolldown/binding-darwin-arm64': 1.2.16
|
'@rolldown/binding-darwin-arm64': 1.2.13
|
||||||
'@rolldown/binding-darwin-x64': 1.2.16
|
'@rolldown/binding-darwin-x64': 1.2.13
|
||||||
'@rolldown/binding-freebsd-x64': 1.2.16
|
'@rolldown/binding-freebsd-x64': 1.2.13
|
||||||
'@rolldown/binding-linux-arm-gnueabihf': 1.2.16
|
'@rolldown/binding-linux-arm-gnueabihf': 1.2.13
|
||||||
'@rolldown/binding-linux-arm64-gnu': 1.2.16
|
'@rolldown/binding-linux-arm64-gnu': 1.2.13
|
||||||
'@rolldown/binding-linux-arm64-musl': 1.2.16
|
'@rolldown/binding-linux-arm64-musl': 1.2.13
|
||||||
'@rolldown/binding-linux-ppc64-gnu': 1.2.16
|
'@rolldown/binding-linux-ppc64-gnu': 1.2.13
|
||||||
'@rolldown/binding-linux-s390x-gnu': 1.2.16
|
'@rolldown/binding-linux-s390x-gnu': 1.2.13
|
||||||
'@rolldown/binding-linux-x64-gnu': 1.2.16
|
'@rolldown/binding-linux-x64-gnu': 1.2.13
|
||||||
'@rolldown/binding-linux-x64-musl': 1.2.16
|
'@rolldown/binding-linux-x64-musl': 1.2.13
|
||||||
'@rolldown/binding-openharmony-arm64': 1.2.16
|
'@rolldown/binding-openharmony-arm64': 1.2.13
|
||||||
'@rolldown/binding-win32-arm64-msvc': 1.2.16
|
'@rolldown/binding-win32-arm64-msvc': 1.2.13
|
||||||
'@rolldown/binding-win32-x64-msvc': 1.2.16
|
'@rolldown/binding-win32-x64-msvc': 1.2.13
|
||||||
|
|
||||||
[email protected]:
|
[email protected]:
|
||||||
dependencies:
|
dependencies:
|
||||||
@@ -3326,15 +3326,15 @@ snapshots:
|
|||||||
dependencies:
|
dependencies:
|
||||||
punycode: 2.3.1
|
punycode: 2.3.1
|
||||||
|
|
||||||
[email protected].5(@types/[email protected].6)([email protected]):
|
[email protected].4(@types/[email protected].5)([email protected]):
|
||||||
dependencies:
|
dependencies:
|
||||||
lightningcss: 1.33.0
|
lightningcss: 1.33.0
|
||||||
picomatch: 4.0.7
|
picomatch: 4.0.7
|
||||||
postcss: 8.5.32
|
postcss: 8.5.29
|
||||||
rolldown: 1.2.16
|
rolldown: 1.2.13
|
||||||
tinyglobby: 0.2.17
|
tinyglobby: 0.2.17
|
||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
'@types/node': 26.6.6
|
'@types/node': 26.6.5
|
||||||
esbuild: 0.27.2
|
esbuild: 0.27.2
|
||||||
fsevents: 2.3.3
|
fsevents: 2.3.3
|
||||||
|
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 8.0 KiB After Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 38 KiB |
|
Before Width: | Height: | Size: 58 KiB After Width: | Height: | Size: 56 KiB |
@@ -1,53 +1,48 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" width="1024" height="1024" viewBox="0 0 1024 1024">
|
<svg xmlns="http://www.w3.org/2000/svg" width="1024" height="1024" viewBox="0 0 1024 1024">
|
||||||
<defs>
|
<defs>
|
||||||
<linearGradient id="ocean" x1="210.49524" y1="190.80952" x2="802.16190" y2="867.00000" gradientUnits="userSpaceOnUse">
|
<linearGradient id="ocean" x1="245" y1="170" x2="770" y2="770" gradientUnits="userSpaceOnUse">
|
||||||
<stop stop-color="#579bc1"/>
|
<stop stop-color="#579bc1"/>
|
||||||
<stop offset=".52" stop-color="#438fbd"/>
|
<stop offset=".52" stop-color="#438fbd"/>
|
||||||
<stop offset="1" stop-color="#2f719e"/>
|
<stop offset="1" stop-color="#2f719e"/>
|
||||||
</linearGradient>
|
</linearGradient>
|
||||||
<linearGradient id="land" x1="227.40000" y1="213.34921" x2="779.62222" y2="827.55556" gradientUnits="userSpaceOnUse">
|
<linearGradient id="land" x1="260" y1="190" x2="750" y2="735" gradientUnits="userSpaceOnUse">
|
||||||
<stop stop-color="#56c78a"/>
|
<stop stop-color="#56c78a"/>
|
||||||
<stop offset=".55" stop-color="#3bbf78"/>
|
<stop offset=".55" stop-color="#3bbf78"/>
|
||||||
<stop offset="1" stop-color="#279b5d"/>
|
<stop offset="1" stop-color="#279b5d"/>
|
||||||
</linearGradient>
|
</linearGradient>
|
||||||
|
<linearGradient id="lock" x1="385" y1="400" x2="650" y2="700" gradientUnits="userSpaceOnUse">
|
||||||
<filter id="globe-shadow" x="-20%" y="-20%" width="140%" height="150%" color-interpolation-filters="sRGB">
|
|
||||||
<feGaussianBlur in="SourceAlpha" stdDeviation="7" result="blur"/>
|
|
||||||
<feOffset in="blur" dy="6" result="offsetBlur"/>
|
|
||||||
<feFlood flood-color="#174D6F" flood-opacity="0.14" result="shadowColor"/>
|
|
||||||
<feComposite in="shadowColor" in2="offsetBlur" operator="in" result="shadow"/>
|
|
||||||
<feMerge><feMergeNode in="shadow"/><feMergeNode in="SourceGraphic"/></feMerge>
|
|
||||||
</filter>
|
|
||||||
|
|
||||||
|
|
||||||
<linearGradient id="shipped-lock" x1="385" y1="400" x2="650" y2="700" gradientUnits="userSpaceOnUse">
|
|
||||||
<stop stop-color="#f3b84c"/>
|
<stop stop-color="#f3b84c"/>
|
||||||
<stop offset=".55" stop-color="#e8a12f"/>
|
<stop offset=".55" stop-color="#e8a12f"/>
|
||||||
<stop offset="1" stop-color="#d4871e"/>
|
<stop offset="1" stop-color="#d4871e"/>
|
||||||
</linearGradient>
|
</linearGradient>
|
||||||
<filter id="shipped-lock-shadow" x="280" y="210" width="470" height="540" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
<clipPath id="globe-clip">
|
||||||
<feGaussianBlur in="SourceAlpha" stdDeviation="18" result="blur"/>
|
<circle cx="512" cy="455" r="315"/>
|
||||||
<feOffset in="blur" dx="0" dy="18" result="offsetBlur"/>
|
</clipPath>
|
||||||
<feFlood flood-color="#70430c" flood-opacity=".2" result="shadowColor"/>
|
<filter id="globe-shadow" x="150" y="90" width="730" height="760" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
||||||
<feComposite in="shadowColor" in2="offsetBlur" operator="in" result="shadow"/>
|
<feDropShadow dx="0" dy="8" stdDeviation="12" flood-color="#174d6f" flood-opacity=".14"/>
|
||||||
<feMerge><feMergeNode in="shadow"/><feMergeNode in="SourceGraphic"/></feMerge>
|
</filter>
|
||||||
</filter></defs>
|
<filter id="lock-shadow" x="280" y="210" width="470" height="540" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
||||||
<g transform="translate(512 512) scale(1.1535211267605634) translate(-511.4 -512)">
|
<feDropShadow dx="0" dy="18" stdDeviation="18" flood-color="#70430c" flood-opacity=".2"/>
|
||||||
<g filter="url(#globe-shadow)">
|
</filter>
|
||||||
<circle cx="511.4" cy="512" r="355" fill="url(#ocean)"/>
|
</defs>
|
||||||
<path d="m341.5 202.8c-83.71 44.8-148.5 123-170.9 210.4 10.88 28.67 32.13 48.77 54.14 63.49 13.18 8.96 18.94 19.84 17.15 31.87-3.84 26.5-46.85 37.89-50.3 71.3-2.688 27.78 17.54 52.74 46.46 67.71 21.76 11.39 35.2 25.73 41.34 44.29 13.44 39.17 32.64 82.56 68.99 105.5 30.08 18.94 46.85 12.67 41.09-1.92-6.144-15.36-26.37-32.13-26.24-53.63 0.128-27.39 26.5-41.98 31.49-62.72v-87.3c-18.69-0.896-30.59-9.216-40.19-19.71-16.51-17.41-37.76-29.44-55.68-36.86-10.37-4.352-12.67-12.8-13.7-22.66-0.896-11.39-6.144-20.74-15.1-28.16-12.8-10.62-19.97-22.53-18.3-34.82 1.92-15.62 17.28-26.5 36.74-29.44 37.25-6.144 70.53-34.69 74.11-63.49 1.792-14.46-5.504-24.32-2.816-33.66 4.864-21.12 34.18-38.14 65.02-51.71 24.83-10.88 45.7-20.61 45.95-39.81 0.256-20.22-20.74-32.9-60.03-33.41-22.53 0.128-46.08 2.56-69.25 4.736z" fill="url(#land)"/>
|
|
||||||
<path d="m663.7 191.5c-50.43 5.376-89.34 38.4-89.34 68.61 0 26.75 27.78 42.88 62.98 46.98 31.36 3.712 48.9 15.36 49.79 34.18 0.896 20.74-17.15 34.18-16.77 51.71 0.512 36.35 51.84 71.04 107.4 71.17 31.74 0.128 62.59-11.39 79.74-28.54-24.32-107.8-99.2-199.3-193.8-244.1z" fill="url(#land)"/>
|
|
||||||
<path d="m866.2 532c-19.46-9.216-42.62-13.7-66.18-13.7-57.47 0-102.1 34.05-102.1 60.8 0 11.9 6.144 19.97 13.06 26.75 11.52 11.52 17.66 25.73 17.66 42.24 0 29.18-22.53 45.06-22.53 73.34 0 26.88 18.69 47.36 39.04 57.73 71.42-61.31 117.6-154.6 121.1-247.2z" fill="url(#land)"/>
|
|
||||||
<circle cx="511.4" cy="512" r="347.111111" fill="none" stroke="#9ccde2" stroke-width="12.396825" stroke-opacity=".24"/>
|
|
||||||
|
|
||||||
</g>
|
|
||||||
</g>
|
|
||||||
<g transform="translate(512 512) scale(1.3) translate(-512 -455)">
|
<g transform="translate(512 512) scale(1.3) translate(-512 -455)">
|
||||||
<g transform="translate(512 490) scale(.82) translate(-512 -490)" filter="url(#shipped-lock-shadow)">
|
<g filter="url(#globe-shadow)">
|
||||||
|
<circle cx="512" cy="455" r="315" fill="url(#ocean)"/>
|
||||||
|
<g clip-path="url(#globe-clip)" fill="url(#land)">
|
||||||
|
<path d="M177 326c74-121 177-185 302-190-13 51-49 84-105 98-4 45-32 79-86 101-37 17-75 14-111-9Z"/>
|
||||||
|
<path d="M564 135c129 18 229 103 273 220-69-3-121 15-157 54-51-14-83-50-95-107-38-36-45-92-21-167Z"/>
|
||||||
|
<path d="M189 467c63-39 125-34 187 16 57 25 73 73 48 144-45 90-108 146-189 166-58-88-73-197-46-326Z"/>
|
||||||
|
<path d="M612 572c78-38 157-18 238 59-45 89-122 144-231 164-20-67-22-122-7-165-22-17-22-36 0-58Z"/>
|
||||||
|
</g>
|
||||||
|
<circle cx="512" cy="455" r="308" fill="none" stroke="#9ccde2" stroke-width="11" stroke-opacity=".24"/>
|
||||||
|
</g>
|
||||||
|
|
||||||
|
<g transform="translate(512 490) scale(.82) translate(-512 -490)" filter="url(#lock-shadow)">
|
||||||
<path d="M405 429v-75c0-142 214-142 214 0v75" fill="none" stroke="#eef1f2" stroke-width="58" stroke-linecap="round"/>
|
<path d="M405 429v-75c0-142 214-142 214 0v75" fill="none" stroke="#eef1f2" stroke-width="58" stroke-linecap="round"/>
|
||||||
<rect x="340" y="403" width="344" height="278" rx="62" fill="url(#shipped-lock)"/>
|
<rect x="340" y="403" width="344" height="278" rx="62" fill="url(#lock)"/>
|
||||||
<rect x="346" y="409" width="332" height="266" rx="56" fill="none" stroke="#f7cb75" stroke-width="10" stroke-opacity=".3"/>
|
<rect x="346" y="409" width="332" height="266" rx="56" fill="none" stroke="#f7cb75" stroke-width="10" stroke-opacity=".3"/>
|
||||||
<g fill="#85500f" opacity=".78" transform="translate(512 550.5) scale(1.2) translate(-512 -550.5)">
|
<g fill="#85500f" opacity=".78">
|
||||||
<path d="M501 538h22l16 69h-54Z"/>
|
<path d="M501 538h22l16 69h-54Z"/>
|
||||||
<circle cx="512" cy="521" r="27"/>
|
<circle cx="512" cy="521" r="27"/>
|
||||||
</g>
|
</g>
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 2.8 KiB |
@@ -1,6 +1,6 @@
|
|||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
use gpapi::{gui::GuiTheme, service::transport::SessionCredential};
|
use gpapi::service::transport::SessionCredential;
|
||||||
use log::info;
|
use log::info;
|
||||||
use tauri::{Listener, Manager};
|
use tauri::{Listener, Manager};
|
||||||
use tokio::sync::watch;
|
use tokio::sync::watch;
|
||||||
@@ -11,68 +11,30 @@ pub struct App {
|
|||||||
credential: Arc<SessionCredential>,
|
credential: Arc<SessionCredential>,
|
||||||
credential_lease: watch::Receiver<bool>,
|
credential_lease: watch::Receiver<bool>,
|
||||||
gui_version: String,
|
gui_version: String,
|
||||||
variant: gpapi::gui::GuiVariant,
|
|
||||||
theme: GuiTheme,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl App {
|
impl App {
|
||||||
pub fn new(
|
pub fn new(credential: Arc<SessionCredential>, credential_lease: watch::Receiver<bool>, gui_version: &str) -> Self {
|
||||||
credential: Arc<SessionCredential>,
|
|
||||||
credential_lease: watch::Receiver<bool>,
|
|
||||||
gui_version: &str,
|
|
||||||
variant: gpapi::gui::GuiVariant,
|
|
||||||
theme: GuiTheme,
|
|
||||||
) -> Self {
|
|
||||||
Self {
|
Self {
|
||||||
credential,
|
credential,
|
||||||
credential_lease,
|
credential_lease,
|
||||||
gui_version: gui_version.to_string(),
|
gui_version: gui_version.to_string(),
|
||||||
variant,
|
|
||||||
theme,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn run(&self) -> anyhow::Result<()> {
|
pub fn run(&self) -> anyhow::Result<()> {
|
||||||
let gui_version = self.gui_version.clone();
|
let gui_version = self.gui_version.clone();
|
||||||
let variant = self.variant;
|
|
||||||
let theme = self.theme;
|
|
||||||
let credential = Arc::clone(&self.credential);
|
let credential = Arc::clone(&self.credential);
|
||||||
let credential_lease = self.credential_lease.clone();
|
let credential_lease = self.credential_lease.clone();
|
||||||
|
|
||||||
tauri::Builder::default()
|
tauri::Builder::default()
|
||||||
.on_window_event(move |window, event| {
|
|
||||||
if theme == GuiTheme::System
|
|
||||||
&& let tauri::WindowEvent::ThemeChanged(theme) = event
|
|
||||||
&& let Some(win) = window.get_webview_window(window.label())
|
|
||||||
&& let Err(error) = win.set_background_color(Some(background_color(*theme)))
|
|
||||||
{
|
|
||||||
log::warn!("Could not update helper window background: {error}");
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.setup(move |app| {
|
.setup(move |app| {
|
||||||
let native_theme = match theme {
|
let win = app.get_webview_window("main").expect("no main window");
|
||||||
GuiTheme::System => None,
|
|
||||||
GuiTheme::Light => Some(tauri::Theme::Light),
|
|
||||||
GuiTheme::Dark => Some(tauri::Theme::Dark),
|
|
||||||
};
|
|
||||||
let config = app
|
|
||||||
.config()
|
|
||||||
.app
|
|
||||||
.windows
|
|
||||||
.iter()
|
|
||||||
.find(|window| window.label == "main")
|
|
||||||
.expect("no main window");
|
|
||||||
let win = tauri::WebviewWindowBuilder::from_config(app, config)?
|
|
||||||
.theme(native_theme)
|
|
||||||
.initialization_script(format!("window.__GP_HELPER_THEME__ = {:?};", theme.as_str()))
|
|
||||||
.visible(false)
|
|
||||||
.build()?;
|
|
||||||
win.set_background_color(Some(background_color(win.theme()?)))?;
|
|
||||||
let _ = win.hide_menu();
|
let _ = win.hide_menu();
|
||||||
|
|
||||||
let notifier = ProgressNotifier::new(win.clone());
|
let notifier = ProgressNotifier::new(win.clone());
|
||||||
let installer = Installer::new(credential, credential_lease.clone());
|
let installer = Installer::new(credential, credential_lease.clone());
|
||||||
let updater = Arc::new(GuiUpdater::new(gui_version, notifier, installer, variant));
|
let updater = Arc::new(GuiUpdater::new(gui_version, notifier, installer));
|
||||||
|
|
||||||
let app_handle = app.handle().clone();
|
let app_handle = app.handle().clone();
|
||||||
let mut app_credential_lease = credential_lease;
|
let mut app_credential_lease = credential_lease;
|
||||||
@@ -104,8 +66,6 @@ impl App {
|
|||||||
tokio::spawn(async move { updater.update().await });
|
tokio::spawn(async move { updater.update().await });
|
||||||
});
|
});
|
||||||
|
|
||||||
win.show()?;
|
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
})
|
})
|
||||||
.run(tauri::generate_context!())?;
|
.run(tauri::generate_context!())?;
|
||||||
@@ -113,10 +73,3 @@ impl App {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn background_color(theme: tauri::Theme) -> tauri::window::Color {
|
|
||||||
match theme {
|
|
||||||
tauri::Theme::Dark => tauri::window::Color(36, 36, 36, 255),
|
|
||||||
_ => tauri::window::Color(246, 245, 244, 255),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -4,7 +4,6 @@ use std::{io::Read, sync::Arc};
|
|||||||
use anyhow::{Context, bail};
|
use anyhow::{Context, bail};
|
||||||
use gpapi::{
|
use gpapi::{
|
||||||
clap::InfoLevelVerbosity,
|
clap::InfoLevelVerbosity,
|
||||||
gui::GuiTheme,
|
|
||||||
service::transport::{MAX_CREDENTIAL_FRAME, SessionCredential},
|
service::transport::{MAX_CREDENTIAL_FRAME, SessionCredential},
|
||||||
utils::env_utils,
|
utils::env_utils,
|
||||||
};
|
};
|
||||||
@@ -30,11 +29,6 @@ struct Cli {
|
|||||||
|
|
||||||
#[arg(long, default_value = env!("CARGO_PKG_VERSION"), help = "The version of the GUI")]
|
#[arg(long, default_value = env!("CARGO_PKG_VERSION"), help = "The version of the GUI")]
|
||||||
gui_version: String,
|
gui_version: String,
|
||||||
#[arg(long, default_value = "tauri", value_parser = ["tauri", "nsh"])]
|
|
||||||
gui_variant: String,
|
|
||||||
|
|
||||||
#[arg(long, value_enum, default_value = "system", help = "Window appearance")]
|
|
||||||
theme: GuiTheme,
|
|
||||||
|
|
||||||
#[command(flatten)]
|
#[command(flatten)]
|
||||||
verbose: InfoLevelVerbosity,
|
verbose: InfoLevelVerbosity,
|
||||||
@@ -44,22 +38,7 @@ impl Cli {
|
|||||||
fn run(&self) -> anyhow::Result<()> {
|
fn run(&self) -> anyhow::Result<()> {
|
||||||
let credential = self.read_credential()?;
|
let credential = self.read_credential()?;
|
||||||
let credential_lease = monitor_credential_lease().context("Failed to monitor service credential lifetime")?;
|
let credential_lease = monitor_credential_lease().context("Failed to monitor service credential lifetime")?;
|
||||||
let variant = if self.gui_variant == "nsh" {
|
let app = App::new(Arc::new(credential), credential_lease, &self.gui_version);
|
||||||
gpapi::gui::GuiVariant::Nsh
|
|
||||||
} else {
|
|
||||||
gpapi::gui::GuiVariant::Tauri
|
|
||||||
};
|
|
||||||
anyhow::ensure!(
|
|
||||||
variant != gpapi::gui::GuiVariant::Nsh || cfg!(target_os = "linux"),
|
|
||||||
"Native Shell is available only on Linux"
|
|
||||||
);
|
|
||||||
let app = App::new(
|
|
||||||
Arc::new(credential),
|
|
||||||
credential_lease,
|
|
||||||
&self.gui_version,
|
|
||||||
variant,
|
|
||||||
self.theme,
|
|
||||||
);
|
|
||||||
|
|
||||||
env_utils::patch_gui_runtime_env(false);
|
env_utils::patch_gui_runtime_env(false);
|
||||||
|
|
||||||
@@ -131,22 +110,6 @@ mod tests {
|
|||||||
|
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn theme_defaults_to_system_and_accepts_explicit_modes() {
|
|
||||||
assert_eq!(Cli::try_parse_from(["gpgui-helper"]).unwrap().theme, GuiTheme::System);
|
|
||||||
for (value, expected) in [
|
|
||||||
("system", GuiTheme::System),
|
|
||||||
("light", GuiTheme::Light),
|
|
||||||
("dark", GuiTheme::Dark),
|
|
||||||
] {
|
|
||||||
assert_eq!(
|
|
||||||
Cli::try_parse_from(["gpgui-helper", "--theme", value]).unwrap().theme,
|
|
||||||
expected
|
|
||||||
);
|
|
||||||
}
|
|
||||||
assert!(Cli::try_parse_from(["gpgui-helper", "--theme", "invalid"]).is_err());
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn credential_lease_closes_at_eof() {
|
fn credential_lease_closes_at_eof() {
|
||||||
let (lease_tx, lease_rx) = watch::channel(true);
|
let (lease_tx, lease_rx) = watch::channel(true);
|
||||||
|
|||||||
@@ -33,12 +33,7 @@ impl<'a> FileDownloader<'a> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub async fn download(&self) -> anyhow::Result<NamedTempFile> {
|
pub async fn download(&self) -> anyhow::Result<NamedTempFile> {
|
||||||
let res = gpapi::utils::request::client_builder()
|
let res = reqwest::get(self.url).await?.error_for_status()?;
|
||||||
.build()?
|
|
||||||
.get(self.url)
|
|
||||||
.send()
|
|
||||||
.await?
|
|
||||||
.error_for_status()?;
|
|
||||||
let content_length = res.content_length().unwrap_or(0);
|
let content_length = res.content_length().unwrap_or(0);
|
||||||
|
|
||||||
info!("Content length: {}", content_length);
|
info!("Content length: {}", content_length);
|
||||||
@@ -84,12 +79,7 @@ impl<'a> ChecksumFetcher<'a> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub async fn fetch(&self) -> anyhow::Result<String> {
|
pub async fn fetch(&self) -> anyhow::Result<String> {
|
||||||
let res = gpapi::utils::request::client_builder()
|
let res = reqwest::get(self.url).await?.error_for_status()?;
|
||||||
.build()?
|
|
||||||
.get(self.url)
|
|
||||||
.send()
|
|
||||||
.await?
|
|
||||||
.error_for_status()?;
|
|
||||||
let checksum = res.text().await?.trim().to_string();
|
let checksum = res.text().await?.trim().to_string();
|
||||||
|
|
||||||
Ok(checksum)
|
Ok(checksum)
|
||||||
|
|||||||
@@ -41,20 +41,10 @@ const GUI_LIBC_SUFFIX: &str = "-musl";
|
|||||||
#[cfg(not(target_env = "musl"))]
|
#[cfg(not(target_env = "musl"))]
|
||||||
const GUI_LIBC_SUFFIX: &str = "";
|
const GUI_LIBC_SUFFIX: &str = "";
|
||||||
|
|
||||||
fn gui_asset_name(variant: gpapi::gui::GuiVariant) -> Option<String> {
|
fn gui_asset_name() -> Option<String> {
|
||||||
if variant == gpapi::gui::GuiVariant::Nsh {
|
|
||||||
return nsh_asset_name_for(std::env::consts::OS, std::env::consts::ARCH);
|
|
||||||
}
|
|
||||||
gui_asset_name_for(std::env::consts::OS, std::env::consts::ARCH, GUI_LIBC_SUFFIX)
|
gui_asset_name_for(std::env::consts::OS, std::env::consts::ARCH, GUI_LIBC_SUFFIX)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn nsh_asset_name_for(os: &str, arch: &str) -> Option<String> {
|
|
||||||
match (os, arch) {
|
|
||||||
("linux", "x86_64" | "aarch64") => Some(format!("gpgui-nsh_{arch}.bin.tar.xz")),
|
|
||||||
_ => None,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn gui_asset_name_for(os: &str, arch: &str, libc_suffix: &str) -> Option<String> {
|
fn gui_asset_name_for(os: &str, arch: &str, libc_suffix: &str) -> Option<String> {
|
||||||
let name = match (os, arch) {
|
let name = match (os, arch) {
|
||||||
("linux", "x86_64" | "aarch64") => format!("gpgui_{arch}{libc_suffix}.bin.tar.xz"),
|
("linux", "x86_64" | "aarch64") => format!("gpgui_{arch}{libc_suffix}.bin.tar.xz"),
|
||||||
@@ -107,11 +97,10 @@ impl Installer {
|
|||||||
Self { command_tx }
|
Self { command_tx }
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn install(&self, path: &str, checksum: &str, variant: gpapi::gui::GuiVariant) -> anyhow::Result<()> {
|
async fn install(&self, path: &str, checksum: &str) -> anyhow::Result<()> {
|
||||||
let request = UpdateGuiRequest {
|
let request = UpdateGuiRequest {
|
||||||
path: path.to_string(),
|
path: path.to_string(),
|
||||||
checksum: checksum.to_string(),
|
checksum: checksum.to_string(),
|
||||||
variant,
|
|
||||||
};
|
};
|
||||||
let (reply, result) = oneshot::channel();
|
let (reply, result) = oneshot::channel();
|
||||||
self
|
self
|
||||||
@@ -374,7 +363,6 @@ async fn receive_binary(socket: &mut Socket) -> anyhow::Result<Vec<u8>> {
|
|||||||
|
|
||||||
pub struct GuiUpdater {
|
pub struct GuiUpdater {
|
||||||
version: String,
|
version: String,
|
||||||
variant: gpapi::gui::GuiVariant,
|
|
||||||
notifier: Arc<ProgressNotifier>,
|
notifier: Arc<ProgressNotifier>,
|
||||||
installer: Installer,
|
installer: Installer,
|
||||||
in_progress: RwLock<bool>,
|
in_progress: RwLock<bool>,
|
||||||
@@ -382,15 +370,9 @@ pub struct GuiUpdater {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl GuiUpdater {
|
impl GuiUpdater {
|
||||||
pub fn new(
|
pub fn new(version: String, notifier: ProgressNotifier, installer: Installer) -> Self {
|
||||||
version: String,
|
|
||||||
notifier: ProgressNotifier,
|
|
||||||
installer: Installer,
|
|
||||||
variant: gpapi::gui::GuiVariant,
|
|
||||||
) -> Self {
|
|
||||||
Self {
|
Self {
|
||||||
version,
|
version,
|
||||||
variant,
|
|
||||||
notifier: Arc::new(notifier),
|
notifier: Arc::new(notifier),
|
||||||
installer,
|
installer,
|
||||||
in_progress: Default::default(),
|
in_progress: Default::default(),
|
||||||
@@ -399,7 +381,7 @@ impl GuiUpdater {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub async fn update(&self) {
|
pub async fn update(&self) {
|
||||||
let Some(asset_name) = gui_asset_name(self.variant) else {
|
let Some(asset_name) = gui_asset_name() else {
|
||||||
info!("GUI updates are not supported on this platform.");
|
info!("GUI updates are not supported on this platform.");
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
@@ -456,7 +438,7 @@ impl GuiUpdater {
|
|||||||
|
|
||||||
info!("Checksum success");
|
info!("Checksum success");
|
||||||
|
|
||||||
if let Err(err) = self.installer.install(&file_path, &checksum, self.variant).await {
|
if let Err(err) = self.installer.install(&file_path, &checksum).await {
|
||||||
warn!("Install error: {}", err);
|
warn!("Install error: {}", err);
|
||||||
self.notify_error();
|
self.notify_error();
|
||||||
} else {
|
} else {
|
||||||
@@ -506,10 +488,13 @@ impl GuiUpdater {
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use gpapi::service::{
|
use gpapi::{
|
||||||
|
os_profile::HostIdentity,
|
||||||
|
service::{
|
||||||
transport::{ClientPrelude, NoiseResponder},
|
transport::{ClientPrelude, NoiseResponder},
|
||||||
vpn_env::{HostInfo, VpnEnv},
|
vpn_env::{HostInfo, VpnEnv},
|
||||||
vpn_state::VpnState,
|
vpn_state::VpnState,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
use tokio::net::TcpListener;
|
use tokio::net::TcpListener;
|
||||||
use tokio_tungstenite::accept_async;
|
use tokio_tungstenite::accept_async;
|
||||||
@@ -537,21 +522,6 @@ mod tests {
|
|||||||
assert_eq!(gui_asset_name_for("macos", "aarch64", ""), None);
|
assert_eq!(gui_asset_name_for("macos", "aarch64", ""), None);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn nsh_assets_are_linux_only_and_use_the_nsh_binary_archive() {
|
|
||||||
assert_eq!(
|
|
||||||
nsh_asset_name_for("linux", "x86_64"),
|
|
||||||
Some("gpgui-nsh_x86_64.bin.tar.xz".into())
|
|
||||||
);
|
|
||||||
assert_eq!(
|
|
||||||
nsh_asset_name_for("linux", "aarch64"),
|
|
||||||
Some("gpgui-nsh_aarch64.bin.tar.xz".into())
|
|
||||||
);
|
|
||||||
for os in ["freebsd", "openbsd", "macos"] {
|
|
||||||
assert_eq!(nsh_asset_name_for(os, "x86_64"), None);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn pending_install_reconnects_with_a_fresh_handshake() {
|
async fn pending_install_reconnects_with_a_fresh_handshake() {
|
||||||
let credential = Arc::new(SessionCredential::generate(Uuid::new_v4(), env!("CARGO_PKG_VERSION")).unwrap());
|
let credential = Arc::new(SessionCredential::generate(Uuid::new_v4(), env!("CARGO_PKG_VERSION")).unwrap());
|
||||||
@@ -562,7 +532,6 @@ mod tests {
|
|||||||
request: UpdateGuiRequest {
|
request: UpdateGuiRequest {
|
||||||
path: "/tmp/gpgui-update".to_owned(),
|
path: "/tmp/gpgui-update".to_owned(),
|
||||||
checksum: "checksum".to_owned(),
|
checksum: "checksum".to_owned(),
|
||||||
variant: gpapi::gui::GuiVariant::Tauri,
|
|
||||||
},
|
},
|
||||||
reply: reply_tx,
|
reply: reply_tx,
|
||||||
})
|
})
|
||||||
@@ -666,7 +635,7 @@ mod tests {
|
|||||||
vpnc_script: None,
|
vpnc_script: None,
|
||||||
auth_executable: String::new(),
|
auth_executable: String::new(),
|
||||||
host_info: HostInfo {
|
host_info: HostInfo {
|
||||||
host_identity: gpapi::os_profile::desktop::collect_identity(),
|
host_identity: HostIdentity::collect(),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -25,7 +25,6 @@
|
|||||||
"maxWidth": 460,
|
"maxWidth": 460,
|
||||||
"maxHeight": 104,
|
"maxHeight": 104,
|
||||||
"label": "main",
|
"label": "main",
|
||||||
"create": false,
|
|
||||||
"decorations": false
|
"decorations": false
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,41 +1,40 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" width="1024" height="1024" viewBox="0 0 1024 1024">
|
<svg xmlns="http://www.w3.org/2000/svg" width="1024" height="1024" viewBox="0 0 1024 1024">
|
||||||
<defs>
|
<defs>
|
||||||
<linearGradient id="ocean" x1="210.49524" y1="190.80952" x2="802.16190" y2="867.00000" gradientUnits="userSpaceOnUse">
|
<linearGradient id="ocean" x1="245" y1="170" x2="770" y2="770" gradientUnits="userSpaceOnUse">
|
||||||
<stop stop-color="#579bc1"/>
|
<stop stop-color="#579bc1"/>
|
||||||
<stop offset=".52" stop-color="#438fbd"/>
|
<stop offset=".52" stop-color="#438fbd"/>
|
||||||
<stop offset="1" stop-color="#2f719e"/>
|
<stop offset="1" stop-color="#2f719e"/>
|
||||||
</linearGradient>
|
</linearGradient>
|
||||||
<linearGradient id="land" x1="227.40000" y1="213.34921" x2="779.62222" y2="827.55556" gradientUnits="userSpaceOnUse">
|
<linearGradient id="land" x1="260" y1="190" x2="750" y2="735" gradientUnits="userSpaceOnUse">
|
||||||
<stop stop-color="#56c78a"/>
|
<stop stop-color="#56c78a"/>
|
||||||
<stop offset=".55" stop-color="#3bbf78"/>
|
<stop offset=".55" stop-color="#3bbf78"/>
|
||||||
<stop offset="1" stop-color="#279b5d"/>
|
<stop offset="1" stop-color="#279b5d"/>
|
||||||
</linearGradient>
|
</linearGradient>
|
||||||
|
<linearGradient id="lock" x1="385" y1="400" x2="650" y2="700" gradientUnits="userSpaceOnUse">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<linearGradient id="shipped-lock" x1="385" y1="400" x2="650" y2="700" gradientUnits="userSpaceOnUse">
|
|
||||||
<stop stop-color="#f3b84c"/>
|
<stop stop-color="#f3b84c"/>
|
||||||
<stop offset=".55" stop-color="#e8a12f"/>
|
<stop offset=".55" stop-color="#e8a12f"/>
|
||||||
<stop offset="1" stop-color="#d4871e"/>
|
<stop offset="1" stop-color="#d4871e"/>
|
||||||
</linearGradient>
|
</linearGradient>
|
||||||
|
<clipPath id="globe-clip">
|
||||||
|
<circle cx="512" cy="455" r="315"/>
|
||||||
|
</clipPath>
|
||||||
</defs>
|
</defs>
|
||||||
<g transform="translate(512 512) scale(1.1535211267605634) translate(-511.4 -512)">
|
|
||||||
<g>
|
|
||||||
<circle cx="511.4" cy="512" r="355" fill="url(#ocean)"/>
|
|
||||||
<path d="m341.5 202.8c-83.71 44.8-148.5 123-170.9 210.4 10.88 28.67 32.13 48.77 54.14 63.49 13.18 8.96 18.94 19.84 17.15 31.87-3.84 26.5-46.85 37.89-50.3 71.3-2.688 27.78 17.54 52.74 46.46 67.71 21.76 11.39 35.2 25.73 41.34 44.29 13.44 39.17 32.64 82.56 68.99 105.5 30.08 18.94 46.85 12.67 41.09-1.92-6.144-15.36-26.37-32.13-26.24-53.63 0.128-27.39 26.5-41.98 31.49-62.72v-87.3c-18.69-0.896-30.59-9.216-40.19-19.71-16.51-17.41-37.76-29.44-55.68-36.86-10.37-4.352-12.67-12.8-13.7-22.66-0.896-11.39-6.144-20.74-15.1-28.16-12.8-10.62-19.97-22.53-18.3-34.82 1.92-15.62 17.28-26.5 36.74-29.44 37.25-6.144 70.53-34.69 74.11-63.49 1.792-14.46-5.504-24.32-2.816-33.66 4.864-21.12 34.18-38.14 65.02-51.71 24.83-10.88 45.7-20.61 45.95-39.81 0.256-20.22-20.74-32.9-60.03-33.41-22.53 0.128-46.08 2.56-69.25 4.736z" fill="url(#land)"/>
|
|
||||||
<path d="m663.7 191.5c-50.43 5.376-89.34 38.4-89.34 68.61 0 26.75 27.78 42.88 62.98 46.98 31.36 3.712 48.9 15.36 49.79 34.18 0.896 20.74-17.15 34.18-16.77 51.71 0.512 36.35 51.84 71.04 107.4 71.17 31.74 0.128 62.59-11.39 79.74-28.54-24.32-107.8-99.2-199.3-193.8-244.1z" fill="url(#land)"/>
|
|
||||||
<path d="m866.2 532c-19.46-9.216-42.62-13.7-66.18-13.7-57.47 0-102.1 34.05-102.1 60.8 0 11.9 6.144 19.97 13.06 26.75 11.52 11.52 17.66 25.73 17.66 42.24 0 29.18-22.53 45.06-22.53 73.34 0 26.88 18.69 47.36 39.04 57.73 71.42-61.31 117.6-154.6 121.1-247.2z" fill="url(#land)"/>
|
|
||||||
<circle cx="511.4" cy="512" r="347.111111" fill="none" stroke="#9ccde2" stroke-width="12.396825" stroke-opacity=".4"/>
|
|
||||||
|
|
||||||
</g>
|
|
||||||
</g>
|
|
||||||
<g transform="translate(512 512) scale(1.3) translate(-512 -455)">
|
<g transform="translate(512 512) scale(1.3) translate(-512 -455)">
|
||||||
|
<circle cx="512" cy="455" r="315" fill="url(#ocean)"/>
|
||||||
|
<g clip-path="url(#globe-clip)" fill="url(#land)">
|
||||||
|
<path d="M177 326c74-121 177-185 302-190-13 51-49 84-105 98-4 45-32 79-86 101-37 17-75 14-111-9Z"/>
|
||||||
|
<path d="M564 135c129 18 229 103 273 220-69-3-121 15-157 54-51-14-83-50-95-107-38-36-45-92-21-167Z"/>
|
||||||
|
<path d="M189 467c63-39 125-34 187 16 57 25 73 73 48 144-45 90-108 146-189 166-58-88-73-197-46-326Z"/>
|
||||||
|
<path d="M612 572c78-38 157-18 238 59-45 89-122 144-231 164-20-67-22-122-7-165-22-17-22-36 0-58Z"/>
|
||||||
|
</g>
|
||||||
|
<circle cx="512" cy="455" r="308" fill="none" stroke="#9ccde2" stroke-width="11" stroke-opacity=".4"/>
|
||||||
|
|
||||||
<g transform="translate(512 490) scale(.82) translate(-512 -490)">
|
<g transform="translate(512 490) scale(.82) translate(-512 -490)">
|
||||||
<path d="M405 429v-75c0-142 214-142 214 0v75" fill="none" stroke="#eef1f2" stroke-width="58" stroke-linecap="round"/>
|
<path d="M405 429v-75c0-142 214-142 214 0v75" fill="none" stroke="#eef1f2" stroke-width="58" stroke-linecap="round"/>
|
||||||
<rect x="340" y="403" width="344" height="278" rx="62" fill="url(#shipped-lock)"/>
|
<rect x="340" y="403" width="344" height="278" rx="62" fill="url(#lock)"/>
|
||||||
<rect x="346" y="409" width="332" height="266" rx="56" fill="none" stroke="#f7cb75" stroke-width="10" stroke-opacity=".3"/>
|
<rect x="346" y="409" width="332" height="266" rx="56" fill="none" stroke="#f7cb75" stroke-width="10" stroke-opacity=".45"/>
|
||||||
<g fill="#85500f" opacity=".78" transform="translate(512 550.5) scale(1.2) translate(-512 -550.5)">
|
<g fill="#85500f" opacity=".85">
|
||||||
<path d="M501 538h22l16 69h-54Z"/>
|
<path d="M501 538h22l16 69h-54Z"/>
|
||||||
<circle cx="512" cy="521" r="27"/>
|
<circle cx="512" cy="521" r="27"/>
|
||||||
</g>
|
</g>
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 2.2 KiB |
@@ -1,33 +1,3 @@
|
|||||||
:root {
|
|
||||||
color-scheme: light;
|
|
||||||
--background: #f6f5f4;
|
|
||||||
--foreground: #2e3436;
|
|
||||||
--muted-foreground: #5e5c64;
|
|
||||||
--progress-label: #3d3846;
|
|
||||||
--progress-track: #d5d3d1;
|
|
||||||
--progress-fill: #3584e4;
|
|
||||||
--error: #9c2f2f;
|
|
||||||
--button: #1c71d8;
|
|
||||||
--button-hover: #1a5fb4;
|
|
||||||
--button-active: #174a8b;
|
|
||||||
--focus-ring: #1a5fb4;
|
|
||||||
}
|
|
||||||
|
|
||||||
:root[data-theme="dark"] {
|
|
||||||
color-scheme: dark;
|
|
||||||
--background: #242424;
|
|
||||||
--foreground: #ffffff;
|
|
||||||
--muted-foreground: #c0bfbc;
|
|
||||||
--progress-label: #deddda;
|
|
||||||
--progress-track: #454545;
|
|
||||||
--progress-fill: #78aeed;
|
|
||||||
--error: #ffb4ab;
|
|
||||||
--button: #1c71d8;
|
|
||||||
--button-hover: #3584e4;
|
|
||||||
--button-active: #1a5fb4;
|
|
||||||
--focus-ring: #78aeed;
|
|
||||||
}
|
|
||||||
|
|
||||||
html,
|
html,
|
||||||
body,
|
body,
|
||||||
#root {
|
#root {
|
||||||
@@ -42,8 +12,8 @@ body,
|
|||||||
}
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
background: var(--background);
|
background: #f6f5f4;
|
||||||
color: var(--foreground);
|
color: #2e3436;
|
||||||
font-family:
|
font-family:
|
||||||
Inter,
|
Inter,
|
||||||
ui-sans-serif,
|
ui-sans-serif,
|
||||||
@@ -65,7 +35,7 @@ button {
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
padding: 16px 18px;
|
padding: 16px 18px;
|
||||||
gap: 15px;
|
gap: 15px;
|
||||||
background: var(--background);
|
background: #f6f5f4;
|
||||||
}
|
}
|
||||||
|
|
||||||
.update-logo {
|
.update-logo {
|
||||||
@@ -82,7 +52,7 @@ button {
|
|||||||
|
|
||||||
.update-title {
|
.update-title {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
color: var(--foreground);
|
color: #2e3436;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
line-height: 1.25;
|
line-height: 1.25;
|
||||||
@@ -91,7 +61,7 @@ button {
|
|||||||
|
|
||||||
.update-description {
|
.update-description {
|
||||||
margin: 3px 0 0;
|
margin: 3px 0 0;
|
||||||
color: var(--muted-foreground);
|
color: #5e5c64;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
line-height: 1.4;
|
line-height: 1.4;
|
||||||
}
|
}
|
||||||
@@ -115,13 +85,13 @@ button {
|
|||||||
margin-top: 9px;
|
margin-top: 9px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
background-color: var(--progress-track);
|
background-color: #d5d3d1;
|
||||||
}
|
}
|
||||||
|
|
||||||
.progress-fill {
|
.progress-fill {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
background: var(--progress-fill);
|
background: #3584e4;
|
||||||
transition: width 180ms ease-out;
|
transition: width 180ms ease-out;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -153,7 +123,7 @@ button {
|
|||||||
|
|
||||||
.progress-label {
|
.progress-label {
|
||||||
flex: 0 0 auto;
|
flex: 0 0 auto;
|
||||||
color: var(--progress-label);
|
color: #3d3846;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
font-variant-numeric: tabular-nums;
|
font-variant-numeric: tabular-nums;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
@@ -169,7 +139,7 @@ button {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.error-status .update-title {
|
.error-status .update-title {
|
||||||
color: var(--error);
|
color: #9c2f2f;
|
||||||
}
|
}
|
||||||
|
|
||||||
.error-copy {
|
.error-copy {
|
||||||
@@ -181,23 +151,23 @@ button {
|
|||||||
padding: 4px 14px;
|
padding: 4px 14px;
|
||||||
border: 0;
|
border: 0;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
background: var(--button);
|
background: #1c71d8;
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
cursor: default;
|
cursor: pointer;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
}
|
}
|
||||||
|
|
||||||
.retry-button:hover {
|
.retry-button:hover {
|
||||||
background: var(--button-hover);
|
background: #1a5fb4;
|
||||||
}
|
}
|
||||||
|
|
||||||
.retry-button:active {
|
.retry-button:active {
|
||||||
background: var(--button-active);
|
background: #174a8b;
|
||||||
}
|
}
|
||||||
|
|
||||||
.retry-button:focus-visible {
|
.retry-button:focus-visible {
|
||||||
outline: 2px solid var(--focus-ring);
|
outline: 2px solid #1a5fb4;
|
||||||
outline-offset: 2px;
|
outline-offset: 2px;
|
||||||
}
|
}
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
import { readFileSync } from "node:fs";
|
|
||||||
import { runInNewContext } from "node:vm";
|
|
||||||
import { test } from "node:test";
|
|
||||||
import assert from "node:assert/strict";
|
|
||||||
|
|
||||||
const html = readFileSync(new URL("../index.html", import.meta.url), "utf8");
|
|
||||||
const script = html.match(/<script>([\s\S]*?)<\/script>/)[1];
|
|
||||||
|
|
||||||
function load(theme, dark) {
|
|
||||||
const root = { dataset: {} };
|
|
||||||
let changed;
|
|
||||||
const media = {
|
|
||||||
matches: dark,
|
|
||||||
addEventListener(event, listener) {
|
|
||||||
assert.equal(event, "change");
|
|
||||||
changed = listener;
|
|
||||||
},
|
|
||||||
};
|
|
||||||
runInNewContext(script, {
|
|
||||||
window: { __GP_HELPER_THEME__: theme },
|
|
||||||
document: { documentElement: root },
|
|
||||||
matchMedia(query) {
|
|
||||||
assert.equal(query, "(prefers-color-scheme: dark)");
|
|
||||||
return media;
|
|
||||||
},
|
|
||||||
});
|
|
||||||
return { root, change(dark) { media.matches = dark; changed?.(); } };
|
|
||||||
}
|
|
||||||
|
|
||||||
test("default and explicit system modes follow system changes before React starts", () => {
|
|
||||||
for (const theme of [undefined, "system"]) {
|
|
||||||
for (const dark of [false, true]) {
|
|
||||||
const page = load(theme, dark);
|
|
||||||
assert.equal(page.root.dataset.theme, dark ? "dark" : "light");
|
|
||||||
page.change(!dark);
|
|
||||||
assert.equal(page.root.dataset.theme, dark ? "light" : "dark");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
test("explicit modes override opposite system appearance and ignore system changes", () => {
|
|
||||||
for (const theme of ["light", "dark"]) {
|
|
||||||
const page = load(theme, theme !== "dark");
|
|
||||||
assert.equal(page.root.dataset.theme, theme);
|
|
||||||
page.change(theme === "dark");
|
|
||||||
assert.equal(page.root.dataset.theme, theme);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
@@ -2,7 +2,6 @@
|
|||||||
name = "gpservice"
|
name = "gpservice"
|
||||||
version.workspace = true
|
version.workspace = true
|
||||||
edition.workspace = true
|
edition.workspace = true
|
||||||
rust-version.workspace = true
|
|
||||||
license.workspace = true
|
license.workspace = true
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
@@ -37,7 +36,7 @@ nix = { version = "0.31", features = ["fs", "socket", "user"] }
|
|||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
openssl.workspace = true
|
openssl.workspace = true
|
||||||
tokio-tungstenite.workspace = true
|
tokio-tungstenite = "0.29"
|
||||||
|
|
||||||
[target.'cfg(target_os = "macos")'.dependencies]
|
[target.'cfg(target_os = "macos")'.dependencies]
|
||||||
gpvpnc = { path = "../../crates/gpvpnc" }
|
gpvpnc = { path = "../../crates/gpvpnc" }
|
||||||
@@ -17,10 +17,7 @@ use tokio::io::unix::AsyncFd;
|
|||||||
use tokio_util::sync::CancellationToken;
|
use tokio_util::sync::CancellationToken;
|
||||||
|
|
||||||
use crate::session_registry::SessionRegistry;
|
use crate::session_registry::SessionRegistry;
|
||||||
use gpapi::service::transport::{
|
use gpapi::service::transport::{DESKTOP_GUI_EXITED, DESKTOP_RENDERING_RETRY};
|
||||||
DESKTOP_GUI_EXITED, DESKTOP_GUI_INSTALLER, DESKTOP_RENDERING_RETRY, DESKTOP_SWITCH_BEGIN, DESKTOP_SWITCH_CANCEL,
|
|
||||||
DESKTOP_SWITCH_COMMIT,
|
|
||||||
};
|
|
||||||
|
|
||||||
/// Private parent/service pipes; credentials never pass through argv, environment or files.
|
/// Private parent/service pipes; credentials never pass through argv, environment or files.
|
||||||
pub(crate) struct DesktopClient {
|
pub(crate) struct DesktopClient {
|
||||||
@@ -47,8 +44,7 @@ impl DesktopClient {
|
|||||||
fcntl(&fd, FcntlArg::F_SETFD(FdFlag::FD_CLOEXEC))?;
|
fcntl(&fd, FcntlArg::F_SETFD(FdFlag::FD_CLOEXEC))?;
|
||||||
let flags = OFlag::from_bits_truncate(fcntl(&fd, FcntlArg::F_GETFL)?);
|
let flags = OFlag::from_bits_truncate(fcntl(&fd, FcntlArg::F_GETFL)?);
|
||||||
fcntl(&fd, FcntlArg::F_SETFL(flags | OFlag::O_NONBLOCK))?;
|
fcntl(&fd, FcntlArg::F_SETFL(flags | OFlag::O_NONBLOCK))?;
|
||||||
// SAFETY: OwnedFd keeps this descriptor open and unchanged until AsyncFd drops it.
|
Ok(AsyncFd::new(fd)?)
|
||||||
Ok(unsafe { AsyncFd::register(fd) }?)
|
|
||||||
}
|
}
|
||||||
Ok(Self {
|
Ok(Self {
|
||||||
input: pipe(input)?,
|
input: pipe(input)?,
|
||||||
@@ -66,41 +62,15 @@ impl DesktopClient {
|
|||||||
let mut rendering_renewed = false;
|
let mut rendering_renewed = false;
|
||||||
loop {
|
loop {
|
||||||
let credential = registry.issue(env!("CARGO_PKG_VERSION"), Some(uid))?;
|
let credential = registry.issue(env!("CARGO_PKG_VERSION"), Some(uid))?;
|
||||||
let mut session_id = credential.session_id();
|
let session_id = credential.session_id();
|
||||||
let mut pending = None;
|
|
||||||
let result = tokio::select! {
|
let result = tokio::select! {
|
||||||
_ = cancel.cancelled() => Ok(None),
|
_ = cancel.cancelled() => Ok(None),
|
||||||
result = async {
|
result = async {
|
||||||
self.write_all(&credential.encode_frame()?).await?;
|
self.write_frame(&credential.encode_frame()?).await?;
|
||||||
loop {
|
self.gui_exited().await
|
||||||
match self.read_control().await? {
|
|
||||||
Some(DESKTOP_GUI_INSTALLER) => {
|
|
||||||
self.write_all(&[u8::from(crate::request_dispatcher::gui_installer().is_some())]).await?;
|
|
||||||
}
|
|
||||||
Some(DESKTOP_SWITCH_BEGIN) => {
|
|
||||||
ensure!(pending.is_none(), "A GUI switch is already pending");
|
|
||||||
let credential = registry.issue(env!("CARGO_PKG_VERSION"), Some(uid))?;
|
|
||||||
pending = Some(credential.session_id());
|
|
||||||
self.write_all(&credential.encode_frame()?).await?;
|
|
||||||
}
|
|
||||||
Some(DESKTOP_SWITCH_COMMIT) => {
|
|
||||||
let replacement = pending.take().context("No GUI switch is pending")?;
|
|
||||||
registry.revoke(session_id);
|
|
||||||
session_id = replacement;
|
|
||||||
}
|
|
||||||
Some(DESKTOP_SWITCH_CANCEL) => {
|
|
||||||
let replacement = pending.take().context("No GUI switch is pending")?;
|
|
||||||
registry.revoke(replacement);
|
|
||||||
}
|
|
||||||
message => break Ok(message),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} => result,
|
} => result,
|
||||||
};
|
};
|
||||||
registry.revoke(session_id);
|
registry.revoke(session_id);
|
||||||
if let Some(session_id) = pending {
|
|
||||||
registry.revoke(session_id);
|
|
||||||
}
|
|
||||||
let requested = restart.swap(false, Ordering::SeqCst);
|
let requested = restart.swap(false, Ordering::SeqCst);
|
||||||
match result? {
|
match result? {
|
||||||
None => return Ok(()),
|
None => return Ok(()),
|
||||||
@@ -115,7 +85,7 @@ impl DesktopClient {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn write_all(&self, mut bytes: &[u8]) -> anyhow::Result<()> {
|
async fn write_frame(&self, mut bytes: &[u8]) -> anyhow::Result<()> {
|
||||||
while !bytes.is_empty() {
|
while !bytes.is_empty() {
|
||||||
let mut ready = self.output.writable().await?;
|
let mut ready = self.output.writable().await?;
|
||||||
match ready.try_io(|fd| write(fd.get_ref(), bytes).map_err(io::Error::from)) {
|
match ready.try_io(|fd| write(fd.get_ref(), bytes).map_err(io::Error::from)) {
|
||||||
@@ -130,7 +100,7 @@ impl DesktopClient {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn read_control(&self) -> anyhow::Result<Option<u8>> {
|
async fn gui_exited(&self) -> anyhow::Result<Option<u8>> {
|
||||||
loop {
|
loop {
|
||||||
let mut ready = self.input.readable().await?;
|
let mut ready = self.input.readable().await?;
|
||||||
let mut byte = [0];
|
let mut byte = [0];
|
||||||
@@ -175,7 +145,7 @@ mod tests {
|
|||||||
.unwrap()
|
.unwrap()
|
||||||
.success()
|
.success()
|
||||||
);
|
);
|
||||||
channel.write_all(b"PRIVATE_FRAME").await.unwrap();
|
channel.write_frame(b"PRIVATE_FRAME").await.unwrap();
|
||||||
}
|
}
|
||||||
use gpapi::service::transport::SessionCredential;
|
use gpapi::service::transport::SessionCredential;
|
||||||
use nix::unistd::pipe;
|
use nix::unistd::pipe;
|
||||||
@@ -283,54 +253,6 @@ mod tests {
|
|||||||
assert!(registry.last_successful_hip_report(issued.session_id()).is_err());
|
assert!(registry.last_successful_hip_report(issued.session_id()).is_err());
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
|
||||||
async fn switch_cancel_preserves_current_session_and_commit_replaces_it() {
|
|
||||||
let (channel, control, reader) = pipes();
|
|
||||||
let registry = Arc::new(SessionRegistry::for_tests(uuid::Uuid::new_v4()));
|
|
||||||
let task = tokio::spawn(channel.serve(
|
|
||||||
registry.clone(),
|
|
||||||
1000,
|
|
||||||
Arc::new(AtomicBool::new(false)),
|
|
||||||
CancellationToken::new(),
|
|
||||||
));
|
|
||||||
let (reader, first) = credential(reader).await;
|
|
||||||
write(&control, &[DESKTOP_GUI_INSTALLER]).unwrap();
|
|
||||||
let reader = tokio::task::spawn_blocking(move || {
|
|
||||||
let mut reader = reader;
|
|
||||||
let mut capability = [0];
|
|
||||||
reader.read_exact(&mut capability).unwrap();
|
|
||||||
assert_eq!(
|
|
||||||
capability[0],
|
|
||||||
u8::from(crate::request_dispatcher::gui_installer().is_some())
|
|
||||||
);
|
|
||||||
reader
|
|
||||||
})
|
|
||||||
.await
|
|
||||||
.unwrap();
|
|
||||||
// A capability query leaves the current session intact and the next frame readable.
|
|
||||||
assert!(registry.last_successful_hip_report(first.session_id()).is_ok());
|
|
||||||
write(&control, &[DESKTOP_SWITCH_BEGIN]).unwrap();
|
|
||||||
let (reader, cancelled) = credential(reader).await;
|
|
||||||
assert_ne!(first.session_id(), cancelled.session_id());
|
|
||||||
assert!(registry.last_successful_hip_report(first.session_id()).is_ok());
|
|
||||||
write(&control, &[DESKTOP_SWITCH_CANCEL, DESKTOP_SWITCH_BEGIN]).unwrap();
|
|
||||||
let (reader, replacement) = credential(reader).await;
|
|
||||||
assert!(registry.last_successful_hip_report(cancelled.session_id()).is_err());
|
|
||||||
assert!(registry.last_successful_hip_report(first.session_id()).is_ok());
|
|
||||||
write(&control, &[DESKTOP_SWITCH_COMMIT, DESKTOP_SWITCH_BEGIN]).unwrap();
|
|
||||||
let (_, pending) = credential(reader).await;
|
|
||||||
assert!(registry.last_successful_hip_report(first.session_id()).is_err());
|
|
||||||
assert!(registry.last_successful_hip_report(replacement.session_id()).is_ok());
|
|
||||||
drop(control);
|
|
||||||
tokio::time::timeout(Duration::from_secs(1), task)
|
|
||||||
.await
|
|
||||||
.unwrap()
|
|
||||||
.unwrap()
|
|
||||||
.unwrap();
|
|
||||||
assert!(registry.last_successful_hip_report(replacement.session_id()).is_err());
|
|
||||||
assert!(registry.last_successful_hip_report(pending.session_id()).is_err());
|
|
||||||
}
|
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn desktop_channel_rejects_invalid_control_messages_and_revokes() {
|
async fn desktop_channel_rejects_invalid_control_messages_and_revokes() {
|
||||||
let (channel, control, reader) = pipes();
|
let (channel, control, reader) = pipes();
|
||||||
|
|||||||
@@ -87,14 +87,14 @@ pub fn install(request: InstallRequest, approving_uid: u32) -> anyhow::Result<Ap
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn resolve(approval_id: &str, desktop_uid: u32) -> anyhow::Result<ApprovedScript> {
|
pub fn resolve(approval_id: &str, desktop_uid: u32) -> anyhow::Result<ApprovedScript> {
|
||||||
let budget = gpapi::collection::CollectionBudget::new(std::time::Duration::from_secs(60));
|
let budget = gpapi::process::collection::CollectionBudget::new(std::time::Duration::from_secs(60));
|
||||||
resolve_with_control(approval_id, desktop_uid, &budget)
|
resolve_with_control(approval_id, desktop_uid, &budget)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn resolve_with_control(
|
pub fn resolve_with_control(
|
||||||
approval_id: &str,
|
approval_id: &str,
|
||||||
desktop_uid: u32,
|
desktop_uid: u32,
|
||||||
control: &dyn gpapi::collection::CollectionControl,
|
control: &dyn gpapi::process::collection::CollectionControl,
|
||||||
) -> anyhow::Result<ApprovedScript> {
|
) -> anyhow::Result<ApprovedScript> {
|
||||||
control.check()?;
|
control.check()?;
|
||||||
ensure!(desktop_uid != 0, "Root is not a desktop HIP approval owner");
|
ensure!(desktop_uid != 0, "Root is not a desktop HIP approval owner");
|
||||||
@@ -199,7 +199,7 @@ fn install_at(
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn resolve_at(base: &Path, approval_id: &str, desktop_uid: u32, file_owner: u32) -> anyhow::Result<ApprovedScript> {
|
fn resolve_at(base: &Path, approval_id: &str, desktop_uid: u32, file_owner: u32) -> anyhow::Result<ApprovedScript> {
|
||||||
let budget = gpapi::collection::CollectionBudget::new(std::time::Duration::from_secs(60));
|
let budget = gpapi::process::collection::CollectionBudget::new(std::time::Duration::from_secs(60));
|
||||||
resolve_at_with_control(base, approval_id, desktop_uid, file_owner, &budget)
|
resolve_at_with_control(base, approval_id, desktop_uid, file_owner, &budget)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -208,7 +208,7 @@ fn resolve_at_with_control(
|
|||||||
approval_id: &str,
|
approval_id: &str,
|
||||||
desktop_uid: u32,
|
desktop_uid: u32,
|
||||||
file_owner: u32,
|
file_owner: u32,
|
||||||
control: &dyn gpapi::collection::CollectionControl,
|
control: &dyn gpapi::process::collection::CollectionControl,
|
||||||
) -> anyhow::Result<ApprovedScript> {
|
) -> anyhow::Result<ApprovedScript> {
|
||||||
control.check()?;
|
control.check()?;
|
||||||
let info = read_metadata_at(base, approval_id, desktop_uid, file_owner)?;
|
let info = read_metadata_at(base, approval_id, desktop_uid, file_owner)?;
|
||||||
|
|||||||
@@ -158,12 +158,12 @@ fn generate(
|
|||||||
request.host_id.as_ref().is_none_or(|id| id.len() <= 256),
|
request.host_id.as_ref().is_none_or(|id| id.len() <= 256),
|
||||||
"Invalid HIP host ID"
|
"Invalid HIP host ID"
|
||||||
);
|
);
|
||||||
let budget = gpapi::collection::CollectionBudget::new(PREVIEW_TIMEOUT);
|
let budget = gpapi::process::collection::CollectionBudget::new(PREVIEW_TIMEOUT);
|
||||||
let check = || {
|
let check = || {
|
||||||
if cancellation.is_cancelled() {
|
if cancellation.is_cancelled() {
|
||||||
return Err(io::Error::new(io::ErrorKind::Interrupted, "HIP preview cancelled"));
|
return Err(io::Error::new(io::ErrorKind::Interrupted, "HIP preview cancelled"));
|
||||||
}
|
}
|
||||||
gpapi::collection::CollectionControl::check(&budget)
|
gpapi::process::collection::CollectionControl::check(&budget)
|
||||||
};
|
};
|
||||||
check()?;
|
check()?;
|
||||||
let profile = crate::hip_source::profile(
|
let profile = crate::hip_source::profile(
|
||||||
@@ -227,7 +227,7 @@ mod tests {
|
|||||||
},
|
},
|
||||||
edited_report: None,
|
edited_report: None,
|
||||||
desktop_uid: None,
|
desktop_uid: None,
|
||||||
identity: gpapi::os_profile::desktop::identity_from_parts(
|
identity: HostIdentity::from_parts(
|
||||||
"device".into(),
|
"device".into(),
|
||||||
"host".into(),
|
"host".into(),
|
||||||
"serial".into(),
|
"serial".into(),
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ pub(crate) fn generate(
|
|||||||
profile: &OsProfile,
|
profile: &OsProfile,
|
||||||
edited: Option<&str>,
|
edited: Option<&str>,
|
||||||
request: &HipRequest,
|
request: &HipRequest,
|
||||||
control: &dyn gpapi::collection::CollectionControl,
|
control: &dyn gpapi::process::collection::CollectionControl,
|
||||||
preview: bool,
|
preview: bool,
|
||||||
) -> anyhow::Result<String> {
|
) -> anyhow::Result<String> {
|
||||||
control.check()?;
|
control.check()?;
|
||||||
@@ -177,9 +177,9 @@ pub(crate) fn profile(
|
|||||||
os_version: Option<String>,
|
os_version: Option<String>,
|
||||||
host_id: Option<String>,
|
host_id: Option<String>,
|
||||||
hostname: Option<String>,
|
hostname: Option<String>,
|
||||||
control: &dyn gpapi::collection::CollectionControl,
|
control: &dyn gpapi::process::collection::CollectionControl,
|
||||||
) -> io::Result<OsProfile> {
|
) -> io::Result<OsProfile> {
|
||||||
let identity = gpapi::os_profile::desktop::identity_from_parts(
|
let identity = HostIdentity::from_parts(
|
||||||
hostname.unwrap_or_else(|| identity.computer().into()),
|
hostname.unwrap_or_else(|| identity.computer().into()),
|
||||||
host_id.unwrap_or_else(|| identity.host_id().into()),
|
host_id.unwrap_or_else(|| identity.host_id().into()),
|
||||||
identity.serialno().into(),
|
identity.serialno().into(),
|
||||||
@@ -192,7 +192,7 @@ pub(crate) fn profile(
|
|||||||
if let Some(os_version) = os_version {
|
if let Some(os_version) = os_version {
|
||||||
builder = builder.os_version(os_version);
|
builder = builder.os_version(os_version);
|
||||||
}
|
}
|
||||||
gpapi::os_profile::desktop::collect_profile_with_control(builder, None, control)
|
builder.build_with_control(control)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn generation_error(error: anyhow::Error) -> io::Error {
|
fn generation_error(error: anyhow::Error) -> io::Error {
|
||||||
@@ -209,7 +209,7 @@ mod tests {
|
|||||||
|
|
||||||
fn fixture_profile() -> OsProfile {
|
fn fixture_profile() -> OsProfile {
|
||||||
profile(
|
profile(
|
||||||
&gpapi::os_profile::desktop::identity_from_parts(
|
&HostIdentity::from_parts(
|
||||||
"device".into(),
|
"device".into(),
|
||||||
"host".into(),
|
"host".into(),
|
||||||
"serial".into(),
|
"serial".into(),
|
||||||
@@ -220,7 +220,7 @@ mod tests {
|
|||||||
Some("negotiated-version".into()),
|
Some("negotiated-version".into()),
|
||||||
None,
|
None,
|
||||||
None,
|
None,
|
||||||
&gpapi::collection::CollectionBudget::new(std::time::Duration::from_secs(60)),
|
&gpapi::process::collection::CollectionBudget::new(std::time::Duration::from_secs(60)),
|
||||||
)
|
)
|
||||||
.unwrap()
|
.unwrap()
|
||||||
}
|
}
|
||||||
@@ -235,7 +235,7 @@ mod tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn profile_retains_negotiated_identity_and_os_version() {
|
fn profile_retains_negotiated_identity_and_os_version() {
|
||||||
let identity = gpapi::os_profile::desktop::identity_from_parts(
|
let identity = HostIdentity::from_parts(
|
||||||
"original".into(),
|
"original".into(),
|
||||||
"original-id".into(),
|
"original-id".into(),
|
||||||
"serial".into(),
|
"serial".into(),
|
||||||
@@ -248,7 +248,7 @@ mod tests {
|
|||||||
Some("negotiated-os".into()),
|
Some("negotiated-os".into()),
|
||||||
Some("negotiated-host".into()),
|
Some("negotiated-host".into()),
|
||||||
Some("negotiated-name".into()),
|
Some("negotiated-name".into()),
|
||||||
&gpapi::collection::CollectionBudget::new(std::time::Duration::from_secs(60)),
|
&gpapi::process::collection::CollectionBudget::new(std::time::Duration::from_secs(60)),
|
||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
assert_eq!(profile.os_version(), "negotiated-os");
|
assert_eq!(profile.os_version(), "negotiated-os");
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ use std::{
|
|||||||
path::{Path, PathBuf},
|
path::{Path, PathBuf},
|
||||||
sync::Arc,
|
sync::Arc,
|
||||||
};
|
};
|
||||||
use tokio::io::{AsyncReadExt, AsyncWriteExt};
|
|
||||||
|
|
||||||
use anyhow::{Context, bail};
|
use anyhow::{Context, bail};
|
||||||
use log::{info, warn};
|
use log::{info, warn};
|
||||||
@@ -44,20 +43,14 @@ impl CredentialServer {
|
|||||||
tokio::select! {
|
tokio::select! {
|
||||||
_ = cancel.cancelled() => break,
|
_ = cancel.cancelled() => break,
|
||||||
accepted = listener.accept() => {
|
accepted = listener.accept() => {
|
||||||
let (mut stream, _) = accepted?;
|
let (stream, _) = accepted?;
|
||||||
if peer_uid(&stream)? != 0 {
|
if peer_uid(&stream)? != 0 {
|
||||||
warn!("Rejected non-root broker credential client");
|
warn!("Rejected non-root broker credential client");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
let registry = Arc::clone(&self.registry);
|
let registry = Arc::clone(&self.registry);
|
||||||
tokio::spawn(async move {
|
tokio::spawn(async move {
|
||||||
let identity = tokio::time::timeout(std::time::Duration::from_secs(5), stream.read_u32()).await;
|
if let Err(err) = credential_lease::serve(stream, registry, None).await {
|
||||||
let uid = match identity {
|
|
||||||
Ok(Ok(0)) => { let _ = stream.write_u8(1).await; return; }
|
|
||||||
Ok(Ok(uid)) => uid,
|
|
||||||
_ => { warn!("Invalid desktop identity from broker"); return; }
|
|
||||||
};
|
|
||||||
if let Err(err) = credential_lease::serve(stream, registry, Some(uid)).await {
|
|
||||||
warn!("Broker credential lease ended: {err}");
|
warn!("Broker credential lease ended: {err}");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ use std::{
|
|||||||
sync::{Arc, atomic::AtomicBool},
|
sync::{Arc, atomic::AtomicBool},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
use common::binary_paths;
|
||||||
use gpapi::{
|
use gpapi::{
|
||||||
service::{
|
service::{
|
||||||
request::{UpdateGuiRequest, UpdateLogLevelRequest, WsRequest},
|
request::{UpdateGuiRequest, UpdateLogLevelRequest, WsRequest},
|
||||||
@@ -137,9 +138,7 @@ impl RequestDispatcher {
|
|||||||
authority
|
authority
|
||||||
.registry
|
.registry
|
||||||
.reserve_connection(authority.session_id, authority.generation, non_tunnel, || {
|
.reserve_connection(authority.session_id, authority.generation, non_tunnel, || {
|
||||||
self
|
self.lifecycle.reserve_connect()
|
||||||
.lifecycle
|
|
||||||
.reserve_connect(request.restart_of().map(|attempt| (attempt, authority.session_id)))
|
|
||||||
})?;
|
})?;
|
||||||
let preparation = ConnectionPreparation {
|
let preparation = ConnectionPreparation {
|
||||||
authority,
|
authority,
|
||||||
@@ -298,17 +297,10 @@ impl RequestDispatcher {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async fn update_gui(&self, request: UpdateGuiRequest) -> ServiceResult {
|
async fn update_gui(&self, request: UpdateGuiRequest) -> ServiceResult {
|
||||||
if request.variant == gpapi::gui::GuiVariant::Nsh && !cfg!(target_os = "linux") {
|
|
||||||
return ServiceResult::rejected(
|
|
||||||
ServiceErrorCode::InvalidRequest,
|
|
||||||
"Native Shell is available only on Linux",
|
|
||||||
);
|
|
||||||
}
|
|
||||||
let _install = self.install_lock.lock().await;
|
let _install = self.install_lock.lock().await;
|
||||||
let path = request.path;
|
let path = request.path;
|
||||||
let checksum = request.checksum;
|
let checksum = request.checksum;
|
||||||
let target = request.variant.update_target();
|
let installed = tokio::task::spawn_blocking(move || install_gui(&path, &checksum)).await;
|
||||||
let installed = tokio::task::spawn_blocking(move || install_gui_at(Path::new(&path), &checksum, &target)).await;
|
|
||||||
match installed {
|
match installed {
|
||||||
Ok(Ok(())) => ServiceResult::Accepted,
|
Ok(Ok(())) => ServiceResult::Accepted,
|
||||||
Ok(Err(GuiInstallError::Checksum(err))) => {
|
Ok(Err(GuiInstallError::Checksum(err))) => {
|
||||||
@@ -333,29 +325,11 @@ enum GuiInstallError {
|
|||||||
Install(anyhow::Error),
|
Install(anyhow::Error),
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn gui_installer() -> Option<std::path::PathBuf> {
|
fn install_gui(src: &str, checksum: &str) -> Result<(), GuiInstallError> {
|
||||||
std::env::current_exe()
|
install_gui_at(Path::new(src), checksum, &binary_paths::gpgui_update_target())
|
||||||
.ok()
|
|
||||||
.and_then(|executable| {
|
|
||||||
executable
|
|
||||||
.parent()?
|
|
||||||
.parent()
|
|
||||||
.map(|prefix| prefix.join("libexec/gpclient/gp-gui-installer"))
|
|
||||||
})
|
|
||||||
.filter(|path| path.is_file())
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn install_gui_at(src: &Path, checksum: &str, target: &Path) -> Result<(), GuiInstallError> {
|
fn install_gui_at(src: &Path, checksum: &str, target: &Path) -> Result<(), GuiInstallError> {
|
||||||
let installer = gui_installer();
|
|
||||||
install_gui_with_installer(src, checksum, target, installer.as_deref())
|
|
||||||
}
|
|
||||||
|
|
||||||
fn install_gui_with_installer(
|
|
||||||
src: &Path,
|
|
||||||
checksum: &str,
|
|
||||||
target: &Path,
|
|
||||||
installer: Option<&Path>,
|
|
||||||
) -> Result<(), GuiInstallError> {
|
|
||||||
let Some(dir) = target.parent() else {
|
let Some(dir) = target.parent() else {
|
||||||
return Err(GuiInstallError::Install(anyhow::anyhow!(
|
return Err(GuiInstallError::Install(anyhow::anyhow!(
|
||||||
"Failed to get parent directory of GUI binary"
|
"Failed to get parent directory of GUI binary"
|
||||||
@@ -367,26 +341,6 @@ fn install_gui_with_installer(
|
|||||||
let archive_path = staged_archive.path().to_string_lossy();
|
let archive_path = staged_archive.path().to_string_lossy();
|
||||||
verify_checksum(&archive_path, checksum).map_err(GuiInstallError::Checksum)?;
|
verify_checksum(&archive_path, checksum).map_err(GuiInstallError::Checksum)?;
|
||||||
|
|
||||||
// A package may need to prepare downloaded executables for its runtime.
|
|
||||||
// Resolve this helper beside the running service, never from the request or PATH.
|
|
||||||
if let Some(installer) = installer {
|
|
||||||
let status = std::process::Command::new(installer)
|
|
||||||
.arg(staged_archive.path())
|
|
||||||
.arg(checksum)
|
|
||||||
.arg(target)
|
|
||||||
.stdin(std::process::Stdio::null())
|
|
||||||
.stdout(std::process::Stdio::null())
|
|
||||||
.status()
|
|
||||||
.map_err(|err| GuiInstallError::Install(err.into()))?;
|
|
||||||
return if status.success() {
|
|
||||||
Ok(())
|
|
||||||
} else {
|
|
||||||
Err(GuiInstallError::Install(anyhow::anyhow!(
|
|
||||||
"GUI package installation failed: {status}"
|
|
||||||
)))
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
let tar = XzDecoder::new(BufReader::new(
|
let tar = XzDecoder::new(BufReader::new(
|
||||||
staged_archive
|
staged_archive
|
||||||
.reopen()
|
.reopen()
|
||||||
@@ -394,8 +348,7 @@ fn install_gui_with_installer(
|
|||||||
))
|
))
|
||||||
.take(MAX_GUI_ARCHIVE_CONTENT_SIZE);
|
.take(MAX_GUI_ARCHIVE_CONTENT_SIZE);
|
||||||
let mut archive = Archive::new(tar);
|
let mut archive = Archive::new(tar);
|
||||||
let binary_name = target.file_name().and_then(|name| name.to_str()).unwrap_or("gpgui");
|
let file = extract_gui_binary(&mut archive, dir)?;
|
||||||
let file = extract_gui_binary(&mut archive, dir, binary_name)?;
|
|
||||||
file
|
file
|
||||||
.as_file()
|
.as_file()
|
||||||
.set_permissions(Permissions::from_mode(0o755))
|
.set_permissions(Permissions::from_mode(0o755))
|
||||||
@@ -443,18 +396,14 @@ fn stage_gui_archive(src: &Path, dir: &Path) -> Result<NamedTempFile, GuiInstall
|
|||||||
Ok(staged)
|
Ok(staged)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn extract_gui_binary<R: Read>(
|
fn extract_gui_binary<R: Read>(archive: &mut Archive<R>, dir: &Path) -> Result<NamedTempFile, GuiInstallError> {
|
||||||
archive: &mut Archive<R>,
|
|
||||||
dir: &Path,
|
|
||||||
binary_name: &str,
|
|
||||||
) -> Result<NamedTempFile, GuiInstallError> {
|
|
||||||
for entry in archive.entries().map_err(|err| GuiInstallError::Install(err.into()))? {
|
for entry in archive.entries().map_err(|err| GuiInstallError::Install(err.into()))? {
|
||||||
let mut entry = entry.map_err(|err| GuiInstallError::Install(err.into()))?;
|
let mut entry = entry.map_err(|err| GuiInstallError::Install(err.into()))?;
|
||||||
let is_gui = entry
|
let is_gui = entry
|
||||||
.path()
|
.path()
|
||||||
.map_err(|err| GuiInstallError::Install(err.into()))?
|
.map_err(|err| GuiInstallError::Install(err.into()))?
|
||||||
.file_name()
|
.file_name()
|
||||||
.is_some_and(|name| name == binary_name);
|
.is_some_and(|name| name == "gpgui");
|
||||||
if is_gui && entry.header().entry_type().is_file() {
|
if is_gui && entry.header().entry_type().is_file() {
|
||||||
let declared_size = entry.size();
|
let declared_size = entry.size();
|
||||||
if declared_size == 0 || declared_size > MAX_GUI_BINARY_SIZE {
|
if declared_size == 0 || declared_size > MAX_GUI_BINARY_SIZE {
|
||||||
@@ -474,7 +423,7 @@ fn extract_gui_binary<R: Read>(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
Err(GuiInstallError::Install(anyhow::anyhow!(
|
Err(GuiInstallError::Install(anyhow::anyhow!(
|
||||||
"GUI update archive does not contain a non-empty regular {binary_name} file"
|
"GUI update archive does not contain a non-empty regular gpgui file"
|
||||||
)))
|
)))
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -524,7 +473,7 @@ mod tests {
|
|||||||
for (entry_type, contents) in [(EntryType::Directory, &[][..]), (EntryType::Regular, &[][..])] {
|
for (entry_type, contents) in [(EntryType::Directory, &[][..]), (EntryType::Regular, &[][..])] {
|
||||||
let data = archive_with_entry(entry_type, contents);
|
let data = archive_with_entry(entry_type, contents);
|
||||||
let mut archive = Archive::new(Cursor::new(data));
|
let mut archive = Archive::new(Cursor::new(data));
|
||||||
assert!(extract_gui_binary(&mut archive, output.path(), "gpgui").is_err());
|
assert!(extract_gui_binary(&mut archive, output.path()).is_err());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -533,7 +482,7 @@ mod tests {
|
|||||||
let output = tempfile::tempdir().unwrap();
|
let output = tempfile::tempdir().unwrap();
|
||||||
let data = archive_with_entry(EntryType::Regular, b"gui binary");
|
let data = archive_with_entry(EntryType::Regular, b"gui binary");
|
||||||
let mut archive = Archive::new(Cursor::new(data));
|
let mut archive = Archive::new(Cursor::new(data));
|
||||||
let extracted = extract_gui_binary(&mut archive, output.path(), "gpgui").unwrap();
|
let extracted = extract_gui_binary(&mut archive, output.path()).unwrap();
|
||||||
let contents = std::fs::read(extracted.path()).unwrap();
|
let contents = std::fs::read(extracted.path()).unwrap();
|
||||||
assert_eq!(contents, b"gui binary");
|
assert_eq!(contents, b"gui binary");
|
||||||
}
|
}
|
||||||
@@ -564,7 +513,7 @@ mod tests {
|
|||||||
data.resize(512 * 3, 0);
|
data.resize(512 * 3, 0);
|
||||||
|
|
||||||
let mut archive = Archive::new(Cursor::new(data));
|
let mut archive = Archive::new(Cursor::new(data));
|
||||||
assert!(extract_gui_binary(&mut archive, output.path(), "gpgui").is_err());
|
assert!(extract_gui_binary(&mut archive, output.path()).is_err());
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -580,33 +529,6 @@ mod tests {
|
|||||||
assert_eq!(std::fs::metadata(&target).unwrap().permissions().mode() & 0o777, 0o755);
|
assert_eq!(std::fs::metadata(&target).unwrap().permissions().mode() & 0o777, 0o755);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn installs_nsh_beside_tauri_without_replacing_it() {
|
|
||||||
let output = tempfile::tempdir().unwrap();
|
|
||||||
let tauri = output.path().join("gpgui");
|
|
||||||
std::fs::write(&tauri, b"tauri").unwrap();
|
|
||||||
let mut encoder = XzEncoder::new(Vec::new(), 1);
|
|
||||||
{
|
|
||||||
let mut archive = Builder::new(&mut encoder);
|
|
||||||
let mut header = Header::new_gnu();
|
|
||||||
header.set_size(3);
|
|
||||||
header.set_mode(0o755);
|
|
||||||
header.set_cksum();
|
|
||||||
archive
|
|
||||||
.append_data(&mut header, "gpgui-nsh_3.2.0/gpgui-nsh", &b"nsh"[..])
|
|
||||||
.unwrap();
|
|
||||||
archive.finish().unwrap();
|
|
||||||
}
|
|
||||||
let mut archive = NamedTempFile::new().unwrap();
|
|
||||||
archive.write_all(&encoder.finish().unwrap()).unwrap();
|
|
||||||
archive.flush().unwrap();
|
|
||||||
let checksum = gpapi::utils::checksum::file_sha256(archive.path()).unwrap();
|
|
||||||
let nsh = output.path().join("gpgui-nsh");
|
|
||||||
install_gui_at(archive.path(), &checksum, &nsh).unwrap();
|
|
||||||
assert_eq!(std::fs::read(nsh).unwrap(), b"nsh");
|
|
||||||
assert_eq!(std::fs::read(tauri).unwrap(), b"tauri");
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn checksum_failure_preserves_the_existing_gui() {
|
fn checksum_failure_preserves_the_existing_gui() {
|
||||||
let archive = compressed_gui_archive(b"replacement");
|
let archive = compressed_gui_archive(b"replacement");
|
||||||
@@ -619,41 +541,6 @@ mod tests {
|
|||||||
assert_eq!(std::fs::read(target).unwrap(), b"existing");
|
assert_eq!(std::fs::read(target).unwrap(), b"existing");
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn package_installer_receives_a_verified_staged_archive() {
|
|
||||||
let archive = compressed_gui_archive(b"gui binary");
|
|
||||||
let checksum = gpapi::utils::checksum::file_sha256(archive.path()).unwrap();
|
|
||||||
let output = tempfile::tempdir().unwrap();
|
|
||||||
let target = output.path().join("gpgui-nsh");
|
|
||||||
let installer = output.path().join("installer");
|
|
||||||
std::fs::write(
|
|
||||||
&installer,
|
|
||||||
"#!/bin/sh\nset -eu\ntest -f \"$1\"\nprintf '%s' \"$2\" > \"$3\"\n",
|
|
||||||
)
|
|
||||||
.unwrap();
|
|
||||||
std::fs::set_permissions(&installer, Permissions::from_mode(0o755)).unwrap();
|
|
||||||
|
|
||||||
assert!(install_gui_with_installer(archive.path(), "invalid", &target, Some(&installer)).is_err());
|
|
||||||
assert!(!target.exists());
|
|
||||||
install_gui_with_installer(archive.path(), &checksum, &target, Some(&installer)).unwrap();
|
|
||||||
assert_eq!(std::fs::read_to_string(target).unwrap(), checksum);
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn package_installation_failure_preserves_the_existing_gui() {
|
|
||||||
let archive = compressed_gui_archive(b"replacement");
|
|
||||||
let checksum = gpapi::utils::checksum::file_sha256(archive.path()).unwrap();
|
|
||||||
let output = tempfile::tempdir().unwrap();
|
|
||||||
let target = output.path().join("gpgui");
|
|
||||||
std::fs::write(&target, b"existing").unwrap();
|
|
||||||
let installer = output.path().join("installer");
|
|
||||||
std::fs::write(&installer, "#!/bin/sh\nexit 1\n").unwrap();
|
|
||||||
std::fs::set_permissions(&installer, Permissions::from_mode(0o755)).unwrap();
|
|
||||||
|
|
||||||
assert!(install_gui_with_installer(archive.path(), &checksum, &target, Some(&installer)).is_err());
|
|
||||||
assert_eq!(std::fs::read(target).unwrap(), b"existing");
|
|
||||||
}
|
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn brokered_mode_rejects_gui_management_and_root_readable_identity_paths() {
|
async fn brokered_mode_rejects_gui_management_and_root_readable_identity_paths() {
|
||||||
let dispatcher = RequestDispatcher::new(
|
let dispatcher = RequestDispatcher::new(
|
||||||
@@ -712,29 +599,4 @@ mod tests {
|
|||||||
Err("macOS does not support custom HIP scripts")
|
Err("macOS does not support custom HIP scripts")
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
#[test]
|
|
||||||
#[ignore = "requires GP_TEST_GUI_BINARY pointing to a built gpgui"]
|
|
||||||
fn installs_single_gui_binary_for_fresh_and_upgrade_downloads() {
|
|
||||||
let binary = std::fs::read(std::env::var("GP_TEST_GUI_BINARY").expect("GP_TEST_GUI_BINARY")).unwrap();
|
|
||||||
let archive = compressed_gui_archive(&binary);
|
|
||||||
let checksum = gpapi::utils::checksum::file_sha256(archive.path()).unwrap();
|
|
||||||
let temporary = tempfile::tempdir().unwrap();
|
|
||||||
let output = std::env::var_os("GP_TEST_GUI_INSTALL_DIR")
|
|
||||||
.map(std::path::PathBuf::from)
|
|
||||||
.unwrap_or_else(|| temporary.path().to_owned());
|
|
||||||
std::fs::create_dir_all(&output).unwrap();
|
|
||||||
std::fs::set_permissions(&output, std::fs::Permissions::from_mode(0o755)).unwrap();
|
|
||||||
let target = output.join("gpclient/gpgui");
|
|
||||||
for upgrade in [false, true] {
|
|
||||||
if upgrade {
|
|
||||||
std::fs::write(&target, b"old GUI").unwrap();
|
|
||||||
}
|
|
||||||
install_gui_at(archive.path(), &checksum, &target).unwrap();
|
|
||||||
assert_eq!(std::fs::read_dir(target.parent().unwrap()).unwrap().count(), 1);
|
|
||||||
assert_eq!(std::fs::read(&target).unwrap(), binary);
|
|
||||||
let result = std::process::Command::new(&target).arg("--version").output().unwrap();
|
|
||||||
assert!(result.status.success(), "{}", String::from_utf8_lossy(&result.stderr));
|
|
||||||
assert!(String::from_utf8_lossy(&result.stdout).contains(env!("CARGO_PKG_VERSION")));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -190,10 +190,6 @@ impl SessionRegistry {
|
|||||||
Ok(None)
|
Ok(None)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn service_instance_id(&self) -> Uuid {
|
|
||||||
self.service_instance_id
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn new(service_instance_id: Uuid) -> Self {
|
pub fn new(service_instance_id: Uuid) -> Self {
|
||||||
Self {
|
Self {
|
||||||
service_instance_id,
|
service_instance_id,
|
||||||
@@ -429,13 +425,6 @@ impl SessionRegistry {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn has_session(&self, session_id: Uuid) -> bool {
|
|
||||||
self
|
|
||||||
.sessions
|
|
||||||
.lock()
|
|
||||||
.is_ok_and(|sessions| sessions.contains_key(&session_id))
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn is_current(&self, session_id: Uuid, generation: u64) -> bool {
|
pub fn is_current(&self, session_id: Uuid, generation: u64) -> bool {
|
||||||
let Ok(sessions) = self.sessions.lock() else {
|
let Ok(sessions) = self.sessions.lock() else {
|
||||||
return false;
|
return false;
|
||||||
@@ -664,7 +653,7 @@ mod tests {
|
|||||||
let (state, _state_rx) = tokio::sync::watch::channel(gpapi::service::vpn_state::VpnState::Disconnected);
|
let (state, _state_rx) = tokio::sync::watch::channel(gpapi::service::vpn_state::VpnState::Disconnected);
|
||||||
let (_task, lifecycle) = crate::vpn_task::VpnTask::new(state, false, registry.clone());
|
let (_task, lifecycle) = crate::vpn_task::VpnTask::new(state, false, registry.clone());
|
||||||
let reservation = registry
|
let reservation = registry
|
||||||
.reserve_connection(session, 1, true, || lifecycle.reserve_connect(None))
|
.reserve_connection(session, 1, true, || lifecycle.reserve_connect())
|
||||||
.unwrap();
|
.unwrap();
|
||||||
let drain = reservation.drain();
|
let drain = reservation.drain();
|
||||||
let cancel = reservation.cancellation();
|
let cancel = reservation.cancellation();
|
||||||
@@ -680,7 +669,7 @@ mod tests {
|
|||||||
assert!(!drain.is_complete());
|
assert!(!drain.is_complete());
|
||||||
assert!(
|
assert!(
|
||||||
registry
|
registry
|
||||||
.reserve_connection(session, 2, true, || lifecycle.reserve_connect(None))
|
.reserve_connection(session, 2, true, || lifecycle.reserve_connect())
|
||||||
.is_err()
|
.is_err()
|
||||||
);
|
);
|
||||||
assert!(matches!(
|
assert!(matches!(
|
||||||
@@ -691,7 +680,7 @@ mod tests {
|
|||||||
drain.wait().await;
|
drain.wait().await;
|
||||||
|
|
||||||
let next_reservation = registry
|
let next_reservation = registry
|
||||||
.reserve_connection(session, 2, true, || lifecycle.reserve_connect(None))
|
.reserve_connection(session, 2, true, || lifecycle.reserve_connect())
|
||||||
.unwrap();
|
.unwrap();
|
||||||
assert!(
|
assert!(
|
||||||
registry
|
registry
|
||||||
@@ -721,7 +710,7 @@ mod tests {
|
|||||||
let (state, _state_rx) = tokio::sync::watch::channel(gpapi::service::vpn_state::VpnState::Disconnected);
|
let (state, _state_rx) = tokio::sync::watch::channel(gpapi::service::vpn_state::VpnState::Disconnected);
|
||||||
let (_task, lifecycle) = crate::vpn_task::VpnTask::new(state, false, registry.clone());
|
let (_task, lifecycle) = crate::vpn_task::VpnTask::new(state, false, registry.clone());
|
||||||
let reservation = registry
|
let reservation = registry
|
||||||
.reserve_connection(session, 1, true, || lifecycle.reserve_connect(None))
|
.reserve_connection(session, 1, true, || lifecycle.reserve_connect())
|
||||||
.unwrap();
|
.unwrap();
|
||||||
let drain = registry.stop_non_tunnel_attachment(session, 1, id).unwrap().unwrap();
|
let drain = registry.stop_non_tunnel_attachment(session, 1, id).unwrap().unwrap();
|
||||||
assert!(reservation.cancellation().is_cancelled());
|
assert!(reservation.cancellation().is_cancelled());
|
||||||
@@ -739,7 +728,7 @@ mod tests {
|
|||||||
);
|
);
|
||||||
assert!(
|
assert!(
|
||||||
registry
|
registry
|
||||||
.reserve_connection(session, 1, false, || lifecycle.reserve_connect(None))
|
.reserve_connection(session, 1, false, || lifecycle.reserve_connect())
|
||||||
.is_ok()
|
.is_ok()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -759,7 +748,7 @@ mod tests {
|
|||||||
let (state, _state_rx) = tokio::sync::watch::channel(gpapi::service::vpn_state::VpnState::Disconnected);
|
let (state, _state_rx) = tokio::sync::watch::channel(gpapi::service::vpn_state::VpnState::Disconnected);
|
||||||
let (_task, lifecycle) = crate::vpn_task::VpnTask::new(state, false, registry.clone());
|
let (_task, lifecycle) = crate::vpn_task::VpnTask::new(state, false, registry.clone());
|
||||||
let tunnel = registry
|
let tunnel = registry
|
||||||
.reserve_connection(session, 1, false, || lifecycle.reserve_connect(None))
|
.reserve_connection(session, 1, false, || lifecycle.reserve_connect())
|
||||||
.unwrap();
|
.unwrap();
|
||||||
registry.disconnect_if_current(session, 1);
|
registry.disconnect_if_current(session, 1);
|
||||||
assert!(!tunnel.cancellation().is_cancelled());
|
assert!(!tunnel.cancellation().is_cancelled());
|
||||||
@@ -776,7 +765,7 @@ mod tests {
|
|||||||
.commit_attach(&permit, ConnectionControl::new(Uuid::new_v4(), tx).0)
|
.commit_attach(&permit, ConnectionControl::new(Uuid::new_v4(), tx).0)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
let session_work = registry
|
let session_work = registry
|
||||||
.reserve_connection(session, 2, true, || lifecycle.reserve_connect(None))
|
.reserve_connection(session, 2, true, || lifecycle.reserve_connect())
|
||||||
.unwrap();
|
.unwrap();
|
||||||
registry.revoke(session);
|
registry.revoke(session);
|
||||||
assert!(session_work.cancellation().is_cancelled());
|
assert!(session_work.cancellation().is_cancelled());
|
||||||
@@ -833,10 +822,7 @@ mod tests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let valid = gphip::generate_report(&gphip::ReportInput {
|
let valid = gphip::generate_report(&gphip::ReportInput {
|
||||||
profile: gpapi::os_profile::desktop::collect_profile(
|
profile: gpapi::os_profile::OsProfile::builder(gpapi::os_profile::ClientOs::Linux).build(),
|
||||||
gpapi::os_profile::OsProfile::builder(gpapi::os_profile::ClientOs::Linux),
|
|
||||||
None,
|
|
||||||
),
|
|
||||||
context: gphip::ReportContext::Preview,
|
context: gphip::ReportContext::Preview,
|
||||||
})
|
})
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|||||||
@@ -27,14 +27,12 @@ mod non_tunnel;
|
|||||||
mod preparation;
|
mod preparation;
|
||||||
pub(crate) use preparation::{PreparedConnection, prepare_connection};
|
pub(crate) use preparation::{PreparedConnection, prepare_connection};
|
||||||
mod runtime;
|
mod runtime;
|
||||||
mod script_tun;
|
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub(crate) struct LifecycleHandle {
|
pub(crate) struct LifecycleHandle {
|
||||||
events: mpsc::Sender<LifecycleEvent>,
|
events: mpsc::Sender<LifecycleEvent>,
|
||||||
admissions: Arc<Mutex<Admissions>>,
|
admissions: Arc<Mutex<Admissions>>,
|
||||||
tunnel: watch::Sender<TunnelBinding>,
|
tunnel: watch::Sender<TunnelBinding>,
|
||||||
state: watch::Sender<VpnState>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Default)]
|
#[derive(Clone, Default)]
|
||||||
@@ -48,7 +46,7 @@ impl LifecycleHandle {
|
|||||||
pub fn subscribe_tunnel(&self) -> watch::Receiver<TunnelBinding> {
|
pub fn subscribe_tunnel(&self) -> watch::Receiver<TunnelBinding> {
|
||||||
self.tunnel.subscribe()
|
self.tunnel.subscribe()
|
||||||
}
|
}
|
||||||
pub fn reserve_connect(&self, restart: Option<(u64, Uuid)>) -> Result<ConnectReservation, ServiceResult> {
|
pub fn reserve_connect(&self) -> Result<ConnectReservation, ServiceResult> {
|
||||||
let mut admissions = self.admissions.lock().expect("VPN lifecycle admissions mutex poisoned");
|
let mut admissions = self.admissions.lock().expect("VPN lifecycle admissions mutex poisoned");
|
||||||
if admissions.closed {
|
if admissions.closed {
|
||||||
return Err(ServiceResult::rejected(
|
return Err(ServiceResult::rejected(
|
||||||
@@ -62,13 +60,6 @@ impl LifecycleHandle {
|
|||||||
"A VPN connection is already in progress",
|
"A VPN connection is already in progress",
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
if restart.is_some() && admissions.restart != restart {
|
|
||||||
return Err(ServiceResult::rejected(
|
|
||||||
ServiceErrorCode::InvalidRequest,
|
|
||||||
"Reconnect request is no longer current",
|
|
||||||
));
|
|
||||||
}
|
|
||||||
admissions.restart = None;
|
|
||||||
let attempt = admissions.next_attempt;
|
let attempt = admissions.next_attempt;
|
||||||
admissions.next_attempt += 1;
|
admissions.next_attempt += 1;
|
||||||
let cancellation = CancellationToken::new();
|
let cancellation = CancellationToken::new();
|
||||||
@@ -95,7 +86,7 @@ impl LifecycleHandle {
|
|||||||
edited_report: Option<Arc<str>>,
|
edited_report: Option<Arc<str>>,
|
||||||
session_id: Option<Uuid>,
|
session_id: Option<Uuid>,
|
||||||
) -> ServiceResult {
|
) -> ServiceResult {
|
||||||
match self.reserve_connect(None) {
|
match self.reserve_connect() {
|
||||||
Ok(reservation) => reservation.commit(
|
Ok(reservation) => reservation.commit(
|
||||||
PreparedConnection::lifecycle_fixture(request),
|
PreparedConnection::lifecycle_fixture(request),
|
||||||
desktop_uid,
|
desktop_uid,
|
||||||
@@ -108,9 +99,7 @@ impl LifecycleHandle {
|
|||||||
|
|
||||||
pub fn request_disconnect(&self) -> ServiceResult {
|
pub fn request_disconnect(&self) -> ServiceResult {
|
||||||
let mut admissions = self.admissions.lock().expect("VPN lifecycle admissions mutex poisoned");
|
let mut admissions = self.admissions.lock().expect("VPN lifecycle admissions mutex poisoned");
|
||||||
admissions.restart = None;
|
|
||||||
let Some(admission) = admissions.current.as_mut() else {
|
let Some(admission) = admissions.current.as_mut() else {
|
||||||
self.state.send_replace(VpnState::Disconnected);
|
|
||||||
return ServiceResult::Accepted;
|
return ServiceResult::Accepted;
|
||||||
};
|
};
|
||||||
if admission.stop_requested {
|
if admission.stop_requested {
|
||||||
@@ -366,7 +355,6 @@ struct Admissions {
|
|||||||
closed: bool,
|
closed: bool,
|
||||||
next_attempt: u64,
|
next_attempt: u64,
|
||||||
current: Option<Admission>,
|
current: Option<Admission>,
|
||||||
restart: Option<(u64, Uuid)>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
@@ -407,12 +395,6 @@ enum LifecycleEvent {
|
|||||||
Stop {
|
Stop {
|
||||||
attempt: u64,
|
attempt: u64,
|
||||||
},
|
},
|
||||||
ScriptTunSuspended {
|
|
||||||
attempt: u64,
|
|
||||||
},
|
|
||||||
ReconnectRequired {
|
|
||||||
attempt: u64,
|
|
||||||
},
|
|
||||||
Established {
|
Established {
|
||||||
attempt: u64,
|
attempt: u64,
|
||||||
session: VpnSessionInfo,
|
session: VpnSessionInfo,
|
||||||
@@ -420,7 +402,7 @@ enum LifecycleEvent {
|
|||||||
MembersChanged {
|
MembersChanged {
|
||||||
attempt: u64,
|
attempt: u64,
|
||||||
members: Vec<gpapi::session::GatewaySessionSummary>,
|
members: Vec<gpapi::session::GatewaySessionSummary>,
|
||||||
failures: Vec<gpapi::session::desktop::GatewayFailureSummary>,
|
failures: Vec<gpapi::session::GatewayFailureSummary>,
|
||||||
},
|
},
|
||||||
Ended {
|
Ended {
|
||||||
attempt: u64,
|
attempt: u64,
|
||||||
@@ -440,7 +422,6 @@ struct ActiveAttempt {
|
|||||||
cancellation: CancellationToken,
|
cancellation: CancellationToken,
|
||||||
task: tokio::task::JoinHandle<()>,
|
task: tokio::task::JoinHandle<()>,
|
||||||
failure: Option<String>,
|
failure: Option<String>,
|
||||||
reconnect_required: bool,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) struct VpnTask {
|
pub(crate) struct VpnTask {
|
||||||
@@ -464,7 +445,6 @@ impl VpnTask {
|
|||||||
events: events_tx,
|
events: events_tx,
|
||||||
admissions: Arc::new(Mutex::new(Admissions::default())),
|
admissions: Arc::new(Mutex::new(Admissions::default())),
|
||||||
tunnel: watch::channel(TunnelBinding::default()).0,
|
tunnel: watch::channel(TunnelBinding::default()).0,
|
||||||
state: vpn_state_tx.clone(),
|
|
||||||
};
|
};
|
||||||
let task = Self {
|
let task = Self {
|
||||||
events,
|
events,
|
||||||
@@ -559,21 +539,6 @@ impl VpnTask {
|
|||||||
active.failure = Some(reason);
|
active.failure = Some(reason);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
LifecycleEvent::ScriptTunSuspended { attempt } => {
|
|
||||||
if let Some(active) = self
|
|
||||||
.active
|
|
||||||
.as_mut()
|
|
||||||
.filter(|a| a.attempt == attempt && !a.cancellation.is_cancelled())
|
|
||||||
{
|
|
||||||
let info = active.info.clone();
|
|
||||||
self.send_state(VpnState::Connecting(Box::new(info)));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
LifecycleEvent::ReconnectRequired { attempt } => {
|
|
||||||
if let Some(active) = self.active.as_mut().filter(|a| a.attempt == attempt) {
|
|
||||||
active.reconnect_required = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
LifecycleEvent::PreparationReleased => {}
|
LifecycleEvent::PreparationReleased => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -597,14 +562,7 @@ impl VpnTask {
|
|||||||
.iter()
|
.iter()
|
||||||
.all(|member| member.authentication.mode() == gpapi::session::SessionMode::NonTunnel),
|
.all(|member| member.authentication.mode() == gpapi::session::SessionMode::NonTunnel),
|
||||||
});
|
});
|
||||||
let mut info = connection.request.info().clone();
|
let info = connection.request.info().clone();
|
||||||
if let gpapi::script_tun::PacketDelivery::ScriptTun(request) = connection.request.args().packet_delivery() {
|
|
||||||
info.set_script_tun_identity(gpapi::script_tun::Identity {
|
|
||||||
service_instance: self.registry.service_instance_id(),
|
|
||||||
attempt,
|
|
||||||
launch_id: request.launch_id,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
let allow_extend_session = connection.request.args().allow_extend_session();
|
let allow_extend_session = connection.request.args().allow_extend_session();
|
||||||
let cancellation = self.lifecycle.attempt_cancellation(attempt);
|
let cancellation = self.lifecycle.attempt_cancellation(attempt);
|
||||||
if !activated {
|
if !activated {
|
||||||
@@ -632,7 +590,6 @@ impl VpnTask {
|
|||||||
cancellation,
|
cancellation,
|
||||||
task,
|
task,
|
||||||
failure: None,
|
failure: None,
|
||||||
reconnect_required: false,
|
|
||||||
});
|
});
|
||||||
if activated {
|
if activated {
|
||||||
self.send_state(VpnState::Connecting(Box::new(info)));
|
self.send_state(VpnState::Connecting(Box::new(info)));
|
||||||
@@ -679,7 +636,7 @@ impl VpnTask {
|
|||||||
&self,
|
&self,
|
||||||
attempt: u64,
|
attempt: u64,
|
||||||
members: Vec<gpapi::session::GatewaySessionSummary>,
|
members: Vec<gpapi::session::GatewaySessionSummary>,
|
||||||
failures: Vec<gpapi::session::desktop::GatewayFailureSummary>,
|
failures: Vec<gpapi::session::GatewayFailureSummary>,
|
||||||
) {
|
) {
|
||||||
let Some(active) = &self.active else {
|
let Some(active) = &self.active else {
|
||||||
return;
|
return;
|
||||||
@@ -746,33 +703,7 @@ impl VpnTask {
|
|||||||
..Default::default()
|
..Default::default()
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if active.reconnect_required
|
if let Some(reason) = active.failure {
|
||||||
&& !active.cancellation.is_cancelled()
|
|
||||||
&& active.session_id.is_some_and(|id| self.registry.has_session(id))
|
|
||||||
{
|
|
||||||
let mut admissions = self
|
|
||||||
.lifecycle
|
|
||||||
.admissions
|
|
||||||
.lock()
|
|
||||||
.expect("VPN lifecycle admissions mutex poisoned");
|
|
||||||
if let Some(admission) = admissions.current.take() {
|
|
||||||
if !admission.cancellation.is_cancelled() && !admission.stop_requested {
|
|
||||||
let owner = active.session_id.unwrap();
|
|
||||||
admissions.restart = Some((attempt, owner));
|
|
||||||
self.send_state(VpnState::ReconnectRequired(Box::new(
|
|
||||||
gpapi::service::vpn_state::ReconnectRequest {
|
|
||||||
attempt,
|
|
||||||
owner,
|
|
||||||
info: active.info,
|
|
||||||
},
|
|
||||||
)));
|
|
||||||
} else {
|
|
||||||
self.send_state(VpnState::Disconnected);
|
|
||||||
}
|
|
||||||
admission.completion.completed.store(true, Ordering::Release);
|
|
||||||
admission.completion.notify.notify_waiters();
|
|
||||||
}
|
|
||||||
} else if let Some(reason) = active.failure {
|
|
||||||
self.send_state(VpnState::Failed(reason));
|
self.send_state(VpnState::Failed(reason));
|
||||||
self.lifecycle.clear_attempt(attempt);
|
self.lifecycle.clear_attempt(attempt);
|
||||||
} else {
|
} else {
|
||||||
@@ -855,12 +786,12 @@ pub(crate) fn test_connect_request(info: ConnectInfo) -> ConnectRequest {
|
|||||||
} else {
|
} else {
|
||||||
"fixture"
|
"fixture"
|
||||||
};
|
};
|
||||||
let binding = gpapi::session::desktop::network::GatewayBinding::new(
|
let binding = gpapi::session::network::GatewayBinding::new(
|
||||||
endpoint,
|
endpoint,
|
||||||
std::net::SocketAddr::new(source, 0),
|
std::net::SocketAddr::new(source, 0),
|
||||||
interface.into(),
|
interface.into(),
|
||||||
1,
|
1,
|
||||||
gpapi::session::desktop::ClientAddresses {
|
gpapi::session::ClientAddresses {
|
||||||
ipv4: match source {
|
ipv4: match source {
|
||||||
std::net::IpAddr::V4(ip) => Some(ip),
|
std::net::IpAddr::V4(ip) => Some(ip),
|
||||||
_ => None,
|
_ => None,
|
||||||
@@ -873,8 +804,8 @@ pub(crate) fn test_connect_request(info: ConnectInfo) -> ConnectRequest {
|
|||||||
"0".repeat(64),
|
"0".repeat(64),
|
||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
let plan = gpapi::session::desktop::ConnectionPlan::new(
|
let plan = gpapi::session::ConnectionPlan::new(
|
||||||
vec![gpapi::session::desktop::AuthenticatedGateway {
|
vec![gpapi::session::AuthenticatedGateway {
|
||||||
gateway: info.gateway().clone(),
|
gateway: info.gateway().clone(),
|
||||||
binding: Some(binding),
|
binding: Some(binding),
|
||||||
authentication: gpapi::session::GatewayAuthentication::new("authcookie=token&user=user".into(), "tunnel".into())
|
authentication: gpapi::session::GatewayAuthentication::new("authcookie=token&user=user".into(), "tunnel".into())
|
||||||
@@ -987,12 +918,12 @@ mod tests {
|
|||||||
fn shutdown_cancels_preparation_despite_a_full_queue_and_rejects_commit() {
|
fn shutdown_cancels_preparation_despite_a_full_queue_and_rejects_commit() {
|
||||||
let (state, _state_rx) = watch::channel(VpnState::Disconnected);
|
let (state, _state_rx) = watch::channel(VpnState::Disconnected);
|
||||||
let (_task, lifecycle) = VpnTask::new(state, false, registry());
|
let (_task, lifecycle) = VpnTask::new(state, false, registry());
|
||||||
let reservation = lifecycle.reserve_connect(None).unwrap();
|
let reservation = lifecycle.reserve_connect().unwrap();
|
||||||
let cancellation = reservation.cancellation();
|
let cancellation = reservation.cancellation();
|
||||||
while lifecycle.events.try_send(LifecycleEvent::PreparationReleased).is_ok() {}
|
while lifecycle.events.try_send(LifecycleEvent::PreparationReleased).is_ok() {}
|
||||||
lifecycle.close_admission();
|
lifecycle.close_admission();
|
||||||
assert!(cancellation.is_cancelled());
|
assert!(cancellation.is_cancelled());
|
||||||
assert!(lifecycle.reserve_connect(None).is_err());
|
assert!(lifecycle.reserve_connect().is_err());
|
||||||
let request = test_connect_request(ConnectInfo::new(
|
let request = test_connect_request(ConnectInfo::new(
|
||||||
"portal.example.com".into(),
|
"portal.example.com".into(),
|
||||||
gpapi::gateway::Gateway::new("vpn".into(), "vpn.example.com".into()),
|
gpapi::gateway::Gateway::new("vpn".into(), "vpn.example.com".into()),
|
||||||
@@ -1003,35 +934,19 @@ mod tests {
|
|||||||
ServiceResult::Rejected(..)
|
ServiceResult::Rejected(..)
|
||||||
));
|
));
|
||||||
assert!(!lifecycle.has_attempt(0));
|
assert!(!lifecycle.has_attempt(0));
|
||||||
assert!(lifecycle.reserve_connect(None).is_err());
|
assert!(lifecycle.reserve_connect().is_err());
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn disconnect_cancels_preparation_even_when_stop_notification_queue_is_full() {
|
fn disconnect_cancels_preparation_even_when_stop_notification_queue_is_full() {
|
||||||
let (state, _state_rx) = watch::channel(VpnState::Disconnected);
|
let (state, _state_rx) = watch::channel(VpnState::Disconnected);
|
||||||
let (_task, lifecycle) = VpnTask::new(state, false, registry());
|
let (_task, lifecycle) = VpnTask::new(state, false, registry());
|
||||||
let reservation = lifecycle.reserve_connect(None).unwrap();
|
let reservation = lifecycle.reserve_connect().unwrap();
|
||||||
while lifecycle.events.try_send(LifecycleEvent::PreparationReleased).is_ok() {}
|
while lifecycle.events.try_send(LifecycleEvent::PreparationReleased).is_ok() {}
|
||||||
assert_eq!(lifecycle.request_disconnect(), ServiceResult::Accepted);
|
assert_eq!(lifecycle.request_disconnect(), ServiceResult::Accepted);
|
||||||
assert!(reservation.cancellation().is_cancelled());
|
assert!(reservation.cancellation().is_cancelled());
|
||||||
assert!(!reservation.drain().is_complete());
|
assert!(!reservation.drain().is_complete());
|
||||||
assert!(lifecycle.reserve_connect(None).is_err());
|
assert!(lifecycle.reserve_connect().is_err());
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn reconnect_admission_is_owned_single_use_and_cancelled_by_disconnect() {
|
|
||||||
let lifecycle = LifecycleHandle::for_tests();
|
|
||||||
let owner = Uuid::new_v4();
|
|
||||||
lifecycle.admissions.lock().unwrap().restart = Some((42, owner));
|
|
||||||
assert!(lifecycle.reserve_connect(Some((42, Uuid::new_v4()))).is_err());
|
|
||||||
assert!(lifecycle.reserve_connect(Some((41, owner))).is_err());
|
|
||||||
let reservation = lifecycle.reserve_connect(Some((42, owner))).unwrap();
|
|
||||||
drop(reservation);
|
|
||||||
assert!(lifecycle.reserve_connect(Some((42, owner))).is_err());
|
|
||||||
lifecycle.admissions.lock().unwrap().restart = Some((43, owner));
|
|
||||||
assert_eq!(lifecycle.request_disconnect(), ServiceResult::Accepted);
|
|
||||||
assert!(lifecycle.reserve_connect(Some((43, owner))).is_err());
|
|
||||||
assert!(lifecycle.reserve_connect(None).is_ok());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -1040,7 +955,7 @@ mod tests {
|
|||||||
let (mut task, lifecycle) = VpnTask::new(state, false, registry());
|
let (mut task, lifecycle) = VpnTask::new(state, false, registry());
|
||||||
let gateway = gpapi::gateway::Gateway::new("vpn".into(), "vpn.example.com".into());
|
let gateway = gpapi::gateway::Gateway::new("vpn".into(), "vpn.example.com".into());
|
||||||
let info = ConnectInfo::new("portal.example.com".into(), gateway.clone(), vec![]);
|
let info = ConnectInfo::new("portal.example.com".into(), gateway.clone(), vec![]);
|
||||||
let reservation = lifecycle.reserve_connect(None).unwrap();
|
let reservation = lifecycle.reserve_connect().unwrap();
|
||||||
let cancellation = reservation.cancellation();
|
let cancellation = reservation.cancellation();
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
reservation.commit(
|
reservation.commit(
|
||||||
@@ -1061,7 +976,6 @@ mod tests {
|
|||||||
cancellation,
|
cancellation,
|
||||||
task: tokio::spawn(async {}),
|
task: tokio::spawn(async {}),
|
||||||
failure: None,
|
failure: None,
|
||||||
reconnect_required: false,
|
|
||||||
});
|
});
|
||||||
task.send_state(VpnState::Connecting(Box::new(info)));
|
task.send_state(VpnState::Connecting(Box::new(info)));
|
||||||
let mut member = gpapi::session::GatewaySessionSummary {
|
let mut member = gpapi::session::GatewaySessionSummary {
|
||||||
@@ -1116,7 +1030,6 @@ mod tests {
|
|||||||
cancellation: cancellation.clone(),
|
cancellation: cancellation.clone(),
|
||||||
task: worker,
|
task: worker,
|
||||||
failure: None,
|
failure: None,
|
||||||
reconnect_required: false,
|
|
||||||
});
|
});
|
||||||
assert_eq!(lifecycle.request_disconnect(), ServiceResult::Accepted);
|
assert_eq!(lifecycle.request_disconnect(), ServiceResult::Accepted);
|
||||||
let stop = task.events.recv().await.unwrap();
|
let stop = task.events.recv().await.unwrap();
|
||||||
@@ -1163,7 +1076,6 @@ mod tests {
|
|||||||
cancellation: cancellation.clone(),
|
cancellation: cancellation.clone(),
|
||||||
task: tokio::spawn(async {}),
|
task: tokio::spawn(async {}),
|
||||||
failure: None,
|
failure: None,
|
||||||
reconnect_required: false,
|
|
||||||
});
|
});
|
||||||
task.send_state(VpnState::Connecting(Box::new(
|
task.send_state(VpnState::Connecting(Box::new(
|
||||||
task.active.as_ref().unwrap().info.clone(),
|
task.active.as_ref().unwrap().info.clone(),
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
use std::{sync::Arc, time::Duration};
|
use std::{sync::Arc, time::Duration};
|
||||||
|
|
||||||
use anyhow::Context;
|
use anyhow::Context;
|
||||||
use gpapi::collection::CollectionControl;
|
use gpapi::process::collection::CollectionControl;
|
||||||
use gpapi::session::{
|
use gpapi::session::{
|
||||||
GatewaySessionSummary, MaintenanceState, SessionEndReason,
|
GatewaySessionSummary, MaintenanceState, SessionEndReason,
|
||||||
desktop::non_tunnel::{SessionCallbacks, SessionExit, maintain_non_tunnel_sessions},
|
non_tunnel::{SessionCallbacks, SessionExit, maintain_non_tunnel_sessions},
|
||||||
};
|
};
|
||||||
use log::warn;
|
use log::warn;
|
||||||
use tokio::sync::{mpsc, watch};
|
use tokio::sync::{mpsc, watch};
|
||||||
|
|||||||
@@ -11,10 +11,7 @@ use gpapi::{
|
|||||||
transport::ServiceResult,
|
transport::ServiceResult,
|
||||||
vpn_state::{ConnectInfo, VpnState},
|
vpn_state::{ConnectInfo, VpnState},
|
||||||
},
|
},
|
||||||
session::{
|
session::{ClientAddresses, GatewayAuthentication, GatewaySession, GatewaySessions, transport::GatewayTransport},
|
||||||
GatewayAuthentication, desktop::ClientAddresses, desktop::GatewaySession, desktop::GatewaySessions,
|
|
||||||
transport::GatewayTransport,
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
use openssl::{
|
use openssl::{
|
||||||
asn1::Asn1Time,
|
asn1::Asn1Time,
|
||||||
@@ -73,7 +70,7 @@ async fn cancelled_pending_owner_logs_out_and_releases_admission_after_response(
|
|||||||
let mut member = fixture.plan().members()[0].clone();
|
let mut member = fixture.plan().members()[0].clone();
|
||||||
member.authentication =
|
member.authentication =
|
||||||
GatewayAuthentication::new("authcookie=fixture&user=fixture".into(), "internal".into()).unwrap();
|
GatewayAuthentication::new("authcookie=fixture&user=fixture".into(), "internal".into()).unwrap();
|
||||||
let plan = gpapi::session::desktop::ConnectionPlan::new(vec![member], vec![], fixture.plan().policy()).unwrap();
|
let plan = gpapi::session::ConnectionPlan::new(vec![member], vec![], fixture.plan().policy()).unwrap();
|
||||||
let request = gpapi::service::request::ConnectRequest::new(fixture.info().clone(), plan);
|
let request = gpapi::service::request::ConnectRequest::new(fixture.info().clone(), plan);
|
||||||
let mut prepared = PreparedConnection::lifecycle_fixture(request);
|
let mut prepared = PreparedConnection::lifecycle_fixture(request);
|
||||||
let mut params = GpParams::builder(prepared.resources.profile.clone());
|
let mut params = GpParams::builder(prepared.resources.profile.clone());
|
||||||
@@ -154,7 +151,7 @@ async fn cancelled_pending_owner_logs_out_and_releases_admission_after_response(
|
|||||||
let (state, state_rx) = watch::channel(VpnState::Disconnected);
|
let (state, state_rx) = watch::channel(VpnState::Disconnected);
|
||||||
let (mut task, lifecycle) = VpnTask::new(state, false, registry.clone());
|
let (mut task, lifecycle) = VpnTask::new(state, false, registry.clone());
|
||||||
let reservation = registry
|
let reservation = registry
|
||||||
.reserve_connection(session_id, 1, true, || lifecycle.reserve_connect(None))
|
.reserve_connection(session_id, 1, true, || lifecycle.reserve_connect())
|
||||||
.unwrap();
|
.unwrap();
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
registry.commit_connection(session_id, 1, true, || reservation.commit(
|
registry.commit_connection(session_id, 1, true, || reservation.commit(
|
||||||
@@ -181,7 +178,7 @@ async fn cancelled_pending_owner_logs_out_and_releases_admission_after_response(
|
|||||||
.unwrap();
|
.unwrap();
|
||||||
assert!(lifecycle.has_attempt(0));
|
assert!(lifecycle.has_attempt(0));
|
||||||
assert!(!drain_waiter.is_finished());
|
assert!(!drain_waiter.is_finished());
|
||||||
assert!(lifecycle.reserve_connect(None).is_err());
|
assert!(lifecycle.reserve_connect().is_err());
|
||||||
assert!(!task.active.as_ref().unwrap().task.is_finished());
|
assert!(!task.active.as_ref().unwrap().task.is_finished());
|
||||||
assert!(matches!(*state_rx.borrow(), VpnState::Disconnected));
|
assert!(matches!(*state_rx.borrow(), VpnState::Disconnected));
|
||||||
release.send(()).unwrap();
|
release.send(()).unwrap();
|
||||||
@@ -194,7 +191,7 @@ async fn cancelled_pending_owner_logs_out_and_releases_admission_after_response(
|
|||||||
}
|
}
|
||||||
assert!(!lifecycle.has_attempt(0));
|
assert!(!lifecycle.has_attempt(0));
|
||||||
drain_waiter.await.unwrap();
|
drain_waiter.await.unwrap();
|
||||||
assert!(lifecycle.reserve_connect(None).is_ok());
|
assert!(lifecycle.reserve_connect().is_ok());
|
||||||
assert!(matches!(*state_rx.borrow(), VpnState::Disconnected));
|
assert!(matches!(*state_rx.borrow(), VpnState::Disconnected));
|
||||||
let request = server.await.unwrap();
|
let request = server.await.unwrap();
|
||||||
assert!(request.starts_with("POST /ssl-vpn/logout.esp "));
|
assert!(request.starts_with("POST /ssl-vpn/logout.esp "));
|
||||||
|
|||||||
@@ -2,13 +2,11 @@ use std::{sync::Arc, time::Duration};
|
|||||||
|
|
||||||
use anyhow::Context;
|
use anyhow::Context;
|
||||||
use gpapi::{
|
use gpapi::{
|
||||||
collection::{CollectionBudget, CollectionControl},
|
|
||||||
gp_params::GpParams,
|
gp_params::GpParams,
|
||||||
os_profile::OsProfile,
|
os_profile::OsProfile,
|
||||||
|
process::collection::{CollectionBudget, CollectionControl},
|
||||||
service::request::ConnectRequest,
|
service::request::ConnectRequest,
|
||||||
session::{
|
session::{GatewaySession, GatewaySessions, network::PhysicalNetwork, transport::GatewayTransport},
|
||||||
desktop::GatewaySession, desktop::GatewaySessions, desktop::network::PhysicalNetwork, transport::GatewayTransport,
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
use tokio_util::sync::CancellationToken;
|
use tokio_util::sync::CancellationToken;
|
||||||
|
|
||||||
@@ -33,17 +31,7 @@ pub(crate) async fn prepare_connection(
|
|||||||
brokered_macos: bool,
|
brokered_macos: bool,
|
||||||
cancellation: CancellationToken,
|
cancellation: CancellationToken,
|
||||||
) -> anyhow::Result<PreparedConnection> {
|
) -> anyhow::Result<PreparedConnection> {
|
||||||
let mode = request.args().packet_delivery().clone();
|
|
||||||
let request = request.with_packet_delivery(mode);
|
|
||||||
let args = request.args();
|
let args = request.args();
|
||||||
if let gpapi::script_tun::PacketDelivery::ScriptTun(consumer) = args.packet_delivery() {
|
|
||||||
consumer.validate()?;
|
|
||||||
anyhow::ensure!(
|
|
||||||
request.plan().members().len() == 1
|
|
||||||
&& request.plan().members()[0].authentication.mode() == gpapi::session::SessionMode::Tunnel,
|
|
||||||
"Script-tun requires a tunnel gateway"
|
|
||||||
);
|
|
||||||
}
|
|
||||||
let non_tunnel = request
|
let non_tunnel = request
|
||||||
.plan()
|
.plan()
|
||||||
.members()
|
.members()
|
||||||
@@ -151,17 +139,14 @@ impl PreparedConnection {
|
|||||||
/// Lifecycle-only fixtures own no issued server sessions. Protocol ownership
|
/// Lifecycle-only fixtures own no issued server sessions. Protocol ownership
|
||||||
/// checks use actual gateway transports rather than this actor-state fixture.
|
/// checks use actual gateway transports rather than this actor-state fixture.
|
||||||
pub(crate) fn lifecycle_fixture(request: ConnectRequest) -> Self {
|
pub(crate) fn lifecycle_fixture(request: ConnectRequest) -> Self {
|
||||||
let profile = gpapi::os_profile::desktop::collect_profile(
|
let profile = OsProfile::builder(gpapi::os_profile::ClientOs::Linux)
|
||||||
OsProfile::builder(gpapi::os_profile::ClientOs::Linux).host_identity(
|
.host_identity(gpapi::os_profile::HostIdentity::from_parts(
|
||||||
gpapi::os_profile::desktop::identity_from_parts(
|
|
||||||
"fixture".into(),
|
"fixture".into(),
|
||||||
"fixture-host".into(),
|
"fixture-host".into(),
|
||||||
"fixture-serial".into(),
|
"fixture-serial".into(),
|
||||||
"02:00:00:00:00:01".into(),
|
"02:00:00:00:00:01".into(),
|
||||||
),
|
))
|
||||||
),
|
.build();
|
||||||
None,
|
|
||||||
);
|
|
||||||
Self {
|
Self {
|
||||||
request,
|
request,
|
||||||
resources: Arc::new(ConnectionResources {
|
resources: Arc::new(ConnectionResources {
|
||||||
@@ -222,17 +207,14 @@ mod tests {
|
|||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn ordinary_tunnel_preparation_needs_no_physical_binding_or_resolver() {
|
async fn ordinary_tunnel_preparation_needs_no_physical_binding_or_resolver() {
|
||||||
let gateway = Gateway::new("fixture".into(), "does-not-resolve.invalid".into());
|
let gateway = Gateway::new("fixture".into(), "does-not-resolve.invalid".into());
|
||||||
let profile = gpapi::os_profile::desktop::collect_profile(
|
let profile = OsProfile::builder(gpapi::os_profile::ClientOs::Linux)
|
||||||
OsProfile::builder(gpapi::os_profile::ClientOs::Linux).host_identity(
|
.host_identity(gpapi::os_profile::HostIdentity::from_parts(
|
||||||
gpapi::os_profile::desktop::identity_from_parts(
|
|
||||||
"fixture".into(),
|
"fixture".into(),
|
||||||
"fixture-host".into(),
|
"fixture-host".into(),
|
||||||
"fixture-serial".into(),
|
"fixture-serial".into(),
|
||||||
"02:00:00:00:00:01".into(),
|
"02:00:00:00:00:01".into(),
|
||||||
),
|
))
|
||||||
),
|
.build();
|
||||||
None,
|
|
||||||
);
|
|
||||||
let request = super::super::test_connect_request(ConnectInfo::new("portal.example.com".into(), gateway, vec![]))
|
let request = super::super::test_connect_request(ConnectInfo::new("portal.example.com".into(), gateway, vec![]))
|
||||||
.with_os_profile(&profile)
|
.with_os_profile(&profile)
|
||||||
.with_disable_ipv6(true);
|
.with_disable_ipv6(true);
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ use std::{sync::Arc, time::Duration};
|
|||||||
|
|
||||||
use anyhow::{Context, ensure};
|
use anyhow::{Context, ensure};
|
||||||
use gpapi::{
|
use gpapi::{
|
||||||
collection::{CollectionBudget, CollectionControl},
|
process::collection::{CollectionBudget, CollectionControl},
|
||||||
service::request::ConnectRequest,
|
service::request::ConnectRequest,
|
||||||
session::SessionMode,
|
session::SessionMode,
|
||||||
};
|
};
|
||||||
@@ -31,12 +31,10 @@ struct TunnelInput {
|
|||||||
source: Arc<openconnect::HipSource>,
|
source: Arc<openconnect::HipSource>,
|
||||||
session_id: Option<Uuid>,
|
session_id: Option<Uuid>,
|
||||||
registry: Arc<crate::session_registry::SessionRegistry>,
|
registry: Arc<crate::session_registry::SessionRegistry>,
|
||||||
desktop_uid: Option<u32>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
struct PreparedTunnel {
|
struct PreparedTunnel {
|
||||||
vpn: Arc<Vpn>,
|
vpn: Arc<Vpn>,
|
||||||
script_tun: Option<super::script_tun::PreparedScriptTun>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The accepted attempt owns cleanup through fallible setup. Non-tunnel workers
|
/// The accepted attempt owns cleanup through fallible setup. Non-tunnel workers
|
||||||
@@ -49,6 +47,13 @@ pub(super) fn spawn(
|
|||||||
) -> JoinHandle<()> {
|
) -> JoinHandle<()> {
|
||||||
tokio::spawn(async move {
|
tokio::spawn(async move {
|
||||||
let attempt = input.attempt;
|
let attempt = input.attempt;
|
||||||
|
let non_tunnel = input
|
||||||
|
.connection
|
||||||
|
.request
|
||||||
|
.plan()
|
||||||
|
.members()
|
||||||
|
.iter()
|
||||||
|
.all(|member| member.authentication.mode() == SessionMode::NonTunnel);
|
||||||
let mut failure = None;
|
let mut failure = None;
|
||||||
let mut approval = None;
|
let mut approval = None;
|
||||||
if !cancellation.is_cancelled() {
|
if !cancellation.is_cancelled() {
|
||||||
@@ -77,8 +82,8 @@ pub(super) fn spawn(
|
|||||||
.all(|member| member.authentication.mode() == SessionMode::NonTunnel)
|
.all(|member| member.authentication.mode() == SessionMode::NonTunnel)
|
||||||
{
|
{
|
||||||
match super::non_tunnel::run(&mut input, source, guard, cancellation.clone(), events.clone()).await {
|
match super::non_tunnel::run(&mut input, source, guard, cancellation.clone(), events.clone()).await {
|
||||||
Ok(gpapi::session::desktop::non_tunnel::SessionExit::Disconnected) => {}
|
Ok(gpapi::session::non_tunnel::SessionExit::Disconnected) => {}
|
||||||
Ok(gpapi::session::desktop::non_tunnel::SessionExit::Failed(reason)) => {
|
Ok(gpapi::session::non_tunnel::SessionExit::Failed(reason)) => {
|
||||||
let message = match reason {
|
let message = match reason {
|
||||||
gpapi::session::SessionEndReason::InvalidCookie => {
|
gpapi::session::SessionEndReason::InvalidCookie => {
|
||||||
"Internal gateway authentication expired; connect again"
|
"Internal gateway authentication expired; connect again"
|
||||||
@@ -105,47 +110,11 @@ pub(super) fn spawn(
|
|||||||
source,
|
source,
|
||||||
session_id: input.session_id,
|
session_id: input.session_id,
|
||||||
registry: input.registry.clone(),
|
registry: input.registry.clone(),
|
||||||
desktop_uid: input.desktop_uid,
|
|
||||||
};
|
};
|
||||||
input.connection.request.release_script_tun_bootstrap();
|
|
||||||
let setup_cancel = cancellation.clone();
|
let setup_cancel = cancellation.clone();
|
||||||
let prepared = tokio::task::spawn_blocking(move || prepare_tunnel(tunnel_input, &setup_cancel)).await;
|
let prepared = tokio::task::spawn_blocking(move || prepare_tunnel(tunnel_input, &setup_cancel)).await;
|
||||||
match prepared {
|
match prepared {
|
||||||
Ok(Ok(mut prepared)) => {
|
Ok(Ok(prepared)) => {
|
||||||
if let Some(script_tun) = prepared.script_tun.take() {
|
|
||||||
if let Some(session_id) = input.session_id {
|
|
||||||
match super::script_tun::run(
|
|
||||||
gpapi::script_tun::Identity {
|
|
||||||
service_instance: input.registry.service_instance_id(),
|
|
||||||
attempt,
|
|
||||||
launch_id: match input.connection.request.args().packet_delivery() {
|
|
||||||
gpapi::script_tun::PacketDelivery::ScriptTun(request) => request.launch_id,
|
|
||||||
_ => unreachable!(),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
prepared.vpn.clone(),
|
|
||||||
script_tun,
|
|
||||||
guard,
|
|
||||||
&input.lifecycle,
|
|
||||||
cancellation.clone(),
|
|
||||||
events.clone(),
|
|
||||||
session_id,
|
|
||||||
input.registry.clone(),
|
|
||||||
&mut input.connection.sessions,
|
|
||||||
)
|
|
||||||
.await
|
|
||||||
{
|
|
||||||
Ok(()) => {}
|
|
||||||
Err(error) if error.is::<super::script_tun::NetworkChanged>() && !cancellation.is_cancelled() => {
|
|
||||||
let _ = events.send(LifecycleEvent::ReconnectRequired { attempt }).await;
|
|
||||||
}
|
|
||||||
Err(error) if !cancellation.is_cancelled() => {
|
|
||||||
failure = Some(error.to_string());
|
|
||||||
}
|
|
||||||
Err(_) => {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
run_tunnel(
|
run_tunnel(
|
||||||
attempt,
|
attempt,
|
||||||
&prepared,
|
&prepared,
|
||||||
@@ -155,15 +124,10 @@ pub(super) fn spawn(
|
|||||||
cancellation.clone(),
|
cancellation.clone(),
|
||||||
events.clone(),
|
events.clone(),
|
||||||
)
|
)
|
||||||
.await;
|
.await
|
||||||
}
|
|
||||||
}
|
|
||||||
Ok(Err(error)) => {
|
|
||||||
failure = Some(format!("Failed to prepare tunnel: {error:#}"));
|
|
||||||
}
|
|
||||||
Err(error) => {
|
|
||||||
failure = Some(format!("Tunnel setup worker failed: {error}"));
|
|
||||||
}
|
}
|
||||||
|
Ok(Err(error)) => warn!("Failed to prepare tunnel: {error:#}"),
|
||||||
|
Err(error) => warn!("Tunnel setup worker failed: {error}"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -181,7 +145,7 @@ pub(super) fn spawn(
|
|||||||
// Identity and approval remain alive through worker drain and logout. Ended
|
// Identity and approval remain alive through worker drain and logout. Ended
|
||||||
// only releases admission after the actor also joins this task.
|
// only releases admission after the actor also joins this task.
|
||||||
drop(approval);
|
drop(approval);
|
||||||
if !cancellation.is_cancelled() {
|
if non_tunnel && !cancellation.is_cancelled() {
|
||||||
if let Some(reason) = failure {
|
if let Some(reason) = failure {
|
||||||
let _ = events.send(LifecycleEvent::Failed { attempt, reason }).await;
|
let _ = events.send(LifecycleEvent::Failed { attempt, reason }).await;
|
||||||
}
|
}
|
||||||
@@ -246,24 +210,8 @@ fn prepare_tunnel(input: TunnelInput, cancellation: &CancellationToken) -> anyho
|
|||||||
);
|
);
|
||||||
let member = &input.request.plan().members()[0];
|
let member = &input.request.plan().members()[0];
|
||||||
let identity_files = &input.resources.identity_files;
|
let identity_files = &input.resources.identity_files;
|
||||||
let (builder, script_tun) = match args.packet_delivery() {
|
|
||||||
gpapi::script_tun::PacketDelivery::System => (
|
|
||||||
crate::vpn_script::builder(member.gateway.server(), member.authentication.cookie(), args)?,
|
|
||||||
None,
|
|
||||||
),
|
|
||||||
gpapi::script_tun::PacketDelivery::ScriptTun(request) => {
|
|
||||||
ensure!(input.session_id.is_some(), "Script-tun requires a desktop session");
|
|
||||||
let (builder, script_tun) = super::script_tun::builder(
|
|
||||||
member.gateway.server(),
|
|
||||||
member.authentication.cookie(),
|
|
||||||
request,
|
|
||||||
input.desktop_uid.context("Desktop identity is unavailable")?,
|
|
||||||
)?;
|
|
||||||
(builder, Some(script_tun))
|
|
||||||
}
|
|
||||||
};
|
|
||||||
let vpn = Arc::new(
|
let vpn = Arc::new(
|
||||||
builder
|
crate::vpn_script::builder(member.gateway.server(), member.authentication.cookie(), args)?
|
||||||
.user_agent(args.user_agent())
|
.user_agent(args.user_agent())
|
||||||
.os(args.openconnect_os())
|
.os(args.openconnect_os())
|
||||||
.os_version(args.os_version())
|
.os_version(args.os_version())
|
||||||
@@ -283,11 +231,6 @@ fn prepare_tunnel(input: TunnelInput, cancellation: &CancellationToken) -> anyho
|
|||||||
.reconnect_timeout(args.reconnect_timeout())
|
.reconnect_timeout(args.reconnect_timeout())
|
||||||
.mtu(args.mtu())
|
.mtu(args.mtu())
|
||||||
.disable_ipv6(args.disable_ipv6())
|
.disable_ipv6(args.disable_ipv6())
|
||||||
.gateway_ip_preference(match args.gateway_ip_preference() {
|
|
||||||
gpapi::gateway::GatewayIpPreference::Auto => openconnect::GatewayIpPreference::Auto,
|
|
||||||
gpapi::gateway::GatewayIpPreference::Ipv4 => openconnect::GatewayIpPreference::Ipv4,
|
|
||||||
gpapi::gateway::GatewayIpPreference::Ipv6 => openconnect::GatewayIpPreference::Ipv6,
|
|
||||||
})
|
|
||||||
.no_dtls(args.no_dtls())
|
.no_dtls(args.no_dtls())
|
||||||
.local_hostname(args.local_hostname())
|
.local_hostname(args.local_hostname())
|
||||||
.dpd_interval(args.force_dpd())
|
.dpd_interval(args.force_dpd())
|
||||||
@@ -304,7 +247,7 @@ fn prepare_tunnel(input: TunnelInput, cancellation: &CancellationToken) -> anyho
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
Ok(PreparedTunnel { vpn, script_tun })
|
Ok(PreparedTunnel { vpn })
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn run_tunnel(
|
async fn run_tunnel(
|
||||||
@@ -312,7 +255,7 @@ async fn run_tunnel(
|
|||||||
prepared: &PreparedTunnel,
|
prepared: &PreparedTunnel,
|
||||||
approval: &crate::hip_source::HipApproval,
|
approval: &crate::hip_source::HipApproval,
|
||||||
lifecycle: &LifecycleHandle,
|
lifecycle: &LifecycleHandle,
|
||||||
sessions: &mut gpapi::session::desktop::GatewaySessions,
|
sessions: &mut gpapi::session::GatewaySessions,
|
||||||
cancellation: CancellationToken,
|
cancellation: CancellationToken,
|
||||||
events: mpsc::Sender<LifecycleEvent>,
|
events: mpsc::Sender<LifecycleEvent>,
|
||||||
) {
|
) {
|
||||||
|
|||||||
@@ -1,247 +0,0 @@
|
|||||||
//! Supervision of an unprivileged script-tun consumer; payload semantics belong to the caller.
|
|
||||||
use super::{LifecycleEvent, LifecycleHandle};
|
|
||||||
use anyhow::{Context, bail, ensure};
|
|
||||||
use gpapi::script_tun::{Bootstrap, Identity, Message, ScriptTunRequest, receive, send as send_message};
|
|
||||||
use openconnect::{Vpn, VpnBuilder, tunnel::Event};
|
|
||||||
use std::{sync::Arc, time::Duration};
|
|
||||||
use tokio::{net::UnixStream, sync::mpsc, time::Instant};
|
|
||||||
use tokio_util::sync::CancellationToken;
|
|
||||||
|
|
||||||
pub(super) struct PreparedScriptTun {
|
|
||||||
pub control: std::os::unix::net::UnixStream,
|
|
||||||
pub bootstrap: Bootstrap,
|
|
||||||
}
|
|
||||||
|
|
||||||
pub(super) fn builder(
|
|
||||||
server: &str,
|
|
||||||
cookie: &str,
|
|
||||||
request: &ScriptTunRequest,
|
|
||||||
uid: u32,
|
|
||||||
) -> anyhow::Result<(VpnBuilder, PreparedScriptTun)> {
|
|
||||||
request.validate()?;
|
|
||||||
ensure!(uid != 0, "Script-tun worker requires a desktop user");
|
|
||||||
let (control, child) = std::os::unix::net::UnixStream::pair()?;
|
|
||||||
let builder = Vpn::builder(server, cookie).script_tun_program(
|
|
||||||
request.program.to_str().context("Program is not UTF-8")?,
|
|
||||||
&request.args,
|
|
||||||
uid,
|
|
||||||
child.into(),
|
|
||||||
)?;
|
|
||||||
Ok((
|
|
||||||
builder,
|
|
||||||
PreparedScriptTun {
|
|
||||||
control,
|
|
||||||
bootstrap: request.bootstrap.clone(),
|
|
||||||
},
|
|
||||||
))
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Debug)]
|
|
||||||
pub(super) struct NetworkChanged;
|
|
||||||
impl std::fmt::Display for NetworkChanged {
|
|
||||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
|
||||||
f.write_str("VPN network configuration changed")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
impl std::error::Error for NetworkChanged {}
|
|
||||||
|
|
||||||
enum Native {
|
|
||||||
Event(Event),
|
|
||||||
Established(openconnect::VpnSessionInfo),
|
|
||||||
}
|
|
||||||
|
|
||||||
pub(super) async fn run(
|
|
||||||
identity: Identity,
|
|
||||||
vpn: Arc<Vpn>,
|
|
||||||
prepared: PreparedScriptTun,
|
|
||||||
approval: &crate::hip_source::HipApproval,
|
|
||||||
lifecycle: &LifecycleHandle,
|
|
||||||
cancellation: CancellationToken,
|
|
||||||
events: mpsc::Sender<LifecycleEvent>,
|
|
||||||
session_id: uuid::Uuid,
|
|
||||||
registry: Arc<crate::session_registry::SessionRegistry>,
|
|
||||||
sessions: &mut gpapi::session::desktop::GatewaySessions,
|
|
||||||
) -> anyhow::Result<()> {
|
|
||||||
let attempt = identity.attempt;
|
|
||||||
let (native_tx, native) = mpsc::channel(64);
|
|
||||||
let observed = native_tx.clone();
|
|
||||||
let overflow = cancellation.clone();
|
|
||||||
let monitor = gptunnel::TunnelMonitor::attach_with_observer(vpn.clone(), move |event| {
|
|
||||||
if !matches!(event, Event::Statistics(_)) && observed.try_send(Native::Event(event.clone())).is_err() {
|
|
||||||
overflow.cancel();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
let event_result = events
|
|
||||||
.send(LifecycleEvent::TunnelMonitor {
|
|
||||||
attempt,
|
|
||||||
monitor: monitor.clone(),
|
|
||||||
})
|
|
||||||
.await;
|
|
||||||
if event_result.is_err() {
|
|
||||||
monitor.stop().await;
|
|
||||||
return Ok(());
|
|
||||||
}
|
|
||||||
let worker_vpn = vpn.clone();
|
|
||||||
std::mem::take(sessions).relinquish();
|
|
||||||
let worker = tokio::task::spawn_blocking(move || {
|
|
||||||
worker_vpn.connect(move |session| {
|
|
||||||
let _ = native_tx.try_send(Native::Established(session));
|
|
||||||
})
|
|
||||||
});
|
|
||||||
tokio::pin!(worker);
|
|
||||||
let mut worker_done = false;
|
|
||||||
let stop = cancellation.child_token();
|
|
||||||
let supervisor = supervise(identity, prepared, native, stop.clone(), events);
|
|
||||||
tokio::pin!(supervisor);
|
|
||||||
let mut supervisor_done = false;
|
|
||||||
let mut approval_poll = tokio::time::interval(Duration::from_millis(250));
|
|
||||||
let result = loop {
|
|
||||||
tokio::select! {
|
|
||||||
biased;
|
|
||||||
result = &mut supervisor => { supervisor_done = true; break result; }
|
|
||||||
result = &mut worker => { worker_done = true; break Err(anyhow::anyhow!("VPN worker ended: {:?}", result)); }
|
|
||||||
_ = approval_poll.tick() => {
|
|
||||||
if !approval.approval_is_valid() || !registry.has_session(session_id) {
|
|
||||||
super::runtime::stop_for_revoked_approval(lifecycle, &cancellation);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
stop.cancel();
|
|
||||||
if !supervisor_done {
|
|
||||||
let _ = supervisor.await;
|
|
||||||
}
|
|
||||||
vpn.disconnect();
|
|
||||||
if !worker_done {
|
|
||||||
let _ = worker.await;
|
|
||||||
}
|
|
||||||
monitor.stop().await;
|
|
||||||
result
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Debug, PartialEq, Eq)]
|
|
||||||
enum WorkerState {
|
|
||||||
Preparing,
|
|
||||||
Ready,
|
|
||||||
Activating,
|
|
||||||
Active,
|
|
||||||
Suspending,
|
|
||||||
}
|
|
||||||
|
|
||||||
// The same control loop runs against native observations in production and a
|
|
||||||
// generic socket consumer in tests; VPN ownership stays in run().
|
|
||||||
async fn supervise(
|
|
||||||
identity: Identity,
|
|
||||||
mut prepared: PreparedScriptTun,
|
|
||||||
mut native: mpsc::Receiver<Native>,
|
|
||||||
cancellation: CancellationToken,
|
|
||||||
events: mpsc::Sender<LifecycleEvent>,
|
|
||||||
) -> anyhow::Result<()> {
|
|
||||||
let attempt = identity.attempt;
|
|
||||||
prepared.control.set_nonblocking(true)?;
|
|
||||||
let control = UnixStream::from_std(prepared.control)?;
|
|
||||||
let (mut input, mut output) = control.into_split();
|
|
||||||
let (messages_tx, mut messages) = mpsc::channel(8);
|
|
||||||
let reader = tokio::spawn(async move {
|
|
||||||
loop {
|
|
||||||
let message = receive(&mut input).await;
|
|
||||||
let failed = message.is_err();
|
|
||||||
if messages_tx.send(message).await.is_err() || failed {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
let mut network = None;
|
|
||||||
let mut session = None;
|
|
||||||
let mut worker = WorkerState::Preparing;
|
|
||||||
let mut online = false;
|
|
||||||
let mut was_connected = false;
|
|
||||||
let mut deadline: Option<Instant> = None;
|
|
||||||
let result = async {
|
|
||||||
loop {
|
|
||||||
tokio::select! {
|
|
||||||
biased;
|
|
||||||
_ = cancellation.cancelled() => break,
|
|
||||||
_ = async { if let Some(at) = deadline { tokio::time::sleep_until(at).await } else { std::future::pending().await } } => bail!("Script-tun worker activation timed out"),
|
|
||||||
message = messages.recv() => match message.context("Script-tun control reader stopped")?? {
|
|
||||||
Message::Ready if worker == WorkerState::Preparing && network.is_some() => {
|
|
||||||
worker = WorkerState::Ready;
|
|
||||||
}
|
|
||||||
Message::Activated if worker == WorkerState::Activating => {
|
|
||||||
ensure!(online, "Script-tun activation completed while VPN was offline");
|
|
||||||
ensure!(!cancellation.is_cancelled(), "Script-tun startup cancelled");
|
|
||||||
events.send(LifecycleEvent::Established { attempt, session: session.clone().context("Native session is missing")? }).await?;
|
|
||||||
worker = WorkerState::Active; was_connected = true; deadline = None;
|
|
||||||
}
|
|
||||||
Message::Suspended if worker == WorkerState::Suspending => { worker = WorkerState::Ready; deadline = None; }
|
|
||||||
Message::Error { message } => bail!("Script-tun worker: {message}"),
|
|
||||||
_ => bail!("Unexpected script-tun consumer message"),
|
|
||||||
},
|
|
||||||
event = native.recv() => match event.context("Native event stream ended")? {
|
|
||||||
Native::Established(value) => { session = Some(value); online = true; deadline.get_or_insert(Instant::now() + Duration::from_secs(10)); }
|
|
||||||
Native::Event(Event::Configuration(config)) => {
|
|
||||||
let observed = config.context("VPN configuration is absent").and_then(observed_network);
|
|
||||||
if was_connected && (observed.is_err() || network.as_ref().is_some_and(|old| observed.as_ref().is_ok_and(|new| old != new))) { return Err(NetworkChanged.into()); }
|
|
||||||
let observed = observed?;
|
|
||||||
if let Some(old) = &network { ensure!(old == &observed, "VPN configuration changed during startup"); }
|
|
||||||
else {
|
|
||||||
send(&mut output, &Message::Configure { identity, bootstrap: std::mem::take(&mut prepared.bootstrap), network: observed.clone() }).await?;
|
|
||||||
network = Some(observed);
|
|
||||||
deadline = Some(Instant::now() + Duration::from_secs(10));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Native::Event(Event::Reconnecting) => {
|
|
||||||
ensure!(worker != WorkerState::Activating, "VPN connection interrupted during script-tun activation; reconnect the VPN");
|
|
||||||
online = false;
|
|
||||||
events.send(LifecycleEvent::ScriptTunSuspended { attempt }).await?;
|
|
||||||
if matches!(worker, WorkerState::Ready | WorkerState::Active) {
|
|
||||||
send(&mut output, &Message::Suspend).await?; worker = WorkerState::Suspending;
|
|
||||||
deadline = Some(Instant::now() + Duration::from_secs(10));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Native::Event(Event::Reconnected) => online = true,
|
|
||||||
Native::Event(_) => {},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if online && session.is_some() && worker == WorkerState::Ready && !cancellation.is_cancelled() {
|
|
||||||
send(&mut output, &Message::Activate).await?; worker = WorkerState::Activating;
|
|
||||||
deadline = Some(Instant::now() + Duration::from_secs(10));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Ok(())
|
|
||||||
}.await;
|
|
||||||
let _ = tokio::time::timeout(Duration::from_millis(250), send(&mut output, &Message::Stop)).await;
|
|
||||||
drop(output);
|
|
||||||
reader.abort();
|
|
||||||
let _ = reader.await;
|
|
||||||
result
|
|
||||||
}
|
|
||||||
|
|
||||||
fn observed_network(
|
|
||||||
config: openconnect::tunnel::Configuration,
|
|
||||||
) -> anyhow::Result<gpapi::session::desktop::tunnel::NegotiatedNetwork> {
|
|
||||||
ensure!(
|
|
||||||
!config.truncated && !config.dns.truncated && !config.search_domains.truncated,
|
|
||||||
"VPN configuration is truncated"
|
|
||||||
);
|
|
||||||
Ok(gpapi::session::desktop::tunnel::NegotiatedNetwork {
|
|
||||||
addresses: [config.ipv4, config.ipv6.or(config.netmask6)]
|
|
||||||
.into_iter()
|
|
||||||
.flatten()
|
|
||||||
.map(|a| a.split('/').next().unwrap().parse())
|
|
||||||
.collect::<Result<_, _>>()?,
|
|
||||||
dns: config.dns.items.iter().map(|a| a.parse()).collect::<Result<_, _>>()?,
|
|
||||||
search: config.search_domains.items,
|
|
||||||
mtu: config.mtu.context("VPN MTU is absent")? as usize,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
async fn send(writer: &mut (impl tokio::io::AsyncWrite + Unpin), message: &Message) -> anyhow::Result<()> {
|
|
||||||
tokio::time::timeout(Duration::from_secs(10), send_message(writer, message))
|
|
||||||
.await
|
|
||||||
.context("Script-tun control write timed out")??;
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(test)]
|
|
||||||
mod tests;
|
|
||||||
@@ -1,293 +0,0 @@
|
|||||||
use super::*;
|
|
||||||
use openconnect::{VpnSessionInfo, tunnel::Configuration};
|
|
||||||
use tokio::io::AsyncWriteExt;
|
|
||||||
|
|
||||||
// A generic consumer, with no proxy settings or private worker protocol.
|
|
||||||
struct Consumer {
|
|
||||||
control: UnixStream,
|
|
||||||
native: mpsc::Sender<Native>,
|
|
||||||
events: mpsc::Receiver<LifecycleEvent>,
|
|
||||||
cancel: CancellationToken,
|
|
||||||
task: tokio::task::JoinHandle<anyhow::Result<()>>,
|
|
||||||
identity: Identity,
|
|
||||||
}
|
|
||||||
impl Consumer {
|
|
||||||
fn new() -> Self {
|
|
||||||
let (control, child) = std::os::unix::net::UnixStream::pair().unwrap();
|
|
||||||
child.set_nonblocking(true).unwrap();
|
|
||||||
let (native, observations) = mpsc::channel(64);
|
|
||||||
let (events, notifications) = mpsc::channel(8);
|
|
||||||
let identity = Identity {
|
|
||||||
service_instance: uuid::Uuid::new_v4(),
|
|
||||||
attempt: 7,
|
|
||||||
launch_id: uuid::Uuid::new_v4(),
|
|
||||||
};
|
|
||||||
let cancel = CancellationToken::new();
|
|
||||||
let task = tokio::spawn(supervise(
|
|
||||||
identity,
|
|
||||||
PreparedScriptTun {
|
|
||||||
control,
|
|
||||||
bootstrap: Bootstrap::new(b"consumer bootstrap").unwrap(),
|
|
||||||
},
|
|
||||||
observations,
|
|
||||||
cancel.clone(),
|
|
||||||
events,
|
|
||||||
));
|
|
||||||
Self {
|
|
||||||
control: UnixStream::from_std(child).unwrap(),
|
|
||||||
native,
|
|
||||||
events: notifications,
|
|
||||||
cancel,
|
|
||||||
task,
|
|
||||||
identity,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
async fn message(&mut self) -> Message {
|
|
||||||
tokio::time::timeout(Duration::from_secs(2), receive(&mut self.control))
|
|
||||||
.await
|
|
||||||
.unwrap()
|
|
||||||
.unwrap()
|
|
||||||
}
|
|
||||||
async fn event(&mut self) -> LifecycleEvent {
|
|
||||||
tokio::time::timeout(Duration::from_secs(2), self.events.recv())
|
|
||||||
.await
|
|
||||||
.unwrap()
|
|
||||||
.unwrap()
|
|
||||||
}
|
|
||||||
async fn configure(&mut self) {
|
|
||||||
self
|
|
||||||
.native
|
|
||||||
.send(Native::Event(Event::Configuration(Some(configuration()))))
|
|
||||||
.await
|
|
||||||
.unwrap();
|
|
||||||
let Message::Configure {
|
|
||||||
identity,
|
|
||||||
network,
|
|
||||||
bootstrap,
|
|
||||||
} = self.message().await
|
|
||||||
else {
|
|
||||||
panic!("expected Configure")
|
|
||||||
};
|
|
||||||
assert_eq!(identity, self.identity);
|
|
||||||
assert_eq!(network.addresses, vec!["10.0.0.2".parse::<std::net::IpAddr>().unwrap()]);
|
|
||||||
assert_eq!(network.mtu, 1400);
|
|
||||||
assert_eq!(bootstrap.decode().unwrap(), b"consumer bootstrap");
|
|
||||||
}
|
|
||||||
async fn activate(&mut self) {
|
|
||||||
self.configure().await;
|
|
||||||
self
|
|
||||||
.native
|
|
||||||
.send(Native::Established(VpnSessionInfo::default()))
|
|
||||||
.await
|
|
||||||
.unwrap();
|
|
||||||
send_message(&mut self.control, &Message::Ready).await.unwrap();
|
|
||||||
assert!(matches!(self.message().await, Message::Activate));
|
|
||||||
send_message(&mut self.control, &Message::Activated).await.unwrap();
|
|
||||||
assert!(matches!(
|
|
||||||
self.event().await,
|
|
||||||
LifecycleEvent::Established { attempt: 7, .. }
|
|
||||||
));
|
|
||||||
}
|
|
||||||
async fn finish(&mut self) -> anyhow::Result<()> {
|
|
||||||
tokio::time::timeout(Duration::from_secs(2), &mut self.task)
|
|
||||||
.await
|
|
||||||
.unwrap()
|
|
||||||
.unwrap()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
impl Drop for Consumer {
|
|
||||||
fn drop(&mut self) {
|
|
||||||
self.cancel.cancel();
|
|
||||||
self.task.abort();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
fn configuration() -> Configuration {
|
|
||||||
Configuration {
|
|
||||||
ipv4: Some("10.0.0.2".into()),
|
|
||||||
mtu: Some(1400),
|
|
||||||
..Default::default()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[tokio::test]
|
|
||||||
async fn connected_requires_native_establishment_and_consumer_acknowledgment() {
|
|
||||||
let mut consumer = Consumer::new();
|
|
||||||
consumer.configure().await;
|
|
||||||
send_message(&mut consumer.control, &Message::Ready).await.unwrap();
|
|
||||||
assert!(
|
|
||||||
tokio::time::timeout(Duration::from_millis(30), receive(&mut consumer.control))
|
|
||||||
.await
|
|
||||||
.is_err()
|
|
||||||
);
|
|
||||||
assert!(consumer.events.try_recv().is_err());
|
|
||||||
let session = VpnSessionInfo {
|
|
||||||
lifetime_secs: Some(3600),
|
|
||||||
..Default::default()
|
|
||||||
};
|
|
||||||
consumer
|
|
||||||
.native
|
|
||||||
.send(Native::Established(session.clone()))
|
|
||||||
.await
|
|
||||||
.unwrap();
|
|
||||||
assert!(matches!(consumer.message().await, Message::Activate));
|
|
||||||
assert!(consumer.events.try_recv().is_err());
|
|
||||||
send_message(&mut consumer.control, &Message::Activated).await.unwrap();
|
|
||||||
let LifecycleEvent::Established {
|
|
||||||
attempt,
|
|
||||||
session: reported,
|
|
||||||
} = consumer.event().await
|
|
||||||
else {
|
|
||||||
panic!("expected Established")
|
|
||||||
};
|
|
||||||
assert_eq!(attempt, consumer.identity.attempt);
|
|
||||||
assert_eq!(reported, session);
|
|
||||||
consumer.cancel.cancel();
|
|
||||||
assert!(matches!(consumer.message().await, Message::Stop));
|
|
||||||
consumer.finish().await.unwrap();
|
|
||||||
assert!(receive(&mut consumer.control).await.is_err());
|
|
||||||
}
|
|
||||||
|
|
||||||
#[tokio::test]
|
|
||||||
async fn unchanged_reconnect_waits_for_suspension_before_reactivation() {
|
|
||||||
let mut consumer = Consumer::new();
|
|
||||||
consumer.activate().await;
|
|
||||||
consumer.native.send(Native::Event(Event::Reconnecting)).await.unwrap();
|
|
||||||
assert!(matches!(
|
|
||||||
consumer.event().await,
|
|
||||||
LifecycleEvent::ScriptTunSuspended { attempt: 7 }
|
|
||||||
));
|
|
||||||
assert!(matches!(consumer.message().await, Message::Suspend));
|
|
||||||
consumer
|
|
||||||
.native
|
|
||||||
.send(Native::Event(Event::Configuration(Some(configuration()))))
|
|
||||||
.await
|
|
||||||
.unwrap();
|
|
||||||
consumer.native.send(Native::Event(Event::Reconnected)).await.unwrap();
|
|
||||||
assert!(
|
|
||||||
tokio::time::timeout(Duration::from_millis(30), receive(&mut consumer.control))
|
|
||||||
.await
|
|
||||||
.is_err()
|
|
||||||
);
|
|
||||||
send_message(&mut consumer.control, &Message::Suspended).await.unwrap();
|
|
||||||
assert!(matches!(consumer.message().await, Message::Activate));
|
|
||||||
assert!(consumer.events.try_recv().is_err());
|
|
||||||
send_message(&mut consumer.control, &Message::Activated).await.unwrap();
|
|
||||||
assert!(matches!(
|
|
||||||
consumer.event().await,
|
|
||||||
LifecycleEvent::Established { attempt: 7, .. }
|
|
||||||
));
|
|
||||||
consumer.cancel.cancel();
|
|
||||||
assert!(matches!(consumer.message().await, Message::Stop));
|
|
||||||
consumer.finish().await.unwrap();
|
|
||||||
}
|
|
||||||
|
|
||||||
#[tokio::test]
|
|
||||||
async fn changed_reconnect_stops_consumer_and_returns_network_changed() {
|
|
||||||
let mut consumer = Consumer::new();
|
|
||||||
consumer.activate().await;
|
|
||||||
consumer.native.send(Native::Event(Event::Reconnecting)).await.unwrap();
|
|
||||||
assert!(matches!(
|
|
||||||
consumer.event().await,
|
|
||||||
LifecycleEvent::ScriptTunSuspended { .. }
|
|
||||||
));
|
|
||||||
assert!(matches!(consumer.message().await, Message::Suspend));
|
|
||||||
send_message(&mut consumer.control, &Message::Suspended).await.unwrap();
|
|
||||||
let mut changed = configuration();
|
|
||||||
changed.ipv4 = Some("10.0.0.3".into());
|
|
||||||
consumer
|
|
||||||
.native
|
|
||||||
.send(Native::Event(Event::Configuration(Some(changed))))
|
|
||||||
.await
|
|
||||||
.unwrap();
|
|
||||||
assert!(matches!(consumer.message().await, Message::Stop));
|
|
||||||
assert!(consumer.finish().await.unwrap_err().is::<NetworkChanged>());
|
|
||||||
assert!(
|
|
||||||
!consumer.cancel.is_cancelled(),
|
|
||||||
"restart must not look like explicit cancellation"
|
|
||||||
);
|
|
||||||
assert!(consumer.events.try_recv().is_err());
|
|
||||||
assert!(receive(&mut consumer.control).await.is_err());
|
|
||||||
}
|
|
||||||
|
|
||||||
#[tokio::test]
|
|
||||||
async fn cancellation_during_activation_prevents_connected() {
|
|
||||||
let mut consumer = Consumer::new();
|
|
||||||
consumer.configure().await;
|
|
||||||
consumer
|
|
||||||
.native
|
|
||||||
.send(Native::Established(VpnSessionInfo::default()))
|
|
||||||
.await
|
|
||||||
.unwrap();
|
|
||||||
send_message(&mut consumer.control, &Message::Ready).await.unwrap();
|
|
||||||
assert!(matches!(consumer.message().await, Message::Activate));
|
|
||||||
consumer.cancel.cancel();
|
|
||||||
// A late acknowledgment must not publish Connected after cancellation.
|
|
||||||
let _ = send_message(&mut consumer.control, &Message::Activated).await;
|
|
||||||
assert!(matches!(consumer.message().await, Message::Stop));
|
|
||||||
consumer.finish().await.unwrap();
|
|
||||||
assert!(consumer.events.try_recv().is_err());
|
|
||||||
}
|
|
||||||
|
|
||||||
#[tokio::test]
|
|
||||||
async fn consumer_eof_ends_startup_and_active_sessions() {
|
|
||||||
for active in [false, true] {
|
|
||||||
let mut consumer = Consumer::new();
|
|
||||||
if active {
|
|
||||||
consumer.activate().await;
|
|
||||||
} else {
|
|
||||||
consumer.configure().await;
|
|
||||||
}
|
|
||||||
consumer.control.shutdown().await.unwrap();
|
|
||||||
assert!(consumer.finish().await.is_err());
|
|
||||||
assert!(consumer.events.try_recv().is_err());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[tokio::test]
|
|
||||||
async fn unexpected_acknowledgment_fails_before_connected() {
|
|
||||||
let mut consumer = Consumer::new();
|
|
||||||
consumer.configure().await;
|
|
||||||
send_message(&mut consumer.control, &Message::Activated).await.unwrap();
|
|
||||||
assert!(matches!(consumer.message().await, Message::Stop));
|
|
||||||
assert!(consumer.finish().await.unwrap_err().to_string().contains("Unexpected"));
|
|
||||||
assert!(consumer.events.try_recv().is_err());
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn prepares_worker_for_current_desktop_user_without_enumerating_groups() {
|
|
||||||
let uid = unsafe { nix::libc::getuid() };
|
|
||||||
if uid == 0 {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
let request = ScriptTunRequest {
|
|
||||||
launch_id: uuid::Uuid::new_v4(),
|
|
||||||
program: "/usr/bin/true".into(),
|
|
||||||
args: vec![],
|
|
||||||
bootstrap: Bootstrap::default(),
|
|
||||||
};
|
|
||||||
builder("https://vpn.example", "test", &request, uid).unwrap();
|
|
||||||
}
|
|
||||||
|
|
||||||
#[tokio::test]
|
|
||||||
async fn reconnect_during_activation_returns_clear_error_without_connected() {
|
|
||||||
let mut consumer = Consumer::new();
|
|
||||||
consumer.configure().await;
|
|
||||||
consumer
|
|
||||||
.native
|
|
||||||
.send(Native::Established(VpnSessionInfo::default()))
|
|
||||||
.await
|
|
||||||
.unwrap();
|
|
||||||
send_message(&mut consumer.control, &Message::Ready).await.unwrap();
|
|
||||||
assert!(matches!(consumer.message().await, Message::Activate));
|
|
||||||
consumer.native.send(Native::Event(Event::Reconnecting)).await.unwrap();
|
|
||||||
assert!(matches!(consumer.message().await, Message::Stop));
|
|
||||||
assert!(
|
|
||||||
consumer
|
|
||||||
.finish()
|
|
||||||
.await
|
|
||||||
.unwrap_err()
|
|
||||||
.to_string()
|
|
||||||
.contains("during script-tun activation")
|
|
||||||
);
|
|
||||||
assert!(consumer.events.try_recv().is_err());
|
|
||||||
}
|
|
||||||
@@ -41,7 +41,7 @@ pub(crate) struct ConnectionControl {
|
|||||||
connection_id: Uuid,
|
connection_id: Uuid,
|
||||||
tx: mpsc::Sender<ConnectionCommand>,
|
tx: mpsc::Sender<ConnectionCommand>,
|
||||||
close_tx: watch::Sender<Option<CloseReason>>,
|
close_tx: watch::Sender<Option<CloseReason>>,
|
||||||
statistics: watch::Sender<Option<gpapi::session::desktop::tunnel::TunnelStatisticsSnapshot>>,
|
statistics: watch::Sender<Option<gpapi::session::tunnel::TunnelStatisticsSnapshot>>,
|
||||||
statistics_enabled: Arc<AtomicBool>,
|
statistics_enabled: Arc<AtomicBool>,
|
||||||
committed: Arc<AtomicBool>,
|
committed: Arc<AtomicBool>,
|
||||||
}
|
}
|
||||||
@@ -102,15 +102,13 @@ impl ConnectionControl {
|
|||||||
self.statistics.send_replace(None);
|
self.statistics.send_replace(None);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn publish_statistics(&self, snapshot: gpapi::session::desktop::tunnel::TunnelStatisticsSnapshot) {
|
pub fn publish_statistics(&self, snapshot: gpapi::session::tunnel::TunnelStatisticsSnapshot) {
|
||||||
if self.statistics_enabled() && !self.is_closed() {
|
if self.statistics_enabled() && !self.is_closed() {
|
||||||
self.statistics.send_replace(Some(snapshot));
|
self.statistics.send_replace(Some(snapshot));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn subscribe_statistics(
|
pub fn subscribe_statistics(&self) -> watch::Receiver<Option<gpapi::session::tunnel::TunnelStatisticsSnapshot>> {
|
||||||
&self,
|
|
||||||
) -> watch::Receiver<Option<gpapi::session::desktop::tunnel::TunnelStatisticsSnapshot>> {
|
|
||||||
self.statistics.subscribe()
|
self.statistics.subscribe()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -752,7 +750,7 @@ mod tests {
|
|||||||
.unwrap();
|
.unwrap();
|
||||||
assert!(matches!(reply, ServerMessage::Reply {
|
assert!(matches!(reply, ServerMessage::Reply {
|
||||||
id,
|
id,
|
||||||
result: ServiceResult::TunnelStatisticsSnapshot(gpapi::session::desktop::tunnel::TunnelStatisticsSnapshot::Unavailable { reason: gpapi::session::desktop::tunnel::TunnelUnavailableReason::NoTunnel }),
|
result: ServiceResult::TunnelStatisticsSnapshot(gpapi::session::tunnel::TunnelStatisticsSnapshot::Unavailable { reason: gpapi::session::tunnel::TunnelUnavailableReason::NoTunnel }),
|
||||||
} if id == statistics_id));
|
} if id == statistics_id));
|
||||||
|
|
||||||
let update_id = Uuid::new_v4();
|
let update_id = Uuid::new_v4();
|
||||||
@@ -763,7 +761,6 @@ mod tests {
|
|||||||
request: WsRequest::UpdateGui(UpdateGuiRequest {
|
request: WsRequest::UpdateGui(UpdateGuiRequest {
|
||||||
path: update_file.path().to_string_lossy().into_owned(),
|
path: update_file.path().to_string_lossy().into_owned(),
|
||||||
checksum: "invalid".to_owned(),
|
checksum: "invalid".to_owned(),
|
||||||
variant: gpapi::gui::GuiVariant::Tauri,
|
|
||||||
}),
|
}),
|
||||||
};
|
};
|
||||||
socket
|
socket
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ use gpapi::{
|
|||||||
vpn_env::{HostInfo, VpnEnv},
|
vpn_env::{HostInfo, VpnEnv},
|
||||||
vpn_state::VpnState,
|
vpn_state::VpnState,
|
||||||
},
|
},
|
||||||
session::desktop::tunnel::{TunnelStatisticsSnapshot, TunnelUnavailableReason},
|
session::tunnel::{TunnelStatisticsSnapshot, TunnelUnavailableReason},
|
||||||
utils::lock_file::LockFile,
|
utils::lock_file::LockFile,
|
||||||
};
|
};
|
||||||
use log::{info, warn};
|
use log::{info, warn};
|
||||||
@@ -397,7 +397,7 @@ fn build_snapshot(vpn_state: VpnState) -> VpnEnv {
|
|||||||
vpnc_script: find_vpnc_script(),
|
vpnc_script: find_vpnc_script(),
|
||||||
auth_executable: binary_paths::gpauth().to_string_lossy().into_owned(),
|
auth_executable: binary_paths::gpauth().to_string_lossy().into_owned(),
|
||||||
host_info: HostInfo {
|
host_info: HostInfo {
|
||||||
host_identity: gpapi::os_profile::desktop::collect_identity(),
|
host_identity: HostIdentity::collect(),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -488,7 +488,7 @@ mod tests {
|
|||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn statistics_demand_is_per_attachment_and_does_not_consume_revisions() {
|
async fn statistics_demand_is_per_attachment_and_does_not_consume_revisions() {
|
||||||
use gpapi::service::transport::ServiceResult;
|
use gpapi::service::transport::ServiceResult;
|
||||||
use gpapi::session::desktop::tunnel::TunnelStatisticsState;
|
use gpapi::session::tunnel::TunnelStatisticsState;
|
||||||
let (context, registry) = context();
|
let (context, registry) = context();
|
||||||
let (a, a_session, a_generation, _a_rx) = attach(&context, ®istry).await;
|
let (a, a_session, a_generation, _a_rx) = attach(&context, ®istry).await;
|
||||||
let (b, b_session, b_generation, _b_rx) = attach(&context, ®istry).await;
|
let (b, b_session, b_generation, _b_rx) = attach(&context, ®istry).await;
|
||||||
@@ -564,7 +564,7 @@ mod tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn snapshot_budget_trims_observation_without_changing_existing_metadata() {
|
fn snapshot_budget_trims_observation_without_changing_existing_metadata() {
|
||||||
use gpapi::session::desktop::tunnel::{TunnelConfiguration, TunnelPhase, TunnelState, TunnelTransport};
|
use gpapi::session::tunnel::{TunnelConfiguration, TunnelPhase, TunnelState, TunnelTransport};
|
||||||
let mut snapshot = build_snapshot(VpnState::Disconnected);
|
let mut snapshot = build_snapshot(VpnState::Disconnected);
|
||||||
let mut configuration = TunnelConfiguration::default();
|
let mut configuration = TunnelConfiguration::default();
|
||||||
configuration.included_routes.items = vec!["r".repeat(1000); 15];
|
configuration.included_routes.items = vec!["r".repeat(1000); 15];
|
||||||
|
|||||||
@@ -1,83 +1,17 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
## 3.3.0
|
## 3.0.6
|
||||||
|
|
||||||
### Added
|
### Changed
|
||||||
|
|
||||||
- Added Native Shell, a new desktop interface for macOS and Linux. macOS builds now use it by default.
|
- Embedded macOS VPN network configuration and added configuration logs for troubleshooting.
|
||||||
- Added an Interface setting on Linux to switch between Tauri and Native Shell.
|
|
||||||
- Added tray icon appearance options for light and dark desktop panels on Linux, FreeBSD, and OpenBSD.
|
|
||||||
- Added in-app feature highlights, with a setting to turn them off.
|
|
||||||
|
|
||||||
### Improved
|
|
||||||
|
|
||||||
- Made System VPN and Local Proxy modes selectable directly from the main window.
|
|
||||||
- Refined connection details, saved-server selection, keyboard navigation, and dialog appearance.
|
|
||||||
- Removed the need for OpenSSL compatibility configuration and external OpenSSL conversion tools.
|
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
- Fixed macOS VPN DNS configuration and cleanup, including split-tunnel connections.
|
- Fixed desktop notifications disappearing immediately on GNOME.
|
||||||
- Fixed background CLI reconnections failing after the initial connection.
|
- Corrected the notification sender to GP Connect and clarified update notification titles on Linux and BSD.
|
||||||
- Fixed server addresses losing custom ports when pasted as URLs.
|
- Fixed ESP tunnel setup when a gateway reports a zero address, including load-balanced gateways.
|
||||||
- Fixed gateway login address handling for servers with explicit ports.
|
- Removed obsolete OpenConnect package dependencies from the AUR package.
|
||||||
- Fixed browser sign-in registration when desktop-specific settings override the callback handler on Linux, FreeBSD, or OpenBSD.
|
|
||||||
- Fixed supplied server certificate pins not being enforced during tunnel setup.
|
|
||||||
- Fixed delayed clicks activating a different control after a Native Shell view changed.
|
|
||||||
|
|
||||||
### Command-line notes
|
|
||||||
|
|
||||||
- Deprecated `--fix-openssl` on Linux, FreeBSD, and OpenBSD. Existing commands still accept it, but it has no effect.
|
|
||||||
|
|
||||||
## 3.2.0
|
|
||||||
|
|
||||||
### Added
|
|
||||||
|
|
||||||
- Added Local Proxy mode with configurable SOCKS5 and HTTP listeners, so selected apps can use the VPN without changing system routes or DNS.
|
|
||||||
- Added a gateway IP preference for trying IPv4 or IPv6 first, available in Settings and through `gpclient connect --ip-preference`.
|
|
||||||
|
|
||||||
### Improved
|
|
||||||
|
|
||||||
- Enabled switching between the macOS main window and menu bar popover without restarting the app.
|
|
||||||
- Refined gateway selection, connection status, and proxy listener details.
|
|
||||||
- Made numeric settings validation clearer before saving.
|
|
||||||
|
|
||||||
### Fixed
|
|
||||||
|
|
||||||
- Fixed VPN shutdown waiting too long when a gateway stops responding to logout.
|
|
||||||
- Fixed segmented controls sometimes losing the selected option when clicked.
|
|
||||||
- Fixed app shortcuts failing to open with some Linux and BSD desktop launchers.
|
|
||||||
- Fixed invisible desktop icons on systems using older versions of librsvg.
|
|
||||||
|
|
||||||
## 3.1.0
|
|
||||||
|
|
||||||
### Added
|
|
||||||
|
|
||||||
- Added a Connection Details panel showing VPN information and live upload and download activity.
|
|
||||||
- Added an optional terminal dashboard showing connection status and logs, enabled with `--dashboard`.
|
|
||||||
- Added client certificate setup in Settings, with guidance when a VPN requires a certificate.
|
|
||||||
|
|
||||||
### Improved
|
|
||||||
|
|
||||||
- Refreshed Settings and dialogs, with automatic saving for most settings and Save and Cancel buttons for detailed edits.
|
|
||||||
- Made sign-in errors clearer and added recovery options within the app.
|
|
||||||
- Added a website address bar to the sign-in window.
|
|
||||||
- Expanded support for client certificate files, including password-protected files, with clearer file and password errors.
|
|
||||||
- Improved license activation error messages and troubleshooting logs.
|
|
||||||
|
|
||||||
### Fixed
|
|
||||||
|
|
||||||
- Fixed sign-in retries losing the selected VPN server after a security error.
|
|
||||||
- Fixed mismatched certificate and key files being accepted and replacing a working certificate setup.
|
|
||||||
- Fixed failed saves discarding certificate details or custom device report (HIP) edits, allowing a retry without re-entering changes.
|
|
||||||
- Fixed theme, automatic-update, and logging settings appearing saved when saving had failed; errors are now shown and previous settings remain in use.
|
|
||||||
- Fixed notifications disappearing too quickly on GNOME and clarified notification sender names and update titles.
|
|
||||||
- Fixed connection failures with some VPN gateways.
|
|
||||||
|
|
||||||
### Command-line notes
|
|
||||||
|
|
||||||
- Renamed copy-and-paste browser sign-in to `--browser manual`; existing commands using `--browser remote` still work.
|
|
||||||
- Removed the unneeded `--fix-openssl` option on macOS; existing macOS commands and scripts must omit it.
|
|
||||||
|
|
||||||
## 3.0.5
|
## 3.0.5
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ tokio = { workspace = true, features = ["io-util", "net", "time"] }
|
|||||||
# Browser auth dependencies
|
# Browser auth dependencies
|
||||||
browser-launcher = { path = "../browser-launcher", default-features = false, features = ["launcher"], optional = true }
|
browser-launcher = { path = "../browser-launcher", default-features = false, features = ["launcher"], optional = true }
|
||||||
tiny_http = { version = "0.12", optional = true }
|
tiny_http = { version = "0.12", optional = true }
|
||||||
tempfile = { workspace = true, optional = true }
|
|
||||||
uuid = { version = "1", optional = true, features = ["v4"] }
|
uuid = { version = "1", optional = true, features = ["v4"] }
|
||||||
uzers = { workspace = true, optional = true }
|
uzers = { workspace = true, optional = true }
|
||||||
|
|
||||||
@@ -44,7 +43,6 @@ objc2-security = { version = "0.3", default-features = false, features = ["std",
|
|||||||
[features]
|
[features]
|
||||||
browser-auth = [
|
browser-auth = [
|
||||||
"dep:browser-launcher",
|
"dep:browser-launcher",
|
||||||
"dep:tempfile",
|
|
||||||
"dep:tiny_http",
|
"dep:tiny_http",
|
||||||
"dep:uuid",
|
"dep:uuid",
|
||||||
"dep:uzers",
|
"dep:uzers",
|
||||||
|
|||||||
@@ -14,6 +14,13 @@ use tokio::{
|
|||||||
time::timeout,
|
time::timeout,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#[cfg(any(target_os = "linux", target_os = "freebsd", target_os = "openbsd"))]
|
||||||
|
use log::warn;
|
||||||
|
#[cfg(any(target_os = "linux", target_os = "freebsd", target_os = "openbsd", test))]
|
||||||
|
use std::ffi::OsStr;
|
||||||
|
#[cfg(any(target_os = "linux", target_os = "freebsd", target_os = "openbsd"))]
|
||||||
|
use std::process::{Command, Output};
|
||||||
|
|
||||||
const CALLBACK_SCHEME: &str = "globalprotectcallback";
|
const CALLBACK_SCHEME: &str = "globalprotectcallback";
|
||||||
const PROTOCOL_MAGIC: &[u8; 4] = b"GPAC";
|
const PROTOCOL_MAGIC: &[u8; 4] = b"GPAC";
|
||||||
const PROTOCOL_VERSION: u8 = 1;
|
const PROTOCOL_VERSION: u8 = 1;
|
||||||
@@ -28,9 +35,6 @@ const STATUS_UNSUPPORTED_VERSION: u8 = 2;
|
|||||||
#[cfg(target_os = "macos")]
|
#[cfg(target_os = "macos")]
|
||||||
mod macos;
|
mod macos;
|
||||||
|
|
||||||
#[cfg(any(target_os = "linux", target_os = "freebsd", target_os = "openbsd", test))]
|
|
||||||
mod xdg;
|
|
||||||
|
|
||||||
pub struct AuthCallbackReceiver {
|
pub struct AuthCallbackReceiver {
|
||||||
listener: UnixListener,
|
listener: UnixListener,
|
||||||
socket_path: PathBuf,
|
socket_path: PathBuf,
|
||||||
@@ -98,12 +102,87 @@ impl Drop for AuthCallbackReceiver {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub async fn forward_auth_callback(callback: &str) -> anyhow::Result<()> {
|
pub async fn forward_auth_callback(callback: &str) -> anyhow::Result<()> {
|
||||||
validate_auth_callback(callback)?;
|
validate_callback(callback)?;
|
||||||
forward_auth_callback_to(callback, &callback_socket_path()).await
|
forward_auth_callback_to(callback, &callback_socket_path()).await
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(any(target_os = "linux", target_os = "freebsd", target_os = "openbsd"))]
|
#[cfg(any(target_os = "linux", target_os = "freebsd", target_os = "openbsd"))]
|
||||||
pub use xdg::ensure_auth_callback_handler;
|
pub fn ensure_auth_callback_handler() -> anyhow::Result<()> {
|
||||||
|
const MIME_TYPE: &str = "x-scheme-handler/globalprotectcallback";
|
||||||
|
const HANDLER: &str = "gpgui.desktop";
|
||||||
|
|
||||||
|
ensure_lxqt_mime_tool()?;
|
||||||
|
|
||||||
|
let current_handler = query_callback_handler(MIME_TYPE)?;
|
||||||
|
if !should_register_handler(¤t_handler) {
|
||||||
|
return Ok(());
|
||||||
|
}
|
||||||
|
|
||||||
|
let output = Command::new("xdg-mime")
|
||||||
|
.args(["default", HANDLER, MIME_TYPE])
|
||||||
|
.output()
|
||||||
|
.context("xdg-mime is required for external-browser authentication")?;
|
||||||
|
if !output.status.success() {
|
||||||
|
log_command_failure("register callback handler", &output);
|
||||||
|
bail!("Failed to register the globalprotectcallback URL handler");
|
||||||
|
}
|
||||||
|
if query_callback_handler(MIME_TYPE)? != HANDLER {
|
||||||
|
bail!("The globalprotectcallback URL handler registration did not take effect");
|
||||||
|
}
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(any(target_os = "linux", target_os = "freebsd", target_os = "openbsd"))]
|
||||||
|
fn query_callback_handler(mime_type: &str) -> anyhow::Result<String> {
|
||||||
|
let output = Command::new("xdg-mime")
|
||||||
|
.args(["query", "default", mime_type])
|
||||||
|
.output()
|
||||||
|
.context("xdg-mime is required for external-browser authentication")?;
|
||||||
|
if !output.status.success() {
|
||||||
|
log_command_failure("query callback handler", &output);
|
||||||
|
bail!("Failed to query the globalprotectcallback URL handler");
|
||||||
|
}
|
||||||
|
Ok(String::from_utf8_lossy(&output.stdout).trim().to_string())
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(any(target_os = "linux", target_os = "freebsd", target_os = "openbsd"))]
|
||||||
|
fn ensure_lxqt_mime_tool() -> anyhow::Result<()> {
|
||||||
|
if !is_lxqt_desktop(std::env::var_os("XDG_CURRENT_DESKTOP").as_deref()) {
|
||||||
|
return Ok(());
|
||||||
|
}
|
||||||
|
|
||||||
|
let result = Command::new("qtxdg-mat").args(["defapp", "--help"]).output();
|
||||||
|
match result {
|
||||||
|
Ok(output) if output.status.success() => Ok(()),
|
||||||
|
Ok(output) => {
|
||||||
|
let stderr = String::from_utf8_lossy(&output.stderr);
|
||||||
|
warn!(
|
||||||
|
"qtxdg-mat readiness check failed with {}: {}",
|
||||||
|
output.status,
|
||||||
|
stderr.trim()
|
||||||
|
);
|
||||||
|
bail!("Install qtxdg-tools for browser SSO.")
|
||||||
|
}
|
||||||
|
Err(err) => {
|
||||||
|
warn!("Failed to run qtxdg-mat readiness check: {err}");
|
||||||
|
bail!("Install qtxdg-tools for browser SSO.")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(any(target_os = "linux", target_os = "freebsd", target_os = "openbsd", test))]
|
||||||
|
fn is_lxqt_desktop(current_desktop: Option<&OsStr>) -> bool {
|
||||||
|
current_desktop
|
||||||
|
.and_then(OsStr::to_str)
|
||||||
|
.is_some_and(|desktop| desktop.split(':').any(|name| name.eq_ignore_ascii_case("lxqt")))
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(any(target_os = "linux", target_os = "freebsd", target_os = "openbsd"))]
|
||||||
|
fn log_command_failure(action: &str, output: &Output) {
|
||||||
|
let stderr = String::from_utf8_lossy(&output.stderr);
|
||||||
|
warn!("xdg-mime failed to {action} with {}: {}", output.status, stderr.trim());
|
||||||
|
}
|
||||||
|
|
||||||
#[cfg(target_os = "macos")]
|
#[cfg(target_os = "macos")]
|
||||||
pub fn ensure_auth_callback_handler() -> anyhow::Result<()> {
|
pub fn ensure_auth_callback_handler() -> anyhow::Result<()> {
|
||||||
@@ -120,8 +199,13 @@ pub fn ensure_auth_callback_handler() -> anyhow::Result<()> {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(any(target_os = "linux", target_os = "freebsd", target_os = "openbsd", test))]
|
||||||
|
fn should_register_handler(current_handler: &str) -> bool {
|
||||||
|
current_handler != "gpgui.desktop"
|
||||||
|
}
|
||||||
|
|
||||||
async fn forward_auth_callback_to(callback: &str, socket_path: &Path) -> anyhow::Result<()> {
|
async fn forward_auth_callback_to(callback: &str, socket_path: &Path) -> anyhow::Result<()> {
|
||||||
validate_auth_callback(callback)?;
|
validate_callback(callback)?;
|
||||||
|
|
||||||
let (version, status) = timeout(IO_TIMEOUT, async {
|
let (version, status) = timeout(IO_TIMEOUT, async {
|
||||||
let mut stream = UnixStream::connect(socket_path)
|
let mut stream = UnixStream::connect(socket_path)
|
||||||
@@ -232,7 +316,7 @@ fn remove_stale_socket(socket_path: &Path) -> anyhow::Result<()> {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn validate_auth_callback(callback: &str) -> anyhow::Result<()> {
|
fn validate_callback(callback: &str) -> anyhow::Result<()> {
|
||||||
if callback.len() > MAX_CALLBACK_SIZE {
|
if callback.len() > MAX_CALLBACK_SIZE {
|
||||||
bail!("Authentication callback exceeds the maximum supported size");
|
bail!("Authentication callback exceeds the maximum supported size");
|
||||||
}
|
}
|
||||||
@@ -276,7 +360,7 @@ async fn read_callback(stream: &mut UnixStream) -> Result<String, CallbackReadEr
|
|||||||
.await
|
.await
|
||||||
.map_err(|_| CallbackReadError::Io)?;
|
.map_err(|_| CallbackReadError::Io)?;
|
||||||
let callback = String::from_utf8(payload).map_err(|_| CallbackReadError::Invalid)?;
|
let callback = String::from_utf8(payload).map_err(|_| CallbackReadError::Invalid)?;
|
||||||
validate_auth_callback(&callback).map_err(|_| CallbackReadError::Invalid)?;
|
validate_callback(&callback).map_err(|_| CallbackReadError::Invalid)?;
|
||||||
Ok(callback)
|
Ok(callback)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -296,10 +380,27 @@ mod tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn validates_supported_callback_scheme() {
|
fn validates_supported_callback_scheme() {
|
||||||
assert!(validate_auth_callback(VALID_CALLBACK).is_ok());
|
assert!(validate_callback(VALID_CALLBACK).is_ok());
|
||||||
assert!(validate_auth_callback("https://example.com").is_err());
|
assert!(validate_callback("https://example.com").is_err());
|
||||||
assert!(validate_auth_callback("globalprotectcallback:").is_err());
|
assert!(validate_callback("globalprotectcallback:").is_err());
|
||||||
assert!(validate_auth_callback(&format!("globalprotectcallback:{}", "x".repeat(MAX_CALLBACK_SIZE))).is_err());
|
assert!(validate_callback(&format!("globalprotectcallback:{}", "x".repeat(MAX_CALLBACK_SIZE))).is_err());
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn replaces_any_other_callback_handler() {
|
||||||
|
assert!(!should_register_handler("gpgui.desktop"));
|
||||||
|
assert!(should_register_handler(""));
|
||||||
|
assert!(should_register_handler("gpauth.desktop"));
|
||||||
|
assert!(should_register_handler("other-vpn.desktop"));
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn detects_lxqt_desktop_session() {
|
||||||
|
assert!(is_lxqt_desktop(Some(OsStr::new("LXQt"))));
|
||||||
|
assert!(is_lxqt_desktop(Some(OsStr::new("LXQt:KDE"))));
|
||||||
|
assert!(is_lxqt_desktop(Some(OsStr::new("lxqt"))));
|
||||||
|
assert!(!is_lxqt_desktop(Some(OsStr::new("LXDE"))));
|
||||||
|
assert!(!is_lxqt_desktop(None));
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
|
|||||||
@@ -1,313 +0,0 @@
|
|||||||
use std::{
|
|
||||||
ffi::OsStr,
|
|
||||||
fs,
|
|
||||||
io::{ErrorKind, Write},
|
|
||||||
path::{Path, PathBuf},
|
|
||||||
process::{Command, Output},
|
|
||||||
};
|
|
||||||
|
|
||||||
use anyhow::{Context, bail};
|
|
||||||
use log::warn;
|
|
||||||
|
|
||||||
const MIME_TYPE: &str = "x-scheme-handler/globalprotectcallback";
|
|
||||||
const HANDLER: &str = "gpgui.desktop";
|
|
||||||
|
|
||||||
pub fn ensure_auth_callback_handler() -> anyhow::Result<()> {
|
|
||||||
ensure_lxqt_mime_tool()?;
|
|
||||||
|
|
||||||
let current_handler = query_callback_handler(MIME_TYPE)?;
|
|
||||||
if !should_register_handler(¤t_handler) {
|
|
||||||
return Ok(());
|
|
||||||
}
|
|
||||||
|
|
||||||
let output = Command::new("xdg-mime")
|
|
||||||
.args(["default", HANDLER, MIME_TYPE])
|
|
||||||
.output()
|
|
||||||
.context("xdg-mime is required for external-browser authentication")?;
|
|
||||||
if !output.status.success() {
|
|
||||||
log_command_failure("register callback handler", &output);
|
|
||||||
bail!("Failed to register the globalprotectcallback URL handler");
|
|
||||||
}
|
|
||||||
// xdg-mime writes mimeapps.list, but a user desktop override takes precedence.
|
|
||||||
if let Some(desktop) = std::env::var_os("XDG_CURRENT_DESKTOP") {
|
|
||||||
update_desktop_override(&config_home()?, &desktop)?;
|
|
||||||
}
|
|
||||||
if query_callback_handler(MIME_TYPE)? != HANDLER {
|
|
||||||
bail!("The globalprotectcallback URL handler registration did not take effect");
|
|
||||||
}
|
|
||||||
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
|
|
||||||
fn config_home() -> anyhow::Result<PathBuf> {
|
|
||||||
if let Some(path) = std::env::var_os("XDG_CONFIG_HOME")
|
|
||||||
.map(PathBuf::from)
|
|
||||||
.filter(|path| path.is_absolute())
|
|
||||||
{
|
|
||||||
return Ok(path);
|
|
||||||
}
|
|
||||||
let home = std::env::var_os("HOME")
|
|
||||||
.map(PathBuf::from)
|
|
||||||
.filter(|path| path.is_absolute())
|
|
||||||
.context("Cannot locate the user configuration directory")?;
|
|
||||||
Ok(home.join(".config"))
|
|
||||||
}
|
|
||||||
|
|
||||||
fn update_desktop_override(config_home: &Path, current_desktop: &OsStr) -> anyhow::Result<()> {
|
|
||||||
let Some(current_desktop) = current_desktop.to_str() else {
|
|
||||||
return Ok(());
|
|
||||||
};
|
|
||||||
for desktop in current_desktop.split(':').filter(|name| !name.is_empty()) {
|
|
||||||
let filename = format!("{}-mimeapps.list", desktop.to_ascii_lowercase());
|
|
||||||
if Path::new(&filename).file_name() != Some(OsStr::new(&filename)) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
let path = config_home.join(filename);
|
|
||||||
let contents = match fs::read_to_string(&path) {
|
|
||||||
Ok(contents) => contents,
|
|
||||||
Err(error) if error.kind() == ErrorKind::NotFound => continue,
|
|
||||||
Err(error) => return Err(error).with_context(|| format!("Cannot read {}", path.display())),
|
|
||||||
};
|
|
||||||
let Some(updated) = replace_callback_default(&contents) else {
|
|
||||||
continue;
|
|
||||||
};
|
|
||||||
if updated != contents {
|
|
||||||
// Follow user-managed symlinks and replace atomically to preserve the rest of the file.
|
|
||||||
let target = fs::canonicalize(&path)?;
|
|
||||||
let mut file = tempfile::NamedTempFile::new_in(target.parent().context("Missing configuration directory")?)?;
|
|
||||||
file.as_file().set_permissions(fs::metadata(&target)?.permissions())?;
|
|
||||||
file.write_all(updated.as_bytes())?;
|
|
||||||
file
|
|
||||||
.persist(&target)
|
|
||||||
.with_context(|| format!("Cannot update {}", path.display()))?;
|
|
||||||
}
|
|
||||||
// Only the first desktop override with a callback default can take precedence.
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
|
|
||||||
fn replace_callback_default(contents: &str) -> Option<String> {
|
|
||||||
let mut in_defaults = false;
|
|
||||||
let mut found = false;
|
|
||||||
let mut updated = String::with_capacity(contents.len());
|
|
||||||
for line in contents.split_inclusive('\n') {
|
|
||||||
let trimmed = line.trim();
|
|
||||||
if trimmed.starts_with('[') {
|
|
||||||
in_defaults = trimmed == "[Default Applications]";
|
|
||||||
}
|
|
||||||
if in_defaults
|
|
||||||
&& let Some((key, _)) = line.split_once('=')
|
|
||||||
&& key.trim() == MIME_TYPE
|
|
||||||
{
|
|
||||||
let ending = if line.ends_with("\r\n") {
|
|
||||||
"\r\n"
|
|
||||||
} else if line.ends_with('\n') {
|
|
||||||
"\n"
|
|
||||||
} else {
|
|
||||||
""
|
|
||||||
};
|
|
||||||
updated.push_str(&format!("{key}={HANDLER};{ending}"));
|
|
||||||
found = true;
|
|
||||||
} else {
|
|
||||||
updated.push_str(line);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
found.then_some(updated)
|
|
||||||
}
|
|
||||||
|
|
||||||
fn query_callback_handler(mime_type: &str) -> anyhow::Result<String> {
|
|
||||||
let output = Command::new("xdg-mime")
|
|
||||||
.args(["query", "default", mime_type])
|
|
||||||
.output()
|
|
||||||
.context("xdg-mime is required for external-browser authentication")?;
|
|
||||||
if !output.status.success() {
|
|
||||||
log_command_failure("query callback handler", &output);
|
|
||||||
bail!("Failed to query the globalprotectcallback URL handler");
|
|
||||||
}
|
|
||||||
Ok(String::from_utf8_lossy(&output.stdout).trim().to_string())
|
|
||||||
}
|
|
||||||
|
|
||||||
fn ensure_lxqt_mime_tool() -> anyhow::Result<()> {
|
|
||||||
if !is_lxqt_desktop(std::env::var_os("XDG_CURRENT_DESKTOP").as_deref()) {
|
|
||||||
return Ok(());
|
|
||||||
}
|
|
||||||
|
|
||||||
let result = Command::new("qtxdg-mat").args(["defapp", "--help"]).output();
|
|
||||||
match result {
|
|
||||||
Ok(output) if output.status.success() => Ok(()),
|
|
||||||
Ok(output) => {
|
|
||||||
let stderr = String::from_utf8_lossy(&output.stderr);
|
|
||||||
warn!(
|
|
||||||
"qtxdg-mat readiness check failed with {}: {}",
|
|
||||||
output.status,
|
|
||||||
stderr.trim()
|
|
||||||
);
|
|
||||||
bail!("Install qtxdg-tools for browser SSO.")
|
|
||||||
}
|
|
||||||
Err(err) => {
|
|
||||||
warn!("Failed to run qtxdg-mat readiness check: {err}");
|
|
||||||
bail!("Install qtxdg-tools for browser SSO.")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn is_lxqt_desktop(current_desktop: Option<&OsStr>) -> bool {
|
|
||||||
current_desktop
|
|
||||||
.and_then(OsStr::to_str)
|
|
||||||
.is_some_and(|desktop| desktop.split(':').any(|name| name.eq_ignore_ascii_case("lxqt")))
|
|
||||||
}
|
|
||||||
|
|
||||||
fn log_command_failure(action: &str, output: &Output) {
|
|
||||||
let stderr = String::from_utf8_lossy(&output.stderr);
|
|
||||||
warn!("xdg-mime failed to {action} with {}: {}", output.status, stderr.trim());
|
|
||||||
}
|
|
||||||
|
|
||||||
fn should_register_handler(current_handler: &str) -> bool {
|
|
||||||
current_handler != HANDLER
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(test)]
|
|
||||||
mod tests {
|
|
||||||
use super::*;
|
|
||||||
use std::{fs, os::unix::fs::PermissionsExt};
|
|
||||||
use tempfile::tempdir;
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn preserves_other_sections_and_line_endings() {
|
|
||||||
let contents = "# Comment\r\n[Added Associations]\r\nx-scheme-handler/globalprotectcallback=other.desktop;\r\n[Default Applications]\r\ntext/plain=editor.desktop;\r\n x-scheme-handler/globalprotectcallback =old.desktop;backup.desktop;";
|
|
||||||
assert_eq!(
|
|
||||||
replace_callback_default(contents).unwrap(),
|
|
||||||
"# Comment\r\n[Added Associations]\r\nx-scheme-handler/globalprotectcallback=other.desktop;\r\n[Default Applications]\r\ntext/plain=editor.desktop;\r\n x-scheme-handler/globalprotectcallback =gpgui.desktop;",
|
|
||||||
);
|
|
||||||
assert!(
|
|
||||||
replace_callback_default("[Added Associations]\nx-scheme-handler/globalprotectcallback=old.desktop;\n").is_none()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn updates_only_first_active_desktop_override() {
|
|
||||||
let directory = tempdir().unwrap();
|
|
||||||
let config = directory.path();
|
|
||||||
let original = "[Default Applications]\nx-scheme-handler/globalprotectcallback=old.desktop;\n";
|
|
||||||
fs::write(
|
|
||||||
config.join("other-mimeapps.list"),
|
|
||||||
"[Default Applications]\ntext/plain=editor.desktop;\n",
|
|
||||||
)
|
|
||||||
.unwrap();
|
|
||||||
fs::write(config.join("niri-mimeapps.list"), original).unwrap();
|
|
||||||
fs::write(config.join("fallback-mimeapps.list"), original).unwrap();
|
|
||||||
update_desktop_override(config, OsStr::new("Other:Niri:Fallback")).unwrap();
|
|
||||||
assert_eq!(
|
|
||||||
fs::read_to_string(config.join("niri-mimeapps.list")).unwrap(),
|
|
||||||
"[Default Applications]\nx-scheme-handler/globalprotectcallback=gpgui.desktop;\n"
|
|
||||||
);
|
|
||||||
assert_eq!(
|
|
||||||
fs::read_to_string(config.join("fallback-mimeapps.list")).unwrap(),
|
|
||||||
original
|
|
||||||
);
|
|
||||||
assert_eq!(
|
|
||||||
fs::read_to_string(config.join("other-mimeapps.list")).unwrap(),
|
|
||||||
"[Default Applications]\ntext/plain=editor.desktop;\n"
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn leaves_sessions_without_user_overrides_unchanged() {
|
|
||||||
let directory = tempdir().unwrap();
|
|
||||||
update_desktop_override(directory.path(), OsStr::new("Niri")).unwrap();
|
|
||||||
assert_eq!(fs::read_dir(directory.path()).unwrap().count(), 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn preserves_symlink_and_file_permissions() {
|
|
||||||
let directory = tempdir().unwrap();
|
|
||||||
let target = directory.path().join("managed.list");
|
|
||||||
let link = directory.path().join("niri-mimeapps.list");
|
|
||||||
fs::write(
|
|
||||||
&target,
|
|
||||||
"[Default Applications]\nx-scheme-handler/globalprotectcallback=old.desktop;\n",
|
|
||||||
)
|
|
||||||
.unwrap();
|
|
||||||
fs::set_permissions(&target, fs::Permissions::from_mode(0o640)).unwrap();
|
|
||||||
std::os::unix::fs::symlink(&target, &link).unwrap();
|
|
||||||
update_desktop_override(directory.path(), OsStr::new("Niri")).unwrap();
|
|
||||||
assert!(fs::symlink_metadata(&link).unwrap().file_type().is_symlink());
|
|
||||||
assert_eq!(fs::metadata(&target).unwrap().permissions().mode() & 0o777, 0o640);
|
|
||||||
assert!(fs::read_to_string(&target).unwrap().contains("=gpgui.desktop;"));
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn registers_callback_despite_desktop_override() {
|
|
||||||
if std::env::var_os("GP_TEST_CALLBACK_REGISTRATION").is_some() {
|
|
||||||
ensure_auth_callback_handler().unwrap();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
let directory = tempdir().unwrap();
|
|
||||||
let config = directory.path().join("config");
|
|
||||||
fs::create_dir(&config).unwrap();
|
|
||||||
fs::write(
|
|
||||||
config.join("niri-mimeapps.list"),
|
|
||||||
"# Keep this comment\n[Default Applications]\ntext/plain=editor.desktop;\nx-scheme-handler/globalprotectcallback=old.desktop;\n[Added Associations]\ntext/html=browser.desktop;\n",
|
|
||||||
).unwrap();
|
|
||||||
let script = directory.path().join("xdg-mime");
|
|
||||||
// Model xdg-mime's generic writer and desktop-specific lookup precedence.
|
|
||||||
fs::write(
|
|
||||||
&script,
|
|
||||||
r#"#!/bin/sh
|
|
||||||
if [ "$1" = default ]; then
|
|
||||||
printf '[Default Applications]\n%s=%s;\n' "$3" "$2" > "$XDG_CONFIG_HOME/mimeapps.list"
|
|
||||||
else
|
|
||||||
for desktop in $(printf '%s' "$XDG_CURRENT_DESKTOP" | tr ':' ' ' | tr '[:upper:]' '[:lower:]') ''; do
|
|
||||||
prefix=${desktop:+$desktop-}
|
|
||||||
file="$XDG_CONFIG_HOME/${prefix}mimeapps.list"
|
|
||||||
[ -f "$file" ] || continue
|
|
||||||
handler=$(sed -n 's|^x-scheme-handler/globalprotectcallback=\([^;]*\).*|\1|p' "$file")
|
|
||||||
if [ -n "$handler" ]; then printf '%s\n' "$handler"; exit 0; fi
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
"#,
|
|
||||||
)
|
|
||||||
.unwrap();
|
|
||||||
fs::set_permissions(&script, fs::Permissions::from_mode(0o755)).unwrap();
|
|
||||||
let path = std::env::join_paths(
|
|
||||||
std::iter::once(directory.path().to_path_buf()).chain(std::env::split_paths(&std::env::var_os("PATH").unwrap())),
|
|
||||||
)
|
|
||||||
.unwrap();
|
|
||||||
let output = Command::new(std::env::current_exe().unwrap())
|
|
||||||
.args([
|
|
||||||
"--exact",
|
|
||||||
"callback::xdg::tests::registers_callback_despite_desktop_override",
|
|
||||||
"--nocapture",
|
|
||||||
])
|
|
||||||
.env("GP_TEST_CALLBACK_REGISTRATION", "1")
|
|
||||||
.env("XDG_CURRENT_DESKTOP", "Niri:Other")
|
|
||||||
.env("XDG_CONFIG_HOME", &config)
|
|
||||||
.env("PATH", path)
|
|
||||||
.output()
|
|
||||||
.unwrap();
|
|
||||||
assert!(output.status.success(), "{}", String::from_utf8_lossy(&output.stderr));
|
|
||||||
assert_eq!(
|
|
||||||
fs::read_to_string(config.join("niri-mimeapps.list")).unwrap(),
|
|
||||||
"# Keep this comment\n[Default Applications]\ntext/plain=editor.desktop;\nx-scheme-handler/globalprotectcallback=gpgui.desktop;\n[Added Associations]\ntext/html=browser.desktop;\n",
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn replaces_any_other_callback_handler() {
|
|
||||||
assert!(!should_register_handler("gpgui.desktop"));
|
|
||||||
assert!(should_register_handler(""));
|
|
||||||
assert!(should_register_handler("gpauth.desktop"));
|
|
||||||
assert!(should_register_handler("other-vpn.desktop"));
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn detects_lxqt_desktop_session() {
|
|
||||||
assert!(is_lxqt_desktop(Some(OsStr::new("LXQt"))));
|
|
||||||
assert!(is_lxqt_desktop(Some(OsStr::new("LXQt:KDE"))));
|
|
||||||
assert!(is_lxqt_desktop(Some(OsStr::new("lxqt"))));
|
|
||||||
assert!(!is_lxqt_desktop(Some(OsStr::new("LXDE"))));
|
|
||||||
assert!(!is_lxqt_desktop(None));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -21,19 +21,6 @@ mod recovery_row;
|
|||||||
#[path = "gtk_tls.rs"]
|
#[path = "gtk_tls.rs"]
|
||||||
mod tls;
|
mod tls;
|
||||||
|
|
||||||
pub(super) fn open_okta_verify(url: &tauri::Url) -> bool {
|
|
||||||
if url.scheme() != "com-okta-authenticator" {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// FastPass loads this URI in a hidden iframe. Hand it to the desktop instead of WebKitGTK.
|
|
||||||
info!("Opening Okta Verify");
|
|
||||||
if let Err(error) = gtk::gio::AppInfo::launch_default_for_uri(url.as_str(), None::<>k::gio::AppLaunchContext>) {
|
|
||||||
warn!("Failed to open Okta Verify: {error}");
|
|
||||||
}
|
|
||||||
false
|
|
||||||
}
|
|
||||||
|
|
||||||
fn action_button(label: &str) -> anyhow::Result<gtk::Button> {
|
fn action_button(label: &str) -> anyhow::Result<gtk::Button> {
|
||||||
let button = gtk::Button::with_label(label);
|
let button = gtk::Button::with_label(label);
|
||||||
let spacing = gtk::CssProvider::new();
|
let spacing = gtk::CssProvider::new();
|
||||||
|
|||||||
@@ -129,8 +129,6 @@ impl<'a> WebviewAuthenticator<'a> {
|
|||||||
.title(self.window_title)
|
.title(self.window_title)
|
||||||
.theme(native_theme(self.window_theme))
|
.theme(native_theme(self.window_theme))
|
||||||
.devtools(cfg!(any(debug_assertions, feature = "release-devtools")));
|
.devtools(cfg!(any(debug_assertions, feature = "release-devtools")));
|
||||||
#[cfg(any(target_os = "linux", target_os = "freebsd", target_os = "openbsd"))]
|
|
||||||
let auth_window_builder = auth_window_builder.on_navigation(super::platform_impl::open_okta_verify);
|
|
||||||
let auth_window = auth_window_builder
|
let auth_window = auth_window_builder
|
||||||
.inner_size(900.0, 650.0 + get_title_bar_height() + TOOLBAR_HEIGHT)
|
.inner_size(900.0, 650.0 + get_title_bar_height() + TOOLBAR_HEIGHT)
|
||||||
.min_inner_size(400.0, 300.0)
|
.min_inner_size(400.0, 300.0)
|
||||||
|
|||||||
@@ -6,18 +6,14 @@ edition.workspace = true
|
|||||||
license = "MIT"
|
license = "MIT"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
nix = { version = "0.31", features = ["fs", "signal", "process"], optional = true }
|
nix = { version = "0.31", features = ["fs", "signal", "process"] }
|
||||||
common = { path = "../common" }
|
common = { path = "../common" }
|
||||||
directories = { workspace = true, optional = true }
|
|
||||||
anyhow.workspace = true
|
anyhow.workspace = true
|
||||||
base64.workspace = true
|
base64.workspace = true
|
||||||
dns-lookup = { workspace = true, optional = true }
|
dns-lookup.workspace = true
|
||||||
log.workspace = true
|
log.workspace = true
|
||||||
reqwest.workspace = true
|
reqwest.workspace = true
|
||||||
rustls = { version = "0.23", default-features = false, features = ["ring", "std", "tls12"] }
|
native-tls = "0.2"
|
||||||
rustls-pemfile = "2"
|
|
||||||
p12-keystore = "0.4.1"
|
|
||||||
sec1 = { version = "0.8.1", default-features = false, features = ["der"] }
|
|
||||||
pem.workspace = true
|
pem.workspace = true
|
||||||
pkcs8 = { version = "0.11", features = ["pem", "encryption", "sha1-insecure", "3des", "des-insecure"] }
|
pkcs8 = { version = "0.11", features = ["pem", "encryption", "sha1-insecure", "3des", "des-insecure"] }
|
||||||
x509-cert = { version = "0.3", default-features = false }
|
x509-cert = { version = "0.3", default-features = false }
|
||||||
@@ -25,25 +21,25 @@ xmltree.workspace = true
|
|||||||
serde.workspace = true
|
serde.workspace = true
|
||||||
specta = { workspace = true, features = ["derive", "uuid"] }
|
specta = { workspace = true, features = ["derive", "uuid"] }
|
||||||
urlencoding.workspace = true
|
urlencoding.workspace = true
|
||||||
tokio = { workspace = true, features = ["fs", "macros", "rt", "time"] }
|
tokio = { workspace = true, features = ["fs", "process", "signal", "macros"] }
|
||||||
tokio-util.workspace = true
|
tokio-util.workspace = true
|
||||||
serde_json.workspace = true
|
serde_json.workspace = true
|
||||||
whoami = { workspace = true, optional = true }
|
whoami.workspace = true
|
||||||
tempfile.workspace = true
|
tempfile.workspace = true
|
||||||
thiserror.workspace = true
|
thiserror.workspace = true
|
||||||
chacha20poly1305 = { version = "0.11", features = ["zeroize"] }
|
chacha20poly1305 = { version = "0.11", features = ["zeroize"] }
|
||||||
url.workspace = true
|
url.workspace = true
|
||||||
regex.workspace = true
|
regex.workspace = true
|
||||||
uzers = { workspace = true, optional = true }
|
uzers.workspace = true
|
||||||
serde_urlencoded.workspace = true
|
serde_urlencoded.workspace = true
|
||||||
md5.workspace = true
|
md5.workspace = true
|
||||||
sha2.workspace = true
|
sha2.workspace = true
|
||||||
uuid = { workspace = true, features = ["v4", "v5", "serde"] }
|
uuid = { workspace = true, features = ["v4", "v5", "serde"] }
|
||||||
chrono.workspace = true
|
chrono.workspace = true
|
||||||
humantime.workspace = true
|
humantime.workspace = true
|
||||||
netdev = { workspace = true, optional = true }
|
netdev.workspace = true
|
||||||
socket2 = { version = "0.6", features = ["all"], optional = true }
|
socket2 = { version = "0.6", features = ["all"] }
|
||||||
os_info = { version = "3", default-features = false, optional = true }
|
os_info = { version = "3", default-features = false }
|
||||||
snow.workspace = true
|
snow.workspace = true
|
||||||
zeroize = { workspace = true, features = ["serde"] }
|
zeroize = { workspace = true, features = ["serde"] }
|
||||||
getrandom = "0.4"
|
getrandom = "0.4"
|
||||||
@@ -56,30 +52,25 @@ clap-verbosity-flag = { workspace = true, optional = true }
|
|||||||
env_logger = { workspace = true, optional = true }
|
env_logger = { workspace = true, optional = true }
|
||||||
log-reload = { version = "0.1", optional = true }
|
log-reload = { version = "0.1", optional = true }
|
||||||
|
|
||||||
[target.'cfg(any(target_os="macos", target_os="ios"))'.dependencies]
|
[target.'cfg(target_os="macos")'.dependencies]
|
||||||
|
security-framework = "3"
|
||||||
oslog = { version = "0.2", default-features = false, optional = true }
|
oslog = { version = "0.2", default-features = false, optional = true }
|
||||||
|
|
||||||
# Dependencies for Linux and other OSes only
|
# Dependencies for Linux and other OSes only
|
||||||
[target.'cfg(not(any(target_os="macos", target_os="windows")))'.dependencies]
|
[target.'cfg(not(any(target_os="macos", target_os="windows")))'.dependencies]
|
||||||
gtk = { version = "0.18", optional = true }
|
gtk = { version = "0.18", optional = true }
|
||||||
|
|
||||||
[target.'cfg(target_os="linux")'.dependencies]
|
[target.'cfg(not(target_os = "macos"))'.dependencies]
|
||||||
libloading = { version = "0.9", optional = true }
|
openssl.workspace = true
|
||||||
|
version-compare = "0.2"
|
||||||
[build-dependencies]
|
|
||||||
cc = "1"
|
|
||||||
pkg-config = "0.3"
|
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
openssl.workspace = true
|
openssl.workspace = true
|
||||||
libloading = "0.9"
|
|
||||||
proptest.workspace = true
|
proptest.workspace = true
|
||||||
tokio = { workspace = true, features = ["test-util"] }
|
tokio = { workspace = true, features = ["test-util"] }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["desktop"]
|
tauri = ["dep:tauri", "dep:gtk"]
|
||||||
desktop = ["tokio/process", "tokio/signal", "dep:directories", "dep:nix", "dep:uzers", "dep:netdev", "dep:os_info", "dep:whoami", "dep:dns-lookup", "dep:socket2", "dep:libloading"]
|
clap = ["dep:clap", "dep:clap-verbosity-flag"]
|
||||||
tauri = ["desktop", "dep:tauri", "dep:gtk"]
|
|
||||||
clap = ["desktop", "dep:clap", "dep:clap-verbosity-flag"]
|
|
||||||
webview-auth = []
|
webview-auth = []
|
||||||
logger = ["desktop", "dep:env_logger", "dep:log-reload", "dep:oslog"]
|
logger = ["dep:env_logger", "dep:log-reload", "dep:oslog"]
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
fn main() {
|
|
||||||
println!("cargo:rerun-if-changed=src/utils/certificate/gnutls.c");
|
|
||||||
let target = std::env::var("CARGO_CFG_TARGET_OS").unwrap();
|
|
||||||
if !matches!(target.as_str(), "macos" | "linux" | "freebsd" | "openbsd") {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
let mut package = pkg_config::Config::new();
|
|
||||||
package.atleast_version("3.6").cargo_metadata(false);
|
|
||||||
let library = package
|
|
||||||
.probe("gnutls")
|
|
||||||
.expect("GnuTLS development files are required for desktop certificate import");
|
|
||||||
let mut build = cc::Build::new();
|
|
||||||
build.file("src/utils/certificate/gnutls.c");
|
|
||||||
for include in library.include_paths {
|
|
||||||
build.include(include);
|
|
||||||
}
|
|
||||||
build.compile("gp_certificate_import");
|
|
||||||
// GNU linkers must see the shim before its GnuTLS dependency (--as-needed).
|
|
||||||
package
|
|
||||||
.cargo_metadata(true)
|
|
||||||
.probe("gnutls")
|
|
||||||
.expect("GnuTLS was probed above");
|
|
||||||
}
|
|
||||||
@@ -12,16 +12,6 @@ use crate::{error::AuthDataParseError, utils::base64::decode_to_string};
|
|||||||
|
|
||||||
pub type AuthDataParseResult = anyhow::Result<SamlAuthData, AuthDataParseError>;
|
pub type AuthDataParseResult = anyhow::Result<SamlAuthData, AuthDataParseError>;
|
||||||
|
|
||||||
/// Validates an explicit GlobalProtect SAML completion status.
|
|
||||||
/// A missing status means the page has not supplied an authentication result.
|
|
||||||
pub fn validate_saml_auth_status(status: Option<&str>) -> Result<(), AuthDataParseError> {
|
|
||||||
match status {
|
|
||||||
Some("1") => Ok(()),
|
|
||||||
Some(status) => Err(AuthDataParseError::AuthenticationFailed(status.to_owned())),
|
|
||||||
None => Err(AuthDataParseError::NotFound),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Debug, Default, Clone, Copy, PartialEq, Eq)]
|
#[derive(Debug, Default, Clone, Copy, PartialEq, Eq)]
|
||||||
#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
|
#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
|
||||||
pub enum AuthWindowTheme {
|
pub enum AuthWindowTheme {
|
||||||
@@ -131,7 +121,8 @@ impl SamlAuthData {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn from_html(html: &str) -> AuthDataParseResult {
|
pub fn from_html(html: &str) -> AuthDataParseResult {
|
||||||
validate_saml_auth_status(parse_xml_tag(html, "saml-auth-status").as_deref())?;
|
match parse_xml_tag(html, "saml-auth-status") {
|
||||||
|
Some(status) if status == "1" => {
|
||||||
let username = parse_xml_tag(html, "saml-username");
|
let username = parse_xml_tag(html, "saml-username");
|
||||||
let prelogin_cookie = parse_xml_tag(html, "prelogin-cookie");
|
let prelogin_cookie = parse_xml_tag(html, "prelogin-cookie");
|
||||||
let portal_userauthcookie = parse_xml_tag(html, "portal-userauthcookie");
|
let portal_userauthcookie = parse_xml_tag(html, "portal-userauthcookie");
|
||||||
@@ -139,8 +130,13 @@ impl SamlAuthData {
|
|||||||
let auth_data =
|
let auth_data =
|
||||||
SamlAuthData::new(username, prelogin_cookie, portal_userauthcookie).map_err(AuthDataParseError::Invalid)?;
|
SamlAuthData::new(username, prelogin_cookie, portal_userauthcookie).map_err(AuthDataParseError::Invalid)?;
|
||||||
auth_data.log_summary("html");
|
auth_data.log_summary("html");
|
||||||
|
|
||||||
Ok(auth_data)
|
Ok(auth_data)
|
||||||
}
|
}
|
||||||
|
Some(status) => Err(AuthDataParseError::AuthenticationFailed(status)),
|
||||||
|
None => Err(AuthDataParseError::NotFound),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub fn from_gpcallback(data: &str) -> anyhow::Result<SamlAuthData, AuthDataParseError> {
|
pub fn from_gpcallback(data: &str) -> anyhow::Result<SamlAuthData, AuthDataParseError> {
|
||||||
let auth_data = data.trim_start_matches("globalprotectcallback:");
|
let auth_data = data.trim_start_matches("globalprotectcallback:");
|
||||||
@@ -221,26 +217,6 @@ fn parse_xml_tag(html: &str, tag: &str) -> Option<String> {
|
|||||||
mod tests {
|
mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn saml_status_distinguishes_rejection_from_an_unfinished_page() {
|
|
||||||
assert!(validate_saml_auth_status(Some("1")).is_ok());
|
|
||||||
assert!(matches!(
|
|
||||||
validate_saml_auth_status(None),
|
|
||||||
Err(AuthDataParseError::NotFound)
|
|
||||||
));
|
|
||||||
for status in ["0", "2", "", "unknown"] {
|
|
||||||
assert!(matches!(
|
|
||||||
validate_saml_auth_status(Some(status)),
|
|
||||||
Err(AuthDataParseError::AuthenticationFailed(_))
|
|
||||||
));
|
|
||||||
let html = format!("<saml-auth-status>{status}</saml-auth-status>");
|
|
||||||
assert!(matches!(
|
|
||||||
SamlAuthData::from_html(&html),
|
|
||||||
Err(AuthDataParseError::AuthenticationFailed(_))
|
|
||||||
));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn auth_data_from_gpcallback_cas() {
|
fn auth_data_from_gpcallback_cas() {
|
||||||
let auth_data = "globalprotectcallback:cas-as=1&[email protected]&token=very_long_string";
|
let auth_data = "globalprotectcallback:cas-as=1&[email protected]&token=very_long_string";
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ use clap::{ValueEnum, builder::PossibleValue};
|
|||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
gp_params::CscMode,
|
gp_params::CscMode,
|
||||||
os_profile::{ClientOs, desktop::runtime_client_os},
|
os_profile::{ClientOs, runtime_client_os},
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, ValueEnum)]
|
#[derive(Debug, Clone, Copy, PartialEq, Eq, ValueEnum)]
|
||||||
@@ -31,7 +31,6 @@ impl Default for Os {
|
|||||||
ClientOs::Linux => Os::Linux,
|
ClientOs::Linux => Os::Linux,
|
||||||
ClientOs::Windows => Os::Windows,
|
ClientOs::Windows => Os::Windows,
|
||||||
ClientOs::Mac => Os::Mac,
|
ClientOs::Mac => Os::Mac,
|
||||||
ClientOs::Ios => unreachable!("The desktop CLI is not available on iOS"),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,8 @@ use crate::{
|
|||||||
pub mod args;
|
pub mod args;
|
||||||
|
|
||||||
pub trait Args {
|
pub trait Args {
|
||||||
|
#[cfg(not(target_os = "macos"))]
|
||||||
|
fn fix_openssl(&self) -> bool;
|
||||||
fn ignore_tls_errors(&self) -> bool;
|
fn ignore_tls_errors(&self) -> bool;
|
||||||
|
|
||||||
/// How this program renders its logs.
|
/// How this program renders its logs.
|
||||||
@@ -41,6 +43,14 @@ fn retry_hints(err: &anyhow::Error, args: &impl Args) -> Vec<String> {
|
|||||||
// users already see; keep it exactly.
|
// users already see; keep it exactly.
|
||||||
let mut hints = Vec::new();
|
let mut hints = Vec::new();
|
||||||
|
|
||||||
|
#[cfg(not(target_os = "macos"))]
|
||||||
|
if kind == ServerTlsErrorKind::LegacyRenegotiation && !args.fix_openssl() {
|
||||||
|
let (program, rest) = command_line();
|
||||||
|
hints.push(format!(
|
||||||
|
"Re-run it with the `--fix-openssl` option to work around this issue, e.g.:\n\n{program} --fix-openssl {rest}"
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
if kind == ServerTlsErrorKind::Certificate && !args.ignore_tls_errors() {
|
if kind == ServerTlsErrorKind::Certificate && !args.ignore_tls_errors() {
|
||||||
let (program, rest) = command_line();
|
let (program, rest) = command_line();
|
||||||
hints.push(format!(
|
hints.push(format!(
|
||||||
@@ -194,11 +204,18 @@ mod tests {
|
|||||||
|
|
||||||
#[derive(Default)]
|
#[derive(Default)]
|
||||||
struct TestArgs {
|
struct TestArgs {
|
||||||
|
#[cfg(not(target_os = "macos"))]
|
||||||
|
fix_openssl: bool,
|
||||||
ignore_tls_errors: bool,
|
ignore_tls_errors: bool,
|
||||||
log_format: LogFormat,
|
log_format: LogFormat,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Args for TestArgs {
|
impl Args for TestArgs {
|
||||||
|
#[cfg(not(target_os = "macos"))]
|
||||||
|
fn fix_openssl(&self) -> bool {
|
||||||
|
self.fix_openssl
|
||||||
|
}
|
||||||
|
|
||||||
fn ignore_tls_errors(&self) -> bool {
|
fn ignore_tls_errors(&self) -> bool {
|
||||||
self.ignore_tls_errors
|
self.ignore_tls_errors
|
||||||
}
|
}
|
||||||
@@ -243,12 +260,31 @@ mod tests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn unknown_tls_failure_does_not_suggest_bypassing_certificate_validation() {
|
fn hints_distinguish_legacy_and_unknown_tls_and_respect_both_flags() {
|
||||||
let error = ServerTlsError {
|
let legacy = ServerTlsError {
|
||||||
|
server: "https://vpn.example.com".into(),
|
||||||
|
kind: ServerTlsErrorKind::LegacyRenegotiation,
|
||||||
|
};
|
||||||
|
let hints = retry_hints(&anyhow!(legacy.clone()), &TestArgs::default());
|
||||||
|
if cfg!(target_os = "macos") {
|
||||||
|
assert!(hints.is_empty());
|
||||||
|
} else {
|
||||||
|
assert_eq!(hints.len(), 1);
|
||||||
|
assert!(hints[0].contains("--fix-openssl"));
|
||||||
|
}
|
||||||
|
let args = TestArgs {
|
||||||
|
#[cfg(not(target_os = "macos"))]
|
||||||
|
fix_openssl: true,
|
||||||
|
ignore_tls_errors: true,
|
||||||
|
..Default::default()
|
||||||
|
};
|
||||||
|
assert!(retry_hints(&anyhow!(legacy), &args).is_empty());
|
||||||
|
assert!(retry_hints(&anyhow!(certificate_error()), &args).is_empty());
|
||||||
|
let other = ServerTlsError {
|
||||||
server: "https://vpn.example.com".into(),
|
server: "https://vpn.example.com".into(),
|
||||||
kind: ServerTlsErrorKind::Other,
|
kind: ServerTlsErrorKind::Other,
|
||||||
};
|
};
|
||||||
assert!(retry_hints(&anyhow!(error), &TestArgs::default()).is_empty());
|
assert!(retry_hints(&anyhow!(other), &TestArgs::default()).is_empty());
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Suggesting an option the user already passed is noise, and in JSON mode it
|
/// Suggesting an option the user already passed is noise, and in JSON mode it
|
||||||
|
|||||||