From 8f6e37cd642d684d1210520d9bcd83e8bd4e35df Mon Sep 17 00:00:00 2001 From: Marco Cadetg Date: Sat, 22 Feb 2025 11:32:37 +0100 Subject: [PATCH 01/14] feat: docker container --- .dockerignore | 12 +++++++++ .github/workflows/package.yml | 24 +++++++++++++++++ .gitignore | 3 +-- Dockerfile | 49 +++++++++++++++++++++++++++++++++++ 4 files changed, 86 insertions(+), 2 deletions(-) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..c42a35d8 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,12 @@ +/target +.git +.gitignore +.github +*.md +Dockerfile +.dockerignore +LICENSE-APACHE +LICENSE-MIT +*.sh +.editorconfig +.gitattributes \ No newline at end of file diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index 399c44dd..652add69 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -322,3 +322,27 @@ jobs: name: msi-${{ matrix.arch }} path: artifacts/ if-no-files-found: error + docker: + name: Docker Build + runs-on: ubuntu-latest + needs: build + steps: + - uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v5 + with: + push: true + tags: | + ghcr.io/${{ github.repository }}:latest + ghcr.io/${{ github.repository }}:${{ github.sha }} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 05386a8f..fe36f504 100644 --- a/.gitignore +++ b/.gitignore @@ -55,6 +55,5 @@ $RECYCLE.BIN/ *.lnk ### Custom... ### -Dockerfile lcov.info -*.pcap \ No newline at end of file +*.pcap diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..d99043c7 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,49 @@ +FROM rust:1.85-slim AS builder + +# Install sniffnet build dependencies +RUN apt-get update && apt-get install -y \ + libfreetype6-dev \ + libexpat1-dev \ + libpcap-dev \ + libasound2-dev \ + libfontconfig1-dev \ + libgtk-3-dev \ + pkg-config \ + && rm -rf /var/lib/apt/lists/* + +# Create a new empty shell project +WORKDIR /usr/src/sniffnet +COPY . . + +# Build for release +RUN cargo build --release + +# Runtime stage +FROM debian:bookworm-slim + +# Install runtime dependencies including Wayland +RUN apt-get update && apt-get install -y \ + libfreetype6 \ + libexpat1 \ + libpcap0.8 \ + libasound2 \ + libfontconfig1 \ + libgtk-3-0 \ + libwayland-client0 \ + libwayland-cursor0 \ + libwayland-egl1 \ + libxkbcommon0 \ + mesa-utils \ + libegl1 \ + libvulkan1 \ + && rm -rf /var/lib/apt/lists/* + +# Copy the built binary +COPY --from=builder /usr/src/sniffnet/target/release/sniffnet /usr/local/bin/sniffnet + +# Set environment variables for Wayland +ENV GDK_BACKEND=wayland +ENV WAYLAND_DISPLAY=$WAYLAND_DISPLAY +ENV XDG_RUNTIME_DIR=/tmp + +ENTRYPOINT ["sniffnet"] \ No newline at end of file From 47085a661cb51ae27ec122a70ddcb1ee1ab2eaeb Mon Sep 17 00:00:00 2001 From: Marco Cadetg Date: Sun, 23 Feb 2025 10:05:15 +0100 Subject: [PATCH 02/14] remove unnecessary libraries from docker image --- Dockerfile | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/Dockerfile b/Dockerfile index d99043c7..ad96da93 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ FROM rust:1.85-slim AS builder -# Install sniffnet build dependencies +# Install build dependencies for both X11 and Wayland RUN apt-get update && apt-get install -y \ libfreetype6-dev \ libexpat1-dev \ @@ -11,17 +11,15 @@ RUN apt-get update && apt-get install -y \ pkg-config \ && rm -rf /var/lib/apt/lists/* -# Create a new empty shell project WORKDIR /usr/src/sniffnet COPY . . -# Build for release RUN cargo build --release # Runtime stage FROM debian:bookworm-slim -# Install runtime dependencies including Wayland +# Install runtime dependencies for both X11 and Wayland RUN apt-get update && apt-get install -y \ libfreetype6 \ libexpat1 \ @@ -29,21 +27,8 @@ RUN apt-get update && apt-get install -y \ libasound2 \ libfontconfig1 \ libgtk-3-0 \ - libwayland-client0 \ - libwayland-cursor0 \ - libwayland-egl1 \ - libxkbcommon0 \ - mesa-utils \ - libegl1 \ - libvulkan1 \ && rm -rf /var/lib/apt/lists/* -# Copy the built binary COPY --from=builder /usr/src/sniffnet/target/release/sniffnet /usr/local/bin/sniffnet -# Set environment variables for Wayland -ENV GDK_BACKEND=wayland -ENV WAYLAND_DISPLAY=$WAYLAND_DISPLAY -ENV XDG_RUNTIME_DIR=/tmp - -ENTRYPOINT ["sniffnet"] \ No newline at end of file +ENTRYPOINT ["sniffnet"] From 0be0dfdf178124b32af3593b893c9aaad594d7f4 Mon Sep 17 00:00:00 2001 From: Marco Cadetg Date: Sun, 23 Feb 2025 14:29:57 +0100 Subject: [PATCH 03/14] use qemu to build multiarch docker images --- .github/workflows/package.yml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index 652add69..29bfe619 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -327,22 +327,28 @@ jobs: runs-on: ubuntu-latest needs: build steps: - - uses: actions/checkout@v4 - + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - + - name: Login to GitHub Container Registry uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - + - name: Build and push uses: docker/build-push-action@v5 with: + context: . + platforms: linux/amd64,linux/arm64,linux/386,linux/arm/v7 push: true tags: | ghcr.io/${{ github.repository }}:latest - ghcr.io/${{ github.repository }}:${{ github.sha }} \ No newline at end of file + ghcr.io/${{ github.repository }}:${{ github.sha }} From 5c7d4b33809c74fe63fee066facc2c9094c73305 Mon Sep 17 00:00:00 2001 From: Marco Cadetg Date: Thu, 24 Apr 2025 16:35:57 +0200 Subject: [PATCH 04/14] update documentation about docker image --- .dockerignore | 2 +- .github/workflows/docker.yml | 36 +++++++++++ .github/workflows/package.yml | 8 +-- README.md | 109 +++++++++++++++++++++++++++++++--- 4 files changed, 142 insertions(+), 13 deletions(-) create mode 100644 .github/workflows/docker.yml diff --git a/.dockerignore b/.dockerignore index c42a35d8..8ff7a6ad 100644 --- a/.dockerignore +++ b/.dockerignore @@ -9,4 +9,4 @@ LICENSE-APACHE LICENSE-MIT *.sh .editorconfig -.gitattributes \ No newline at end of file +.gitattributes diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 00000000..da134a79 --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,36 @@ +name: Docker + +on: + workflow_dispatch: + +jobs: + docker: + name: Docker Build + runs-on: ubuntu-latest + needs: build + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: . + platforms: linux/amd64,linux/arm64,linux/386,linux/arm/v7 + push: true + tags: | + ghcr.io/${{ github.repository }}:latest + ghcr.io/${{ github.repository }}:${{ github.sha }} diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index 35e3d930..4d5b36ee 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -331,20 +331,20 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - + - name: Set up QEMU uses: docker/setup-qemu-action@v3 - + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - + - name: Login to GitHub Container Registry uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - + - name: Build and push uses: docker/build-push-action@v5 with: diff --git a/README.md b/README.md index af0b231c..058b7094 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,6 @@ Translated in:

