Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ntopng to version 6.2 #6216

Closed
wants to merge 4 commits into from

Conversation

th0ma7
Copy link
Contributor

@th0ma7 th0ma7 commented Aug 30, 2024

Description

Update ntopng to version 6.2

Relates to #6210

Checklist

  • Build rule all-supported completed successfully
  • New installation of package completed successfully
  • Package upgrade completed successfully (Manually install the package again)
  • Package functionality was tested
  • Any needed documentation is updated/created

Type of change

  • Bug fix
  • New Package
  • Package update
  • Includes small framework changes
  • This change requires a documentation update (e.g. Wiki)

@hgy59
Copy link
Contributor

hgy59 commented Aug 30, 2024

@th0ma7 I would like to fix the patches for ntopng 4.2 first (working on it).

@hgy59
Copy link
Contributor

hgy59 commented Aug 30, 2024

@th0ma7 to bypass the need of patching for rw_locks_supported, I modified the ntopng 4.2 cross Makefile like this:

cross_ntopng_Makefile.patch

But since the 6.2 build succeeds, the rw_locks_supported patches seem not to be required anymore...

For your PR here, my proposal is limitted to:

  1. remove the pre_patch target and run autogen.sh as first step in the pre_configure target

both the qoriq and comcerto2k-7.1 build failures seem to have the same cause.
So the libatomic patch for qoriq might be obsolete...

@th0ma7
Copy link
Contributor Author

th0ma7 commented Aug 31, 2024

In parallel I was looking at options to provide necessary privileges to ntopng, I tried the following:

{
        "defaults":{
                "run-as": "package"
        },
        "username": "sc-ntopng",
        "groupname": "synocommunity",
        "tool": [{
                "relpath": "bin/ntopng",
                "user": "package",
                "group": "package",
                "capabilities": "cap_net_raw,cap_net_admin",
                "permission": "0700"
        }]
}

It ends-up blocked at installation time as needing root privileges... not sure there's any way around that besides possibly a wiki info to set that up manually post install, such as

$ sudo setcap cap_net_raw+eip /var/packages/ntopng/target/bin/ntopng

EDIT: This one-liner above allowed ntopng to start! 🚀 - now having an issue with password at first login 🤷

synology documentation: https://help.synology.com/developer-guide/privilege/privilege_config.html

@hgy59
Copy link
Contributor

hgy59 commented Aug 31, 2024

  • now having an issue with password at first login 🤷

I have the same issue with password at first login, but I suppose it is an issue with the webserver/web app or the browser.

Then I modified version 4.2 for DSM 7 (adjusting the paths in start-stop-service script and config file, installing config file into var instead of etc folder, and defining package user in privileges)
Patching the privilege file for root after installation made ntopng 4.2 working on DSM 7.2.

The working login dialog of ntpng 4.2 looks like this (default login admin/admin works and password must be changed before login succeeds):

grafik

But with ntopng 6.2 it looks like this (and default login admin/admin does not work Login failed: invalid username or password.):

initial page:
grafik

login page:
grafik

I guess that something is wrong with the ntopng web ui.

  • it looks like the css/scripting does not work
  • the password might not be handled correctly by the web ui...

Same error on DSM 6 and DSM 7

@hgy59
Copy link
Contributor

hgy59 commented Aug 31, 2024

with ntopng 6.2 build of this PR, the share/ntopng/httpdocs/dist folder is empty
but it should have (at least) the following files

  • third-party.css
  • white-mode.css
  • ntopng.css
  • third-party.js
  • login.js

edit:
may be that all files of https://github.com/ntop/ntopng-dist should be installed into httpdocs/dist folder ${SYNOPKG_PKGDEST}/share/ntopng/httpdocs/dist

@th0ma7
Copy link
Contributor Author

th0ma7 commented Aug 31, 2024

Well this is really good news in a sense that this is heading is a right direction, and most importantly, it buils (at least from my perspective). I would propose the following:

  1. Can you merge your ntopng 4.2 changes + confirm jackett PR is ?ok?
  2. With this I could then rebase the xz and let it re-run
  3. Then I could focus on the python build errors, which should be the last thing standing - actually it looks like failing on 32-bit archs only, I recall facing a similar issue but no clue what i did then?!?
  4. then in parallel get the domino of other non-python pending PR waiting for xz

On a side note, we can then rebase this PR and pursue the work later on. Feel free to push commits as you see fit while I try to solve the python issue by then? Thoughts?

@hgy59
Copy link
Contributor

hgy59 commented Aug 31, 2024

  1. Can you merge your ntopng 4.2 changes + confirm jackett PR is ?ok?

