-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
luci-app-lldpd: Create based on TanoWrt's app #6456
Conversation
Regarding the 'presets' - would it be possible for the user to choose independently of those? |
Please test the following ucode replacement for the Lua rpcd plugin: 'use strict';
import { popen } from 'fs';
function lldpcli_json(section) {
return json(popen(`lldpcli -f json0 show ${section}`, 'r'));
}
return {
lldpd: {
getStatus: {
call: function() {
return {
statistics: lldpcli_json("statistics"),
neighbors: lldpcli_json("neighbors details"),
interfaces: lldpcli_json("interfaces"),
chassis: lldpcli_json("chassis")
};
}
}
}
}; It needs to be placed in |
Is there any particular reason to prefer ucode over Lua? |
Mhh, am I missing something here? EDIT: Works after installing |
One other thing: Since I minimally adjusted the source code in some places, the line numbers in the translation file are no longer correct. How do you regenerate them? |
Is there something like |
It's the future in openwrt. Moving away from lua.
I think recompiling.
OK - I suppose they're common then. User being able to choose and pick themselves would be a plus. |
1cb4c0e
to
1f93194
Compare
Just focus on putting your new strings in, then I think there is a build string step which will build the .po files.
I see. |
@marek22k Would it be possible to obtain |
If someone chooses to write up how to make an opkg of a PR, it might
happen. I usually just ssh the files to my unit and test in situ.
|
Creating a .ipk file for opkg is the normal end result of compiling a package. Applying PRs is pretty straightforward
And then transfer the compiled .ipk to the router. |
I am testing on these devices: Thanks very much, excited to try it out. |
I used the following "instructions" to create the IPK files.
(Please remove the .txt extension. GitHub unfortunately does not allow .7z files) |
Working really well here, the protocol initially didn't come up but I noticed that no interfaces were added in settings. After adding the correct interfaces via Luci it worked perfectly and /etc/config/lldpd is updated and read properly to set lldpd interfaces. |
Tried to compile this on 23.05.0-rc3 but getting errors on the new
LLDPD compiles fine as do other Luci app packages, so something is missing for this new package? I need to build a version for my GS1900 because this is running snapshot due to an error in the 22.03 release on this product which can cause bootloops. |
Mhh, I'm not an expert in building OpenWrt packages either. I would suggest to try the following instructions after applying the patch.
|
thanks. I had followed the commands but somehow repeating those 3 made the build work. appreciate the pointers. |
Unfortunately the resulting packages give some errors on 23.05.0
The page does not show up in Luci after this error. Tried RC2 and RC3 codedbases but get the same error. |
Mhh, the only thing I could do would be to try the whole thing myself in a VM. Maybe someone else here knows how to fix the bug? What I also wonder is which line 20 of uci is meant? I could also imagine that it is somehow because the whole it is snaphot and RC?! Actually I thought the Luci Web App should be quite version independent. |
This is a copy of https://github.com/tano-systems/luci-app-tn-lldpd, which is licensed under the MIT License. Signed-off-by: Marek Küthe <m.k@mk16.de> luci-app-lldpd: Rename luci-app-tn-lldpd to luci-app-lldpd The original version of Tanosystem has a naming scheme which does not correspond to the standard naming scheme in OpenWrt LuCi. Therefore the renaming. Signed-off-by: Marek Küthe <m.k@mk16.de> luci-app-lldpd: Fix bug not getting the current lldpd status Specifying the arguments in the wrong order can (and has in my tests) resulted in errors. So you can see in the man page that flags like -f come first and then the command. Signed-off-by: Marek Küthe <m.k@mk16.de> luci-app-lldpd: Disable option to enable SNMP agent SNMP agent support is not enabled by default in lldpd. This can (and has in my tests) cause LLDP to stop working. See comment in source code. Signed-off-by: Marek Küthe <m.k@mk16.de> luci-app-lldpd: Add option to disable sending sensitive information Added an option that sets the "-k" flag, which results in less sensitive information being sent. See man pages and description in source code. Signed-off-by: Marek Küthe <m.k@mk16.de> luci-app-lldpd: Add license information to Makefile All of Tano Systems source code for the app is licensed under the MIT License. This has now been indicated accordingly in the Makefile. Signed-off-by: Marek Küthe <m.k@mk16.de> luci-app-lldpd: Remove old footer from Tano Systems The app from Tano Systems appears to include a footer. Since most LuCi apps do not, I have removed it. Signed-off-by: Marek Küthe <m.k@mk16.de> luci-app-lldpd: Bug fix caused that the management IP address could not be set. The TanoWrt fork calls the option to set the management IP addresses "lldp_sys_mgmt_ip". However, in OpenWrt it is called "lldp_mgmt_ip". Signed-off-by: Marek Küthe <m.k@mk16.de> luci-app-lldpd: Improve style Remove double space Signed-off-by: Marek Küthe <m.k@mk16.de> luci-app-lldpd: Adding the Lua dependency The rpcd script used by the Luci app is written in Lua. Therefore, runtime dependencies for Lua must exist when using the Luci app. Signed-off-by: Marek Küthe <m.k@mk16.de> luci-app-lldpd: Remove old files Since the app is called luci-app-lldpd and not luci-app-tn-lldpd, the files for the TanoWrt app are no longer necessary. Signed-off-by: Marek Küthe <m.k@mk16.de> luci-app-lldpd: RPCd backend change from Lua to ucode Signed-off-by: Marek Küthe <m.k@mk16.de> luci-app-lldpd: Update filter matrix The old filter matrix was based on the man pages, but the selected value in the range 1-20 was also assigned to the configuration and thus lldpd was configured incorrectly. lldpd expects a value in the range 0-19. The webapp matrix has now been changed so that the values 0-19 also appear there. This leads to a unification of configuration and webapp. Signed-off-by: Marek Küthe <m.k@mk16.de> luci-app-lldpd: Add location parameter Signed-off-by: Marek Küthe <m.k@mk16.de>
If someone wants to test the new changes: |
Built for which version specifically?
|
OpenWrt 22.03 with the latest changes from me to lldpd |
@marek22k would be good if you re-test this GUI with what goes in via openwrt/openwrt#14193 to ensure they're synched up. |
openwrt/openwrt#14193 is now in master, so this Luci App can be worked on @marek22k |
If anyone is interested here is a build I did for 23.05 |
I noticed an off-by-one error on the filter selection list. You select one version, apply and then it shows the next row up as selected. |
Tested also, and it seems to be this row: var selected = parseInt(cfgvalue) - 1; Which causes off by one :) |
This PR now needs the following PRs: |
openwrt/openwrt#14583 PR down, and optional openwrt/openwrt#14584 down. Note to self: I have a number of fixes that must go in on top of this PR (there are a few quirks and bugs present). |
Well, shit. The lldpd init script it turns out leaves a few things to be desired: openwrt/openwrt#14850 - merged More bugs 🙄 Once these are in, the init script should have parity with this GUI. |
Looks like this is working already, only issues are parsing complex interface patterns. Could this be merged so we can expose it to a wider audience and get more testers using it? |
Last obstacle merged - please have a look at this PR! |
Done. Finally. Take it for a spin. I can't cherry-pick to 23 or 22 just yet, since those parts that are in openwrt:master need to get cherry-picked first to 23/22. That's largely straight-forward because I tested all additions on both. A few more PRs should go in before the CPs start. Namely: openwrt/openwrt#15234 - waiting |
This is a customized copy of TanoWrt's fork, which you can find at https://github.com/tano-systems/luci-app-tn-lldpd, which is under the MIT license. For the app to work, openwrt/openwrt#14193 must be accepted.