fix(server): set vmagent token via LoadCredential

fixes stuff not working thanks to the brand new and awesome config
checker added a few days ago
This commit is contained in:
uku 2024-11-27 09:43:23 +01:00
parent 083d160334
commit 4a335335d5
Signed by: uku
SSH key fingerprint: SHA256:4P0aN6M8ajKukNi6aPOaX0LacanGYtlfjmN+m/sHY/o
2 changed files with 18 additions and 17 deletions

View file

@ -52,7 +52,7 @@ in {
vmagent = {
enable = true;
remoteWrite.url = "https://metrics.uku3lig.net/api/v1/write";
extraArgs = ["-remoteWrite.bearerToken $VM_AUTH_TOKEN"];
extraArgs = ["-remoteWrite.bearerTokenFile=\${CREDENTIALS_DIRECTORY}/vm_auth_token"];
prometheusConfig = {
global.scrape_interval = "15s";
@ -73,7 +73,7 @@ in {
};
systemd = {
services.vmagent.serviceConfig.EnvironmentFile = secrets.get "vmAuthToken";
services.vmagent.serviceConfig.LoadCredential = ["vm_auth_token:${secrets.get "vmAuthToken"}"];
# For more detail, see:
# https://0pointer.de/blog/projects/watchdog.html