-
Notifications
You must be signed in to change notification settings - Fork 6
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
Are agenix secrets supported? #351
Comments
Hi! Sorry for the lack of documentation on this part. The configuration should be:
With the additional This is needed because the type of the APIKey is secretFileType and that type is defined here, it's actually a submodule with a Until more doc is there, you may want to get inspiration from the tests. Now, TBH I'm not sure why you're getting such a convoluted error. That's definitely something that should be improved. |
Ah thanks for the explanation. I had looked at other places how Secrets Files were used (ldap for example) and it was different. Thanks for the hint about the tests. I was a bit worried about not finding a single example of how to use it anywhere on the net. I was using nixarr so far. But I love what you did with the ApiKeys and other settings and I plan to use other selfhosted blocks in the future. Perhaps if I may ask here, what's the right pattern to use the monitoring stack with multiple machines? I have a bunch of different machines that should collect logs and metrics and the log host should aggregate them. Ideally with full knowledge of which services export metrics. |
The media group didn't get created. Huh. In the code it looks like that's not conditional at all. Also another dumb question, do I need to have a vhost per service? I was using mDNS .local addresses so far. It might be time for real DNS... |
I totally understand the confusion. Sorry about that. I'm slowly updating all places to use the secret contract.
TIL about nixarr. That's a really nice project!
Thanks :) The method I'm using is quite universal, I use it in all the services in Self Host Blocks where it is relevant. You might be interested to know that I'm (quite slowly) upstreaming this part to nixpkgs NixOS/nixpkgs#328472 so one day it'll be more widespread, hopefully.
That's really pleasing to hear. ❤️ I'm working on mostly documentation right now so you might get better docs when you get to it. Otherwise, feel free to open an issue or join the matrix channel to ask question. I mean instead of guessing the options is they're undocumented. Oh that makes me think this page lists all options, even those that don't have an accompanying example or manual. https://shb.skarabox.com/options.html You might get some inspiration there already.
That's something I've not yet well investigated. I mean, since Self Host Blocks uses the same machinery as nixpkgs, it won't help you to manage a cluster of machines. I've seen projects manage IPs of servers and other cluster related values but don't remember their names right now. The best I could tell you right now is to add yourself a scraper like so: services.prometheus.scrapeConfigs = [
{
job_name = "my other server - netdata";
metrics_path = "/api/v1/allmetrics?format=prometheus&help=yes&source=as-collected";
static_configs = [
{
targets = ["192.168.1.150:19999"];
}
];
}
]; You'll need to hardcode the IP in some way. It could be done more dynamically by having a DNS server you control. There is a monitoring block in Self Host Blocks. What I do on my server is enable it and add some scrapers for custom jobs.
Yeah that's dumb. I made it work for my use case a while ago and didn't go back in that module for a while. I suppose it's failing because it's telling you the media group does not exist? Actually in my own config there's no mention of creating the media group. Neither in the tests. What error do you get exactly?
Not necessarily. On my DNS provider, I have a two AAAA records. One from the my domain name, say Then, that will reach at some point your router and Nginx will pick up the request and redirect it to the correct service using the subdomain. |
I think it can be done with NixOps. I did once try to get the ball rolling with this question The nix-topology module does seem to do a similar task. They even attempt to discover what services are exposed on a machine. (in a very ugly way) My scrape config is hardcoded as well at the moment. https://github.com/tbaumann/nix-conf/blob/ada81cf338e9cc2d41664d356da9096ef1b750dd/hosts/nas/default.nix#L92 I will use the selfhost blocks to set up the server I guess. That would improve a lot for me already, especially the grafana bootstrap stuff.
Specifically agenix complains that the group media isn't valid for the secrets file. › getent group media
~
› getent passwd sonarr
sonarr:x:274:274::/var/lib/sonarr:/run/current-system/sw/bin/nologin But I also think exraGroups should declare the group. I need to think a bit more... |
yup, group needs to be declared not just referenced. users.groups.media = {}; › getent group media
media:x:974:sonarr |
I started with something simple.
My secrets are agenix or ragenix to be precise.
Yea, that file doesn't exist at build time.
The text was updated successfully, but these errors were encountered: