try setup again
All checks were successful
Build and Deploy MITM Webserver / build (push) Successful in 9s
All checks were successful
Build and Deploy MITM Webserver / build (push) Successful in 9s
This commit is contained in:
@@ -66,48 +66,35 @@ pip install --upgrade pip
|
|||||||
# -----------------------------
|
# -----------------------------
|
||||||
# nDPI installieren (system lib + python bindings)
|
# nDPI installieren (system lib + python bindings)
|
||||||
# -----------------------------
|
# -----------------------------
|
||||||
|
NDPIDIR="/tmp/nDPI"
|
||||||
|
|
||||||
if ! ldconfig -p | grep -q "libndpi"; then
|
if ! ldconfig -p | grep -q "libndpi"; then
|
||||||
echo "==> Build and install nDPI library"
|
echo "==> Build and install nDPI library"
|
||||||
NDPIDIR="/tmp/nDPI"
|
|
||||||
rm -rf "$NDPIDIR"
|
rm -rf "$NDPIDIR"
|
||||||
git clone --depth 1 https://github.com/ntop/nDPI.git "$NDPIDIR"
|
git clone --depth 1 https://github.com/ntop/nDPI.git "$NDPIDIR"
|
||||||
cd "$NDPIDIR"
|
cd "$NDPIDIR"
|
||||||
./autogen.sh
|
./autogen.sh
|
||||||
./configure --prefix=/usr
|
./configure
|
||||||
make -j"$(nproc)"
|
make -j"$(nproc)"
|
||||||
make install
|
make install
|
||||||
ldconfig
|
ldconfig
|
||||||
else
|
else
|
||||||
echo "==> nDPI library already installed"
|
echo "==> nDPI library already installed"
|
||||||
|
# Keep python bindings source in sync with official instructions.
|
||||||
|
if [ ! -d "$NDPIDIR/python" ]; then
|
||||||
|
rm -rf "$NDPIDIR"
|
||||||
|
git clone --depth 1 https://github.com/ntop/nDPI.git "$NDPIDIR"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
patch_ndpi_python_metadata() {
|
if [ -d "$NDPIDIR/python" ]; then
|
||||||
local py_dir="$1"
|
|
||||||
local patched=0
|
|
||||||
if [ -f "$py_dir/pyproject.toml" ] && grep -q "PACK_ON" "$py_dir/pyproject.toml"; then
|
|
||||||
sed -i 's/PACK_ON/"0.0.0"/g' "$py_dir/pyproject.toml"
|
|
||||||
patched=1
|
|
||||||
fi
|
|
||||||
if [ -f "$py_dir/setup.cfg" ] && grep -q "PACK_ON" "$py_dir/setup.cfg"; then
|
|
||||||
sed -i 's/PACK_ON/0.0.0/g' "$py_dir/setup.cfg"
|
|
||||||
patched=1
|
|
||||||
fi
|
|
||||||
if [ -f "$py_dir/setup.py" ] && grep -q "PACK_ON" "$py_dir/setup.py"; then
|
|
||||||
sed -i "s/PACK_ON/'0.0.0'/g" "$py_dir/setup.py"
|
|
||||||
patched=1
|
|
||||||
fi
|
|
||||||
if [ "$patched" -eq 1 ]; then
|
|
||||||
echo "==> Applied PACK_ON metadata workaround for nDPI python bindings"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
if [ -d "/tmp/nDPI/python" ]; then
|
|
||||||
echo "==> Install nDPI Python bindings"
|
echo "==> Install nDPI Python bindings"
|
||||||
patch_ndpi_python_metadata "/tmp/nDPI/python"
|
cd "$NDPIDIR/python"
|
||||||
# nDPI bindings currently fail with newer build backends on some hosts
|
python3 -m pip install --upgrade pip
|
||||||
# (e.g. metadata parsing errors such as "cannot parse PACK_ON").
|
if ! python3 -m pip install -r dev_requirements.txt; then
|
||||||
pip install "setuptools<81" "packaging<25" wheel
|
echo "==> WARNING: failed to install nDPI python dev_requirements"
|
||||||
if ! pip install --no-build-isolation /tmp/nDPI/python; then
|
fi
|
||||||
|
if ! python3 -m pip install .; then
|
||||||
echo "==> WARNING: nDPI Python bindings install failed, backend will run without DPI enrichment"
|
echo "==> WARNING: nDPI Python bindings install failed, backend will run without DPI enrichment"
|
||||||
else
|
else
|
||||||
if python - <<'PY'
|
if python - <<'PY'
|
||||||
@@ -129,6 +116,7 @@ PY
|
|||||||
echo "==> WARNING: nDPI installed but import failed in backend venv"
|
echo "==> WARNING: nDPI installed but import failed in backend venv"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
cd "$BACKEND_DIR"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd "$BACKEND_DIR"
|
cd "$BACKEND_DIR"
|
||||||
@@ -270,10 +258,16 @@ npm run build
|
|||||||
# Backend Dependencies
|
# Backend Dependencies
|
||||||
cd $BACKEND_DIR
|
cd $BACKEND_DIR
|
||||||
source venv/bin/activate
|
source venv/bin/activate
|
||||||
|
NDPIDIR="/tmp/nDPI"
|
||||||
|
if [ ! -d "$NDPIDIR/python" ]; then
|
||||||
|
rm -rf "$NDPIDIR"
|
||||||
|
git clone --branch dev --depth 1 https://github.com/ntop/nDPI.git "$NDPIDIR"
|
||||||
|
fi
|
||||||
if [ -d "/tmp/nDPI/python" ]; then
|
if [ -d "/tmp/nDPI/python" ]; then
|
||||||
patch_ndpi_python_metadata "/tmp/nDPI/python"
|
cd "$NDPIDIR/python"
|
||||||
pip install "setuptools<81" "packaging<25" wheel
|
python3 -m pip install --upgrade pip
|
||||||
if ! pip install --no-build-isolation /tmp/nDPI/python; then
|
python3 -m pip install -r dev_requirements.txt || true
|
||||||
|
if ! python3 -m pip install .; then
|
||||||
echo "WARNING: nDPI Python bindings install failed during runner build"
|
echo "WARNING: nDPI Python bindings install failed during runner build"
|
||||||
else
|
else
|
||||||
python - <<'PY' || echo "WARNING: nDPI import check failed during runner build"
|
python - <<'PY' || echo "WARNING: nDPI import check failed during runner build"
|
||||||
@@ -288,6 +282,7 @@ for name in ("ndpi", "pyndpi"):
|
|||||||
raise SystemExit(1)
|
raise SystemExit(1)
|
||||||
PY
|
PY
|
||||||
fi
|
fi
|
||||||
|
cd $BACKEND_DIR
|
||||||
fi
|
fi
|
||||||
pip install -r requirements.txt
|
pip install -r requirements.txt
|
||||||
deactivate
|
deactivate
|
||||||
|
|||||||
Reference in New Issue
Block a user