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
prometheus-surfboard-exporter: init at 2.0.0 #31645
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks fine to me. Thanks!
851ebf0
to
d566c9d
Compare
nitpick for commit message:
|
User = "nobody"; | ||
Restart = "always"; | ||
PrivateTmp = true; | ||
WorkingDirectory = /tmp; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this application creates temporary files securely? There might be other applications racing for /tmp
. Also a dedicated user different from nobody
would be useful. Unfortunately we do not have the latest systemd release yet. Otherwise runtime directories could be created automatically for DynamicUser=true
.
d566c9d
to
f9e5d71
Compare
Looking at the code, doesn't look like it writes any files. Everything is stdout or the http socket opened. I've removed the work dir and private tmp attributes. I also fixed the commit message on service commit to prefix with nixos/ |
unitConfig.Documentation = "https://github.com/ipstatic/surfboard_exporter"; | ||
wantedBy = [ "multi-user.target" ]; | ||
serviceConfig = { | ||
User = "nobody"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The following should also work here then:
DynamicUser = "yes";
instead of "nobody".
f9e5d71
to
3fd0aee
Compare
buildGoPackage rec { | ||
name = "surfboard_exporter-${version}"; | ||
version = "2.0.0"; | ||
rev = version; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line is redundant.
@disassembler I adjusted the commit that adds the module, to work with the new prometheus exporters module (and also rebased this on the current master). |
@WilliButz can you open a pull request? |
@Mic92 sure if that's okay with @disassembler I open one in the next days. |
Success on x86_64-linux (full log) Attempted: prometheus-surfboard-exporter Partial log (click to expand)
|
Success on x86_64-darwin (full log) Attempted: prometheus-surfboard-exporter Partial log (click to expand)
|
Success on aarch64-linux (full log) Attempted: prometheus-surfboard-exporter Partial log (click to expand)
|
Motivation for this change
Haven't tested the nixos module yet (will try to tomorrow), but I tested running the exporter standalone and a curl of the metric page got me all my surfboard cable modem stats.
Things done
build-use-sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)