diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 280ecd9..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,361 +0,0 @@ -version: 2.1 -jobs: - build_debian: - parameters: - docker_image: - type: string - wget_arguments: - type: string - default: "" - installer_arguments: - type: string - default: "" - # We run it before running any commands on image - prepare_command: - type: string - default: "true" - # We run it before running any commands during preparation phase for systemd enabled Docker container - systemd_prepare_command: - type: string - default: "true" - # We need it as official upstream packages use another path - fastnetmon_daemon_path: - type: string - default: "/usr/bin/fastnetmon" - resource_class: - type: string - default: medium - installer_file_name: - type: string - default: installer - machine_image: - type: string - default: "ubuntu-2204:current" - machine: - image: << parameters.machine_image >> - resource_class: << parameters.resource_class >> - steps: - # Prepare image with systemd enabled - - run: echo -e "FROM << parameters.docker_image >>\n" > Dockerfile - - run: echo -e "ENV DEBIAN_FRONTEND noninteractive\n" >> Dockerfile - - run: echo -e "RUN << parameters.systemd_prepare_command >>\n" >> Dockerfile - - run: echo -e "RUN apt-get update; apt-get install -y systemd systemd-sysv\n" >> Dockerfile - - run: echo -e "CMD [\"/lib/systemd/systemd\"]" >> Dockerfile - - run: cat Dockerfile - - run: cat Dockerfile | sudo docker build --tag debian_systemd - - - run: - name: "Deploy new systemd enabled image" - command: sudo docker run -d --privileged --cap-add SYS_ADMIN --name linux_systemd_container debian_systemd /lib/systemd/systemd - - run: sudo docker ps - - run: << parameters.prepare_command >> - - run: sudo docker exec -it linux_systemd_container apt-get update - - run: sudo docker exec -it linux_systemd_container apt-get install -y --force-yes wget - - run: sudo docker exec -it linux_systemd_container wget << parameters.wget_arguments >> https://install.fastnetmon.com/<< parameters.installer_file_name >>?random-argument-to-disable-caching-$CIRCLE_WORKFLOW_JOB_ID -Oinstaller - - run: sudo docker exec -it linux_systemd_container chmod +x installer - - run: sudo docker exec --env "CI=true" -it linux_systemd_container ./installer -install_community_edition << parameters.installer_arguments >> - - run: sudo docker exec -it linux_systemd_container ldd << parameters.fastnetmon_daemon_path >> - - run: sudo docker exec -it linux_systemd_container systemctl status fastnetmon --no-pager - - run: sudo docker exec -it linux_systemd_container ldd /usr/bin/fastnetmon_client - - run: sudo docker exec -it linux_systemd_container ldd /usr/bin/fastnetmon_api_client - - run: sudo docker exec -it linux_systemd_container << parameters.fastnetmon_daemon_path >> --configuration_check - - run: sudo docker exec -it linux_systemd_container << parameters.fastnetmon_daemon_path >> --version - - run: sudo docker exec -it linux_systemd_container /usr/bin/fastnetmon_client --help - build_debian_upstream: - machine: - image: ubuntu-2204:current - parameters: - docker_image: - type: string - steps: - - run: - name: "Prepare image with systemd enabled" - command: echo -e "FROM << parameters.docker_image >>\nENV DEBIAN_FRONTEND noninteractive\nRUN apt-get update; apt-get install -y systemd systemd-sysv; \nCMD [\"/lib/systemd/systemd\"]" | sudo docker build --tag debian_systemd - - - run: - name: "Deploy new systemd enabled image" - command: sudo docker run -d --privileged --cap-add SYS_ADMIN --name linux_systemd_container debian_systemd /lib/systemd/systemd - - run: sudo docker ps - - run: sudo docker exec -it linux_systemd_container apt-get update - - run: sudo docker exec -it linux_systemd_container apt-get install -y fastnetmon - - run: sudo docker exec -it linux_systemd_container systemctl start fastnetmon - - run: sudo docker exec -it linux_systemd_container ldd /usr/sbin/fastnetmon - - run: sudo docker exec -it linux_systemd_container systemctl status fastnetmon --no-pager - - run: sudo docker exec -it linux_systemd_container ldd /usr/bin/fastnetmon_client - - run: sudo docker exec -it linux_systemd_container /usr/sbin/fastnetmon --configuration_check - - run: sudo docker exec -it linux_systemd_container /usr/sbin/fastnetmon --version - - run: sudo docker exec -it linux_systemd_container /usr/bin/fastnetmon_client --help - - run: sudo docker exec --env -it linux_systemd_container ldd /usr/bin/fastnetmon_api_client - build_debian_backports: - machine: - image: ubuntu-2204:current - parameters: - docker_image: - type: string - debian_codename: - type: string - steps: - - run: - name: "Prepare image with systemd enabled" - command: echo -e "FROM << parameters.docker_image >>\nENV DEBIAN_FRONTEND noninteractive\nRUN apt-get update; apt-get install -y systemd systemd-sysv; \nCMD [\"/lib/systemd/systemd\"]" | sudo docker build --tag debian_systemd - - - run: - name: "Deploy new systemd enabled image" - command: sudo docker run -d --privileged --cap-add SYS_ADMIN --name linux_systemd_container debian_systemd /lib/systemd/systemd - - run: sudo docker ps - - run: echo "deb http://deb.debian.org/debian << parameters.debian_codename >>-backports main" | sudo docker exec -i linux_systemd_container tee /etc/apt/sources.list.d/backports.list - - run: sudo docker exec -it linux_systemd_container apt-get update - - run: sudo docker exec -it linux_systemd_container apt-get install -t "<< parameters.debian_codename >>-backports" -y fastnetmon - - run: sudo docker exec -it linux_systemd_container systemctl start fastnetmon - - run: sudo docker exec -it linux_systemd_container ldd /usr/sbin/fastnetmon - - run: sudo docker exec -it linux_systemd_container systemctl status fastnetmon --no-pager - - run: sudo docker exec -it linux_systemd_container ldd /usr/bin/fastnetmon_client - - run: sudo docker exec -it linux_systemd_container /usr/sbin/fastnetmon --configuration_check - - run: sudo docker exec -it linux_systemd_container /usr/sbin/fastnetmon --version - - run: sudo docker exec -it linux_systemd_container /usr/bin/fastnetmon_client --help - debian12_upgrade_from_repo_version: - docker: - - image: debian:bookworm - steps: - - run: apt-get update - - run: apt-get install -y fastnetmon apt-utils - - run: apt-get install -y wget - - run: wget https://install.fastnetmon.com/installer?random-argument-to-disable-caching-$CIRCLE_WORKFLOW_JOB_ID -Oinstaller - - run: chmod +x installer - - run: ./installer -install_community_edition - - store_artifacts: - path: /tmp/fastnetmon_install.log - - run: ldd /usr/bin/fastnetmon - - run: ldd /usr/bin/fastnetmon_client - - run: ldd /usr/bin/fastnetmon_api_client - - run: /usr/bin/fastnetmon --configuration_check - - run: /usr/bin/fastnetmon --version - - run: /usr/bin/fastnetmon_client --help - - run: dpkg -l |grep fastnetmon - build_centos: - parameters: - docker_image: - type: string - wget_arguments: - type: string - default: "" - installer_arguments: - type: string - default: "" - resource_class: - type: string - default: medium - installer_file_name: - type: string - default: installer - machine_image: - type: string - default: "ubuntu-2204:current" - machine: - image: << parameters.machine_image >> - resource_class: << parameters.resource_class >> - steps: - - run: sudo docker run -d --privileged --cap-add SYS_ADMIN --name linux_systemd_container << parameters.docker_image >> /sbin/init - - run: sudo docker exec --env -it linux_systemd_container yum install -y wget - - run: sudo docker exec --env -it linux_systemd_container wget << parameters.wget_arguments >> https://install.fastnetmon.com/<< parameters.installer_file_name >>?random-argument-to-disable-caching-$CIRCLE_WORKFLOW_JOB_ID -Oinstaller - - run: sudo docker exec --env -it linux_systemd_container chmod +x installer - - run: sudo docker exec --env "CI=true" -it linux_systemd_container ./installer -install_community_edition << parameters.installer_arguments >> - - run: sudo docker exec --env -it linux_systemd_container systemctl status fastnetmon --no-pager - - run: sudo docker exec --env -it linux_systemd_container ldd /usr/bin/fastnetmon - - run: sudo docker exec --env -it linux_systemd_container ldd /usr/bin/fastnetmon_client - - run: sudo docker exec --env -it linux_systemd_container ldd /usr/bin/fastnetmon_api_client - - run: sudo docker exec --env -it linux_systemd_container /usr/bin/fastnetmon --configuration_check - - run: sudo docker exec --env -it linux_systemd_container /usr/bin/fastnetmon --version - - run: sudo docker exec --env -it linux_systemd_container /usr/bin/fastnetmon_client --help - centos7: - machine: - # We use older verison as it has support for Cgroups v1 - image: "ubuntu-2004:current" - steps: - - run: sudo docker run -d --privileged --cap-add SYS_ADMIN --name linux_systemd_container centos:centos7 /sbin/init - # CentOS 7 is EOL and we need to fix repos to be able to install anything - - run: sudo docker exec --env -it linux_systemd_container sed -i '/mirrorlist/d' /etc/yum.repos.d/CentOS-Base.repo - - run: sudo docker exec --env -it linux_systemd_container sed -i 's/#baseurl/baseurl/' /etc/yum.repos.d/CentOS-Base.repo - - run: sudo docker exec --env -it linux_systemd_container sed -i 's/mirror.centos.org/vault.centos.org/' /etc/yum.repos.d/CentOS-Base.repo - - run: sudo docker exec --env -it linux_systemd_container yum install -y wget - - run: sudo docker exec --env -it linux_systemd_container wget https://install.fastnetmon.com/installer?random-argument-to-disable-caching-$CIRCLE_WORKFLOW_JOB_ID -Oinstaller - - run: sudo docker exec --env -it linux_systemd_container chmod +x installer - - run: sudo docker exec --env "CI=true" -it linux_systemd_container ./installer -install_community_edition - - run: sudo docker exec --env -it linux_systemd_container systemctl status fastnetmon --no-pager - - run: sudo docker exec --env -it linux_systemd_container ldd /usr/bin/fastnetmon - - run: sudo docker exec --env -it linux_systemd_container ldd /usr/bin/fastnetmon_client - - run: sudo docker exec --env -it linux_systemd_container ldd /usr/bin/fastnetmon_api_client - - run: sudo docker exec --env -it linux_systemd_container /usr/bin/fastnetmon --configuration_check - - run: sudo docker exec --env -it linux_systemd_container /usr/bin/fastnetmon --version - - run: sudo docker exec --env -it linux_systemd_container /usr/bin/fastnetmon_client --help - build_fedora: - machine: - image: ubuntu-2204:current - parameters: - docker_image: - type: string - steps: - - run: - name: "Prepare image with systemd enabled" - command: echo -e "FROM << parameters.docker_image >>\nRUN dnf install -y systemd; \nCMD [\"/lib/systemd/systemd\"]" | sudo docker build --tag fedora_systemd - - - run: - name: "Start Docker with systemd enabled in container" - command: sudo docker run -d --privileged --cap-add SYS_ADMIN --name linux_systemd_container fedora_systemd /sbin/init - - run: sudo docker ps - - run: sudo docker exec -it linux_systemd_container systemctl status --no-pager - - run: sudo docker exec -it linux_systemd_container dnf clean all - - run: sudo docker exec -it linux_systemd_container dnf install -y fastnetmon - - run: sudo docker exec -it linux_systemd_container systemctl enable fastnetmon - - run: sudo docker exec -it linux_systemd_container systemctl start fastnetmon - - run: sudo docker exec -it linux_systemd_container systemctl status fastnetmon --no-pager - - run: sudo docker exec -it linux_systemd_container ldd /usr/sbin/fastnetmon - - run: sudo docker exec -it linux_systemd_container ldd /usr/bin/fastnetmon_client - - run: sudo docker exec -it linux_systemd_container ldd /usr/bin/fastnetmon_api_client - - run: sudo docker exec -it linux_systemd_container /usr/sbin/fastnetmon --configuration_check - - run: sudo docker exec -it linux_systemd_container /usr/sbin/fastnetmon --version - - run: sudo docker exec -it linux_systemd_container /usr/bin/fastnetmon_client --help - build_centos_epel: - machine: - image: ubuntu-2204:current - parameters: - docker_image: - type: string - steps: - - run: sudo docker run -d --privileged --cap-add SYS_ADMIN --name linux_systemd_container << parameters.docker_image >> /sbin/init - - run: sudo docker exec --env -it linux_systemd_container dnf install -y dnf-plugins-core - - run: sudo docker exec --env -it linux_systemd_container dnf config-manager --set-enabled crb - - run: sudo docker exec --env -it linux_systemd_container dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm - - run: sudo docker exec --env -it linux_systemd_container dnf install -y fastnetmon - - run: sudo docker exec -it linux_systemd_container systemctl enable fastnetmon - - run: sudo docker exec -it linux_systemd_container systemctl start fastnetmon - - run: sudo docker exec -it linux_systemd_container systemctl status fastnetmon --no-pager - - run: sudo docker exec -it linux_systemd_container ldd /usr/sbin/fastnetmon - - run: sudo docker exec -it linux_systemd_container ldd /usr/bin/fastnetmon_client - - run: sudo docker exec -it linux_systemd_container ldd /usr/bin/fastnetmon_api_client - - run: sudo docker exec -it linux_systemd_container /usr/sbin/fastnetmon --configuration_check - - run: sudo docker exec -it linux_systemd_container /usr/sbin/fastnetmon --version - - run: sudo docker exec -it linux_systemd_container /usr/bin/fastnetmon_client --help - -# Declare jobs we will run for each commit and nightly -common_jobs: &common_jobs - # We do not produce latest packages for it - #- build_debian: - # name: "Debian 10" - # docker_image: debian:buster - - build_debian: - name: "Debian 11" - docker_image: debian:bullseye - - build_debian: - name: "Debian 11 ARM64" - docker_image: debian:bullseye - installer_arguments: "" - resource_class: "arm.large" - installer_file_name: "installer_arm64" - - build_debian: - name: "Debian 12" - docker_image: debian:bookworm - - build_debian: - name: "Debian 12 ARM64" - docker_image: debian:bookworm - installer_arguments: "" - resource_class: "arm.large" - installer_file_name: "installer_arm64" - # We do not produce latest packages for it - - build_debian: - name: "Ubuntu 16.04" - docker_image: ubuntu:xenial - # We use older verison as it has support for Cgroups v1 - machine_image: "ubuntu-2004:current" - # We do not produce latest packages for it - - build_debian: - name: "Ubuntu 18.04" - docker_image: ubuntu:bionic - - build_debian: - name: "Ubuntu 20.04" - docker_image: ubuntu:focal - - build_debian: - name: "Ubuntu 20.04 ARM64" - docker_image: ubuntu:focal - installer_arguments: "" - resource_class: "arm.large" - installer_file_name: "installer_arm64" - - build_debian: - name: "Ubuntu 22.04" - docker_image: ubuntu:jammy - - build_debian: - name: "Ubuntu 22.04 ARM64" - docker_image: ubuntu:jammy - installer_arguments: "" - resource_class: "arm.large" - installer_file_name: "installer_arm64" - - build_debian: - name: "Ubuntu 24.04" - docker_image: ubuntu:noble - - build_debian: - name: "Ubuntu 24.04 ARM64" - docker_image: ubuntu:noble - installer_arguments: "" - resource_class: "arm.large" - installer_file_name: "installer_arm64" - # We do not produce latest packages for it - - centos7 - - build_centos: - name: "CentOS 8" - docker_image: almalinux:8 - - build_centos: - name: "CentOS 8 ARM64" - docker_image: almalinux:8 - installer_arguments: "" - resource_class: "arm.large" - installer_file_name: "installer_arm64" - - build_centos: - name: "CentOS 9" - docker_image: almalinux:9 - - build_centos: - name: "CentOS 9 ARM64" - docker_image: almalinux:9 - installer_arguments: "" - resource_class: "arm.large" - installer_file_name: "installer_arm64" - - debian12_upgrade_from_repo_version - - build_debian_upstream: - name: "Debian Sid Upstream" - docker_image: debian:sid - - build_debian_upstream: - name: "Debian Bookworm 12 Upstream" - docker_image: debian:bookworm - #- build_debian_backports: - # name: "Debian 11 backports" - # docker_image: debian:bullseye - # debian_codename: "bullseye" - - build_debian_backports: - name: "Debian 12 backports" - docker_image: debian:bookworm - debian_codename: "bookworm" - - build_debian: - name: "Kali Linux Rolling" - docker_image: kalilinux/kali-rolling - - build_fedora: - name: "Fedora 42 upstream" - docker_image: fedora:42 - - build_fedora: - name: "Fedora Rawhide upstream" - docker_image: fedora:rawhide - - build_centos_epel: - name: "CentOS 9 upstream EPEL" - docker_image: almalinux:9 - -# We have two different workflows to trigger same tasks on commit and nightly -workflows: - version: 2 - all_distros_nightly: - jobs: - *common_jobs - triggers: - - schedule: - cron: "30 2 * * *" - filters: - branches: - only: - - master - all_distros: - jobs: - *common_jobs - diff --git a/.github/workflows/build-debian-legacy.yml b/.github/workflows/build-debian-legacy.yml new file mode 100644 index 0000000..04c66cb --- /dev/null +++ b/.github/workflows/build-debian-legacy.yml @@ -0,0 +1,110 @@ +name: build-debian-community-legacy + + +on: + workflow_call: + inputs: + docker_image: + type: string + required: true + installer_arguments: + type: string + default: "" + systemd_prepare_command: + type: string + default: "true" + # We need it as official upstream packages use another path + #fastnetmon_daemon_path: + # type: string + # default: "/usr/bin/fastnetmon" + runner: + type: string + default: ubuntu-24.04 + installer_file_name: + type: string + default: installer + mount_cgroup_command: + type: string + default: "" + use_install_package: + type: boolean + default: false + use_installer: + type: boolean + default: false + installer_visual_stack: + type: boolean + default: false + no_systemd: + type: boolean + default: false + +jobs: + build: + runs-on: ${{ inputs.runner }} + steps: + - name: Show environment + run: | + uname -a + uname -m + docker version + docker network inspect bridge + - name: Generate Dockerfile + run: | + cat > Dockerfile <> "$GITHUB_ENV" + echo "FASTNETMON_CLIENT_BIN=$(sudo docker exec linux_systemd_container which fastnetmon_client)" >> "$GITHUB_ENV" + - run: sudo docker exec linux_systemd_container ldd "$FASTNETMON_BIN" + - run: sudo docker exec linux_systemd_container ldd "$FASTNETMON_CLIENT_BIN" + - name: Sleep to give enough time for FastNetMon to start + run: sleep 25 + - run: sudo docker exec linux_systemd_container systemctl status fastnetmon --no-pager + if: ${{ !inputs.no_systemd }} + - run: sudo docker exec linux_systemd_container fastnetmon --version + # Not have this flag yet + #- run: sudo docker exec linux_systemd_container fastnetmon_client --help + - run: sudo docker exec linux_systemd_container dpkg -l | grep fastnetmon diff --git a/.github/workflows/build-debian.yml b/.github/workflows/build-debian.yml new file mode 100644 index 0000000..706b768 --- /dev/null +++ b/.github/workflows/build-debian.yml @@ -0,0 +1,153 @@ +name: build-debian-community + + +on: + workflow_call: + inputs: + docker_image: + type: string + required: true + installer_arguments: + type: string + default: "" + systemd_prepare_command: + type: string + default: "true" + # We need it as official upstream packages use another path + #fastnetmon_daemon_path: + # type: string + # default: "/usr/bin/fastnetmon" + runner: + type: string + default: ubuntu-24.04 + installer_file_name: + type: string + default: installer + mount_cgroup_command: + type: string + default: "" + enable_ipv6: + type: boolean + default: false + use_install_package: + type: boolean + default: false + use_installer: + type: boolean + default: false + installer_visual_stack: + type: boolean + default: false + backports_name: + type: string + default: "" + +jobs: + build: + runs-on: ${{ inputs.runner }} + steps: + - name: Show environment + run: | + uname -a + uname -m + docker version + docker network inspect bridge + - name: Enable IPv6 + if: ${{ inputs.enable_ipv6 }} + run: | + cat <<'EOF' | sudo tee /etc/docker/daemon.json + { + "ipv6": true, + "fixed-cidr-v6": "2001:db8:1::/64", + "ip6tables": true + } + EOF + + sudo systemctl restart docker + + docker network inspect bridge + - name: Generate Dockerfile + run: | + cat > Dockerfile <> "$GITHUB_ENV" + if: ${{ inputs.backports_name != ''}} + + - run: sudo docker exec linux_systemd_container apt-get update + + ## Install via apt install fastnetmon ## + - run: sudo docker exec linux_systemd_container apt-get install $ENABLE_BACKPORTS -y fastnetmon + if: ${{ inputs.use_install_package}} + + ## Install via installer ## + - run: sudo docker exec linux_systemd_container apt install -y wget net-tools + if: ${{ inputs.use_installer}} + - run: sudo docker exec linux_systemd_container wget --no-verbose "https://install.fastnetmon.com/${{ inputs.installer_file_name }}?random-argument-to-disable-caching-${{ github.run_id }}" -Oinstaller + if: ${{ inputs.use_installer}} + - run: sudo docker exec linux_systemd_container chmod +x installer + if: ${{ inputs.use_installer}} + - name: Install community + if: ${{ inputs.use_installer}} + run: sudo docker exec --env "CI=true" linux_systemd_container ./installer -install_community_edition + - name: Install community visual stack + if: ${{ inputs.use_installer && inputs.installer_visual_stack}} + run: sudo docker exec --env "CI=true" linux_systemd_container ./installer -install_graphic_stack_community + + # We run it, since with Debian 13 with installer we install upstream and need this start too + - run: sudo docker exec linux_systemd_container systemctl start fastnetmon + # if: ${{ inputs.use_install_package}} + + ## Find path for ldd and do checks + - name: Find FastNetMon binaries + run: | + echo "FASTNETMON_BIN=$(sudo docker exec linux_systemd_container which fastnetmon)" >> "$GITHUB_ENV" + echo "FASTNETMON_CLIENT_BIN=$(sudo docker exec linux_systemd_container which fastnetmon_client)" >> "$GITHUB_ENV" + echo "FASTNETMON_API_CLIENT_BIN=$(sudo docker exec linux_systemd_container which fastnetmon_api_client)" >> "$GITHUB_ENV" + - run: sudo docker exec linux_systemd_container ldd "$FASTNETMON_BIN" + - run: sudo docker exec linux_systemd_container ldd "$FASTNETMON_CLIENT_BIN" + - run: sudo docker exec linux_systemd_container ldd "$FASTNETMON_API_CLIENT_BIN" + - name: Sleep to give enough time for FastNetMon to start + run: sleep 25 + - run: sudo docker exec linux_systemd_container systemctl status fastnetmon --no-pager + - run: sudo docker exec linux_systemd_container fastnetmon --configuration_check --log_to_console + - run: sudo docker exec linux_systemd_container fastnetmon --version + - run: sudo docker exec linux_systemd_container fastnetmon_client --help + - run: sudo docker exec linux_systemd_container dpkg -l | grep fastnetmon diff --git a/.github/workflows/build-redhat-centos7.yml b/.github/workflows/build-redhat-centos7.yml new file mode 100644 index 0000000..3700f06 --- /dev/null +++ b/.github/workflows/build-redhat-centos7.yml @@ -0,0 +1,114 @@ +name: build-rhel-community-centos7 + + +on: + workflow_call: + inputs: + docker_image: + type: string + required: true + installer_arguments: + type: string + default: "" + systemd_prepare_command: + type: string + default: "true" + # We need it as official upstream packages use another path + #fastnetmon_daemon_path: + # type: string + # default: "/usr/bin/fastnetmon" + runner: + type: string + default: ubuntu-24.04 + installer_file_name: + type: string + default: installer + mount_cgroup_command: + type: string + default: "" + enable_ipv6: + type: boolean + default: false + use_install_package: + type: boolean + default: false + use_installer: + type: boolean + default: false + installer_visual_stack: + type: boolean + default: false + packet_manager: + type: string + default: yum + +jobs: + build: + runs-on: ${{ inputs.runner }} + steps: + - name: Show environment + run: | + uname -a + uname -m + docker version + docker network inspect bridge + - name: Enable IPv6 + if: ${{ inputs.enable_ipv6 }} + run: | + cat <<'EOF' | sudo tee /etc/docker/daemon.json + { + "ipv6": true, + "fixed-cidr-v6": "2001:db8:1::/64", + "ip6tables": true + } + EOF + + sudo systemctl restart docker + + docker network inspect bridge + + - run: sudo docker run -d --privileged --cap-add SYS_ADMIN ${{ inputs.mount_cgroup_command }} --name linux_systemd_container ${{ inputs.docker_image }} /sbin/init + + - run: sudo docker ps -a + - run: sleep 25 + + + + - run: sudo docker exec linux_systemd_container sed -i '/mirrorlist/d' /etc/yum.repos.d/CentOS-Base.repo + - run: sudo docker exec linux_systemd_container sed -i 's/#baseurl/baseurl/' /etc/yum.repos.d/CentOS-Base.repo + - run: sudo docker exec linux_systemd_container sed -i 's/mirror.centos.org/vault.centos.org/' /etc/yum.repos.d/CentOS-Base.repo + + + - run: sudo docker exec linux_systemd_container ${{ inputs.packet_manager}} install -y which + + ## Install via installer ## + - run: sudo docker exec linux_systemd_container ${{ inputs.packet_manager}} install -y wget + if: ${{ inputs.use_installer}} + - run: sudo docker exec linux_systemd_container wget --no-verbose "https://install.fastnetmon.com/${{ inputs.installer_file_name }}?random-argument-to-disable-caching-${{ github.run_id }}" -Oinstaller + if: ${{ inputs.use_installer}} + - run: sudo docker exec linux_systemd_container chmod +x installer + if: ${{ inputs.use_installer}} + - name: Install community + if: ${{ inputs.use_installer}} + run: sudo docker exec --env "CI=true" linux_systemd_container ./installer -install_community_edition + - name: Install community visual stack + if: ${{ inputs.use_installer && inputs.installer_visual_stack}} + run: sudo docker exec --env "CI=true" linux_systemd_container ./installer -install_graphic_stack_community + + + + ## Find path for ldd and do checks + - name: Find FastNetMon binaries + run: | + echo "FASTNETMON_BIN=$(sudo docker exec linux_systemd_container which fastnetmon)" >> "$GITHUB_ENV" + echo "FASTNETMON_CLIENT_BIN=$(sudo docker exec linux_systemd_container which fastnetmon_client)" >> "$GITHUB_ENV" + echo "FASTNETMON_API_CLIENT_BIN=$(sudo docker exec linux_systemd_container which fastnetmon_api_client)" >> "$GITHUB_ENV" + - run: sudo docker exec linux_systemd_container ldd "$FASTNETMON_BIN" + - run: sudo docker exec linux_systemd_container ldd "$FASTNETMON_CLIENT_BIN" + - run: sudo docker exec linux_systemd_container ldd "$FASTNETMON_API_CLIENT_BIN" + - name: Sleep to give enough time for FastNetMon to start + run: sleep 25 + - run: sudo docker exec linux_systemd_container fastnetmon --configuration_check --log_to_console + - run: sudo docker exec linux_systemd_container fastnetmon --version + - run: sudo docker exec linux_systemd_container fastnetmon_client --help + - run: sudo docker exec linux_systemd_container rpm -qa | grep fastnetmon diff --git a/.github/workflows/build-redhat-fedora.yml b/.github/workflows/build-redhat-fedora.yml new file mode 100644 index 0000000..3e090f2 --- /dev/null +++ b/.github/workflows/build-redhat-fedora.yml @@ -0,0 +1,91 @@ +name: build-rhel-community + + +on: + workflow_call: + inputs: + docker_image: + type: string + required: true + systemd_prepare_command: + type: string + default: "true" + # We need it as official upstream packages use another path + #fastnetmon_daemon_path: + # type: string + # default: "/usr/bin/fastnetmon" + runner: + type: string + default: ubuntu-24.04 + mount_cgroup_command: + type: string + default: "" + +jobs: + build: + runs-on: ${{ inputs.runner }} + steps: + - name: Show environment + run: | + uname -a + uname -m + docker version + docker network inspect bridge + + + - name: Generate Dockerfile + run: | + cat > Dockerfile <> "$GITHUB_ENV" + echo "FASTNETMON_CLIENT_BIN=$(sudo docker exec linux_systemd_container which fastnetmon_client)" >> "$GITHUB_ENV" + echo "FASTNETMON_API_CLIENT_BIN=$(sudo docker exec linux_systemd_container which fastnetmon_api_client)" >> "$GITHUB_ENV" + - run: sudo docker exec linux_systemd_container ldd "$FASTNETMON_BIN" + - run: sudo docker exec linux_systemd_container ldd "$FASTNETMON_CLIENT_BIN" + - run: sudo docker exec linux_systemd_container ldd "$FASTNETMON_API_CLIENT_BIN" + - name: Sleep to give enough time for FastNetMon to start + run: sleep 25 + - run: sudo docker exec linux_systemd_container systemctl status fastnetmon --no-pager + - run: sudo docker exec linux_systemd_container fastnetmon --configuration_check --log_to_console + - run: sudo docker exec linux_systemd_container fastnetmon --version + - run: sudo docker exec linux_systemd_container fastnetmon_client --help + - run: sudo docker exec linux_systemd_container rpm -qa | grep fastnetmon diff --git a/.github/workflows/build-redhat.yml b/.github/workflows/build-redhat.yml new file mode 100644 index 0000000..32cbf01 --- /dev/null +++ b/.github/workflows/build-redhat.yml @@ -0,0 +1,139 @@ +name: build-rhel-community + + +on: + workflow_call: + inputs: + docker_image: + type: string + required: true + installer_arguments: + type: string + default: "" + systemd_prepare_command: + type: string + default: "true" + # We need it as official upstream packages use another path + #fastnetmon_daemon_path: + # type: string + # default: "/usr/bin/fastnetmon" + runner: + type: string + default: ubuntu-24.04 + installer_file_name: + type: string + default: installer + mount_cgroup_command: + type: string + default: "" + enable_ipv6: + type: boolean + default: false + use_install_package: + type: boolean + default: false + use_installer: + type: boolean + default: false + installer_visual_stack: + type: boolean + default: false + packet_manager: + type: string + default: yum + +jobs: + build: + runs-on: ${{ inputs.runner }} + steps: + - name: Show environment + run: | + uname -a + uname -m + docker version + docker network inspect bridge + - name: Enable IPv6 + if: ${{ inputs.enable_ipv6 }} + run: | + cat <<'EOF' | sudo tee /etc/docker/daemon.json + { + "ipv6": true, + "fixed-cidr-v6": "2001:db8:1::/64", + "ip6tables": true + } + EOF + + sudo systemctl restart docker + + docker network inspect bridge + + - run: sudo docker run -d --privileged --cap-add SYS_ADMIN ${{ inputs.mount_cgroup_command }} --name linux_systemd_container ${{ inputs.docker_image }} /sbin/init + + - run: sudo docker ps -a + - run: sleep 10 + - name: Wait for container to start + run: | + sudo docker exec linux_systemd_container bash -lc ' + state="$(systemctl is-system-running --wait || true)" + echo "Systemd state: $state" + case "$state" in + running|degraded) + exit 0 + ;; + # For older systemd (ubuntu 18/rhel 8) + initializing|starting) + sleep 3 + ;; + *) + exit 1 + ;; + esac + ' + - run: sudo docker exec linux_systemd_container systemctl status --no-pager + + + - run: sudo docker exec linux_systemd_container ${{ inputs.packet_manager}} install -y which + + - name: Add epel repo + if: ${{ inputs.use_install_package }} + run: | + sudo docker exec linux_systemd_container ${{ inputs.packet_manager}} install -y dnf-plugins-core + sudo docker exec linux_systemd_container ${{ inputs.packet_manager}} config-manager --set-enabled crb + sudo docker exec linux_systemd_container ${{ inputs.packet_manager}} install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm + - run: sudo docker exec linux_systemd_container ${{ inputs.packet_manager}} install -y fastnetmon + if: ${{ inputs.use_install_package}} + - run: sudo docker exec linux_systemd_container systemctl start fastnetmon + if: ${{ inputs.use_install_package}} + + ## Install via installer ## + - run: sudo docker exec linux_systemd_container ${{ inputs.packet_manager}} install -y wget + if: ${{ inputs.use_installer}} + - run: sudo docker exec linux_systemd_container wget --no-verbose "https://install.fastnetmon.com/${{ inputs.installer_file_name }}?random-argument-to-disable-caching-${{ github.run_id }}" -Oinstaller + if: ${{ inputs.use_installer}} + - run: sudo docker exec linux_systemd_container chmod +x installer + if: ${{ inputs.use_installer}} + - name: Install community + if: ${{ inputs.use_installer}} + run: sudo docker exec --env "CI=true" linux_systemd_container ./installer -install_community_edition + - name: Install community visual stack + if: ${{ inputs.use_installer && inputs.installer_visual_stack}} + run: sudo docker exec --env "CI=true" linux_systemd_container ./installer -install_graphic_stack_community + + + + ## Find path for ldd and do checks + - name: Find FastNetMon binaries + run: | + echo "FASTNETMON_BIN=$(sudo docker exec linux_systemd_container which fastnetmon)" >> "$GITHUB_ENV" + echo "FASTNETMON_CLIENT_BIN=$(sudo docker exec linux_systemd_container which fastnetmon_client)" >> "$GITHUB_ENV" + echo "FASTNETMON_API_CLIENT_BIN=$(sudo docker exec linux_systemd_container which fastnetmon_api_client)" >> "$GITHUB_ENV" + - run: sudo docker exec linux_systemd_container ldd "$FASTNETMON_BIN" + - run: sudo docker exec linux_systemd_container ldd "$FASTNETMON_CLIENT_BIN" + - run: sudo docker exec linux_systemd_container ldd "$FASTNETMON_API_CLIENT_BIN" + - name: Sleep to give enough time for FastNetMon to start + run: sleep 25 + - run: sudo docker exec linux_systemd_container systemctl status fastnetmon --no-pager + - run: sudo docker exec linux_systemd_container fastnetmon --configuration_check --log_to_console + - run: sudo docker exec linux_systemd_container fastnetmon --version + - run: sudo docker exec linux_systemd_container fastnetmon_client --help + - run: sudo docker exec linux_systemd_container rpm -qa | grep fastnetmon diff --git a/.github/workflows/ci-community.yml b/.github/workflows/ci-community.yml new file mode 100644 index 0000000..2ff067e --- /dev/null +++ b/.github/workflows/ci-community.yml @@ -0,0 +1,256 @@ +name: CI community packages + +on: + push: + pull_request: + workflow_dispatch: + schedule: + - cron: "0 2 * * *" # UTC + +concurrency: + group: ci-${{ github.ref }} + cancel-in-progress: true + +jobs: + build_debian_community: + name: ${{ matrix.name }} + uses: ./.github/workflows/build-debian.yml + strategy: + fail-fast: false + matrix: + include: + ### Debian 11 ### + - name: Debian 11 + docker_image: debian:11 + use_installer: true + + - name: Debian 11 ARM + docker_image: debian:11 + use_installer: true + installer_file_name: "installer_arm64" + runner: ubuntu-24.04-arm + + ### Debian 12 ### + + - name: Debian 12 + docker_image: debian:12 + use_installer: true + + - name: Debian 12 ARM + docker_image: debian:12 + use_installer: true + installer_file_name: "installer_arm64" + runner: ubuntu-24.04-arm + + - name: Debian 12 upstream + docker_image: debian:12 + use_install_package: true + + - name: Debian 12 backports + docker_image: debian:12 + use_install_package: true + backports_name: bookworm + + - name: Debian 12 upgrade from repo + docker_image: debian:12 + use_install_package: true + use_installer: true + + ### Debian 13 ### + + - name: Debian 13 + docker_image: debian:13 + use_installer: true + + - name: Debian 13 ARM + docker_image: debian:13 + use_installer: true + installer_file_name: "installer_arm64" + runner: ubuntu-24.04-arm + + - name: Debian 13 upstream + docker_image: debian:13 + use_install_package: true + + - name: Debian 13 upgrade from repo + docker_image: debian:13 + use_install_package: true + use_installer: true + + ### Debian Sid ### + - name: Debian Sid upstream + docker_image: debian:sid + use_install_package: true + + - name: Kali Linux Rolling + docker_image: kalilinux/kali-rolling + use_installer: true + + + ### Ubuntu 20.04 ### + - name: Ubuntu 20.04 + docker_image: ubuntu:20.04 + use_installer: true + + - name: Ubuntu 20.04 ARM + docker_image: ubuntu:20.04 + use_installer: true + installer_file_name: "installer_arm64" + runner: ubuntu-24.04-arm + + ### Ubuntu 22.04 ### + - name: Ubuntu 22.04 + docker_image: ubuntu:22.04 + use_installer: true + + - name: Ubuntu 22.04 ARM + docker_image: ubuntu:22.04 + use_installer: true + installer_file_name: "installer_arm64" + runner: ubuntu-24.04-arm + + ### Ubuntu 24.04 ### + - name: Ubuntu 24.04 + docker_image: ubuntu:24.04 + use_installer: true + + - name: Ubuntu 24.04 ARM + docker_image: ubuntu:24.04 + use_installer: true + installer_file_name: "installer_arm64" + runner: ubuntu-24.04-arm + with: + docker_image: ${{ matrix.docker_image }} + installer_arguments: ${{ matrix.installer_arguments || '' }} + systemd_prepare_command: ${{ matrix.systemd_prepare_command || 'true' }} + mount_cgroup_command: ${{ matrix.mount_cgroup_command || ''}} + installer_file_name: ${{ matrix.installer_file_name || 'installer' }} + runner: ${{ matrix.runner || 'ubuntu-24.04' }} + enable_ipv6: ${{ matrix.enable_ipv6 || false }} + use_installer: ${{ matrix.use_installer || false }} + installer_visual_stack: ${{ matrix.installer_visual_stack || false }} + use_install_package: ${{ matrix.use_install_package || false }} + backports_name: ${{ matrix.backports_name || '' }} + + + build_debian_community_legacy: + name: ${{ matrix.name }} + uses: ./.github/workflows/build-debian-legacy.yml + strategy: + fail-fast: false + matrix: + include: + # We use older verison as it has support for Cgroups v1 + - name: Ubuntu 16.04 + docker_image: ubuntu:16.04 + use_installer: true + runner: ubuntu-22.04 + no_systemd: true + + - name: Ubuntu 18.04 + docker_image: ubuntu:18.04 + use_installer: true + runner: ubuntu-22.04 + + - name: Ubuntu 18.04 upstream + docker_image: ubuntu:18.04 + use_install_package: true + runner: ubuntu-22.04 + with: + docker_image: ${{ matrix.docker_image }} + installer_arguments: ${{ matrix.installer_arguments || '' }} + systemd_prepare_command: ${{ matrix.systemd_prepare_command || 'true' }} + mount_cgroup_command: ${{ matrix.mount_cgroup_command || ''}} + installer_file_name: ${{ matrix.installer_file_name || 'installer' }} + runner: ${{ matrix.runner || 'ubuntu-24.04' }} + use_installer: ${{ matrix.use_installer || false }} + installer_visual_stack: ${{ matrix.installer_visual_stack || false }} + use_install_package: ${{ matrix.use_install_package || false }} + no_systemd: ${{ matrix.no_systemd || false }} + + build_rhel_community: + name: ${{ matrix.name }} + uses: ./.github/workflows/build-redhat.yml + strategy: + fail-fast: false + matrix: + include: + - name: AlmaLinux 8 + docker_image: almalinux:8 + use_installer: true + + - name: AlmaLinux 8 ARM + docker_image: almalinux:8 + use_installer: true + installer_file_name: "installer_arm64" + runner: ubuntu-24.04-arm + + - name: AlmaLinux 9 + docker_image: almalinux:9 + use_installer: true + + - name: AlmaLinux 9 ARM + docker_image: almalinux:9 + use_installer: true + installer_file_name: "installer_arm64" + runner: ubuntu-24.04-arm + + - name: AlmaLinux 9 upstream EPEL + docker_image: almalinux:9 + use_install_package: true + packet_manager: "dnf" + + with: + docker_image: ${{ matrix.docker_image }} + installer_arguments: ${{ matrix.installer_arguments || '' }} + systemd_prepare_command: ${{ matrix.systemd_prepare_command || 'true' }} + mount_cgroup_command: ${{ matrix.mount_cgroup_command || ''}} + installer_file_name: ${{ matrix.installer_file_name || 'installer' }} + runner: ${{ matrix.runner || 'ubuntu-24.04' }} + enable_ipv6: ${{ matrix.enable_ipv6 || false }} + use_installer: ${{ matrix.use_installer || false }} + installer_visual_stack: ${{ matrix.installer_visual_stack || false }} + use_install_package: ${{ matrix.use_install_package || false }} + packet_manager: ${{ matrix.packet_manager || 'yum'}} + + build_rhel_community_centos7: + name: ${{ matrix.name }} + uses: ./.github/workflows/build-redhat-centos7.yml + strategy: + fail-fast: false + matrix: + include: + - name: CentOS 7 + docker_image: centos:centos7 + use_installer: true + runner: ubuntu-22.04 + with: + docker_image: ${{ matrix.docker_image }} + installer_arguments: ${{ matrix.installer_arguments || '' }} + systemd_prepare_command: ${{ matrix.systemd_prepare_command || 'true' }} + mount_cgroup_command: ${{ matrix.mount_cgroup_command || ''}} + installer_file_name: ${{ matrix.installer_file_name || 'installer' }} + runner: ${{ matrix.runner || 'ubuntu-24.04' }} + enable_ipv6: ${{ matrix.enable_ipv6 || false }} + use_installer: ${{ matrix.use_installer || false }} + installer_visual_stack: ${{ matrix.installer_visual_stack || false }} + use_install_package: ${{ matrix.use_install_package || false }} + packet_manager: ${{ matrix.packet_manager || 'yum'}} + + build_rhel_community_fedora: + name: ${{ matrix.name }} + uses: ./.github/workflows/build-redhat-fedora.yml + strategy: + fail-fast: false + matrix: + include: + - name: Fedora 42 upstream + docker_image: fedora:42 + + - name: Fedora rawhide upstream + docker_image: fedora:rawhide + with: + docker_image: ${{ matrix.docker_image }} + systemd_prepare_command: ${{ matrix.systemd_prepare_command || 'true' }} + mount_cgroup_command: ${{ matrix.mount_cgroup_command || ''}} + runner: ${{ matrix.runner || 'ubuntu-24.04' }} \ No newline at end of file