Merge pull request #259 from GyulyVGC/packages
Finalising the new packaging strategy
@@ -8,6 +8,9 @@ indent_style = space
|
||||
indent_size = 4
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[*.rtf]
|
||||
end_of_line = crlf
|
||||
|
||||
[{.gitignore,*.desktop}]
|
||||
indent_size = 0
|
||||
|
||||
|
||||
1
.gitattributes
vendored
@@ -1,6 +1,7 @@
|
||||
* text eol=lf
|
||||
.* text eol=lf
|
||||
|
||||
*.bmp binary
|
||||
*.png binary
|
||||
*.icns binary
|
||||
*.ico binary
|
||||
|
||||
373
.github/workflows/package.yml
vendored
@@ -2,19 +2,216 @@ name: Package
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
workflow_call:
|
||||
secrets:
|
||||
NPCAP_OEM_URL:
|
||||
required: true
|
||||
|
||||
jobs:
|
||||
|
||||
package:
|
||||
runs-on: ${{ matrix.os }}
|
||||
build:
|
||||
runs-on: ${{ matrix.os }}-latest
|
||||
strategy:
|
||||
fail-fast: true
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest, windows-latest]
|
||||
include:
|
||||
- os: ubuntu
|
||||
arch: i386
|
||||
target: i686-unknown-linux-gnu
|
||||
- os: ubuntu
|
||||
arch: armhf
|
||||
target: armv7-unknown-linux-gnueabihf
|
||||
- os: ubuntu
|
||||
arch: amd64
|
||||
target: x86_64-unknown-linux-gnu
|
||||
- os: ubuntu
|
||||
arch: arm64
|
||||
target: aarch64-unknown-linux-gnu
|
||||
- os: macos
|
||||
arch: amd64
|
||||
target: x86_64-apple-darwin
|
||||
- os: macos
|
||||
arch: arm64
|
||||
target: aarch64-apple-darwin
|
||||
- os: windows
|
||||
arch: i386
|
||||
target: i686-pc-windows-msvc
|
||||
- os: windows
|
||||
arch: amd64
|
||||
target: x86_64-pc-windows-msvc
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Install dependencies
|
||||
if: ${{ matrix.os == 'windows' }}
|
||||
env:
|
||||
NPCAP_OEM_URL: ${{ secrets.NPCAP_OEM_URL }}
|
||||
shell: powershell
|
||||
run: |
|
||||
Write-Host "::group::Npcap SDK"
|
||||
$ARCH = "${{ matrix.arch }}"
|
||||
Invoke-WebRequest -Uri "https://npcap.com/dist/npcap-sdk-1.13.zip" -OutFile "$env:TEMP\npcap-sdk.zip" -Verbose
|
||||
Expand-Archive -LiteralPath "$env:TEMP\npcap-sdk.zip" -DestinationPath "$env:TEMP\npcap-sdk" -Verbose
|
||||
$LibPath = switch ($ARCH)
|
||||
{
|
||||
"i386" { "Lib" }
|
||||
"amd64" { "Lib\x64" }
|
||||
default { throw "$ARCH is not supported!" }
|
||||
}
|
||||
Add-Content -Path "$env:GITHUB_ENV" -Value "LIB=$env:TEMP\npcap-sdk\$LibPath"
|
||||
Write-Host "::endgroup::"
|
||||
Write-Host "::group::Npcap DLL"
|
||||
Invoke-WebRequest -Uri "$env:NPCAP_OEM_URL" -OutFile "$env:TEMP\npcap-oem.exe" -Verbose
|
||||
Start-Process -FilePath "$env:TEMP\npcap-oem.exe" -ArgumentList "/S" -Wait
|
||||
Write-Host "::endgroup::"
|
||||
|
||||
- name: Install Rust
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
profile: minimal
|
||||
default: true
|
||||
|
||||
- name: Add build targets
|
||||
if: ${{ matrix.os == 'macos' }}
|
||||
run: |
|
||||
rustup target add \
|
||||
x86_64-apple-darwin \
|
||||
aarch64-apple-darwin
|
||||
|
||||
- name: Add build targets
|
||||
if: ${{ matrix.os == 'windows' }}
|
||||
run: |
|
||||
rustup target add `
|
||||
i686-pc-windows-msvc `
|
||||
x86_64-pc-windows-msvc
|
||||
|
||||
- name: Install Cross
|
||||
if: ${{ matrix.os == 'ubuntu' }}
|
||||
run: cargo install cross --git https://github.com/cross-rs/cross
|
||||
|
||||
- name: Build binary
|
||||
if: ${{ matrix.os == 'ubuntu' }}
|
||||
run: cross build --release --target ${{ matrix.target }}
|
||||
|
||||
- name: Build binary
|
||||
if: ${{ matrix.os == 'macos' || matrix.os == 'windows' }}
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: build
|
||||
args: --release --target ${{ matrix.target }}
|
||||
|
||||
- name: Upload build artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: build-${{ matrix.os }}
|
||||
path: |
|
||||
target/*/release/sniffnet
|
||||
target/*/release/sniffnet.exe
|
||||
if-no-files-found: error
|
||||
|
||||
deb:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: debian:latest
|
||||
needs: build
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Install dependencies
|
||||
run: apt update -y && apt install -y curl build-essential
|
||||
|
||||
- name: Install Rust
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
profile: minimal
|
||||
default: true
|
||||
|
||||
- name: Install packaging tools
|
||||
run: cargo install cargo-deb
|
||||
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: build-ubuntu
|
||||
path: target/
|
||||
|
||||
- name: Package for Debian-based Linux distros
|
||||
shell: bash
|
||||
run: |
|
||||
targets=(
|
||||
i686-unknown-linux-gnu
|
||||
armv7-unknown-linux-gnueabihf
|
||||
x86_64-unknown-linux-gnu
|
||||
aarch64-unknown-linux-gnu
|
||||
)
|
||||
mkdir artifacts
|
||||
for target in "${targets[@]}"; do
|
||||
cargo deb --no-build --no-strip --target $target
|
||||
mv target/${target}/debian/*.deb artifacts/
|
||||
done
|
||||
mv artifacts/sniffnet*amd64.deb artifacts/Sniffnet_LinuxDEB_amd64.deb
|
||||
mv artifacts/sniffnet*arm64.deb artifacts/Sniffnet_LinuxDEB_arm64.deb
|
||||
mv artifacts/sniffnet*i386.deb artifacts/Sniffnet_LinuxDEB_i386.deb
|
||||
mv artifacts/sniffnet*armhf.deb artifacts/Sniffnet_LinuxDEB_armhf.deb
|
||||
|
||||
- name: Upload package artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: deb
|
||||
path: artifacts/
|
||||
|
||||
rpm:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: fedora:latest
|
||||
needs: build
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Install dependencies
|
||||
run: dnf update -y && dnf install -y @development-tools patchelf
|
||||
|
||||
- name: Install Rust
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
profile: minimal
|
||||
default: true
|
||||
|
||||
- name: Install packaging tools
|
||||
run: cargo install cargo-generate-rpm
|
||||
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: build-ubuntu
|
||||
path: target/
|
||||
|
||||
- name: Package for RPM-based Linux distros
|
||||
shell: bash
|
||||
run: |
|
||||
targets=(
|
||||
x86_64-unknown-linux-gnu
|
||||
aarch64-unknown-linux-gnu
|
||||
)
|
||||
mkdir artifacts
|
||||
for target in "${targets[@]}"; do
|
||||
patchelf --replace-needed libpcap.so.0.8 libpcap.so.1 target/${target}/release/sniffnet
|
||||
cargo generate-rpm --target $target
|
||||
mv target/${target}/generate-rpm/*.rpm artifacts/
|
||||
done
|
||||
mv artifacts/sniffnet*x86_64.rpm artifacts/Sniffnet_LinuxRPM_x86_64.rpm
|
||||
mv artifacts/sniffnet*aarch64.rpm artifacts/Sniffnet_LinuxRPM_aarch64.rpm
|
||||
|
||||
- name: Upload package artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: rpm
|
||||
path: artifacts/
|
||||
|
||||
dmg:
|
||||
runs-on: macos-latest
|
||||
needs: build
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
@@ -24,80 +221,110 @@ jobs:
|
||||
with:
|
||||
toolchain: stable
|
||||
profile: minimal
|
||||
components: rustfmt, clippy
|
||||
default: true
|
||||
|
||||
- name: Install Linux dependencies
|
||||
if: matrix.os == 'ubuntu-latest'
|
||||
run: sudo apt-get install libpcap-dev libasound2-dev
|
||||
|
||||
- name: Install Windows dependency - npcap sdk
|
||||
if: matrix.os == 'windows-latest'
|
||||
- name: Install packaging tools
|
||||
run: |
|
||||
Invoke-WebRequest -Uri "https://npcap.com/dist/npcap-sdk-1.13.zip" -OutFile "C:/npcap-sdk.zip"
|
||||
Expand-Archive -LiteralPath C:/npcap-sdk.zip -DestinationPath C:/npcap-sdk
|
||||
echo "LIB=C:/npcap-sdk/Lib/x64" >> $env:GITHUB_ENV
|
||||
|
||||
- name: Install Windows dependency - npcap dll
|
||||
if: matrix.os == 'windows-latest'
|
||||
run: |
|
||||
Invoke-WebRequest -Uri ${{secrets.NPCAP_OEM_URL}} -OutFile C:/npcap-oem.exe
|
||||
C:/npcap-oem.exe /S
|
||||
|
||||
- name: Build
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: build
|
||||
args: --release
|
||||
|
||||
- name: Package for Debian-based Linux distros
|
||||
if: matrix.os == 'ubuntu-latest'
|
||||
run: |
|
||||
cargo install cargo-deb
|
||||
cargo deb
|
||||
mkdir artifacts
|
||||
mv target/debian/*.deb artifacts/
|
||||
|
||||
# doesn't work properly on ubuntu-latest!
|
||||
# - name: Package for RPM-based Linux distros
|
||||
# if: matrix.os == 'ubuntu-latest'
|
||||
# run: |
|
||||
# cargo install cargo-generate-rpm
|
||||
# cargo generate-rpm
|
||||
# mv target/generate-rpm/*.rpm artifacts/
|
||||
|
||||
- name: Package DMG for macOS
|
||||
if: matrix.os == 'macOS-latest'
|
||||
run: |
|
||||
cargo install cargo-bundle
|
||||
cargo bundle --release
|
||||
rm target/release/bundle/osx/sniffnet.app/Contents/Info.plist
|
||||
cp resources/Info.plist target/release/bundle/osx/sniffnet.app/Contents/Info.plist
|
||||
cp resources/wrapper.sh target/release/bundle/osx/sniffnet.app/Contents/MacOS/wrapper.sh
|
||||
cargo install toml-cli
|
||||
brew install create-dmg
|
||||
mkdir artifacts
|
||||
create-dmg \
|
||||
--volname "Sniffnet Installer" \
|
||||
--background "resources/logos/bg_dmg.png" \
|
||||
--window-pos 200 120 \
|
||||
--window-size 900 450 \
|
||||
--icon-size 100 \
|
||||
--app-drop-link 620 240 \
|
||||
--icon "Sniffnet.app" 300 240 \
|
||||
--hide-extension "Sniffnet.app" \
|
||||
"artifacts/sniffnet.dmg" \
|
||||
"target/release/bundle/osx/"
|
||||
|
||||
- name: Package MSI for Windows
|
||||
if: matrix.os == 'windows-latest'
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: build-macos
|
||||
path: target/
|
||||
|
||||
- name: Package for macOS
|
||||
shell: bash
|
||||
run: |
|
||||
cargo install cargo-wix
|
||||
cargo wix --nocapture
|
||||
VERSION=$(toml get Cargo.toml package.version --raw)
|
||||
sed -i'.bak' -e "s/0\.0\.0/${VERSION}/g" -e "s/fffffff/${GITHUB_SHA:0:7}/g" resources/packaging/macos/Info.plist
|
||||
targets=(
|
||||
x86_64-apple-darwin
|
||||
aarch64-apple-darwin
|
||||
)
|
||||
mkdir artifacts
|
||||
mv target/wix/*.msi artifacts/
|
||||
for target in "${targets[@]}"; do
|
||||
mkdir -p target/${target}/release/bundle/osx/Sniffnet.app/Contents/{MacOS,Resources}
|
||||
cp resources/packaging/macos/Info.plist \
|
||||
target/${target}/release/bundle/osx/Sniffnet.app/Contents/
|
||||
cp resources/packaging/macos/graphics/sniffnet.icns \
|
||||
target/${target}/release/bundle/osx/Sniffnet.app/Contents/Resources/
|
||||
chmod +x target/${target}/release/sniffnet
|
||||
cp target/${target}/release/sniffnet \
|
||||
target/${target}/release/bundle/osx/Sniffnet.app/Contents/MacOS/
|
||||
cp resources/packaging/macos/wrapper.sh \
|
||||
target/${target}/release/bundle/osx/Sniffnet.app/Contents/MacOS/
|
||||
create-dmg \
|
||||
--volname "Sniffnet Installer" \
|
||||
--background "resources/packaging/macos/graphics/dmg_bg.png" \
|
||||
--window-pos 200 120 \
|
||||
--window-size 900 450 \
|
||||
--icon-size 100 \
|
||||
--app-drop-link 620 240 \
|
||||
--icon "Sniffnet.app" 300 240 \
|
||||
--hide-extension "Sniffnet.app" \
|
||||
"artifacts/sniffnet-${target%%-*}.dmg" \
|
||||
"target/${target}/release/bundle/osx/"
|
||||
done
|
||||
mv artifacts/sniffnet*x86_64.dmg artifacts/Sniffnet_macOS_Intel.dmg
|
||||
mv artifacts/sniffnet*aarch64.dmg artifacts/Sniffnet_macOS_AppleSilicon.dmg
|
||||
|
||||
- name: Upload artifacts
|
||||
- name: Upload package artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: ${{ matrix.os }}-artifacts
|
||||
name: dmg
|
||||
path: artifacts/
|
||||
|
||||
msi:
|
||||
runs-on: windows-latest
|
||||
needs: build
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Install dependencies
|
||||
shell: powershell
|
||||
run: |
|
||||
Write-Host "::group::WiX Toolset"
|
||||
Invoke-WebRequest `
|
||||
-Uri "https://github.com/wixtoolset/wix3/releases/download/wix3112rtm/wix311-binaries.zip" `
|
||||
-OutFile "$env:TEMP\wix-binaries.zip" -Verbose
|
||||
Expand-Archive -LiteralPath "$env:TEMP\wix-binaries.zip" -DestinationPath "$env:TEMP\wix" -Verbose
|
||||
Set-Item -Path env:Path -Value "$env:Path;$env:TEMP\wix"
|
||||
Write-Host "::endgroup::"
|
||||
|
||||
- name: Install Rust
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
profile: minimal
|
||||
default: true
|
||||
|
||||
- name: Install packaging tools
|
||||
run: cargo install cargo-wix
|
||||
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: build-windows
|
||||
path: target/
|
||||
|
||||
- name: Package for Microsoft Windows
|
||||
shell: powershell
|
||||
run: |
|
||||
$targets=@(
|
||||
"i686-pc-windows-msvc",
|
||||
"x86_64-pc-windows-msvc"
|
||||
)
|
||||
New-Item -ItemType Directory -Path artifacts
|
||||
foreach ($target in $targets)
|
||||
{
|
||||
cargo wix --no-build --nocapture --target $target
|
||||
Move-Item -Path target\wix\sniffnet*x86.msi -Destination .\artifacts\Sniffnet_Windows_32-bit.msi
|
||||
Move-Item -Path target\wix\sniffnet*x86_64.msi -Destination .\artifacts\Sniffnet_Windows_64-bit.msi
|
||||
}
|
||||
|
||||
- name: Upload package artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: msi
|
||||
path: artifacts/
|
||||
|
||||
25
CHANGELOG.md
@@ -3,14 +3,31 @@ # Changelog
|
||||
All Sniffnet releases with the relative changes are documented in this file.
|
||||
|
||||
|
||||
## UNRELEASED
|
||||
## [1.2.1] - 2023-06-08
|
||||
|
||||
- Considerably refined the app packaging strategy (see [#246](https://github.com/GyulyVGC/sniffnet/pull/246) for more details), fixing various related issues ([#199](https://github.com/GyulyVGC/sniffnet/issues/199), [#220](https://github.com/GyulyVGC/sniffnet/issues/220), [#223](https://github.com/GyulyVGC/sniffnet/issues/223), [#224](https://github.com/GyulyVGC/sniffnet/issues/224), [#225](https://github.com/GyulyVGC/sniffnet/issues/225), [#242](https://github.com/GyulyVGC/sniffnet/issues/242))
|
||||
- Added button to clear all the current search filters quickly in inspect page
|
||||
- Added Swedish translation 🇸🇪 ([#213](https://github.com/GyulyVGC/sniffnet/pull/213))
|
||||
- URLs update...
|
||||
- Updated existing translations to v1.2 (German, Spanish, Persian, Korean, Russian, Turkish, Ukrainian, and Chinese)
|
||||
- Updated most of the existing translations to v1.2:
|
||||
- German - [#191](https://github.com/GyulyVGC/sniffnet/pull/191)
|
||||
- Spanish - [#203](https://github.com/GyulyVGC/sniffnet/pull/203)
|
||||
- Persian - [#193](https://github.com/GyulyVGC/sniffnet/pull/193)
|
||||
- Korean - [#205](https://github.com/GyulyVGC/sniffnet/pull/205)
|
||||
- Polish - [#244](https://github.com/GyulyVGC/sniffnet/pull/244)
|
||||
- Romanian - [#241](https://github.com/GyulyVGC/sniffnet/pull/241)
|
||||
- Russian - [#187](https://github.com/GyulyVGC/sniffnet/pull/187)
|
||||
- Turkish - [#192](https://github.com/GyulyVGC/sniffnet/pull/192)
|
||||
- Ukrainian - [#216](https://github.com/GyulyVGC/sniffnet/pull/216)
|
||||
- Chinese - [#214](https://github.com/GyulyVGC/sniffnet/pull/214)
|
||||
- Renamed "Administrative entity" to "Autonomous System name" to avoid confusion
|
||||
- Improved filter columns relative width to avoid the "Application protocol" label being cut when displayed in Swedish
|
||||
- Updated docs including installation instruction for Aarch Linux
|
||||
- Footer URLs have been updated to include links to Sniffnet's official website and GitHub Sponsor page
|
||||
- Updated docs including installation instruction for Aarch Linux ([#185](https://github.com/GyulyVGC/sniffnet/pull/185))
|
||||
- Minor improvements to packets and bytes number format
|
||||
- Minor improvements to:
|
||||
- code readability ([#248](https://github.com/GyulyVGC/sniffnet/pull/248))
|
||||
- docs ([#235](https://github.com/GyulyVGC/sniffnet/pull/235))
|
||||
- Solved a minor problem that caused flags to be slightly misaligned in inspect page table
|
||||
|
||||
|
||||
## [1.2.0] - 2023-05-18
|
||||
|
||||
921
Cargo.lock
generated
137
Cargo.toml
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "sniffnet"
|
||||
version = "1.2.0"
|
||||
version = "1.2.1"
|
||||
authors = [ "Giuliano Bellini" ]
|
||||
edition = "2021"
|
||||
description = "Application to comfortably monitor your network traffic"
|
||||
@@ -21,6 +21,9 @@ include = [
|
||||
"resources/sounds/*"
|
||||
]
|
||||
|
||||
[target."cfg(windows)"]
|
||||
rustflags = ["-C", "target-feature=+crt-static"]
|
||||
|
||||
#═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
|
||||
|
||||
[profile.release]
|
||||
@@ -44,7 +47,7 @@ maxminddb = "0.23.0"
|
||||
confy = "0.5.1"
|
||||
serde = { version = "1.0.163", default_features = false, features = ["derive"] }
|
||||
rodio = { version = "0.17.1", default_features = false, features = ["mp3"] }
|
||||
reqwest = { version = "0.11.18", features = ["json", "blocking"] }
|
||||
reqwest = { version = "0.11.18", default-features = false, features = ["json", "blocking", "rustls-tls"] }
|
||||
dns-lookup = "2.0.2"
|
||||
|
||||
#───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
@@ -52,70 +55,102 @@ dns-lookup = "2.0.2"
|
||||
[dev-dependencies]
|
||||
rstest = "0.17.0"
|
||||
|
||||
#───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
|
||||
[target."cfg(windows)".build-dependencies]
|
||||
winres = "0.1.12"
|
||||
|
||||
#═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
|
||||
|
||||
[package.metadata.cross.target.x86_64-unknown-linux-gnu]
|
||||
pre-build = [
|
||||
"dpkg --add-architecture amd64",
|
||||
"apt update -y && apt install -y libfreetype6-dev:amd64 libexpat1-dev:amd64 libpcap-dev:amd64 libasound2-dev:amd64 libfontconfig1-dev:amd64"
|
||||
]
|
||||
|
||||
[package.metadata.cross.target.i686-unknown-linux-gnu]
|
||||
pre-build = [
|
||||
"dpkg --add-architecture i386",
|
||||
"apt update -y && apt install -y libfreetype6-dev:i386 libexpat1-dev:i386 libpcap-dev:i386 libasound2-dev:i386 libfontconfig1-dev:i386"
|
||||
]
|
||||
|
||||
[package.metadata.cross.target.aarch64-unknown-linux-gnu]
|
||||
pre-build = [
|
||||
"dpkg --add-architecture arm64",
|
||||
"apt update -y && apt install -y libfreetype6-dev:arm64 libexpat1-dev:arm64 libpcap-dev:arm64 libasound2-dev:arm64 libfontconfig1-dev:arm64"
|
||||
]
|
||||
|
||||
[package.metadata.cross.target.armv7-unknown-linux-gnueabihf]
|
||||
pre-build = [
|
||||
"dpkg --add-architecture armhf",
|
||||
"apt update -y && apt install -y libfreetype6-dev:armhf libexpat1-dev:armhf libpcap-dev:armhf libasound2-dev:armhf libfontconfig1-dev:armhf"
|
||||
]
|
||||
|
||||
#═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
|
||||
|
||||
[package.metadata.deb]
|
||||
depends = "libasound2-dev, libpcap-dev, libfontconfig1"
|
||||
section="Network"
|
||||
license-file="resources/packaging/LICENSE"
|
||||
extended-description-file="resources/packaging/linux/description.txt"
|
||||
maintainer-scripts="resources/packaging/linux/scripts/"
|
||||
depends = "libasound2, libpcap0.8, libfontconfig1"
|
||||
assets = [
|
||||
["target/release/sniffnet", "/usr/bin/", "755"],
|
||||
["resources/sniffnet.desktop", "/usr/share/applications/", "644"],
|
||||
["resources/icons/sniffnet-linux_8x8.png", "/usr/share/icons/hicolor/8x8/apps/sniffnet.png", "644"],
|
||||
["resources/icons/sniffnet-linux_16x16.png", "/usr/share/icons/hicolor/16x16/apps/sniffnet.png", "644"],
|
||||
["resources/icons/sniffnet-linux_22x22.png", "/usr/share/icons/hicolor/22x22/apps/sniffnet.png", "644"],
|
||||
["resources/icons/sniffnet-linux_24x24.png", "/usr/share/icons/hicolor/24x24/apps/sniffnet.png", "644"],
|
||||
["resources/icons/sniffnet-linux_32x32.png", "/usr/share/icons/hicolor/32x32/apps/sniffnet.png", "644"],
|
||||
["resources/icons/sniffnet-linux_36x36.png", "/usr/share/icons/hicolor/36x36/apps/sniffnet.png", "644"],
|
||||
["resources/icons/sniffnet-linux_42x42.png", "/usr/share/icons/hicolor/42x42/apps/sniffnet.png", "644"],
|
||||
["resources/icons/sniffnet-linux_48x48.png", "/usr/share/icons/hicolor/48x48/apps/sniffnet.png", "644"],
|
||||
["resources/icons/sniffnet-linux_64x64.png", "/usr/share/icons/hicolor/64x64/apps/sniffnet.png", "644"],
|
||||
["resources/icons/sniffnet-linux_72x72.png", "/usr/share/icons/hicolor/72x72/apps/sniffnet.png", "644"],
|
||||
["resources/icons/sniffnet-linux_96x96.png", "/usr/share/icons/hicolor/96x96/apps/sniffnet.png", "644"],
|
||||
["resources/icons/sniffnet-linux_128x128.png", "/usr/share/icons/hicolor/128x128/apps/sniffnet.png", "644"],
|
||||
["resources/icons/sniffnet-linux_160x160.png", "/usr/share/icons/hicolor/160x160/apps/sniffnet.png", "644"],
|
||||
["resources/icons/sniffnet-linux_192x192.png", "/usr/share/icons/hicolor/192x192/apps/sniffnet.png", "644"],
|
||||
["resources/icons/sniffnet-linux_256x256.png", "/usr/share/icons/hicolor/256x256/apps/sniffnet.png", "644"],
|
||||
["resources/icons/sniffnet-linux_384x384.png", "/usr/share/icons/hicolor/384x384/apps/sniffnet.png", "644"],
|
||||
["resources/icons/sniffnet-linux_512x512.png", "/usr/share/icons/hicolor/512x512/apps/sniffnet.png", "644"],
|
||||
["resources/icons/sniffnet-linux_1024x1024.png", "/usr/share/icons/hicolor/1024x1024/apps/sniffnet.png", "644"]
|
||||
["resources/packaging/linux/sniffnet.desktop", "/usr/share/applications/", "644"],
|
||||
["resources/packaging/linux/graphics/sniffnet_8x8.png", "/usr/share/icons/hicolor/8x8/apps/sniffnet.png", "644"],
|
||||
["resources/packaging/linux/graphics/sniffnet_16x16.png", "/usr/share/icons/hicolor/16x16/apps/sniffnet.png", "644"],
|
||||
["resources/packaging/linux/graphics/sniffnet_22x22.png", "/usr/share/icons/hicolor/22x22/apps/sniffnet.png", "644"],
|
||||
["resources/packaging/linux/graphics/sniffnet_24x24.png", "/usr/share/icons/hicolor/24x24/apps/sniffnet.png", "644"],
|
||||
["resources/packaging/linux/graphics/sniffnet_32x32.png", "/usr/share/icons/hicolor/32x32/apps/sniffnet.png", "644"],
|
||||
["resources/packaging/linux/graphics/sniffnet_36x36.png", "/usr/share/icons/hicolor/36x36/apps/sniffnet.png", "644"],
|
||||
["resources/packaging/linux/graphics/sniffnet_42x42.png", "/usr/share/icons/hicolor/42x42/apps/sniffnet.png", "644"],
|
||||
["resources/packaging/linux/graphics/sniffnet_48x48.png", "/usr/share/icons/hicolor/48x48/apps/sniffnet.png", "644"],
|
||||
["resources/packaging/linux/graphics/sniffnet_64x64.png", "/usr/share/icons/hicolor/64x64/apps/sniffnet.png", "644"],
|
||||
["resources/packaging/linux/graphics/sniffnet_72x72.png", "/usr/share/icons/hicolor/72x72/apps/sniffnet.png", "644"],
|
||||
["resources/packaging/linux/graphics/sniffnet_96x96.png", "/usr/share/icons/hicolor/96x96/apps/sniffnet.png", "644"],
|
||||
["resources/packaging/linux/graphics/sniffnet_128x128.png", "/usr/share/icons/hicolor/128x128/apps/sniffnet.png", "644"],
|
||||
["resources/packaging/linux/graphics/sniffnet_160x160.png", "/usr/share/icons/hicolor/160x160/apps/sniffnet.png", "644"],
|
||||
["resources/packaging/linux/graphics/sniffnet_192x192.png", "/usr/share/icons/hicolor/192x192/apps/sniffnet.png", "644"],
|
||||
["resources/packaging/linux/graphics/sniffnet_256x256.png", "/usr/share/icons/hicolor/256x256/apps/sniffnet.png", "644"],
|
||||
["resources/packaging/linux/graphics/sniffnet_384x384.png", "/usr/share/icons/hicolor/384x384/apps/sniffnet.png", "644"],
|
||||
["resources/packaging/linux/graphics/sniffnet_512x512.png", "/usr/share/icons/hicolor/512x512/apps/sniffnet.png", "644"],
|
||||
["resources/packaging/linux/graphics/sniffnet_1024x1024.png", "/usr/share/icons/hicolor/1024x1024/apps/sniffnet.png", "644"]
|
||||
]
|
||||
|
||||
#───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
|
||||
[package.metadata.generate-rpm]
|
||||
auto-req = "no"
|
||||
post_install_script = "setcap cap_net_raw,cap_net_admin=eip /usr/bin/sniffnet"
|
||||
pre_uninstall_script = "setcap '' /usr/bin/sniffnet"
|
||||
assets = [
|
||||
{ source = "target/release/sniffnet", dest = "/usr/bin/", mode = "755" },
|
||||
{ source = "resources/sniffnet.desktop", dest = "/usr/share/applications/", mode = "644" },
|
||||
{ source = "resources/icons/sniffnet-linux_8x8.png", dest = "/usr/share/icons/hicolor/8x8/apps/sniffnet.png", mode = "644" },
|
||||
{ source = "resources/icons/sniffnet-linux_16x16.png", dest = "/usr/share/icons/hicolor/16x16/apps/sniffnet.png", mode = "644" },
|
||||
{ source = "resources/icons/sniffnet-linux_22x22.png", dest = "/usr/share/icons/hicolor/22x22/apps/sniffnet.png", mode = "644" },
|
||||
{ source = "resources/icons/sniffnet-linux_24x24.png", dest = "/usr/share/icons/hicolor/24x24/apps/sniffnet.png", mode = "644" },
|
||||
{ source = "resources/icons/sniffnet-linux_32x32.png", dest = "/usr/share/icons/hicolor/32x32/apps/sniffnet.png", mode = "644" },
|
||||
{ source = "resources/icons/sniffnet-linux_36x36.png", dest = "/usr/share/icons/hicolor/36x36/apps/sniffnet.png", mode = "644" },
|
||||
{ source = "resources/icons/sniffnet-linux_42x42.png", dest = "/usr/share/icons/hicolor/42x42/apps/sniffnet.png", mode = "644" },
|
||||
{ source = "resources/icons/sniffnet-linux_48x48.png", dest = "/usr/share/icons/hicolor/48x48/apps/sniffnet.png", mode = "644" },
|
||||
{ source = "resources/icons/sniffnet-linux_64x64.png", dest = "/usr/share/icons/hicolor/64x64/apps/sniffnet.png", mode = "644" },
|
||||
{ source = "resources/icons/sniffnet-linux_72x72.png", dest = "/usr/share/icons/hicolor/72x72/apps/sniffnet.png", mode = "644" },
|
||||
{ source = "resources/icons/sniffnet-linux_96x96.png", dest = "/usr/share/icons/hicolor/96x96/apps/sniffnet.png", mode = "644" },
|
||||
{ source = "resources/icons/sniffnet-linux_128x128.png", dest = "/usr/share/icons/hicolor/128x128/apps/sniffnet.png", mode = "644" },
|
||||
{ source = "resources/icons/sniffnet-linux_160x160.png", dest = "/usr/share/icons/hicolor/160x160/apps/sniffnet.png", mode = "644" },
|
||||
{ source = "resources/icons/sniffnet-linux_192x192.png", dest = "/usr/share/icons/hicolor/192x192/apps/sniffnet.png", mode = "644" },
|
||||
{ source = "resources/icons/sniffnet-linux_256x256.png", dest = "/usr/share/icons/hicolor/256x256/apps/sniffnet.png", mode = "644" },
|
||||
{ source = "resources/icons/sniffnet-linux_384x384.png", dest = "/usr/share/icons/hicolor/384x384/apps/sniffnet.png", mode = "644" },
|
||||
{ source = "resources/icons/sniffnet-linux_512x512.png", dest = "/usr/share/icons/hicolor/512x512/apps/sniffnet.png", mode = "644" },
|
||||
{ source = "resources/icons/sniffnet-linux_1024x1024.png", dest = "/usr/share/icons/hicolor/1024x1024/apps/sniffnet.png", mode = "644" }
|
||||
{ source = "resources/packaging/linux/sniffnet.desktop", dest = "/usr/share/applications/", mode = "644" },
|
||||
{ source = "resources/packaging/linux/graphics/sniffnet_8x8.png", dest = "/usr/share/icons/hicolor/8x8/apps/sniffnet.png", mode = "644" },
|
||||
{ source = "resources/packaging/linux/graphics/sniffnet_16x16.png", dest = "/usr/share/icons/hicolor/16x16/apps/sniffnet.png", mode = "644" },
|
||||
{ source = "resources/packaging/linux/graphics/sniffnet_22x22.png", dest = "/usr/share/icons/hicolor/22x22/apps/sniffnet.png", mode = "644" },
|
||||
{ source = "resources/packaging/linux/graphics/sniffnet_24x24.png", dest = "/usr/share/icons/hicolor/24x24/apps/sniffnet.png", mode = "644" },
|
||||
{ source = "resources/packaging/linux/graphics/sniffnet_32x32.png", dest = "/usr/share/icons/hicolor/32x32/apps/sniffnet.png", mode = "644" },
|
||||
{ source = "resources/packaging/linux/graphics/sniffnet_36x36.png", dest = "/usr/share/icons/hicolor/36x36/apps/sniffnet.png", mode = "644" },
|
||||
{ source = "resources/packaging/linux/graphics/sniffnet_42x42.png", dest = "/usr/share/icons/hicolor/42x42/apps/sniffnet.png", mode = "644" },
|
||||
{ source = "resources/packaging/linux/graphics/sniffnet_48x48.png", dest = "/usr/share/icons/hicolor/48x48/apps/sniffnet.png", mode = "644" },
|
||||
{ source = "resources/packaging/linux/graphics/sniffnet_64x64.png", dest = "/usr/share/icons/hicolor/64x64/apps/sniffnet.png", mode = "644" },
|
||||
{ source = "resources/packaging/linux/graphics/sniffnet_72x72.png", dest = "/usr/share/icons/hicolor/72x72/apps/sniffnet.png", mode = "644" },
|
||||
{ source = "resources/packaging/linux/graphics/sniffnet_96x96.png", dest = "/usr/share/icons/hicolor/96x96/apps/sniffnet.png", mode = "644" },
|
||||
{ source = "resources/packaging/linux/graphics/sniffnet_128x128.png", dest = "/usr/share/icons/hicolor/128x128/apps/sniffnet.png", mode = "644" },
|
||||
{ source = "resources/packaging/linux/graphics/sniffnet_160x160.png", dest = "/usr/share/icons/hicolor/160x160/apps/sniffnet.png", mode = "644" },
|
||||
{ source = "resources/packaging/linux/graphics/sniffnet_192x192.png", dest = "/usr/share/icons/hicolor/192x192/apps/sniffnet.png", mode = "644" },
|
||||
{ source = "resources/packaging/linux/graphics/sniffnet_256x256.png", dest = "/usr/share/icons/hicolor/256x256/apps/sniffnet.png", mode = "644" },
|
||||
{ source = "resources/packaging/linux/graphics/sniffnet_384x384.png", dest = "/usr/share/icons/hicolor/384x384/apps/sniffnet.png", mode = "644" },
|
||||
{ source = "resources/packaging/linux/graphics/sniffnet_512x512.png", dest = "/usr/share/icons/hicolor/512x512/apps/sniffnet.png", mode = "644" },
|
||||
{ source = "resources/packaging/linux/graphics/sniffnet_1024x1024.png", dest = "/usr/share/icons/hicolor/1024x1024/apps/sniffnet.png", mode = "644" }
|
||||
]
|
||||
|
||||
[package.metadata.generate-rpm.requires]
|
||||
alsa-lib-devel = "*"
|
||||
libpcap-devel = "*"
|
||||
fontconfig-devel = "*"
|
||||
alsa-lib = "*"
|
||||
libpcap = "*"
|
||||
fontconfig = "*"
|
||||
|
||||
#───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
|
||||
[package.metadata.bundle]
|
||||
name = "Sniffnet"
|
||||
identifier = "gyulyvgc.sniffnet"
|
||||
icon = [
|
||||
"resources/icons/sniffnet-macos.icns"
|
||||
]
|
||||
[package.metadata.wix]
|
||||
include = [".\\resources\\packaging\\windows\\setup.wxs"]
|
||||
|
||||
38
README.md
@@ -15,7 +15,7 @@
|
||||
<div align="center">
|
||||
|
||||
Graphical interface translated in:<br>
|
||||
🇬🇧 🇩🇪 🇬🇷 🇪🇦 🇮🇷 🇫🇷 🇮🇹 🇰🇷 🇵🇱 🇵🇹 🇷🇴 🇷🇺 🇹🇷 🇺🇦 🇨🇳<br>
|
||||
🇬🇧 🇩🇪 🇬🇷 🇪🇦 🇮🇷 🇫🇷 🇮🇹 🇰🇷 🇵🇱 🇵🇹 🇷🇴 🇷🇺 🇸🇪 🇹🇷 🇺🇦 🇨🇳<br>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -64,13 +64,31 @@ ## Installation
|
||||
|
||||
<summary>from GitHub releases <img alt="" src="https://img.shields.io/github/downloads/gyulyvgc/sniffnet/total?color=success&logo=github"/></summary>
|
||||
|
||||
You can install Sniffnet through the installers available in the [latest release](https://github.com/GyulyVGC/sniffnet/releases). <br>
|
||||
You can install Sniffnet through the installers available in the [latest release](https://github.com/GyulyVGC/sniffnet/releases/latest). <br>
|
||||
Choose from a Windows installer, a macOS disk image, a DEB package, or an RPM package (depending on your operating system). <br>
|
||||
Here for your convenience you can find the direct link to the downloads:
|
||||
- [Windows](https://github.com/GyulyVGC/sniffnet/releases/latest/download/Sniffnet_Windows.msi) (13.1 MB)
|
||||
- [macOS](https://github.com/GyulyVGC/sniffnet/releases/latest/download/Sniffnet_MacOS.dmg) (12.4 MB)
|
||||
- [Linux (DEB)](https://github.com/GyulyVGC/sniffnet/releases/latest/download/Sniffnet_Linux.deb) (9.2 MB)
|
||||
- [Linux (RPM)](https://github.com/GyulyVGC/sniffnet/releases/latest/download/Sniffnet_Linux.rpm) (11.4 MB)
|
||||
Below, for your convenience, you can find the direct links to the downloads.
|
||||
|
||||
### Windows
|
||||
|
||||
- [Windows 64-bit](https://github.com/GyulyVGC/sniffnet/releases/latest/download/Sniffnet_Windows_64-bit.msi)
|
||||
- [Windows 32-bit](https://github.com/GyulyVGC/sniffnet/releases/latest/download/Sniffnet_Windows_32-bit.msi) (only for older architectures)
|
||||
|
||||
### macOS
|
||||
|
||||
- [macOS Intel](https://github.com/GyulyVGC/sniffnet/releases/latest/download/Sniffnet_macOS_Intel.dmg)
|
||||
- [macOS Apple Silicon](https://github.com/GyulyVGC/sniffnet/releases/latest/download/Sniffnet_macOS_AppleSilicon.dmg)
|
||||
|
||||
### Linux DEB-based
|
||||
|
||||
- [Linux amd64](https://github.com/GyulyVGC/sniffnet/releases/latest/download/Sniffnet_LinuxDEB_amd64.deb)
|
||||
- [Linux arm64](https://github.com/GyulyVGC/sniffnet/releases/latest/download/Sniffnet_LinuxDEB_arm64.deb)
|
||||
- [Linux i386](https://github.com/GyulyVGC/sniffnet/releases/latest/download/Sniffnet_LinuxDEB_i386.deb) (only for older architectures)
|
||||
- [Linux armhf](https://github.com/GyulyVGC/sniffnet/releases/latest/download/Sniffnet_LinuxDEB_armhf.deb) (only for older architectures)
|
||||
|
||||
### Linux RPM-based
|
||||
|
||||
- [Linux x86_64](https://github.com/GyulyVGC/sniffnet/releases/latest/download/Sniffnet_LinuxRPM_x86_64.rpm)
|
||||
- [Linux aarch64](https://github.com/GyulyVGC/sniffnet/releases/latest/download/Sniffnet_LinuxRPM_aarch64.rpm)
|
||||
|
||||
</details>
|
||||
|
||||
@@ -128,7 +146,7 @@ ## Required dependencies
|
||||
|
||||
- Download the [Npcap SDK](https://npcap.com/#download).
|
||||
|
||||
- Add the SDK's ```/Lib/x64``` folder to your ```LIB``` environment variable.
|
||||
- Add the SDK's ```/Lib/x64``` (or ```/Lib```) folder to your ```LIB``` environment variable.
|
||||
|
||||
</details>
|
||||
|
||||
@@ -137,10 +155,10 @@ ## Required dependencies
|
||||
|
||||
<summary>Linux dependencies <img alt="" src="https://user-images.githubusercontent.com/100347457/193474239-c48d37af-d4c1-4a94-9207-0d46c6d75f1f.png" width="35px"/></summary>
|
||||
|
||||
- On [Debian-based](https://en.wikipedia.org/wiki/List_of_Linux_distributions#Debian-based) distributions:
|
||||
- On [DEB-based](https://en.wikipedia.org/wiki/List_of_Linux_distributions#Debian-based) distributions:
|
||||
- `libpcap-dev`
|
||||
- `libasound2-dev`
|
||||
- `libfontconfig1`
|
||||
- `libfontconfig1-dev`
|
||||
- On [RPM-based](https://en.wikipedia.org/wiki/List_of_Linux_distributions#RPM-based) distributions:
|
||||
- `libpcap-devel`
|
||||
- `alsa-lib-devel`
|
||||
|
||||
12
build.rs
Normal file
@@ -0,0 +1,12 @@
|
||||
#[cfg(windows)]
|
||||
extern crate winres;
|
||||
|
||||
#[cfg(windows)]
|
||||
fn main() {
|
||||
let mut res = winres::WindowsResource::new();
|
||||
res.set_icon("resources/packaging/windows/graphics/sniffnet.ico");
|
||||
res.compile().unwrap();
|
||||
}
|
||||
|
||||
#[cfg(unix)]
|
||||
fn main() {}
|
||||
@@ -1,32 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>English</string>
|
||||
<key>CFBundleDisplayName</key>
|
||||
<string>Sniffnet</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>wrapper.sh</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>sniffnet-macos.icns</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>gyulyvgc.sniffnet</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>Sniffnet</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0.0</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>20221123.150927</string>
|
||||
<key>CSResourcesFileMapped</key>
|
||||
<true/>
|
||||
<key>LSRequiresCarbon</key>
|
||||
<true/>
|
||||
<key>NSHighResolutionCapable</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
|
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 37 KiB |
|
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 31 KiB |
236
resources/packaging/LICENSE
Normal file
@@ -0,0 +1,236 @@
|
||||
*******************************************************************************
|
||||
DUAL LICENSED SOFTWARE
|
||||
*******************************************************************************
|
||||
|
||||
The software in this project is dual licensed under the terms of the MIT License
|
||||
and the Apache License 2.0. You may choose to use this software under either
|
||||
license, at your discretion.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
The MIT License
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2022 - Bellini Giuliano
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Apache License 2.0
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
*******************************************************************************
|
||||
18
resources/packaging/linux/description.txt
Normal file
@@ -0,0 +1,18 @@
|
||||
Features:
|
||||
Choose a network adapter of your PC to inspect
|
||||
Select a set of filters to apply to the observed traffic;
|
||||
View overall statistics about your Internet traffic;
|
||||
View real-time charts about traffic intensity (bytes and packets per second, incoming and outgoing);
|
||||
Get details about domain names and network providers of the hosts you are exchanging traffic with;
|
||||
Identify connections in your local network;
|
||||
Get information about the country of the remote hosts (IP geolocation);
|
||||
Save your favorite network hosts;
|
||||
Set custom notifications to inform you when defined network events occur;
|
||||
Choose the style that fits you the most from 4 different available themes;
|
||||
Inspect each of your network connections in real time;
|
||||
Save complete textual report with detailed information for each network connection:
|
||||
Source and destination IP addresses,
|
||||
Source and destination ports,
|
||||
Carried protocols,
|
||||
Amount of exchanged packets and bytes,
|
||||
Initial and final timestamp of information exchange
|
||||
|
Before Width: | Height: | Size: 311 KiB After Width: | Height: | Size: 311 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 39 KiB |
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.9 KiB |
|
Before Width: | Height: | Size: 71 KiB After Width: | Height: | Size: 71 KiB |
|
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 4.4 KiB |
|
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 5.2 KiB |
|
Before Width: | Height: | Size: 103 KiB After Width: | Height: | Size: 103 KiB |
|
Before Width: | Height: | Size: 6.8 KiB After Width: | Height: | Size: 6.8 KiB |
|
Before Width: | Height: | Size: 7.7 KiB After Width: | Height: | Size: 7.7 KiB |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
0
resources/packaging/linux/scripts/.gitkeep
Normal file
5
resources/packaging/linux/scripts/postinst
Normal file
@@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
setcap cap_net_raw,cap_net_admin=eip /usr/bin/sniffnet
|
||||
5
resources/packaging/linux/scripts/prerm
Normal file
@@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
setcap '' /usr/bin/sniffnet
|
||||
@@ -3,8 +3,8 @@ Version=1.0
|
||||
Type=Application
|
||||
Name=Sniffnet
|
||||
Comment=Application to comfortably monitor your network traffic
|
||||
Categories=Network;Security;Utility;
|
||||
Categories=Network;Utility;
|
||||
Icon=sniffnet
|
||||
Exec=sudo /usr/bin/sniffnet
|
||||
Exec=/usr/bin/sniffnet
|
||||
StartupWMClass=sniffnet
|
||||
Terminal=true
|
||||
Terminal=false
|
||||
20
resources/packaging/macos/Info.plist
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key><string>English</string>
|
||||
<key>CFBundleDisplayName</key><string>Sniffnet</string>
|
||||
<key>CFBundleExecutable</key><string>wrapper.sh</string>
|
||||
<key>CFBundleIconFile</key><string>sniffnet.icns</string>
|
||||
<key>CFBundleIdentifier</key><string>io.github.gyulyvgc.sniffnet</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key><string>6.0</string>
|
||||
<key>CFBundleName</key><string>Sniffnet</string>
|
||||
<key>CFBundlePackageType</key><string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key><string>0.0.0</string>
|
||||
<key>CFBundleVersion</key><string>fffffff</string>
|
||||
<key>CSResourcesFileMapped</key><true/>
|
||||
<key>LSApplicationCategoryType</key><string>public.app-category.utilities</string>
|
||||
<key>LSRequiresCarbon</key><true/>
|
||||
<key>NSHighResolutionCapable</key><true/>
|
||||
</dict>
|
||||
</plist>
|
||||
|
Before Width: | Height: | Size: 202 KiB After Width: | Height: | Size: 202 KiB |
2
resources/packaging/macos/wrapper.sh
Executable file
@@ -0,0 +1,2 @@
|
||||
#!/usr/bin/env zsh
|
||||
osascript -e "do shell script \"/*/Sniffnet.app/Contents/MacOS/sniffnet >/dev/null 2>&1 &\" with administrator privileges"
|
||||
BIN
resources/packaging/windows/EULA.rtf
Normal file
BIN
resources/packaging/windows/graphics/banner.bmp
Normal file
|
After Width: | Height: | Size: 84 KiB |
BIN
resources/packaging/windows/graphics/dialog.bmp
Normal file
|
After Width: | Height: | Size: 452 KiB |
|
Before Width: | Height: | Size: 133 KiB After Width: | Height: | Size: 133 KiB |
195
resources/packaging/windows/setup.wxs
Normal file
@@ -0,0 +1,195 @@
|
||||
<?xml version="1.0" encoding="windows-1252"?>
|
||||
|
||||
<?if $(sys.BUILDARCH) = x64 or $(sys.BUILDARCH) = arm64 ?>
|
||||
<?define PlatformProgramFilesFolder = "ProgramFiles64Folder" ?>
|
||||
<?else ?>
|
||||
<?define PlatformProgramFilesFolder = "ProgramFilesFolder" ?>
|
||||
<?endif ?>
|
||||
|
||||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
|
||||
<Product
|
||||
Id="*"
|
||||
Name="Sniffnet"
|
||||
UpgradeCode="352ADDB7-26A5-46BB-B25B-94E379BC2408"
|
||||
Manufacturer="Giuliano Bellini"
|
||||
Language="1033"
|
||||
Codepage="1252"
|
||||
Version="$(var.Version)"
|
||||
>
|
||||
<Package Id="*"
|
||||
Keywords="Installer"
|
||||
Description="Application to comfortably monitor your network traffic"
|
||||
Manufacturer="Giuliano Bellini"
|
||||
InstallerVersion="450"
|
||||
Languages="1033"
|
||||
Compressed="yes"
|
||||
InstallScope="perMachine"
|
||||
SummaryCodepage="1252"
|
||||
/>
|
||||
|
||||
<MajorUpgrade
|
||||
Schedule="afterInstallInitialize"
|
||||
DowngradeErrorMessage="A newer version of [ProductName] is already installed. Setup will now exit."
|
||||
/>
|
||||
|
||||
<Media Id="1" Cabinet="media1.cab" EmbedCab="yes" DiskPrompt="CD-ROM #1"/>
|
||||
<Property Id="DiskPrompt" Value="Sniffnet Installation"/>
|
||||
|
||||
<Directory Id="TARGETDIR" Name="SourceDir">
|
||||
<Directory Id="$(var.PlatformProgramFilesFolder)" Name="PFiles">
|
||||
<Directory Id="APPLICATIONFOLDER" Name="Sniffnet">
|
||||
|
||||
<Component Id="License" Guid="A36E8284-89A2-4E79-BD7F-3E09EA2C4713">
|
||||
<File Id="LicenseFile" Name="License.txt" DiskId="1" Source="resources\packaging\LICENSE" KeyPath="yes"/>
|
||||
</Component>
|
||||
|
||||
<Component Id="binary0" Guid="58F0AFE1-A350-4E13-9333-DA54AA435B14">
|
||||
<File
|
||||
Id="exe0"
|
||||
Name="sniffnet.exe"
|
||||
DiskId="1"
|
||||
Source="$(var.CargoTargetBinDir)/sniffnet.exe"
|
||||
KeyPath="yes"
|
||||
/>
|
||||
</Component>
|
||||
<Component Id="Path" Guid="E235E4DE-745C-4B50-BA17-593BEE5641D3" KeyPath="yes">
|
||||
<Environment
|
||||
Id="PATH"
|
||||
Name="PATH"
|
||||
Value="[APPLICATIONFOLDER]"
|
||||
Permanent="no"
|
||||
Part="last"
|
||||
Action="set"
|
||||
System="yes"
|
||||
/>
|
||||
</Component>
|
||||
</Directory>
|
||||
</Directory>
|
||||
|
||||
<Directory Id="ProgramMenuFolder">
|
||||
<Directory Id="ApplicationProgramsFolder" Name="Sniffnet">
|
||||
<Component Id="StartMenuShortcut" Guid="4E665F8C-85A8-4DB1-81FD-9F6BDFA02708">
|
||||
<Shortcut
|
||||
Id="ApplicationStartMenuShortcut"
|
||||
Name="Sniffnet"
|
||||
Description="Application to comfortably monitor your network traffic"
|
||||
Target="[APPLICATIONFOLDER]sniffnet.exe"
|
||||
WorkingDirectory="APPLICATIONFOLDER"
|
||||
/>
|
||||
<RemoveFolder Id="ApplicationProgramsFolder" On="uninstall"/>
|
||||
<RegistryValue
|
||||
Root="HKCU"
|
||||
Key="Software\GyulyVGC\Sniffnet\StartMenuShortcut"
|
||||
Name="installed"
|
||||
Type="integer"
|
||||
Value="1"
|
||||
KeyPath="yes"
|
||||
/>
|
||||
</Component>
|
||||
</Directory>
|
||||
</Directory>
|
||||
|
||||
<Directory Id="DesktopFolder" Name="Desktop">
|
||||
<Component Id="DesktopShortcut" Guid="B1635238-2FD3-4C65-9104-333B5BD47BD1">
|
||||
<Shortcut
|
||||
Id="ApplicationDesktopShortcut"
|
||||
Name="Sniffnet"
|
||||
Description="Application to comfortably monitor your network traffic"
|
||||
Target="[APPLICATIONFOLDER]sniffnet.exe"
|
||||
WorkingDirectory="APPLICATIONFOLDER"
|
||||
/>
|
||||
<RemoveFolder Id="DesktopFolder" On="uninstall"/>
|
||||
<RegistryValue
|
||||
Root="HKCU"
|
||||
Key="Software\GyulyVGC\Sniffnet\DesktopShortcut"
|
||||
Name="installed"
|
||||
Type="integer"
|
||||
Value="1"
|
||||
KeyPath="yes"
|
||||
/>
|
||||
</Component>
|
||||
</Directory>
|
||||
</Directory>
|
||||
|
||||
<Feature
|
||||
Id="Binaries"
|
||||
Title="Application"
|
||||
Description="Installs all binaries and the license."
|
||||
Level="1"
|
||||
ConfigurableDirectory="APPLICATIONFOLDER"
|
||||
AllowAdvertise="no"
|
||||
Display="expand"
|
||||
Absent="disallow"
|
||||
>
|
||||
<ComponentRef Id="License"/>
|
||||
<ComponentRef Id="binary0"/>
|
||||
|
||||
<Feature
|
||||
Id="Environment"
|
||||
Title="PATH Environment Variable"
|
||||
Description="Add the install location of the [ProductName] executable to the PATH system environment variable. This allows the [ProductName] executable to be called from any location."
|
||||
Level="1"
|
||||
Absent="allow"
|
||||
>
|
||||
<ComponentRef Id="Path"/>
|
||||
</Feature>
|
||||
|
||||
<Feature
|
||||
Id="StartMenu"
|
||||
Title="Start Menu Shortcut"
|
||||
Description="Add [ProductName] shortcut in the Start Menu for quick search."
|
||||
Level="1"
|
||||
Absent="allow"
|
||||
>
|
||||
<ComponentRef Id="StartMenuShortcut"/>
|
||||
</Feature>
|
||||
|
||||
<Feature
|
||||
Id="Desktop"
|
||||
Title="Desktop Shortcut"
|
||||
Description="Add the [ProductName] shortcut to the Desktop for quick access."
|
||||
Level="1"
|
||||
Absent="allow"
|
||||
>
|
||||
<ComponentRef Id="DesktopShortcut"/>
|
||||
</Feature>
|
||||
</Feature>
|
||||
|
||||
<SetProperty Id="ARPINSTALLLOCATION" Value="[APPLICATIONFOLDER]" After="CostFinalize"/>
|
||||
|
||||
<Icon Id="ProductICO" SourceFile="resources\packaging\windows\graphics\sniffnet.ico"/>
|
||||
<Property Id="ARPPRODUCTICON" Value="ProductICO"/>
|
||||
|
||||
<Property Id="ARPHELPLINK" Value="https://github.com/GyulyVGC/sniffnet"/>
|
||||
|
||||
<Property Id="WIXUI_EXITDIALOGOPTIONALTEXT" Value="Important: This application requires Npcap for proper functionality. If you have not installed Npcap yet, please install it now or the application will not run."/>
|
||||
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="Open Npcap website"/>
|
||||
|
||||
<UI>
|
||||
<UIRef Id="WixUI_FeatureTree"/>
|
||||
|
||||
<Publish
|
||||
Dialog="ExitDialog"
|
||||
Control="Finish"
|
||||
Event="DoAction"
|
||||
Value="OpenNpcapWebsite"
|
||||
>
|
||||
WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed
|
||||
</Publish>
|
||||
</UI>
|
||||
|
||||
<WixVariable Id="WixUILicenseRtf" Value="resources\packaging\windows\EULA.rtf"/>
|
||||
|
||||
<WixVariable Id="WixUIBannerBmp" Value="resources\packaging\windows\graphics\banner.bmp"/>
|
||||
<WixVariable Id="WixUIDialogBmp" Value="resources\packaging\windows\graphics\dialog.bmp"/>
|
||||
|
||||
<CustomAction
|
||||
Id="OpenNpcapWebsite"
|
||||
ExeCommand="powershell.exe -NoLogo -NoProfile -NonInteractive -InputFormat None -ExecutionPolicy Bypass -Command "& {
|
||||
Start-Process 'https://npcap.com/#download'
|
||||
}""
|
||||
Directory="APPLICATIONFOLDER"
|
||||
Return="asyncNoWait"
|
||||
/>
|
||||
</Product>
|
||||
</Wix>
|
||||
@@ -1,3 +0,0 @@
|
||||
#!/bin/sh
|
||||
osascript \
|
||||
-e "do shell script \"/*/Sniffnet.app/Contents/MacOS/sniffnet > /dev/null 2>&1 & \" with administrator privileges"
|
||||
@@ -1,3 +1,10 @@
|
||||
use iced::widget::Tooltip;
|
||||
use iced::{Length, Renderer};
|
||||
use iced_native::svg::Handle;
|
||||
use iced_native::widget::tooltip::Position;
|
||||
use iced_native::widget::Svg;
|
||||
use maxminddb::{geoip2, MaxMindDBError, Reader};
|
||||
|
||||
use crate::countries::flags_pictures::{
|
||||
AD, AE, AF, AG, AI, AL, AM, AO, AQ, AR, AS, AT, AU, AW, AX, AZ, BA, BB, BD, BE, BF, BG, BH, BI,
|
||||
BJ, BL, BM, BN, BO, BQ, BR, BROADCAST, BS, BT, BV, BW, BY, BZ, CA, CC, CD, CF, CG, CH, CI, CK,
|
||||
@@ -22,12 +29,6 @@
|
||||
local_translation, unknown_translation, your_network_adapter_translation,
|
||||
};
|
||||
use crate::{Language, StyleType};
|
||||
use iced::widget::Tooltip;
|
||||
use iced::{Length, Renderer};
|
||||
use iced_native::svg::Handle;
|
||||
use iced_native::widget::tooltip::Position;
|
||||
use iced_native::widget::Svg;
|
||||
use maxminddb::{geoip2, MaxMindDBError, Reader};
|
||||
|
||||
pub const COUNTRY_MMDB: &[u8] = include_bytes!("../../resources/DB/GeoLite2-Country.mmdb");
|
||||
|
||||
|
||||
@@ -179,17 +179,17 @@ mod tests {
|
||||
use super::*;
|
||||
|
||||
#[rstest]
|
||||
#[case("123", BytesNotification {
|
||||
#[case("123", BytesNotification {
|
||||
previous_threshold: 123, threshold: Some(123), byte_multiple: ByteMultiple::B, ..BytesNotification::default() })]
|
||||
#[case("500k", BytesNotification {
|
||||
#[case("500k", BytesNotification {
|
||||
previous_threshold: 500_000, threshold: Some(500_000),byte_multiple: ByteMultiple::KB, ..BytesNotification::default() })]
|
||||
#[case("420 m", BytesNotification {
|
||||
#[case("420 m", BytesNotification {
|
||||
previous_threshold: 420_000_000, threshold: Some(420_000_000),byte_multiple: ByteMultiple::MB, ..BytesNotification::default() })]
|
||||
#[case("foob@r", BytesNotification{
|
||||
threshold: Some(800000),
|
||||
..Default::default()
|
||||
})]
|
||||
#[case(" 888 g", BytesNotification {
|
||||
#[case(" 888 g", BytesNotification {
|
||||
previous_threshold: 888_000_000_000, threshold: Some(888_000_000_000),byte_multiple: ByteMultiple::GB, ..BytesNotification::default() })]
|
||||
fn test_can_instantiate_bytes_notification_from_string(
|
||||
#[case] input: &str,
|
||||
@@ -252,18 +252,18 @@ fn test_can_instantiate_favourite_notification() {
|
||||
}
|
||||
|
||||
#[rstest]
|
||||
#[case("123", PacketsNotification {
|
||||
#[case("123", PacketsNotification {
|
||||
previous_threshold: 123,
|
||||
threshold: Some(123),
|
||||
..PacketsNotification::default() })]
|
||||
#[case("8888", PacketsNotification {
|
||||
#[case("8888", PacketsNotification {
|
||||
previous_threshold: 8888,
|
||||
threshold: Some(8888),
|
||||
..PacketsNotification::default() })]
|
||||
#[case("420 m", PacketsNotification {
|
||||
#[case("420 m", PacketsNotification {
|
||||
threshold: Some(750),
|
||||
..PacketsNotification::default() })]
|
||||
#[case("foob@r", PacketsNotification {
|
||||
#[case("foob@r", PacketsNotification {
|
||||
threshold: Some(750),
|
||||
..PacketsNotification::default() })]
|
||||
fn test_can_instantiate_packet_notification_from_string(
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
use crate::countries::flags_pictures::{
|
||||
CN, DE, ES, FLAGS_WIDTH_SMALL, FR, GB, GR, IR, IT, KR, PL, PT, RO, RU, SE, TR, UA,
|
||||
};
|
||||
use iced::{Length, Renderer};
|
||||
use iced_native::svg::Handle;
|
||||
use iced_native::widget::Svg;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::countries::flags_pictures::{
|
||||
CN, DE, ES, FLAGS_WIDTH_SMALL, FR, GB, GR, IR, IT, KR, PL, PT, RO, RU, SE, TR, UA,
|
||||
};
|
||||
|
||||
/// This enum defines the available languages.
|
||||
#[derive(PartialEq, Eq, Clone, Copy, Debug, Serialize, Deserialize, Hash)]
|
||||
pub enum Language {
|
||||
|
||||
301
wix/main.wxs
@@ -1,301 +0,0 @@
|
||||
<?xml version='1.0' encoding='windows-1252'?>
|
||||
<!--
|
||||
Copyright (C) 2017 Christopher R. Field.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
|
||||
<!--
|
||||
The "cargo wix" subcommand provides a variety of predefined variables available
|
||||
for customization of this template. The values for each variable are set at
|
||||
installer creation time. The following variables are available:
|
||||
|
||||
TargetTriple = The rustc target triple name.
|
||||
TargetEnv = The rustc target environment. This is typically either
|
||||
"msvc" or "gnu" depending on the toolchain downloaded and
|
||||
installed.
|
||||
TargetVendor = The rustc target vendor. This is typically "pc", but Rust
|
||||
does support other vendors, like "uwp".
|
||||
CargoTargetBinDir = The complete path to the binary (exe). The default would
|
||||
be "target\release\<BINARY_NAME>.exe" where
|
||||
"<BINARY_NAME>" is replaced with the name of each binary
|
||||
target defined in the package's manifest (Cargo.toml). If
|
||||
a different rustc target triple is used than the host,
|
||||
i.e. cross-compiling, then the default path would be
|
||||
"target\<CARGO_TARGET>\<CARGO_PROFILE>\<BINARY_NAME>.exe",
|
||||
where "<CARGO_TARGET>" is replaced with the "CargoTarget"
|
||||
variable value and "<CARGO_PROFILE>" is replaced with the
|
||||
value from the `CargoProfile` variable.
|
||||
CargoTargetDir = The path to the directory for the build artifacts, i.e.
|
||||
"target".
|
||||
CargoProfile = Either "debug" or `release` depending on the build
|
||||
profile. The default is "release".
|
||||
Version = The version for the installer. The default is the
|
||||
"Major.Minor.Fix" semantic versioning number of the Rust
|
||||
package.
|
||||
-->
|
||||
|
||||
<!--
|
||||
Please do not remove these pre-processor If-Else blocks. These are used with
|
||||
the `cargo wix` subcommand to automatically determine the installation
|
||||
destination for 32-bit versus 64-bit installers. Removal of these lines will
|
||||
cause installation errors.
|
||||
-->
|
||||
<?if $(sys.BUILDARCH) = x64 or $(sys.BUILDARCH) = arm64 ?>
|
||||
<?define PlatformProgramFilesFolder = "ProgramFiles64Folder" ?>
|
||||
<?else ?>
|
||||
<?define PlatformProgramFilesFolder = "ProgramFilesFolder" ?>
|
||||
<?endif ?>
|
||||
|
||||
<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>
|
||||
|
||||
<Product
|
||||
Id='*'
|
||||
Name='sniffnet'
|
||||
UpgradeCode='20F423EF-7C95-484B-A439-2A7238B9B0B9'
|
||||
Manufacturer='Giuliano Bellini'
|
||||
Language='1033'
|
||||
Codepage='1252'
|
||||
Version='$(var.Version)'>
|
||||
|
||||
<!--
|
||||
<CustomAction
|
||||
Id="DownloadAndInstallNpcap"
|
||||
Directory='INSTALLDIR'
|
||||
Execute="deferred"
|
||||
Impersonate="no"
|
||||
Return="ignore"
|
||||
ExeCommand="Invoke-WebRequest -Uri 'https://npcap.com/dist/npcap-1.60.exe' -OutFile '$env:TEMP\npcap_installer.exe'; Start-Process -FilePath '$env:TEMP\npcap_installer.exe' -ArgumentList '/S' -Wait;"
|
||||
/>
|
||||
|
||||
<InstallExecuteSequence>
|
||||
<Custom Action="DownloadAndInstallNpcap" After="InstallFiles"/>
|
||||
</InstallExecuteSequence>
|
||||
-->
|
||||
|
||||
<Package Id='*'
|
||||
Keywords='Installer'
|
||||
Description='Application to comfortably monitor your network traffic'
|
||||
Manufacturer='Giuliano Bellini'
|
||||
InstallerVersion='450'
|
||||
Languages='1033'
|
||||
Compressed='yes'
|
||||
InstallScope='perMachine'
|
||||
SummaryCodepage='1252'
|
||||
/>
|
||||
|
||||
<MajorUpgrade
|
||||
Schedule='afterInstallInitialize'
|
||||
DowngradeErrorMessage='A newer version of [ProductName] is already installed. Setup will now exit.'/>
|
||||
|
||||
<Icon Id='SetupIcon' SourceFile='resources\icons\sniffnet-windows.ico'/>
|
||||
|
||||
<Media Id='1' Cabinet='media1.cab' EmbedCab='yes' DiskPrompt='CD-ROM #1'/>
|
||||
<Property Id='DiskPrompt' Value='sniffnet Installation'/>
|
||||
|
||||
<Directory Id='TARGETDIR' Name='SourceDir'>
|
||||
<Directory Id='$(var.PlatformProgramFilesFolder)' Name='PFiles'>
|
||||
<Directory Id='APPLICATIONFOLDER' Name='sniffnet'>
|
||||
|
||||
<!--
|
||||
Enabling the license sidecar file in the installer is a four step process:
|
||||
|
||||
1. Uncomment the `Component` tag and its contents.
|
||||
2. Change the value for the `Source` attribute in the `File` tag to a path
|
||||
to the file that should be included as the license sidecar file. The path
|
||||
can, and probably should be, relative to this file.
|
||||
3. Change the value for the `Name` attribute in the `File` tag to the
|
||||
desired name for the file when it is installed alongside the `bin` folder
|
||||
in the installation directory. This can be omitted if the desired name is
|
||||
the same as the file name.
|
||||
4. Uncomment the `ComponentRef` tag with the Id attribute value of "License"
|
||||
further down in this file.
|
||||
|
||||
<Component Id='License' Guid='*'>
|
||||
<File Id='LicenseFile' Name='MIT' DiskId='1' Source='LICENSE-MIT' KeyPath='yes'/>
|
||||
<File Id='LicenseFile' Name='Apache 2.0' DiskId='1' Source='LICENSE-APACHE' KeyPath='yes'/>
|
||||
</Component>
|
||||
|
||||
-->
|
||||
|
||||
<Directory Id='Bin' Name='bin'>
|
||||
<Component Id='Path' Guid='67CC6129-6FD7-4615-A675-7AC5E1ABE0B3' KeyPath='yes'>
|
||||
<Environment
|
||||
Id='PATH'
|
||||
Name='PATH'
|
||||
Value='[Bin]'
|
||||
Permanent='no'
|
||||
Part='last'
|
||||
Action='set'
|
||||
System='yes'/>
|
||||
</Component>
|
||||
<Component Id='binary0' Guid='*'>
|
||||
<File
|
||||
Id='exe0'
|
||||
Name='sniffnet.exe'
|
||||
DiskId='1'
|
||||
Source='$(var.CargoTargetBinDir)\sniffnet.exe'
|
||||
KeyPath='yes'/>
|
||||
</Component>
|
||||
</Directory>
|
||||
</Directory>
|
||||
</Directory>
|
||||
<Directory Id="ProgramMenuFolder">
|
||||
<Directory Id="ApplicationProgramsFolder" Name="Sniffnet"/>
|
||||
</Directory>
|
||||
<Directory Id="DesktopFolder" Name="Desktop">
|
||||
</Directory>
|
||||
</Directory>
|
||||
|
||||
<DirectoryRef Id="ApplicationProgramsFolder">
|
||||
<Component Id="AppStart" Guid="d5886d8d-009d-4468-9db3-1ebc72f7c201">
|
||||
<Shortcut Id="AppStartShortcut"
|
||||
Name="Sniffet"
|
||||
Description="Application to comfortably monitor your network traffic"
|
||||
Target="[APPLICATIONFOLDER]bin\sniffnet.exe"
|
||||
WorkingDirectory="APPLICATIONROOTDIRECTORY"
|
||||
Icon="SetupIcon"/>
|
||||
<RemoveFolder Id="ApplicationProgramsFolder" On="uninstall"/>
|
||||
<RegistryValue Root="HKCU" Key="Software\gyulyvgc\sniffnet" Name="StartShortcut" Type="integer" Value="1" KeyPath="yes"/>
|
||||
</Component>
|
||||
</DirectoryRef>
|
||||
|
||||
<DirectoryRef Id="DesktopFolder">
|
||||
<Component Id="AppDesk" Guid="e7261bca-c8c3-4f7f-be81-eb3a7470bc7d">
|
||||
<Shortcut Id="AppDeskShortcut"
|
||||
Name="Sniffnet"
|
||||
Description="Application to comfortably monitor your network traffic"
|
||||
Target="[APPLICATIONFOLDER]bin\sniffnet.exe"
|
||||
WorkingDirectory="APPLICATIONROOTDIRECTORY"
|
||||
Icon="SetupIcon"/>
|
||||
<RemoveFolder Id="DesktopFolder" On="uninstall"/>
|
||||
<RegistryValue Root="HKCU" Key="Software\gyulyvgc\sniffnet" Name="DeskShortcut" Type="integer" Value="1" KeyPath="yes"/>
|
||||
</Component>
|
||||
</DirectoryRef>
|
||||
|
||||
<Feature
|
||||
Id='Binaries'
|
||||
Title='Application'
|
||||
Description='Installs all binaries and the license.'
|
||||
Level='1'
|
||||
ConfigurableDirectory='APPLICATIONFOLDER'
|
||||
AllowAdvertise='no'
|
||||
Display='expand'
|
||||
Absent='disallow'>
|
||||
|
||||
<!--
|
||||
Uncomment the following `ComponentRef` tag to add the license
|
||||
sidecar file to the installer.
|
||||
|
||||
<ComponentRef Id='License'/>
|
||||
-->
|
||||
|
||||
<ComponentRef Id='binary0'/>
|
||||
|
||||
<Feature
|
||||
Id='Environment'
|
||||
Title='PATH Environment Variable'
|
||||
Description='Add the install location of the [ProductName] executable to the PATH system environment variable. This allows the [ProductName] executable to be called from any location.'
|
||||
Level='1'
|
||||
Absent='allow'>
|
||||
<ComponentRef Id='Path'/>
|
||||
</Feature>
|
||||
</Feature>
|
||||
|
||||
<Feature
|
||||
Id='StartShort'
|
||||
Title='Start menu shortcut'
|
||||
Description='Add a shortcut to the start menu'
|
||||
Level='1'
|
||||
AllowAdvertise='no'
|
||||
Display='expand'
|
||||
Absent='disallow'>
|
||||
<ComponentRef Id="AppStart" />
|
||||
</Feature>
|
||||
|
||||
<Feature
|
||||
Id='DeskShort'
|
||||
Title='Desktop shortcut'
|
||||
Description='Add a shortcut to the desktop'
|
||||
Level='1'
|
||||
AllowAdvertise='no'
|
||||
Display='expand'
|
||||
Absent='disallow'>
|
||||
<ComponentRef Id="AppDesk" />
|
||||
</Feature>
|
||||
|
||||
<SetProperty Id='ARPINSTALLLOCATION' Value='[APPLICATIONFOLDER]' After='CostFinalize'/>
|
||||
|
||||
|
||||
<!--
|
||||
Uncomment the following `Icon` and `Property` tags to change the product icon.
|
||||
|
||||
The product icon is the graphic that appears in the Add/Remove
|
||||
Programs control panel for the application.
|
||||
-->
|
||||
<Icon Id='ProductICO' SourceFile="resources\icons\sniffnet-windows.ico"/>
|
||||
<Property Id='ARPPRODUCTICON' Value='ProductICO' />
|
||||
|
||||
<Property Id='ARPHELPLINK' Value='https://github.com/GyulyVGC/sniffnet'/>
|
||||
|
||||
<UI>
|
||||
<UIRef Id='WixUI_FeatureTree'/>
|
||||
|
||||
<!--
|
||||
Enabling the EULA dialog in the installer is a three step process:
|
||||
|
||||
1. Comment out or remove the two `Publish` tags that follow the
|
||||
`WixVariable` tag.
|
||||
2. Uncomment the `<WixVariable Id='WixUILicenseRtf' Value='Path\to\Eula.rft'>` tag futher down
|
||||
3. Replace the `Value` attribute of the `WixVariable` tag with
|
||||
the path to a RTF file that will be used as the EULA and
|
||||
displayed in the license agreement dialog.
|
||||
-->
|
||||
<Publish Dialog='WelcomeDlg' Control='Next' Event='NewDialog' Value='CustomizeDlg' Order='99'>1</Publish>
|
||||
<Publish Dialog='CustomizeDlg' Control='Back' Event='NewDialog' Value='WelcomeDlg' Order='99'>1</Publish>
|
||||
|
||||
</UI>
|
||||
|
||||
|
||||
<!--
|
||||
Enabling the EULA dialog in the installer requires uncommenting
|
||||
the following `WixUILicenseRTF` tag and changing the `Value`
|
||||
attribute.
|
||||
|
||||
<WixVariable Id='WixUILicenseRtf' Value='resources\EULA.rtf'/>
|
||||
-->
|
||||
|
||||
<!--
|
||||
Uncomment the next `WixVariable` tag to customize the installer's
|
||||
Graphical User Interface (GUI) and add a custom banner image across
|
||||
the top of each screen. See the WiX Toolset documentation for details
|
||||
about customization.
|
||||
|
||||
The banner BMP dimensions are 493 x 58 pixels.
|
||||
-->
|
||||
<!--<WixVariable Id='WixUIBannerBmp' Value='wix\Banner.bmp'/>-->
|
||||
|
||||
|
||||
<!--
|
||||
Uncomment the next `WixVariable` tag to customize the installer's
|
||||
Graphical User Interface (GUI) and add a custom image to the first
|
||||
dialog, or screen. See the WiX Toolset documentation for details about
|
||||
customization.
|
||||
|
||||
The dialog BMP dimensions are 493 x 312 pixels.
|
||||
-->
|
||||
<!--<WixVariable Id='WixUIDialogBmp' Value='wix\Dialog.bmp'/>-->
|
||||
|
||||
</Product>
|
||||
|
||||
</Wix>
|
||||