-
Notifications
You must be signed in to change notification settings - Fork 11
packages/repostitories: add pacman support #34
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
base: main
Are you sure you want to change the base?
Conversation
1b494b6 to
1a6e12a
Compare
|
This should be good for testing. @B-DUB99 (PatchMon/PatchMon#373) are you able to independently test? At that point you can replace your local copy (maybe keep a backup so you can revert) and test: |
|
I did find this issue while testing but it seems to be a regression in the front and/or backend--I was able to see all the packages with the mitigation outlined in the issue: PatchMon/PatchMon#386 |
|
I just tested your branch and it is amazing! Because I am using Debian and Arch (maybe 40:60), I upvoted the issue on Github and a few days later, there is an already working version available. Two findings so far:
Instead of having all the mirrors listed in /etc/pacman.d/mirrorlist reported as repositories in PatchMon,
we should have only the enabled repositories defined (=uncommented) in /etc/pacman.conf like with Debian.
|
Definitely agree, I noticed that too. Let's address it in a separate PR, I believe there's a PR for it already (#13 ). Sort of in the same vein as doing things the "normal" way I have some thoughts about packaging the agent into a dev, rpm, etc.
Hmm I'll test this—I must not have any commented mirrors on my machine. Should be an easy fix thank you! Might be tomorrow before I get to this. |
Looking at your screenshot (Repository Reporting) above, you have at least 9 active mirrors for the "core" repo. |
Adds support for package and repository reporting on pacman-based distributions. As implemented--currently omits security update information, these rolling distributions only support complete updates and do not support security-only update options. PatchMon/PatchMon#373
I think I might be misunderstanding you--I'm not sure how to reproduce what you're describing: I went ahead and added a couple test cases: Along with the actual check: https://github.com/ocelotsloth/PatchMon-agent/blob/main/internal/repositories/pacman_test.go#L91-L98 It looks like it's correctly ignoring commented out lines from the configuration file. It's expected that multiple entries will show up for each repository if you define multiple // pkg/models.go
// Repository represents a software repository
type Repository struct {
Name string `json:"name"`
URL string `json:"url"`
Distribution string `json:"distribution"`
Components string `json:"components"`
RepoType string `json:"repoType"`
IsEnabled bool `json:"isEnabled"`
IsSecure bool `json:"isSecure"`
}I went with reporting individual |
|
https://wiki.debian.org/SourcesList#Repository_URI
It does seem like Arch is a little unique in this way but I've never actually tried to find a way to configure fallback mirrors on other distributions before. I may experiment with it later. |
|
yes - ok, the way Arch addresses the package sources is different from Debian. Debian: Arch: The RepoSource definitions in /etc/pacman.d/mirrorlist and /etc/pacman.d/endeavouros-mirrorlist
--> the line "Server = https://mirror.moson.org/arch/$repo/os/$arch" in /etc/pacman.d/mirrorlist in combination with /etc/pacman.conf expands to: https://mirror.moson.org/arch/core/os/x86_64/ --> the line "Server = https://mirror.moson.org/endeavouros/repo/$repo/$arch" in /etc/pacman.d/endeavouros-mirrorlist in combination with /etc/pacman.conf expands to: https://mirror.moson.org/endeavouros/repo/endeavouros/x86_64/ The logic of the conf file (/etc/pacman.conf) and the conf directories (/etc/pacman.d/) is the same as in Debian. From my point of view, the patchmon-agent should not care about mirrorlists or even mirrors. [core] I hope that helps. |
|
Hi team. I hope all are well :) What's your opinion @ocelotsloth in relation to some of the comments @raspitoaster has mentioned about repolists? Do you feel that the agent as you've configured it is enough to push into release or some more work needed. Thanks |
|
I am happy with the implementation because I am in a special situation using a central package cache, so I have only one "server="-line per repository. |



Adds support for package and repository reporting on pacman-based distributions.
As implemented--currently omits security update information, these rolling distributions only support complete updates and do not support security-only update options.
PatchMon/PatchMon#373
Testing
Host Level Reporting
Repository Reporting (with Include statements traversed)
Outdated Package Reporting
Complete Package Reporting