- ## _Support Sniffnet's development_ πŸ’– Sniffnet is completely free, open-source software which needs lots of effort and time to develop and maintain. @@ -56,7 +55,6 @@ Do you want to help the project in an alternative way? You can also head to the Jan Walter

- ## Download | Windows | macOS | Linux (.deb) | Linux (.rpm) | @@ -84,7 +82,6 @@ cargo install sniffnet --locked -
from Homebrew @@ -118,6 +115,7 @@ brew install sniffnet ``` Alternatively, you can try it in a shell with: + ```sh nix-shell -p sniffnet ``` @@ -171,6 +169,103 @@ tce-load -wi sniffnet
+
+ + Using Docker + +## Docker + +Sniffnet can be run in a Docker container. This is especially useful for quickly testing the application without installing all dependencies directly on your system. + +### Pull from GitHub Container Registry + +The easiest way to get started is by pulling the pre-built image from GitHub Container Registry: + +```sh +# Pull the latest version +docker pull ghcr.io/gyulyvgc/sniffnet:latest + +# Or pull a specific version +docker pull ghcr.io/gyulyvgc/sniffnet:1.2.3 # Replace with actual version +``` + +### Running the Docker container + +To run Sniffnet in a Docker container on Linux, you need to grant the appropriate network permissions and configure display access: + +#### For Wayland + +```sh +docker run -it \ + --net=host \ + -v $XDG_RUNTIME_DIR/$WAYLAND_DISPLAY:/tmp/$WAYLAND_DISPLAY \ + -e WAYLAND_DISPLAY=$WAYLAND_DISPLAY \ + -e XDG_RUNTIME_DIR=/tmp \ + -e RUST_BACKTRACE=full \ + -e ICED_BACKEND=tiny-skia \ + --cap-add=NET_ADMIN \ + --cap-add=NET_RAW \ + ghcr.io/gyulyvgc/sniffnet:latest +``` + +#### For X11 + +```sh +docker run -it \ + --net=host \ + -e DISPLAY=$DISPLAY \ + -v /tmp/.X11-unix:/tmp/.X11-unix \ + -e RUST_BACKTRACE=full \ + -e ICED_BACKEND=tiny-skia \ + --cap-add=NET_ADMIN \ + --cap-add=NET_RAW \ + ghcr.io/gyulyvgc/sniffnet:latest +``` + +> [!NOTE] +> +> - The `--net=host` flag is required for Sniffnet to access your network interfaces. +> - `--cap-add=NET_ADMIN` and `--cap-add=NET_RAW` are needed for packet capture capabilities. +> - If you experience rendering issues, the `ICED_BACKEND=tiny-skia` environment variable switches to the software renderer. + +### Building your own Docker image + +If you prefer to build the Docker image yourself: + +```sh +# Clone the repository +git clone https://github.com/GyulyVGC/sniffnet.git +cd sniffnet + +# Build the Docker image +docker build -t sniffnet . + +# Run with the same parameters as above, but using your local image +docker run -it --net=host [...other parameters] sniffnet +``` + +### Troubleshooting Docker setup + +If you encounter issues: + +1. Make sure you have the necessary permissions to run Docker commands (or use `sudo`) +2. For GUI issues, ensure your host display server allows connections from Docker +3. If you're using SELinux, you might need to adjust policies or temporarily set it to permissive mode + +For X11, you may need to allow Docker to connect to your X server: + +```sh +xhost +local:docker +``` + +Remember to revert this change when done: + +```sh +xhost -local:docker +``` + +
+ ## Features - πŸ’» choose a **network adapter** of your PC to inspect @@ -212,7 +307,7 @@ The Wiki includes step-by-step guides, tips, examples of usage, and answers to f Most of the errors that may arise are likely due to your system missing dependencies required to correctly analyze a network adapter.
-Check the [required dependencies page](https://github.com/GyulyVGC/sniffnet/wiki/Required-dependencies) +Check the [required dependencies page](https://github.com/GyulyVGC/sniffnet/wiki/Required-dependencies) for instructions on how to proceed depending on your operating system. ### Rendering problems @@ -227,11 +322,10 @@ a CPU-only software renderer that should work properly on every environment: ICED_BACKEND=tiny-skia ``` -### ***In any case, don't hesitate to [open an issue](https://github.com/GyulyVGC/sniffnet/issues/new/choose), and I will do my best to help you!*** +### _**In any case, don't hesitate to [open an issue](https://github.com/GyulyVGC/sniffnet/issues/new/choose), and I will do my best to help you!**_ - ## Acknowledgements - A big shout-out to [all the contributors](https://github.com/GyulyVGC/sniffnet/blob/main/CONTRIBUTORS.md) of Sniffnet! @@ -239,7 +333,6 @@ ICED_BACKEND=tiny-skia - IP geolocation and ASN data are provided by [MaxMind](https://www.maxmind.com) - Last but not least, thanks to [every single stargazer](https://github.com/GyulyVGC/sniffnet/stargazers): all forms of support made it possible to keep improving Sniffnet! - ## Stay in the loop Wait... there's more!
Sniffnet is rapidly evolving, and new features are added on a regular basis.
@@ -251,4 +344,4 @@ Follow the news and Sniffnet soci Mastodon  Telegram  Twitter / X - \ No newline at end of file + From 7dd1aa55c259ed0321fe799bee7d066f0ac2018e Mon Sep 17 00:00:00 2001 From: Marco Cadetg Date: Thu, 24 Apr 2025 16:41:16 +0200 Subject: [PATCH 05/14] remove docker workflow job from package --- .github/workflows/docker.yml | 11 +++++++++-- .github/workflows/package.yml | 30 ------------------------------ README.md | 2 +- 3 files changed, 10 insertions(+), 33 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index da134a79..c41d70b5 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -7,11 +7,17 @@ jobs: docker: name: Docker Build runs-on: ubuntu-latest - needs: build - steps: + steps: - name: Checkout uses: actions/checkout@v4 + - name: Extract version from Cargo.toml + id: cargo-version + run: | + VERSION=$(grep -m1 "^version" Cargo.toml | cut -d'"' -f2) + echo "VERSION=$VERSION" >> $GITHUB_ENV + echo "version=$VERSION" >> $GITHUB_OUTPUT + - name: Set up QEMU uses: docker/setup-qemu-action@v3 @@ -33,4 +39,5 @@ jobs: push: true tags: | ghcr.io/${{ github.repository }}:latest + ghcr.io/${{ github.repository }}:${{ env.VERSION }} ghcr.io/${{ github.repository }}:${{ github.sha }} diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index 4d5b36ee..f89dbbe4 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -324,33 +324,3 @@ jobs: name: msi-${{ matrix.arch }} path: artifacts/ if-no-files-found: error - docker: - name: Docker Build - runs-on: ubuntu-latest - needs: build - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Login to GitHub Container Registry - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build and push - uses: docker/build-push-action@v5 - with: - context: . - platforms: linux/amd64,linux/arm64,linux/386,linux/arm/v7 - push: true - tags: | - ghcr.io/${{ github.repository }}:latest - ghcr.io/${{ github.repository }}:${{ github.sha }} diff --git a/README.md b/README.md index 058b7094..5fc8bf7f 100644 --- a/README.md +++ b/README.md @@ -322,7 +322,7 @@ a CPU-only software renderer that should work properly on every environment: ICED_BACKEND=tiny-skia ``` -### _**In any case, don't hesitate to [open an issue](https://github.com/GyulyVGC/sniffnet/issues/new/choose), and I will do my best to help you!**_ +### ***In any case, don't hesitate to [open an issue](https://github.com/GyulyVGC/sniffnet/issues/new/choose), and I will do my best to help you!*** From bd9054d9df45f5b10a6bc1cccbb86184c7f214ac Mon Sep 17 00:00:00 2001 From: Marco Cadetg Date: Fri, 25 Apr 2025 11:47:38 +0200 Subject: [PATCH 06/14] testing on debian xfce desktop on arm64/aarch64 --- README.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/README.md b/README.md index 5fc8bf7f..35c64873 100644 --- a/README.md +++ b/README.md @@ -264,6 +264,26 @@ Remember to revert this change when done: xhost -local:docker ``` +#### For ARM64/aarch64 systems (like Apple Silicon Macs or Raspberry Pi) + +When running on ARM64 architecture, you may encounter X11 library errors such as: + +- `OsError XNotSupported libraryopenerror libX11-xcb.so.1 cannot open shared object file no such file or directory` +- `libxkbcommon-x11.so could not be loaded` + +To resolve these issues, mount the host system's ARM64 libraries into the container: + +```sh +sudo docker run -d \ + --net=host \ + --cap-add=NET_ADMIN \ + -v /tmp/.X11-unix:/tmp/.X11-unix \ + -v $HOME/.Xauthority:/root/.Xauthority \ + -v /lib/aarch64-linux-gnu:/lib/aarch64-linux-gnu \ + -e DISPLAY=$DISPLAY \ + --name sniffnet \ + ghcr.io/gyulyvgc/sniffnet:latest + ## Features From c5a006fe2104666ac688d297f72fd340c6d3875a Mon Sep 17 00:00:00 2001 From: Marco Cadetg Date: Fri, 25 Apr 2025 23:31:07 +0200 Subject: [PATCH 07/14] fix missing backticks on closing shell example --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 35c64873..17f8423f 100644 --- a/README.md +++ b/README.md @@ -283,6 +283,7 @@ sudo docker run -d \ -e DISPLAY=$DISPLAY \ --name sniffnet \ ghcr.io/gyulyvgc/sniffnet:latest +``` From c126a11f18de0105f12ccb0173223ee6a0b96f2f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 29 Apr 2025 03:38:22 +0000 Subject: [PATCH 08/14] Bump toml from 0.8.20 to 0.8.22 Bumps [toml](https://github.com/toml-rs/toml) from 0.8.20 to 0.8.22. - [Commits](https://github.com/toml-rs/toml/compare/toml-v0.8.20...toml-v0.8.22) --- updated-dependencies: - dependency-name: toml dependency-version: 0.8.22 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Cargo.lock | 23 +++++++++++++++-------- Cargo.toml | 2 +- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7abf03a6..1df62476 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -828,7 +828,7 @@ dependencies = [ "directories", "serde", "thiserror 1.0.69", - "toml 0.8.20", + "toml 0.8.22", ] [[package]] @@ -4715,7 +4715,7 @@ dependencies = [ "serde_test", "serial_test", "splines", - "toml 0.8.20", + "toml 0.8.22", "winres", ] @@ -5153,9 +5153,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.20" +version = "0.8.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd87a5cdd6ffab733b2f74bc4fd7ee5fff6634124999ac278c35fc78c6120148" +checksum = "05ae329d1f08c4d17a59bed7ff5b5a769d062e64a62d34a3261b219e62cd5aae" dependencies = [ "serde", "serde_spanned", @@ -5165,26 +5165,33 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.8" +version = "0.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" +checksum = "3da5db5a963e24bc68be8b17b6fa82814bb22ee8660f192bb182771d498f09a3" dependencies = [ "serde", ] [[package]] name = "toml_edit" -version = "0.22.24" +version = "0.22.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17b4795ff5edd201c7cd6dca065ae59972ce77d1b80fa0a84d94950ece7d1474" +checksum = "310068873db2c5b3e7659d2cc35d21855dbafa50d1ce336397c666e3cb08137e" dependencies = [ "indexmap", "serde", "serde_spanned", "toml_datetime", + "toml_write", "winnow", ] +[[package]] +name = "toml_write" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfb942dfe1d8e29a7ee7fcbde5bd2b9a25fb89aa70caea2eba3bee836ff41076" + [[package]] name = "tower" version = "0.5.2" diff --git a/Cargo.toml b/Cargo.toml index 6550c1f1..0bb71d20 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -48,7 +48,7 @@ confy = "0.6.1" serde = { version = "1.0.219", default-features = false, features = ["derive"] } rodio = { version = "0.20.1", default-features = false, features = ["mp3"] } dns-lookup = "2.0.4" -toml = "0.8.20" +toml = "0.8.22" ctrlc = { version = "3.4.6", features = ["termination"] } rfd = "0.15.3" phf = "0.11.3" From c82a3a9f9bb83d5ec1f221c2b49820c3b41e5f5f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 30 Apr 2025 03:29:59 +0000 Subject: [PATCH 09/14] Bump chrono from 0.4.40 to 0.4.41 Bumps [chrono](https://github.com/chronotope/chrono) from 0.4.40 to 0.4.41. - [Release notes](https://github.com/chronotope/chrono/releases) - [Changelog](https://github.com/chronotope/chrono/blob/main/CHANGELOG.md) - [Commits](https://github.com/chronotope/chrono/compare/v0.4.40...v0.4.41) --- updated-dependencies: - dependency-name: chrono dependency-version: 0.4.41 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7abf03a6..6ee0a716 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -647,9 +647,9 @@ checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" [[package]] name = "chrono" -version = "0.4.40" +version = "0.4.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a7964611d71df112cb1730f2ee67324fcf4d0fc6606acbbe9bfe06df124637c" +checksum = "c469d952047f47f91b68d1cba3f10d63c11d73e4636f24f08daf0278abf01c4d" dependencies = [ "android-tzdata", "iana-time-zone", diff --git a/Cargo.toml b/Cargo.toml index 6550c1f1..56389cc4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -39,7 +39,7 @@ strip = true [dependencies] pcap = "2.2.0" etherparse = "0.18.0" -chrono = { version = "0.4.40", default-features = false, features = ["clock"] } +chrono = { version = "0.4.41", default-features = false, features = ["clock"] } plotters = { version = "0.3.7", default-features = false, features = ["area_series", "line_series"] } iced = { version = "0.13.1", features = ["tokio", "svg", "advanced", "lazy", "image"] } plotters-iced = "0.11.0" From 210dcabb8bf0950739f4a21b170e838a3207c7b1 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Thu, 1 May 2025 23:49:59 +0200 Subject: [PATCH 10/14] docs: add domcyrus as a contributor for platform (#798) --- .all-contributorsrc | 9 +++++++++ CONTRIBUTORS.md | 9 +++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index 87342cd8..e56df8da 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -630,6 +630,15 @@ "design", "a11y" ] + }, + { + "login": "domcyrus", + "name": "Marco Cadetg", + "avatar_url": "https://avatars.githubusercontent.com/u/884083?v=4", + "profile": "https://github.com/domcyrus", + "contributions": [ + "platform" + ] } ], "contributorsPerLine": 7, diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 47fc150f..6ff792aa 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -51,42 +51,43 @@ A big shout-out to all the contributors of Sniffnet ([emoji key](https://allcont Marc GavilΓ‘n
Marc GavilΓ‘n

🌍 + Marco Cadetg
Marco Cadetg

πŸ“¦ Matthias Braun
Matthias Braun

πŸ“– Michel Hansma
Michel Hansma

🎨 ️️️️♿️ Morgan Hill
Morgan Hill

πŸ›‘οΈ Muhammadali Hakimov
Muhammadali Hakimov

🌍 Oleksii Filonenko
Oleksii Filonenko

🌍 Orhun Parmaksız
Orhun ParmaksΔ±z

πŸ“– πŸ“¦ πŸ’΅ - Peter Dave Hello
Peter Dave Hello

🌍 + Peter Dave Hello
Peter Dave Hello

🌍 Phil Clifford
Phil Clifford

πŸ“¦ Quetzal-coalt
Quetzal-coalt

🌍 Safaraliev Maxim
Safaraliev Maxim

🌍 Shawn Yeager
Shawn Yeager

πŸ’΅ The Artifex
The Artifex

🌍 πŸ“¦ Trα»‹nh Duy HΖ°ng
Trα»‹nh Duy HΖ°ng

🌍 - TyseEX
TyseEX

πŸ› + TyseEX
TyseEX

πŸ› Victor Nilsson
Victor Nilsson

🌍 Wang Zishi
Wang Zishi

🌍 Yevhen
Yevhen

🌍 ZEROF
ZEROF

πŸ’΅ ZeroDot1
ZeroDot1

🎨 ️️️️♿️ clr
clr

πŸ“– 🌍 - ervinpopescu
ervinpopescu

🌍 + ervinpopescu
ervinpopescu

🌍 glitsj16
glitsj16

πŸ“¦ guilherme-demarchi
guilherme-demarchi

🌍 hirotake111
hirotake111

🌍 luca3s
luca3s

🌍 pia
pia

🌍 pin
pin

πŸ“¦ - shu-kitamura
shu-kitamura

πŸ’» + shu-kitamura
shu-kitamura

πŸ’» starccy
starccy

πŸ’» tiansheng li
tiansheng li

πŸ’΅ vtiinanen
vtiinanen

🌍 From a1f4520a72f9e3b82b1b3170a83d1f5e67bdbdce Mon Sep 17 00:00:00 2001 From: GyulyVGC Date: Fri, 2 May 2025 22:09:45 +0200 Subject: [PATCH 11/14] update .dockerignore and docker.yml --- .dockerignore | 28 ++++++++++-------- .github/workflows/docker.yml | 56 ++++++++++++++++++------------------ 2 files changed, 44 insertions(+), 40 deletions(-) diff --git a/.dockerignore b/.dockerignore index 8ff7a6ad..50d4dff2 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,12 +1,16 @@ -/target -.git -.gitignore -.github -*.md -Dockerfile -.dockerignore -LICENSE-APACHE -LICENSE-MIT -*.sh -.editorconfig -.gitattributes +# Ignore everything +* + +# Explicitly allow files +!src/**/*.rs +!build.rs +!Cargo.toml +!Cargo.lock +!Dockerfile +!services.txt +!resources/countries_flags/**/*.svg +!resources/DB/*.mmdb +!resources/fonts/subset/*.ttf +!resources/logos/raw/icon.png +!resources/packaging/windows/graphics/sniffnet.ico +!resources/sounds/*.mp3 diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index c41d70b5..a4db437b 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -8,36 +8,36 @@ jobs: name: Docker Build runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v4 + - name: Checkout + uses: actions/checkout@v4 - - name: Extract version from Cargo.toml - id: cargo-version - run: | - VERSION=$(grep -m1 "^version" Cargo.toml | cut -d'"' -f2) - echo "VERSION=$VERSION" >> $GITHUB_ENV - echo "version=$VERSION" >> $GITHUB_OUTPUT + - name: Extract version from Cargo.toml + id: cargo-version + run: | + VERSION=v$(grep -m1 "^version" Cargo.toml | cut -d'"' -f2) + echo "VERSION=$VERSION" >> $GITHUB_ENV + echo "version=$VERSION" >> $GITHUB_OUTPUT - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 - - name: Login to GitHub Container Registry - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GHCR_TOKEN }} - - name: Build and push - uses: docker/build-push-action@v5 - with: - context: . - platforms: linux/amd64,linux/arm64,linux/386,linux/arm/v7 - push: true - tags: | - ghcr.io/${{ github.repository }}:latest - ghcr.io/${{ github.repository }}:${{ env.VERSION }} - ghcr.io/${{ github.repository }}:${{ github.sha }} + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: . + platforms: linux/amd64,linux/arm64,linux/386,linux/arm/v7 + push: true + tags: | + ghcr.io/${{ github.repository }}:latest + ghcr.io/${{ github.repository }}:${{ env.VERSION }} + ghcr.io/${{ github.repository }}:${{ github.sha }} From 1f9385041a8d1decc772e73549803aace3618d7f Mon Sep 17 00:00:00 2001 From: GyulyVGC Date: Fri, 2 May 2025 22:49:07 +0200 Subject: [PATCH 12/14] update README and CHANGELOG --- CHANGELOG.md | 1 + README.md | 229 ++------------------------------------------------- 2 files changed, 8 insertions(+), 222 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 41a5eef6..0b307031 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ All Sniffnet releases with the relative changes are documented in this file. - Identify and tag unassigned/reserved "bogon" IP addresses ([#678](https://github.com/GyulyVGC/sniffnet/pull/678) β€” fixes [#209](https://github.com/GyulyVGC/sniffnet/issues/209)) - Show data agglomerates in _Inspect_ page table ([#684](https://github.com/GyulyVGC/sniffnet/pull/684) β€” fixes [#601](https://github.com/GyulyVGC/sniffnet/issues/601)) - Added Traditional Chinese (Taiwan) translation πŸ‡ΉπŸ‡Ό ([#774](https://github.com/GyulyVGC/sniffnet/pull/774)) +- A Docker image of Sniffnet is now available ([#735](https://github.com/GyulyVGC/sniffnet/pull/735)) - Updated some of the existing translations to v1.3: - Portuguese ([#690](https://github.com/GyulyVGC/sniffnet/pull/690)) - Ukrainian ([#692](https://github.com/GyulyVGC/sniffnet/pull/692)) diff --git a/README.md b/README.md index 17f8423f..d8bb4c9a 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,7 @@ Translated in:

+ ## _Support Sniffnet's development_ πŸ’– Sniffnet is completely free, open-source software which needs lots of effort and time to develop and maintain. @@ -55,6 +56,7 @@ Do you want to help the project in an alternative way? You can also head to the Jan Walter

+ ## Download | Windows | macOS | Linux (.deb) | Linux (.rpm) | @@ -62,231 +64,12 @@ Do you want to help the project in an alternative way? You can also head to the |         [64‑bit](https://github.com/GyulyVGC/sniffnet/releases/latest/download/Sniffnet_Windows_64-bit.msi) \| [32‑bit](https://github.com/GyulyVGC/sniffnet/releases/latest/download/Sniffnet_Windows_32-bit.msi)         | [Intel](https://github.com/GyulyVGC/sniffnet/releases/latest/download/Sniffnet_macOS_Intel.dmg) \| [Apple silicon](https://github.com/GyulyVGC/sniffnet/releases/latest/download/Sniffnet_macOS_AppleSilicon.dmg) | [amd64](https://github.com/GyulyVGC/sniffnet/releases/latest/download/Sniffnet_LinuxDEB_amd64.deb) \| [arm64](https://github.com/GyulyVGC/sniffnet/releases/latest/download/Sniffnet_LinuxDEB_arm64.deb) \| [i386](https://github.com/GyulyVGC/sniffnet/releases/latest/download/Sniffnet_LinuxDEB_i386.deb) \| [armhf](https://github.com/GyulyVGC/sniffnet/releases/latest/download/Sniffnet_LinuxDEB_armhf.deb) |         [x86_64](https://github.com/GyulyVGC/sniffnet/releases/latest/download/Sniffnet_LinuxRPM_x86_64.rpm) \| [aarch64](https://github.com/GyulyVGC/sniffnet/releases/latest/download/Sniffnet_LinuxRPM_aarch64.rpm)         | Links in the table above will download the latest version of Sniffnet directly from [GitHub releases](https://github.com/GyulyVGC/sniffnet/releases).
+Not what you're looking for? Check out [alternative installation methods](https://github.com/GyulyVGC/sniffnet/wiki/Alternative-installation-methods). > [!NOTE] > > Remember to also install the [required dependencies](https://github.com/GyulyVGC/sniffnet/wiki/Required-dependencies) for your operating system. -**Alternative installation methods** are reported in the following: - -
- - from Crates.io - -Follow this method only if you have [Rust installed](https://www.rust-lang.org/tools/install) on your machine.
-In this case, the application binary can be built and installed with: - -```sh -cargo install sniffnet --locked -``` - -
- -
- - from Homebrew - - You can install [Sniffnet Homebrew package](https://github.com/Homebrew/homebrew-core/pkgs/container/core%2Fsniffnet) with: - - ```sh -brew install sniffnet -``` - -
- -
- - from Nixpkgs - - You can install [Sniffnet Nix package](https://search.nixos.org/packages?channel=23.05&show=sniffnet&from=0&size=50&sort=relevance&type=packages&query=sniffnet) adding the following Nix code to your NixOS Configuration, usually located in `/etc/nixos/configuration.nix`: - - ```nix - environment.systemPackages = [ - pkgs.sniffnet - ]; -``` - - Alternatively, you can install it in your home using [Home Manager](https://github.com/nix-community/home-manager) with: - - ```nix - home.packages = [ - pkgs.sniffnet - ]; -``` - - Alternatively, you can try it in a shell with: - - ```sh -nix-shell -p sniffnet -``` - -
- -
- - on Arch Linux - - You can install Sniffnet community package via [pacman](https://wiki.archlinux.org/title/Pacman): - - ```sh -pacman -S sniffnet -``` - -
- -
- - on FreeBSD - -You can install Sniffnet port with: - - ```sh -pkg install sniffnet -``` - -
- -
- - on NetBSD - -You can install Sniffnet from the official repositories via [pkgin](https://pkgin.net): - - ```sh -pkgin install sniffnet -``` - -
-
- - on Tiny Core Linux - -You can install Sniffnet from the official repository with: - - ``` -tce-load -wi sniffnet -``` - -
- -
- - Using Docker - -## Docker - -Sniffnet can be run in a Docker container. This is especially useful for quickly testing the application without installing all dependencies directly on your system. - -### Pull from GitHub Container Registry - -The easiest way to get started is by pulling the pre-built image from GitHub Container Registry: - -```sh -# Pull the latest version -docker pull ghcr.io/gyulyvgc/sniffnet:latest - -# Or pull a specific version -docker pull ghcr.io/gyulyvgc/sniffnet:1.2.3 # Replace with actual version -``` - -### Running the Docker container - -To run Sniffnet in a Docker container on Linux, you need to grant the appropriate network permissions and configure display access: - -#### For Wayland - -```sh -docker run -it \ - --net=host \ - -v $XDG_RUNTIME_DIR/$WAYLAND_DISPLAY:/tmp/$WAYLAND_DISPLAY \ - -e WAYLAND_DISPLAY=$WAYLAND_DISPLAY \ - -e XDG_RUNTIME_DIR=/tmp \ - -e RUST_BACKTRACE=full \ - -e ICED_BACKEND=tiny-skia \ - --cap-add=NET_ADMIN \ - --cap-add=NET_RAW \ - ghcr.io/gyulyvgc/sniffnet:latest -``` - -#### For X11 - -```sh -docker run -it \ - --net=host \ - -e DISPLAY=$DISPLAY \ - -v /tmp/.X11-unix:/tmp/.X11-unix \ - -e RUST_BACKTRACE=full \ - -e ICED_BACKEND=tiny-skia \ - --cap-add=NET_ADMIN \ - --cap-add=NET_RAW \ - ghcr.io/gyulyvgc/sniffnet:latest -``` - -> [!NOTE] -> -> - The `--net=host` flag is required for Sniffnet to access your network interfaces. -> - `--cap-add=NET_ADMIN` and `--cap-add=NET_RAW` are needed for packet capture capabilities. -> - If you experience rendering issues, the `ICED_BACKEND=tiny-skia` environment variable switches to the software renderer. - -### Building your own Docker image - -If you prefer to build the Docker image yourself: - -```sh -# Clone the repository -git clone https://github.com/GyulyVGC/sniffnet.git -cd sniffnet - -# Build the Docker image -docker build -t sniffnet . - -# Run with the same parameters as above, but using your local image -docker run -it --net=host [...other parameters] sniffnet -``` - -### Troubleshooting Docker setup - -If you encounter issues: - -1. Make sure you have the necessary permissions to run Docker commands (or use `sudo`) -2. For GUI issues, ensure your host display server allows connections from Docker -3. If you're using SELinux, you might need to adjust policies or temporarily set it to permissive mode - -For X11, you may need to allow Docker to connect to your X server: - -```sh -xhost +local:docker -``` - -Remember to revert this change when done: - -```sh -xhost -local:docker -``` - -#### For ARM64/aarch64 systems (like Apple Silicon Macs or Raspberry Pi) - -When running on ARM64 architecture, you may encounter X11 library errors such as: - -- `OsError XNotSupported libraryopenerror libX11-xcb.so.1 cannot open shared object file no such file or directory` -- `libxkbcommon-x11.so could not be loaded` - -To resolve these issues, mount the host system's ARM64 libraries into the container: - -```sh -sudo docker run -d \ - --net=host \ - --cap-add=NET_ADMIN \ - -v /tmp/.X11-unix:/tmp/.X11-unix \ - -v $HOME/.Xauthority:/root/.Xauthority \ - -v /lib/aarch64-linux-gnu:/lib/aarch64-linux-gnu \ - -e DISPLAY=$DISPLAY \ - --name sniffnet \ - ghcr.io/gyulyvgc/sniffnet:latest -``` - -
- ## Features - πŸ’» choose a **network adapter** of your PC to inspect @@ -328,7 +111,7 @@ The Wiki includes step-by-step guides, tips, examples of usage, and answers to f Most of the errors that may arise are likely due to your system missing dependencies required to correctly analyze a network adapter.
-Check the [required dependencies page](https://github.com/GyulyVGC/sniffnet/wiki/Required-dependencies) +Check the [required dependencies page](https://github.com/GyulyVGC/sniffnet/wiki/Required-dependencies) for instructions on how to proceed depending on your operating system. ### Rendering problems @@ -347,6 +130,7 @@ ICED_BACKEND=tiny-skia + ## Acknowledgements - A big shout-out to [all the contributors](https://github.com/GyulyVGC/sniffnet/blob/main/CONTRIBUTORS.md) of Sniffnet! @@ -354,6 +138,7 @@ ICED_BACKEND=tiny-skia - IP geolocation and ASN data are provided by [MaxMind](https://www.maxmind.com) - Last but not least, thanks to [every single stargazer](https://github.com/GyulyVGC/sniffnet/stargazers): all forms of support made it possible to keep improving Sniffnet! + ## Stay in the loop Wait... there's more!
Sniffnet is rapidly evolving, and new features are added on a regular basis.
@@ -365,4 +150,4 @@ Follow the news and Sniffnet soci Mastodon  Telegram  Twitter / X - + \ No newline at end of file From f8f461921a140091dd1680d06a9f3d726f4c931a Mon Sep 17 00:00:00 2001 From: GyulyVGC Date: Fri, 2 May 2025 23:18:42 +0200 Subject: [PATCH 13/14] update docker.yml --- .github/workflows/docker.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index a4db437b..ff453b00 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -28,7 +28,7 @@ jobs: uses: docker/login-action@v3 with: registry: ghcr.io - username: ${{ github.actor }} + username: GyulyVGC password: ${{ secrets.GHCR_TOKEN }} - name: Build and push @@ -38,6 +38,6 @@ jobs: platforms: linux/amd64,linux/arm64,linux/386,linux/arm/v7 push: true tags: | - ghcr.io/${{ github.repository }}:latest - ghcr.io/${{ github.repository }}:${{ env.VERSION }} - ghcr.io/${{ github.repository }}:${{ github.sha }} + ghcr.io/gyulyvgc/sniffnet:latest + ghcr.io/gyulyvgc/sniffnet:${{ env.VERSION }} + ghcr.io/gyulyvgc/sniffnet:${{ github.sha }} From 73774e5c2082c0a73ca79b9a48c122afe0951c58 Mon Sep 17 00:00:00 2001 From: GyulyVGC Date: Sat, 3 May 2025 09:04:38 +0200 Subject: [PATCH 14/14] update docker.yml --- .github/workflows/docker.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index ff453b00..35afb8d6 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -35,9 +35,8 @@ jobs: uses: docker/build-push-action@v5 with: context: . - platforms: linux/amd64,linux/arm64,linux/386,linux/arm/v7 + platforms: linux/amd64,linux/arm64 push: true tags: | ghcr.io/gyulyvgc/sniffnet:latest ghcr.io/gyulyvgc/sniffnet:${{ env.VERSION }} - ghcr.io/gyulyvgc/sniffnet:${{ github.sha }}