This is not as easy as it seems, I first have to find a more actual commit first, that works with ntopng 4.2 on DSM 7.
My working test is based on commit 5f87395 (10.08.2023) and I used the debian 10 based spksrc image.

@hgy59
Copy link
Contributor

hgy59 commented Aug 31, 2024

@th0ma7 for the ntopng 2.4 branch I have two options, but only debian 11 spksrc image successfully builds.

  1. based on commit 03af560 ntopng 4.2 successfully builds with debian 11 spksrc image
  2. based on current master (commit 9af59c0) ntopng 4.2 build fails with debian 12 spksrc image. The failure is, that while linking ntopng, the curl, mysql and lua libraries can't be found.

@th0ma7
Copy link
Contributor Author

th0ma7 commented Aug 31, 2024

  1. based on current master (commit 9af59c0) ntopng 4.2 build fails with debian 12 spksrc image. The failure is, that while linking ntopng, the curl, mysql and lua libraries can't be found.

@hgy59 have a look at the 6.2 Makefile I revised, I believe the solution may be somewhat close to that. I do the following at the end:

sed -i.orig -e "/^LIBS/s/[[:space:]]\+/ /g" \
            -e "/^LIBS/s/ -l -l/ -l/g" \
            -e "/^LIBS/s/ -lssl -lssl / -lssl /g" \
            -e "/^LIBS/s/ -lssl / -lssl -llua -lmysqlclient /g" \
            -e '/^LIBS/s/$$(LIBPCAP) $$(LUA_LIB) $$(LIBRRDTOOL_LIB)/$$(LIBPCAP) $$(LIBRRDTOOL_LIB)/g' \
            ./Makefile

Basically it :

  1. removes the multiple space (which facilitates later sed exec)
  2. removes the -l -l (I recall there where also empty -l followed by -L in 4.2 version needing attention
  3. removes the duplicate -lssl
  4. most importantly, removes the $$(LUA_LIB) and replaces that with -llua -lmysqlclient (you probably have to add -lcurl for 4.2. To do so I use the -lssl and add to it.

Hopefully this helps, worst case, create a PR and I can have a look at it. If I recall corectly, he reason is that it messes around with local libraries instead of only using the ones from our install prefix.

@th0ma7 th0ma7 force-pushed the misc-updates-ntopng branch from fa5398d to 26cf9d5 Compare September 3, 2024 16:14
@th0ma7
Copy link
Contributor Author

th0ma7 commented Sep 3, 2024

@hgy59 if that is of interest, I did a quick rebase of my changes. I got it to build for the following:

-rw-r--r-- 1 spksrc spksrc 61235200 Sep  3 10:30 ntopng_aarch64-6.2.4_6.2-5.spk
-rw-r--r-- 1 spksrc spksrc 63170560 Sep  3 16:30 ntopng_aarch64-7.1_6.2-5.spk
-rw-r--r-- 1 spksrc spksrc 61040640 Sep  3 10:30 ntopng_armv7-6.2.4_6.2-5.spk
-rw-r--r-- 1 spksrc spksrc 61603840 Sep  3 10:32 ntopng_armv7-7.1_6.2-5.spk
-rw-r--r-- 1 spksrc spksrc 60631040 Sep  3 10:46 ntopng_comcerto2k-7.1_6.2-5.spk
-rw-r--r-- 1 spksrc spksrc 63334400 Sep  3 10:46 ntopng_evansport-6.2.4_6.2-5.spk
-rw-r--r-- 1 spksrc spksrc 63989760 Sep  3 10:48 ntopng_evansport-7.1_6.2-5.spk
-rw-r--r-- 1 spksrc spksrc 60231680 Sep  3 11:02 ntopng_hi3535-6.2.4_6.2-5.spk
-rw-r--r-- 1 spksrc spksrc 62423040 Sep  3 11:01 ntopng_qoriq-6.2.4_6.2-5.spk
-rw-r--r-- 1 spksrc spksrc 63324160 Sep  3 11:03 ntopng_x64-6.2.4_6.2-5.spk
-rw-r--r-- 1 spksrc spksrc 64102400 Sep  3 11:01 ntopng_x64-7.1_6.2-5.spk

@hgy59 hgy59 mentioned this pull request Sep 3, 2024
6 tasks
@th0ma7
Copy link
Contributor Author

th0ma7 commented Sep 3, 2024

closed. superseeded with #6220

@th0ma7 th0ma7 closed this Sep 3, 2024
@th0ma7 th0ma7 deleted the misc-updates-ntopng branch September 3, 2024 23:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants