-
Notifications
You must be signed in to change notification settings - Fork 128
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
Added a panel to show the status of the apt packages #75
base: master
Are you sure you want to change the base?
Conversation
This allows a user to include a status panel of what package updates are pending on an Apt Package managed system such as Ubuntu. Also included is the configuration file change to include a 'package_management' section that must be configured for proper operation. (I was unable to get the panel to not display if the section was missing) It is currently configured to be not enabled. Change the flag to 'true' to enable the panel. While setup for Apt, this could easily be extended for yum, pacman, etc and I hope they would include their configuration inside of 'package_management' as well. Tested on: Ubuntu 20.04.2 LTS (GNU/Linux 5.4.0-72-generic x86_64)
Thanks! Unfortunately, it looks like you confirmed my suspicions that the utility For the PHP Warning - I'll have to check on this as I wasn't paying attention to the php logs when poking at this problem. Looking at the php count() api - https://www.php.net/manual/en/function.count.php - this might be a bigger issue or I'm using it wrong. I think what you're seeing is expected if the module is enabled but can't find the executable. I would also expect a console warning to be emitted of Doing a bit of further digging, I found https://askubuntu.com/a/441934 - which leads me to think that parsing the result of As for the hardcoded paths - that was a definite shortcut to get this working. I'm fairly confident that Ubuntu has had the script in that location for a few major versions and thought that would be Good Enough For Now. However, now that the sudo blocker for running apt-get directly appears to be a non-issue, it might be worth it to just get rid of leveraging For testing:
Thanks for writing up the detailed question |
* Introduced a block to parse the result of apt-get * Corrected issue with checking for the presence of the configuration * Fixed issue with exec() and parsing of the results
Well, as the saying goes "Got some good news and bad news..." Thanks for the details on your setup & output results. It does make troubleshooting so much easier. Bad News: Leveraging Good News: I updated the script to check for Interesting News: Turns out my initial assumptions about the Config utility was misplaced - if you attempt to get a missing key, it'll return the entire configuration tree. I dropped a TODO for myself to revisit as my PHP days were more of the 3.x variety.... Oh! Other interesting news: The various linux distros are slowly combining the various /bin and /usr/bin (etc) directory structures. Take a look: https://www.freedesktop.org/wiki/Software/systemd/TheCaseForTheUsrMerge/ The next version of Debian does the same thing but I can't find the announcement again. As for the warnings, I'm firmly in the camp that they should be addressed otherwise alert fatigue occurs. Weirdly, php logging isn't enabled on my server & I can't quite figure out where it's configured. (Another item for the list of 'random things to investigate when bored'.) Also, I wasn't able to get this to throw the error but if you're running PHP 8.0, that warning should be an error... which wouldn't be nice to throw. So.... best to fix it! |
Wow ! That is just perfect ! Thanks a lot for this feature ! Just for information, for my personal needs, I added an option to enable the
It should be in log file like those if not configured and if you use apache: |
You're welcome! Updated the logic per your code snippets. Thanks for the patch code. I did adjust it so the apt-get update is only triggered if you're using the apt-get path. (as the apt-check does execute it automatically if it's been too long since the last cache update, from what I'm seeing) I also added in the To be honest, having this script execute a sudo command feels a bit .... ugly. At least your documentation limits www-data to apt-get only, which is good & I appreciate calling out that approach. Turns out my PHP install had it's logging disabled. Probably did that a while ago and forgot about it :) Hmm, I should probably merge my branch with my main branch. Time to experiment with the |
Nice, so now your pull-request (may) work the same way between all linux !
I understand your concern.
If there is a password prompt, this new feature will just never work anyway, but you are right specifying '--non-interactive' will prevent side effects if your server is not correctly configured to allow www-data to use the command in s.u. mode ;)
By default, web servers have logs enabled. |
This allows a user to include a status panel of what package updates are pending on an Apt Package managed system such as Ubuntu.
Also included is the configuration file change to include a 'package_management' section that must be configured for proper operation. (I was unable to get the panel to not display if the section was missing) It is currently configured to be not enabled. Change the flag to 'true' to enable the panel.
While setup for Apt, this could easily be extended for yum, pacman, etc and I hope they would include their configuration inside of 'package_management' as well.
Tested on: Ubuntu 20.04.2 LTS (GNU/Linux 5.4.0-72-generic x86_64)
This resolves: #65
Thanks to the following PR's for examples on how to set things up