1
1
Fork 1
mirror of https://github.com/oddlama/nix-config.git synced 2025-10-10 23:00:39 +02:00

fix: apparently ':' is not a great character for basic auth

This commit is contained in:
oddlama 2023-06-18 16:03:41 +02:00
parent d6af975817
commit 06d5d26dde
No known key found for this signature in database
GPG key ID: 14EFE510775FE39A
4 changed files with 3 additions and 4 deletions

View file

@ -115,7 +115,7 @@ in {
url = "https://${sentinelCfg.proxiedDomains.loki}";
orgId = 1;
basicAuth = true;
basicAuthUser = "${nodeName}:grafana-loki-basic-auth-password";
basicAuthUser = "${nodeName}+grafana-loki-basic-auth-password";
secureJsonData.basicAuthPassword = "$__file{${config.age.secrets.grafana-loki-basic-auth-password.path}}";
}
];

View file

@ -41,7 +41,7 @@ in {
file,
}: ''
echo " -> Aggregating "${lib.escapeShellArg host}":"${lib.escapeShellArg name}"" >&2
echo -n ${lib.escapeShellArg host}":"${lib.escapeShellArg name}" "
echo -n ${lib.escapeShellArg host}"+"${lib.escapeShellArg name}" "
${decrypt} ${lib.escapeShellArg file} \
| ${pkgs.caddy}/bin/caddy hash-password --algorithm bcrypt \
|| die "Failure while aggregating caddy basic auth hashes"
@ -55,7 +55,6 @@ in {
useACMEHost = sentinelCfg.lib.extra.matchingWildcardCert lokiDomain;
extraConfig = ''
import common
skip_log
basicauth {
import ${sentinelCfg.age.secrets.loki-basic-auth-hashes.path}
}

View file

@ -48,7 +48,7 @@ in {
clients = [
{
basic_auth.username = "${nodeName}:promtail-loki-basic-auth-password";
basic_auth.username = "${nodeName}+promtail-loki-basic-auth-password";
basic_auth.password_file = config.age.secrets.promtail-loki-basic-auth-password.path;
url = "https://${nodes.${cfg.proxy}.config.proxiedDomains.loki}/loki/api/v1/push";
}