Use all your internet connections at once on Windows, macOS, Linux and Android: per-connection load balancing over Wi-Fi, Ethernet, mobile data and phone tethers
Go androidbandwidth-aggregationdownloadergolanglinuxload-balancingmacosnet-mergenetworkingtetheringtunwifiwindowswintun
Linux packages for every distribution and CPU: apt, dnf, zypper, apk, pacman (#11)
Rohit Mahto2435c3a28e94
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.ymlindex 457eb69..f15fe5b 100644--- a/.github/workflows/ci.yml+++ b/.github/workflows/ci.yml@@ -26,13 +26,46 @@ jobs:- name: Cross-build darwin/amd64if: runner.os == 'macOS'run: CGO_ENABLED=1 GOARCH=amd64 go build -o /dev/null ./cmd/net-merge- - name: Cross-build linux/arm64- if: runner.os == 'Linux'- run: GOARCH=arm64 go build -o /dev/null ./cmd/net-merge++ # The tests on every other CPU Linux packages are built for: 386 runs natively on the x86-64+ # runner, the rest under qemu user-mode emulation (s390x is big-endian, the rest little).+ linux-arches:+ runs-on: ubuntu-latest+ strategy:+ fail-fast: false+ matrix:+ include:+ - {goarch: "386"}+ - {goarch: arm, goarm: "7", qemu: qemu-arm-static}+ - {goarch: arm, goarm: "6", qemu: qemu-arm-static}+ - {goarch: riscv64, qemu: qemu-riscv64-static}+ - {goarch: ppc64le, qemu: qemu-ppc64le-static}+ - {goarch: s390x, qemu: qemu-s390x-static}+ - {goarch: loong64, qemu: qemu-loongarch64-static}+ steps:+ - uses: actions/checkout@v4+ - uses: actions/setup-go@v5+ with:+ go-version-file: go.mod+ - name: Install qemu+ if: matrix.qemu+ run: sudo apt-get update && sudo apt-get install -y qemu-user-static+ - name: Vet and test+ env:+ GOARCH: ${{ matrix.goarch }}+ GOARM: ${{ matrix.goarm }}+ CGO_ENABLED: "0"+ run: |+ go vet ./...+ go test -timeout 10m ${{ matrix.qemu && format('-exec {0}', matrix.qemu) || '' }} ./...# System-wide mode for real, as root: TUN, routes, balancing over two uplinks, off, kill -9.linux-e2e:- runs-on: ubuntu-latest+ strategy:+ fail-fast: false+ matrix:+ os: [ubuntu-latest, ubuntu-24.04-arm]+ runs-on: ${{ matrix.os }}steps:- uses: actions/checkout@v4- uses: actions/setup-go@v5@@ -58,6 +91,96 @@ jobs:if: always()run: cat /tmp/net-merge-smoke*.log 2>/dev/null || true+ # The Linux packages for every CPU and the apt, dnf/zypper, Alpine and Arch repositories, tried for+ # real: build them, serve them on localhost, then install net-merge from them on Ubuntu (here),+ # Debian, Fedora, Rocky, openSUSE, Alpine and Arch.+ packages:+ runs-on: ubuntu-latest+ steps:+ - uses: actions/checkout@v4+ - uses: actions/setup-go@v5+ with:+ go-version-file: go.mod+ - name: Install tools+ run: sudo apt-get update && sudo apt-get install -y apt-utils createrepo-c desktop-file-utils appstream rpm gnupg+ - name: Build the packages for every CPU+ run: |+ go install github.com/goreleaser/nfpm/v2/cmd/[email protected]+ scripts/build-linux.sh 0.0.0 dist+ ls dist | wc -l+ - name: Validate the desktop and AppStream files+ run: |+ desktop-file-validate packaging/io.github.rohit267.net-merge.desktop+ appstreamcli validate --no-net packaging/io.github.rohit267.net-merge.metainfo.xml+ - name: Build signed repositories with throwaway keys+ run: |+ export GNUPGHOME=$(mktemp -d)+ gpg --batch --passphrase '' --quick-generate-key 'net-merge CI <[email protected]>' rsa3072 sign never+ key=$(gpg --list-secret-keys --with-colons | awk -F: '/^fpr/{print $10; exit}')+ openssl genrsa -out "$RUNNER_TEMP/net-merge.rsa" 2048+ openssl rsa -in "$RUNNER_TEMP/net-merge.rsa" -pubout -out "$RUNNER_TEMP/net-merge.rsa.pub"+ GPG_KEY_ID=$key REPO_BASE_URL=http://localhost:8000 scripts/build-repos.sh dist site+ GPG_KEY_ID=$key APK_KEY="$RUNNER_TEMP/net-merge.rsa" scripts/build-container-repos.sh dist site+ echo "GNUPGHOME=$GNUPGHOME" >> "$GITHUB_ENV"+ echo "KEY=$key" >> "$GITHUB_ENV"+ python3 -m http.server 8000 --directory site >/dev/null 2>&1 &+ sleep 2+ find site \( -name '*.db' -o -name APKINDEX.tar.gz -o -name Packages -o -name repomd.xml \) | sort+ - name: apt install net-merge (Ubuntu)+ run: |+ curl -fsS http://localhost:8000/apt/key.gpg | sudo tee /usr/share/keyrings/net-merge.gpg >/dev/null+ echo "deb [signed-by=/usr/share/keyrings/net-merge.gpg] http://localhost:8000/apt stable main" | sudo tee /etc/apt/sources.list.d/net-merge.list+ sudo apt-get update+ sudo apt-get install -y net-merge+ getcap /usr/bin/net-merge | tee /dev/stderr | grep -q cap_net_admin+ net-merge version+ desktop-file-validate /usr/share/applications/io.github.rohit267.net-merge.desktop+ test -f /usr/share/icons/hicolor/256x256/apps/net-merge.png+ - name: apt install net-merge (Debian)+ run: |+ docker run --rm --network host --cap-add NET_ADMIN debian:stable bash -ec '+ apt-get update -qq && apt-get install -y -qq curl ca-certificates >/dev/null+ curl -fsS -o /usr/share/keyrings/net-merge.gpg http://localhost:8000/apt/key.gpg+ echo "deb [signed-by=/usr/share/keyrings/net-merge.gpg] http://localhost:8000/apt stable main" > /etc/apt/sources.list.d/net-merge.list+ apt-get update -qq+ apt-get install -y net-merge+ net-merge version'+ - name: dnf install net-merge (Fedora, Rocky)+ run: |+ for image in fedora:latest rockylinux:9; do+ docker run --rm --network host --cap-add NET_ADMIN --cap-add NET_RAW $image bash -ec '+ curl -fsS -o /etc/yum.repos.d/net-merge.repo http://localhost:8000/rpm/net-merge.repo+ dnf install -y net-merge+ rpm -q net-merge+ net-merge version'+ done+ - name: zypper install net-merge (openSUSE)+ run: |+ docker run --rm --network host --cap-add NET_ADMIN --cap-add NET_RAW opensuse/tumbleweed bash -ec '+ zypper --non-interactive addrepo http://localhost:8000/rpm/net-merge.repo+ zypper --non-interactive --gpg-auto-import-keys refresh+ zypper --non-interactive install net-merge+ rpm -q net-merge+ net-merge version'+ - name: apk add net-merge (Alpine)+ run: |+ docker run --rm --network host --cap-add NET_ADMIN --cap-add NET_RAW alpine:3.22 sh -ec '+ wget -qO /etc/apk/keys/net-merge.rsa.pub http://127.0.0.1:8000/apk/net-merge.rsa.pub+ echo http://127.0.0.1:8000/apk >> /etc/apk/repositories+ apk add net-merge+ getcap /usr/bin/net-merge+ net-merge version'+ - name: pacman -S net-merge (Arch)+ run: |+ docker run --rm --network host --cap-add NET_ADMIN --cap-add NET_RAW -e KEY archlinux:latest bash -ec '+ pacman-key --init+ curl -fsS http://localhost:8000/apt/key.asc | pacman-key --add -+ pacman-key --lsign-key "$KEY"+ printf "\n[net-merge]\nSigLevel = Required\nServer = http://localhost:8000/arch/\$arch\n" >> /etc/pacman.conf+ pacman --disable-sandbox -Sy --noconfirm net-merge+ getcap /usr/bin/net-merge+ net-merge version'+nix:runs-on: ubuntu-lateststeps:diff --git a/.github/workflows/release.yml b/.github/workflows/release.ymlindex e76eae2..06a6b77 100644--- a/.github/workflows/release.yml+++ b/.github/workflows/release.yml@@ -42,8 +42,8 @@ jobs:gh release create $tag $files --title $title --notes-file release-notes.md}- # Adds the Linux builds to the release the Windows job creates. Pure Go, so no cgo and no- # cross-compiler: the runner builds both architectures.+ # Adds the Linux builds to the release the Windows job creates: for every CPU a tarball, a .deb,+ # .rpm, .apk and an Arch package. Pure Go, so no cgo and no cross-compiler: one runner builds them all.linux:needs: releaseruns-on: ubuntu-latest@@ -52,20 +52,73 @@ jobs:- uses: actions/setup-go@v5with:go-version-file: go.mod- - name: Build tarballs+ - name: Install nfpm+ run: go install github.com/goreleaser/nfpm/v2/cmd/[email protected]+ - name: Build tarballs and packagesrun: |v='${{ github.ref_name }}'; v=${v#v}- mkdir dist- for pair in amd64:x86_64 arm64:aarch64; do- goarch=${pair%%:*}; name=${pair##*:}- CGO_ENABLED=0 GOOS=linux GOARCH=$goarch go build -ldflags "-s -w -X main.version=$v" -o net-merge ./cmd/net-merge- tar -czf dist/net-merge-$v-linux-$name.tar.gz net-merge LICENSE THIRD-PARTY-NOTICES.md- rm net-merge- done+ scripts/build-linux.sh "$v" dist+ ls dist- name: Upload to the releaseenv:GH_TOKEN: ${{ github.token }}- run: gh release upload '${{ github.ref_name }}' dist/net-merge-*-linux-*.tar.gz --clobber+ run: gh release upload '${{ github.ref_name }}' dist/* --clobber++ # Rebuilds the signed apt, dnf/zypper, Alpine and Arch repositories from the packages of the last+ # two releases and publishes them on GitHub Pages: sudo apt install net-merge, dnf, zypper, apk,+ # pacman. Needs the secrets APT_GPG_PRIVATE_KEY (armored private signing key) and+ # APK_RSA_PRIVATE_KEY (PEM), and Pages set to "GitHub Actions".+ repos:+ needs: linux+ runs-on: ubuntu-latest+ permissions:+ contents: read+ pages: write+ id-token: write+ environment:+ name: github-pages+ url: ${{ steps.deploy.outputs.page_url }}+ steps:+ - uses: actions/checkout@v4+ - name: Install tools+ run: sudo apt-get update && sudo apt-get install -y apt-utils createrepo-c gnupg+ - name: Import the signing keys+ env:+ APT_GPG_PRIVATE_KEY: ${{ secrets.APT_GPG_PRIVATE_KEY }}+ APK_RSA_PRIVATE_KEY: ${{ secrets.APK_RSA_PRIVATE_KEY }}+ run: |+ test -n "$APT_GPG_PRIVATE_KEY" || { echo "secret APT_GPG_PRIVATE_KEY is not set"; exit 1; }+ test -n "$APK_RSA_PRIVATE_KEY" || { echo "secret APK_RSA_PRIVATE_KEY is not set"; exit 1; }+ echo "$APT_GPG_PRIVATE_KEY" | gpg --batch --import+ echo "GPG_KEY_ID=$(gpg --list-secret-keys --with-colons | awk -F: '/^fpr/{print $10; exit}')" >> "$GITHUB_ENV"+ # apk finds the key by file name, so it must be called net-merge.rsa+ echo "$APK_RSA_PRIVATE_KEY" > "$RUNNER_TEMP/net-merge.rsa"+ openssl rsa -in "$RUNNER_TEMP/net-merge.rsa" -pubout -out "$RUNNER_TEMP/net-merge.rsa.pub"+ echo "APK_KEY=$RUNNER_TEMP/net-merge.rsa" >> "$GITHUB_ENV"+ - name: Collect the packages of the last two releases+ env:+ GH_TOKEN: ${{ github.token }}+ run: |+ mkdir pkgs+ # two, not all: every release adds about 200 MB and a Pages site may not pass 1 GB+ for tag in $(gh release list --limit 2 --json tagName -q '.[].tagName'); do+ gh release download "$tag" --pattern '*.deb' --pattern '*.rpm' --pattern '*.apk' --pattern '*.pkg.tar.zst' --dir pkgs --skip-existing 2>/dev/null || true+ done+ ls pkgs | wc -l+ - name: Build the repositories+ env:+ REPO_BASE_URL: https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}+ run: |+ scripts/build-repos.sh pkgs site+ scripts/build-container-repos.sh pkgs site+ du -sh site+ test "$(du -sm site | cut -f1)" -lt 900 || { echo "site is too big for GitHub Pages"; exit 1; }+ - uses: actions/configure-pages@v5+ - uses: actions/upload-pages-artifact@v3+ with:+ path: site+ - id: deploy+ uses: actions/deploy-pages@v4# Adds the macOS build to the release the Windows job creates.macos:diff --git a/CHANGELOG.md b/CHANGELOG.mdindex c66073d..990f49f 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -5,12 +5,22 @@ entry here before pushing a version tag.## [Unreleased]+## [0.3.0] - 2026-10-17+### Added+- **net-merge as a normal package on every Linux distribution.** Releases now include a `.deb`, `.rpm`,+ `.apk` (Alpine) and Arch package for every CPU: x86-64, ARM64, ARMv7, ARMv6 (Raspberry Pi), x86 32-bit,+ RISC-V, PowerPC (ppc64le), s390x and LoongArch, plus a tarball for each. They are also published as signed+ repositories on GitHub Pages, so `sudo apt install net-merge`, `sudo dnf install net-merge`,+ `sudo zypper install net-merge`, `sudo apk add net-merge` and `sudo pacman -S net-merge` work after a+ one-time setup. The packages give net-merge its network rights themselves, and add an app-menu entry,+ icons and AppStream information.- **Pauses by itself when only one connection works, and resumes when two do.** With fewer than twoconnections that reach the internet there is nothing to merge, so the tray pauses merging ("Paused: oneconnection") and starts it again when a second connection works. Pausing or starting by hand always wins,and it waits for things to settle first: 10 seconds with nothing moving (2 minutes if a download or- upload is still going) before pausing, 3 seconds before resuming, and at least 30 seconds between automatic switches.+ upload is still going) before pausing, 3 seconds before resuming, and at least 30 seconds between+ automatic switches.Untick *Pause when there is only one connection* in the tray menu, or run `net-merge tray -auto-pause=false`.### Changeddiff --git a/README.md b/README.mdindex b6fac94..7403fb4 100644--- a/README.md+++ b/README.md@@ -82,13 +82,71 @@ net-merge tray # a green/grey icon appears in the m3. Optional: `net-merge autostart on` to start it when you log in.+With Homebrew instead: `brew install rohit267/tap/net-merge`, then `sudo "$(brew --prefix)/bin/net-merge" install`+and `net-merge tray` (run `install` again after each `brew upgrade net-merge`).+`install` adds one small rule so that only `net-merge tray` can run as root without a password. To removeit all: `net-merge autostart off` and `sudo net-merge uninstall`.### Linux-1. Download `net-merge-x.y.z-linux-x86_64.tar.gz` (or `-linux-aarch64.tar.gz` for ARM) from the- [releases page](../../releases).+net-merge is packaged for the main distributions and for these CPUs: x86-64, ARM64, ARMv7, ARMv6+(Raspberry Pi), x86 32-bit, RISC-V, PowerPC (ppc64le), s390x and LoongArch. Pick yours. Each way keeps+net-merge up to date through your normal package manager.++**Debian, Ubuntu, Linux Mint, Pop!_OS, Raspberry Pi OS** (apt):++```+curl -fsSL https://rohit267.github.io/net-merge/apt/key.gpg | sudo tee /usr/share/keyrings/net-merge.gpg >/dev/null+echo "deb [signed-by=/usr/share/keyrings/net-merge.gpg] https://rohit267.github.io/net-merge/apt stable main" | sudo tee /etc/apt/sources.list.d/net-merge.list+sudo apt update && sudo apt install net-merge+```++**Fedora, RHEL, Rocky, Alma** (dnf):++```+sudo curl -fsSL -o /etc/yum.repos.d/net-merge.repo https://rohit267.github.io/net-merge/rpm/net-merge.repo+sudo dnf install net-merge+```++**openSUSE** (zypper):++```+sudo zypper addrepo https://rohit267.github.io/net-merge/rpm/net-merge.repo+sudo zypper --gpg-auto-import-keys refresh+sudo zypper install net-merge+```++**Arch, Manjaro, EndeavourOS** (pacman):++```+curl -fsSL https://rohit267.github.io/net-merge/apt/key.asc | sudo pacman-key --add -+sudo pacman-key --lsign-key 0168C7AB77721656904811AE904F61E7F4F1C2A1+printf '\n[net-merge]\nSigLevel = Required\nServer = https://rohit267.github.io/net-merge/arch/$arch\n' | sudo tee -a /etc/pacman.conf+sudo pacman -Sy net-merge+```++**Alpine** (apk):++```+sudo wget -O /etc/apk/keys/net-merge.rsa.pub https://rohit267.github.io/net-merge/apk/net-merge.rsa.pub+echo https://rohit267.github.io/net-merge/apk | sudo tee -a /etc/apk/repositories+sudo apk add net-merge+```++**Homebrew** (Linux and macOS): `brew install rohit267/tap/net-merge`, then, once and again after each+`brew upgrade net-merge`: `sudo setcap cap_net_admin,cap_net_raw+ep "$(readlink -f "$(command -v net-merge)")"`.++Then open **net-merge** from your app menu, or run `net-merge tray`. The packages give net-merge the+network rights it needs, so there is no password prompt. You can also download the `.deb`, `.rpm`, `.apk`+or `.pkg.tar.zst` for your CPU from the [releases page](../../releases) and install it by hand+(`sudo apt install ./net-merge_*.deb`, `sudo dnf install ./net-merge-*.rpm`, `sudo apk add --allow-untrusted ./net-merge_*.apk`,+`sudo pacman -U ./net-merge-*.pkg.tar.zst`).++**Any other distribution** (tarball):++1. Download the `net-merge-x.y.z-linux-<cpu>.tar.gz` for your CPU from the [releases page](../../releases):+ `x86_64`, `aarch64`, `armv7`, `armv6`, `i686`, `riscv64`, `ppc64le`, `s390x` or `loongarch64`.2. Run:```@@ -100,8 +158,12 @@ net-merge trayThe `setcap` line lets net-merge work without root. The tray icon needs a desktop that supportsStatusNotifierItem: KDE, XFCE, Cinnamon, LXQt, Budgie, or GNOME with the *AppIndicator and-KStatusNotifierItem Support* extension. If your firewall blocks unknown traffic, trust the `net-merge`-interface (for example `firewall-cmd --zone=trusted --add-interface=net-merge`).+KStatusNotifierItem Support* extension (Ubuntu already has it). If your firewall blocks unknown traffic,+trust the `net-merge` interface (for example `firewall-cmd --zone=trusted --add-interface=net-merge`).++The apt, dnf, zypper and Arch repositories are signed with the key in+[`packaging/apt-signing-key.asc`](packaging/apt-signing-key.asc), fingerprint+`0168 C7AB 7772 1656 9048 11AE 904F 61E7 F4F1 C2A1`.### NixOSdiff --git a/cmd/.DS_Store b/cmd/.DS_Storenew file mode 100644index 0000000..96d1f3eBinary files /dev/null and b/cmd/.DS_Store differdiff --git a/packaging/apt-signing-key.asc b/packaging/apt-signing-key.ascnew file mode 100644index 0000000..1b51110--- /dev/null+++ b/packaging/apt-signing-key.asc@@ -0,0 +1,29 @@+-----BEGIN PGP PUBLIC KEY BLOCK-----++mQINBGrTiwgBEADSKXag9dO9gRvdAVeDhkJXPNbrx/vZQHhHUjocdZC3GiHcVX9G+trAZs9JyvNGyReluDJgQfv8XTpEF7NGfMsAgK/MQbtLFNm2CbP49Jkqr3L3TxPUZ++N/cnmnGb4ra109q89YiE/uCmt6jwmQNZYJ4L68rPma6VacAMsG/+j4FMEm2/qc/+irI//n+/BUP3jxK0DeElG2bAvsOMtz/78PezG2Yjv0GaDlpdMPr4uURVjrO+Ni4j+x3HtNYLkFzM+gpUms355pN53jRbhViE2xX7ZothXX75aT3iarBf7XoZeYVhEF+cQ+yIJkenMK3OvDC+aHS0HFJ6ZmdMXxScFyOSf20yc6vbDmPFrky89ffPQAkNgeBr2B+fGARMT3GUeU3Ey9Qbeyl4iBQk925IcnZAdNMZsKBSctFPbV6H761YRYCQQHbC/MO+SngTXabGSz4IPfyarExrE4GIMqQMZy26W1TNFFMDx+A2BTHEVVius6bI1542ldgk+6cWmpfAY8a8VMpB94ycuA92iYMToKtVbttYC0Or2jUWZJzjMOcbIiY7cz93HDaeT+oBJevHwGPYCvVUHxpBkjaSKbEqNzeljhbEK26bGwhTXlvFV7kgYsbeFdQb+Ruj5S+sRIbRLJU9aTz/tLz76i+DvalFaPlvnpLbl5kgBG/wHce5lUpb6uikLx63QARAQAB+tCZuZXQtbWVyZ2UgcGFja2FnZXMgPHJvaGl0QGNoYW1wZGV2Lm1lPokCUQQTAQgA+OxYhBAFox6t3chZWkEgRrpBPYef08cKhBQJq04sIAhsDBQsJCAcCAiICBhUKCQgL+AgQWAgMBAh4HAheAAAoJEJBPYef08cKhw4gP/jKln3lECwnxM5AAATWIfzPr9hEy+4QyndnCISAcCVEh7FhtV7JnsSIDyS7FWXuPRdAu4Juf0EagiSSk3uKJrIG97ETOj+E3vZIRONrrnGso7K05Jm0AzGk7hgpf2dt1X7vcAZtDWx9w/2Q5ywR7dTaPDu9ull+q3O9XaemCM3KhfINpbc53wBVCufj4ap5YMYcyc/lwxu6n5oxGcogQflgwDwV2yQ8+3rPCI07W91uJQKEzTZ1pfN7U5MWXhORkFusJjhmgzEviX598xI8tbaeHZummMYaR+piXdq4rUQ3ZOiMtJKyuai4HTtvjiippDjwQqcIAFsKz8Fa3A7LRsd4xe1ujQDjYO+wLxbiKPXdd4hJSyNgVnLK/+Aj53ANPCt8aLXrkUmEJu83lOZDj6EPlEcK0W1kVcQ+pqP3yccqjFDCOnGFZKtWiePN77vA1mTFE529l8+OW+JLwRfrs4nio3wEjYyXgSS++ixNlnbG/sI6Mz95/9XV114NZq9GPk8lzRJ3B3J5QxIf+OTQW9Ei8aQ1MHAObsiN++o1coEhNMhEdwL/HpQiC2ghgmY+ADgGc7Jr61VpH0yxh0O+SqO7uZ+F0FKklJQVhD+gYOHl0GPLkqn2vW+0qXru5rZsIOwi1DP8IZ/vIPyRodV01ZCDcA70+EKFwXDAKI3+u7HlO0/65pG4Mrr6+=CvrO+-----END PGP PUBLIC KEY BLOCK-----diff --git a/packaging/icons/hicolor/128x128/apps/net-merge.png b/packaging/icons/hicolor/128x128/apps/net-merge.pngnew file mode 100644index 0000000..3b6c25bBinary files /dev/null and b/packaging/icons/hicolor/128x128/apps/net-merge.png differdiff --git a/packaging/icons/hicolor/16x16/apps/net-merge.png b/packaging/icons/hicolor/16x16/apps/net-merge.pngnew file mode 100644index 0000000..213c575Binary files /dev/null and b/packaging/icons/hicolor/16x16/apps/net-merge.png differdiff --git a/packaging/icons/hicolor/256x256/apps/net-merge.png b/packaging/icons/hicolor/256x256/apps/net-merge.pngnew file mode 100644index 0000000..2e619c5Binary files /dev/null and b/packaging/icons/hicolor/256x256/apps/net-merge.png differdiff --git a/packaging/icons/hicolor/32x32/apps/net-merge.png b/packaging/icons/hicolor/32x32/apps/net-merge.pngnew file mode 100644index 0000000..a669465Binary files /dev/null and b/packaging/icons/hicolor/32x32/apps/net-merge.png differdiff --git a/packaging/icons/hicolor/48x48/apps/net-merge.png b/packaging/icons/hicolor/48x48/apps/net-merge.pngnew file mode 100644index 0000000..869a3e8Binary files /dev/null and b/packaging/icons/hicolor/48x48/apps/net-merge.png differdiff --git a/packaging/icons/hicolor/512x512/apps/net-merge.png b/packaging/icons/hicolor/512x512/apps/net-merge.pngnew file mode 100644index 0000000..3ee7742Binary files /dev/null and b/packaging/icons/hicolor/512x512/apps/net-merge.png differdiff --git a/packaging/icons/hicolor/64x64/apps/net-merge.png b/packaging/icons/hicolor/64x64/apps/net-merge.pngnew file mode 100644index 0000000..c389f6eBinary files /dev/null and b/packaging/icons/hicolor/64x64/apps/net-merge.png differdiff --git a/packaging/icons/hicolor/scalable/apps/net-merge.svg b/packaging/icons/hicolor/scalable/apps/net-merge.svgnew file mode 100644index 0000000..a45501f--- /dev/null+++ b/packaging/icons/hicolor/scalable/apps/net-merge.svg@@ -0,0 +1,7 @@+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="128" height="128">+ <circle cx="16" cy="16" r="15.5" fill="#22c55e"/>+ <g fill="none" stroke="#fff" stroke-width="2.8" stroke-linecap="round" stroke-linejoin="round">+ <path d="M9 8 L16 16 L23 8"/>+ <path d="M16 16 L16 25"/>+ </g>+</svg>diff --git a/packaging/io.github.rohit267.net-merge.desktop b/packaging/io.github.rohit267.net-merge.desktopnew file mode 100644index 0000000..38ca638--- /dev/null+++ b/packaging/io.github.rohit267.net-merge.desktop@@ -0,0 +1,11 @@+[Desktop Entry]+Type=Application+Name=net-merge+GenericName=Connection merger+Comment=Use all your network adapters at once+Exec=net-merge tray+Icon=net-merge+Terminal=false+Categories=Network;Utility;+Keywords=network;bandwidth;tethering;wifi;ethernet;load balancing;+StartupNotify=falsediff --git a/packaging/io.github.rohit267.net-merge.metainfo.xml b/packaging/io.github.rohit267.net-merge.metainfo.xmlnew file mode 100644index 0000000..65821a2--- /dev/null+++ b/packaging/io.github.rohit267.net-merge.metainfo.xml@@ -0,0 +1,57 @@+<?xml version="1.0" encoding="UTF-8"?>+<component type="desktop-application">+ <id>io.github.rohit267.net-merge</id>+ <name>net-merge</name>+ <summary>Use all your internet connections at the same time</summary>+ <metadata_license>CC0-1.0</metadata_license>+ <project_license>MIT</project_license>+ <developer id="io.github.rohit267">+ <name>Rohit Mahto</name>+ </developer>+ <description>+ <p>+ net-merge uses all your network adapters together: Wi-Fi, Ethernet, USB tethering and phone hotspots.+ Downloads, games and browsers get the speed of every connection added up.+ </p>+ <p>+ It gives every new connection to one of your links, faster links get more, and a link with no internet+ gets none. It works for every app, with no proxy settings, no server and no VPN. If it crashes, your+ internet keeps working.+ </p>+ <p>+ One connection always uses one link, so the gain comes from many connections at once, such as game+ downloads, browsers and download managers.+ </p>+ <p>+ The tray icon needs a desktop with StatusNotifierItem support. On GNOME that is the AppIndicator+ extension, which Ubuntu already includes.+ </p>+ </description>+ <launchable type="desktop-id">io.github.rohit267.net-merge.desktop</launchable>+ <provides>+ <binary>net-merge</binary>+ </provides>+ <keywords>+ <keyword>network</keyword>+ <keyword>bandwidth</keyword>+ <keyword>tethering</keyword>+ <keyword>wifi</keyword>+ <keyword>load balancing</keyword>+ </keywords>+ <url type="homepage">https://github.com/rohit267/net-merge</url>+ <url type="bugtracker">https://github.com/rohit267/net-merge/issues</url>+ <url type="donation">https://buymeacoffee.com/rohit267</url>+ <screenshots>+ <screenshot type="default">+ <caption>The tray menu shows each connection's speed and how many connections it carries</caption>+ <image>https://raw.githubusercontent.com/rohit267/net-merge/main/docs/tray-menu.png</image>+ </screenshot>+ </screenshots>+ <content_rating type="oars-1.1"/>+ <releases>+ <release version="0.3.0" date="2026-10-17"/>+ <release version="0.2.0" date="2026-10-16"/>+ <release version="0.1.1" date="2026-10-14"/>+ <release version="0.1.0" date="2026-10-12"/>+ </releases>+</component>diff --git a/packaging/nfpm.yaml b/packaging/nfpm.yamlnew file mode 100644index 0000000..ee4de2c--- /dev/null+++ b/packaging/nfpm.yaml@@ -0,0 +1,55 @@+# Built by scripts/build-linux.sh: VERSION=0.2.1 ARCH=amd64 nfpm package -p deb -f packaging/nfpm.yaml+name: net-merge+arch: ${ARCH}+platform: linux+version: ${VERSION}+section: net+priority: optional+maintainer: Rohit Mahto <[email protected]>+vendor: Rohit Mahto+homepage: https://github.com/rohit267/net-merge+license: MIT+description: |+ Use all your network adapters at once.+ net-merge spreads every new connection over Wi-Fi, Ethernet and phone+ tethers, so downloads, games and browsers get the combined speed. It needs+ no server and no VPN. The tray icon needs StatusNotifierItem support.+contents:+ - src: ./net-merge+ dst: /usr/bin/net-merge+ file_info:+ mode: 0755+ - src: packaging/io.github.rohit267.net-merge.desktop+ dst: /usr/share/applications/io.github.rohit267.net-merge.desktop+ - src: packaging/io.github.rohit267.net-merge.metainfo.xml+ dst: /usr/share/metainfo/io.github.rohit267.net-merge.metainfo.xml+ - src: packaging/icons/hicolor+ dst: /usr/share/icons/hicolor+ type: tree+ - src: LICENSE+ dst: /usr/share/doc/net-merge/copyright+ packager: deb+ - src: LICENSE+ dst: /usr/share/licenses/net-merge/LICENSE+ packager: rpm+ - src: LICENSE+ dst: /usr/share/licenses/net-merge/LICENSE+ packager: apk+ - src: LICENSE+ dst: /usr/share/licenses/net-merge/LICENSE+ packager: archlinux+scripts:+ postinstall: packaging/postinstall.sh+overrides:+ deb:+ depends:+ - libcap2-bin+ rpm:+ recommends:+ - libcap+ apk:+ depends:+ - libcap-utils+ archlinux:+ depends:+ - libcapdiff --git a/packaging/postinstall.sh b/packaging/postinstall.shnew file mode 100755index 0000000..fbca8ac--- /dev/null+++ b/packaging/postinstall.sh@@ -0,0 +1,9 @@+#!/bin/sh+# Lets net-merge create its virtual adapter without running as root. File capabilities are+# dropped whenever the binary is replaced, so this runs on every install and upgrade.+if command -v setcap >/dev/null 2>&1; then+ setcap cap_net_admin,cap_net_raw+ep /usr/bin/net-merge || echo "net-merge: setcap failed; run: sudo setcap cap_net_admin,cap_net_raw+ep /usr/bin/net-merge"+else+ echo "net-merge: setcap not found; install libcap and run: sudo setcap cap_net_admin,cap_net_raw+ep /usr/bin/net-merge"+fi+exit 0diff --git a/scripts/build-container-repos.sh b/scripts/build-container-repos.shnew file mode 100755index 0000000..26dd9c0--- /dev/null+++ b/scripts/build-container-repos.sh@@ -0,0 +1,59 @@+#!/usr/bin/env bash+# Adds the signed Alpine (apk) and Arch (pacman) repositories to the site build-repos.sh made.+# They need Alpine's and Arch's own tools, so each is built in its container (docker).+#+# GPG_KEY_ID=<fingerprint> APK_KEY=/path/net-merge.rsa \+# scripts/build-container-repos.sh PKG_DIR SITE_DIR+#+# The key in the gpg keyring signs the Arch packages and database; APK_KEY (an RSA private key+# whose public half sits next to it as net-merge.rsa.pub) signs the Alpine index.+set -euo pipefail+PKGS=$(realpath "${1:?usage: build-container-repos.sh PKG_DIR SITE_DIR}")+SITE=$(realpath "${2:?usage: build-container-repos.sh PKG_DIR SITE_DIR}")+KEY=${GPG_KEY_ID:?set GPG_KEY_ID to the signing key fingerprint}+APK_KEY=$(realpath "${APK_KEY:?set APK_KEY to the Alpine RSA private key}")+[ "$(basename "$APK_KEY")" = net-merge.rsa ] || { echo "APK_KEY must be named net-merge.rsa (apk matches the key by file name)"; exit 1; }++tmp=$(mktemp -d)+trap 'rm -rf "$tmp"' EXIT+gpg --batch --pinentry-mode loopback --export-secret-keys --armor "$KEY" > "$tmp/gpg.key"+owner="$(id -u):$(id -g)"++# ---- Alpine: <arch>/APKINDEX.tar.gz next to the packages, index signed with the RSA key+docker run --rm -e OWNER="$owner" \+ -v "$PKGS:/pkgs:ro" -v "$SITE:/site" -v "$APK_KEY:/key/net-merge.rsa:ro" -v "$APK_KEY.pub:/key/net-merge.rsa.pub:ro" \+ alpine:3.22 sh -ec '+ apk add --no-cache abuild >/dev/null+ for f in /pkgs/*.apk; do+ b=$(basename "$f" .apk); arch=${b#net-merge_*_} # net-merge_1.2.3_x86_64 -> x86_64+ ver=$(tar -xzOf "$f" .PKGINFO | sed -n "s/^pkgver = //p")+ mkdir -p /site/apk/$arch+ cp "$f" /site/apk/$arch/net-merge-$ver.apk # apk looks for <name>-<version>.apk+ done+ for d in /site/apk/*/; do+ (cd "$d" && apk index --allow-untrusted -o APKINDEX.tar.gz *.apk && abuild-sign -k /key/net-merge.rsa APKINDEX.tar.gz)+ done+ cp /key/net-merge.rsa.pub /site/apk/net-merge.rsa.pub+ chown -R "$OWNER" /site/apk'++# ---- Arch: <arch>/net-merge.db next to the packages, packages and database signed with the gpg key+docker run --rm -e OWNER="$owner" -e KEY="$KEY" \+ -v "$PKGS:/pkgs:ro" -v "$SITE:/site" -v "$tmp/gpg.key:/gpg.key:ro" \+ archlinux:latest bash -ec '+ gpg --batch --import /gpg.key+ sign() { gpg --batch --yes --pinentry-mode loopback --local-user "$KEY" --detach-sign --output "$1.sig" "$1"; }+ for f in /pkgs/*.pkg.tar.zst; do+ arch=${f%.pkg.tar.zst}; arch=${arch##*-}+ mkdir -p /site/arch/$arch+ cp "$f" /site/arch/$arch/+ sign "/site/arch/$arch/$(basename "$f")"+ done+ for d in /site/arch/*/; do+ (cd "$d" && repo-add --quiet --sign --key "$KEY" net-merge.db.tar.zst *.pkg.tar.zst)+ # GitHub Pages cannot serve symlinks: pacman asks for net-merge.db, so make real copies+ for l in "$d"*; do+ [ -L "$l" ] && cp --remove-destination "$(readlink -f "$l")" "$l"+ done+ done+ chown -R "$OWNER" /site/arch'+echo "added the Alpine and Arch repositories to $SITE"diff --git a/scripts/build-linux.sh b/scripts/build-linux.shnew file mode 100755index 0000000..92cff08--- /dev/null+++ b/scripts/build-linux.sh@@ -0,0 +1,33 @@+#!/usr/bin/env bash+# Builds the Linux tarball and the .deb, .rpm, .apk and Arch packages of one version for every+# architecture, from the repository root: scripts/build-linux.sh VERSION OUT_DIR+# Pure Go, so one machine builds them all. Needs nfpm (NFPM=/path/to/nfpm if it is not on PATH).+set -euo pipefail+v=${1:?usage: build-linux.sh VERSION OUT_DIR}+mkdir -p "${2:?usage: build-linux.sh VERSION OUT_DIR}"+out=$(realpath "$2")+nfpm=${NFPM:-nfpm}+FORMATS=${FORMATS:-deb rpm apk archlinux}++# GOARCH GOARM nfpm-ARCH tarball-name [format to skip]+while read -r goarch goarm narch name skip; do+ CGO_ENABLED=0 GOOS=linux GOARCH=$goarch GOARM=${goarm/-/} \+ go build -trimpath -ldflags "-s -w -X main.version=$v" -o net-merge ./cmd/net-merge+ tar -czf "$out/net-merge-$v-linux-$name.tar.gz" net-merge LICENSE THIRD-PARTY-NOTICES.md+ for p in $FORMATS; do+ [ "$p" = "${skip:-}" ] && continue+ VERSION=$v ARCH=$narch "$nfpm" package -p "$p" -f packaging/nfpm.yaml -t "$out/"+ done+ rm net-merge+# Debian's armhf is the armv6 build, which also runs on armv7, so armv7 gets no .deb of its own.+done <<'ARCHS'+amd64 - amd64 x86_64+arm64 - arm64 aarch64+arm 7 arm7 armv7 deb+arm 6 arm6 armv6+386 - 386 i686+riscv64 - riscv64 riscv64+ppc64le - ppc64le ppc64le+s390x - s390x s390x+loong64 - loong64 loongarch64+ARCHSdiff --git a/scripts/build-repos.sh b/scripts/build-repos.shnew file mode 100755index 0000000..f8a4f13--- /dev/null+++ b/scripts/build-repos.sh@@ -0,0 +1,93 @@+#!/usr/bin/env bash+# Builds a signed apt repository and a signed dnf/zypper repository from .deb/.rpm files, as a+# static site that can be served from GitHub Pages. Needs apt-ftparchive (apt-utils), dpkg-deb,+# createrepo_c and gpg, with the signing key already in the keyring. The Alpine and Arch+# repositories are added to the same site by build-container-repos.sh.+#+# GPG_KEY_ID=<fingerprint> REPO_BASE_URL=https://rohit267.github.io/net-merge \+# scripts/build-repos.sh PKG_DIR OUT_DIR+set -euo pipefail+PKGS=$(realpath "${1:?usage: build-repos.sh PKG_DIR OUT_DIR}")+mkdir -p "${2:?usage: build-repos.sh PKG_DIR OUT_DIR}"+OUT=$(realpath "$2")+KEY=${GPG_KEY_ID:?set GPG_KEY_ID to the signing key fingerprint}+BASE=${REPO_BASE_URL:-https://rohit267.github.io/net-merge}+sign() { gpg --batch --yes --pinentry-mode loopback --local-user "$KEY" "$@"; }++rm -rf "$OUT"/*+mkdir -p "$OUT/apt/pool/main" "$OUT/rpm"+cp "$PKGS"/*.deb "$OUT/apt/pool/main/"+cp "$PKGS"/*.rpm "$OUT/rpm/"++# ---- apt: dists/stable/main/binary-<arch>/Packages, Release, InRelease+cd "$OUT/apt"+archs=$(for f in pool/main/*.deb; do dpkg-deb -f "$f" Architecture; done | sort -u | tr '\n' ' ')+for arch in $archs; do+ d=dists/stable/main/binary-$arch+ mkdir -p "$d"+ apt-ftparchive --arch "$arch" packages pool > "$d/Packages"+ gzip -9kf "$d/Packages"+done+apt-ftparchive \+ -o APT::FTPArchive::Release::Origin=net-merge \+ -o APT::FTPArchive::Release::Label=net-merge \+ -o APT::FTPArchive::Release::Suite=stable \+ -o APT::FTPArchive::Release::Codename=stable \+ -o APT::FTPArchive::Release::Architectures="$archs" \+ -o APT::FTPArchive::Release::Components=main \+ -o APT::FTPArchive::Release::Description="net-merge: use all your network adapters at once" \+ release dists/stable > dists/stable/Release+sign --clearsign -o dists/stable/InRelease dists/stable/Release+sign --armor --detach-sign -o dists/stable/Release.gpg dists/stable/Release+gpg --export "$KEY" > key.gpg # binary keyring, for signed-by=+gpg --armor --export "$KEY" > key.asc++# ---- dnf: repodata signed with repo_gpgcheck+cd "$OUT/rpm"+createrepo_c --quiet .+sign --armor --detach-sign -o repodata/repomd.xml.asc repodata/repomd.xml+gpg --armor --export "$KEY" > key.asc+cat > net-merge.repo <<REPO+[net-merge]+name=net-merge+baseurl=$BASE/rpm+enabled=1+gpgcheck=0+repo_gpgcheck=1+gpgkey=$BASE/rpm/key.asc+REPO++# ---- a plain page at the root, so the site has something to show+cat > "$OUT/index.html" <<HTML+<!doctype html>+<meta charset="utf-8">+<meta name="viewport" content="width=device-width, initial-scale=1">+<title>net-merge packages</title>+<style>body{font:16px/1.5 system-ui,sans-serif;max-width:46rem;margin:2rem auto;padding:0 1rem}pre{background:#f3f4f6;padding:.8rem;overflow:auto;border-radius:6px}@media(prefers-color-scheme:dark){body{background:#0b1220;color:#e5e7eb}pre{background:#111827}a{color:#4ade80}}</style>+<h1>net-merge packages</h1>+<p>Use all your internet connections at once. <a href="https://github.com/rohit267/net-merge">Project on GitHub</a>.+Signing key fingerprint: <code>$KEY</code>.</p>+<h2>Debian, Ubuntu, Mint, Pop!_OS, Raspberry Pi OS</h2>+<pre>curl -fsSL $BASE/apt/key.gpg | sudo tee /usr/share/keyrings/net-merge.gpg >/dev/null+echo "deb [signed-by=/usr/share/keyrings/net-merge.gpg] $BASE/apt stable main" | sudo tee /etc/apt/sources.list.d/net-merge.list+sudo apt update && sudo apt install net-merge</pre>+<h2>Fedora, RHEL, Rocky, Alma</h2>+<pre>sudo curl -fsSL -o /etc/yum.repos.d/net-merge.repo $BASE/rpm/net-merge.repo+sudo dnf install net-merge</pre>+<h2>openSUSE</h2>+<pre>sudo zypper addrepo $BASE/rpm/net-merge.repo+sudo zypper --gpg-auto-import-keys refresh+sudo zypper install net-merge</pre>+<h2>Arch, Manjaro, EndeavourOS</h2>+<pre>curl -fsSL $BASE/apt/key.asc | sudo pacman-key --add -+sudo pacman-key --lsign-key $KEY+printf '\n[net-merge]\nSigLevel = Required\nServer = $BASE/arch/\$arch\n' | sudo tee -a /etc/pacman.conf+sudo pacman -Sy net-merge</pre>+<h2>Alpine</h2>+<pre>sudo wget -O /etc/apk/keys/net-merge.rsa.pub $BASE/apk/net-merge.rsa.pub+echo $BASE/apk | sudo tee -a /etc/apk/repositories+sudo apk add net-merge</pre>+<p>Everything else: the <code>.tar.gz</code> for your CPU on the <a href="https://github.com/rohit267/net-merge/releases/latest">releases page</a>.</p>+HTML+touch "$OUT/.nojekyll"+echo "built apt and dnf repositories in $OUT"diff --git a/scripts/linux-e2e.sh b/scripts/linux-e2e.shindex 8605e15..bd4d404 100755--- a/scripts/linux-e2e.sh+++ b/scripts/linux-e2e.sh@@ -10,7 +10,10 @@set -uo pipefailBIN=$(realpath "${1:-./net-merge}")STATE=/tmp/net-merge-e2e-URL=https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb # large file on a CDN+# Large files on CDNs. A runner sometimes gets nothing from one of them, so the next is tried.+URLS=(https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb+ https://archive.ubuntu.com/ubuntu/dists/noble/Contents-amd64.gz+ https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb)REAL=$(ip -4 route show default | awk '{print $5; exit}')fails=0pass() { echo "PASS $*"; }@@ -85,17 +88,20 @@ if command -v dig >/dev/null; thenfiecho "== 12 parallel downloads: both uplinks must carry traffic"-r0=$(nic_bytes "$REAL"); v0=$(nic_bytes nmup-h)-pids=()-for _ in $(seq 1 12); do- curl -4 -s --max-time 40 -r 0-9999999 -o /dev/null "$URL" &- pids+=($!)+for url in "${URLS[@]}"; do+ r0=$(nic_bytes "$REAL"); v0=$(nic_bytes nmup-h)+ pids=()+ for _ in $(seq 1 12); do+ curl -4 -s --max-time 40 -r 0-9999999 -o /dev/null "$url" &+ pids+=($!)+ done+ wait "${pids[@]}"+ sleep 2 # one status tick+ r1=$(nic_bytes "$REAL"); v1=$(nic_bytes nmup-h)+ real_mb=$(((r1 - r0) / 1000000)); veth_mb=$(((v1 - v0) / 1000000))+ echo " $url: via $REAL: ${real_mb} MB, via nmup-h: ${veth_mb} MB"+ [ $((real_mb + veth_mb)) -ge 10 ] && break # something came through; only then is a bad split a real failuredone-wait "${pids[@]}"-sleep 2 # one status tick-r1=$(nic_bytes "$REAL"); v1=$(nic_bytes nmup-h)-real_mb=$(((r1 - r0) / 1000000)); veth_mb=$(((v1 - v0) / 1000000))-echo " via $REAL: ${real_mb} MB, via nmup-h: ${veth_mb} MB"[ "$real_mb" -ge 10 ] && [ "$veth_mb" -ge 10 ] &&pass "downloads were split across both uplinks" || fail "downloads not split (real ${real_mb} MB, veth ${veth_mb} MB)"diff --git a/scripts/release-notes.ps1 b/scripts/release-notes.ps1index bebc02f..c0fe7c6 100644--- a/scripts/release-notes.ps1+++ b/scripts/release-notes.ps1@@ -14,8 +14,9 @@ if (-not $m.Success -or -not $m.Groups[1].Value.Trim()) {$install = "**Install:** download ``net-merge-setup-$Version.exe`` below and run it (needs admin; it upgrades " +"an existing install in place). A portable zip is attached too. Not code-signed yet, so SmartScreen " +"will warn: *More info > Run anyway*."-$install += "`n`n**macOS and Linux:** download ``net-merge-$Version-macos-universal.tar.gz`` or " +- "``net-merge-$Version-linux-x86_64.tar.gz`` / ``-linux-aarch64.tar.gz`` and follow the Install section of the README."+$install += "`n`n**macOS:** download ``net-merge-$Version-macos-universal.tar.gz`` (or ``brew install rohit267/tap/net-merge``). " ++ "**Linux:** install with apt, dnf, zypper, apk or pacman, or download the ``net-merge-$Version-linux-<cpu>.tar.gz`` " ++ "for your CPU, or a ``.deb`` / ``.rpm`` / ``.apk`` / ``.pkg.tar.zst``. The steps are in the Install section of the README."# UTF-8 without a BOM (Windows PowerShell's -Encoding utf8 adds one, which GitHub would show)$path = $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($Out)[IO.File]::WriteAllText($path, $install + "`n`n" + $m.Groups[1].Value.Trim() + "`n", (New-Object Text.UTF8Encoding $false))