mirror of
https://github.com/oddlama/nix-config.git
synced 2025-10-11 07:10:39 +02:00
fix: more robust resolving of influxdb2 provisioning address
This commit is contained in:
parent
f29318a5ac
commit
dfd49c656a
1 changed files with 9 additions and 2 deletions
|
@ -17,6 +17,7 @@
|
||||||
genAttrs
|
genAttrs
|
||||||
getExe
|
getExe
|
||||||
hasAttr
|
hasAttr
|
||||||
|
hasInfix
|
||||||
head
|
head
|
||||||
literalExpression
|
literalExpression
|
||||||
mkBefore
|
mkBefore
|
||||||
|
@ -24,8 +25,8 @@
|
||||||
mkIf
|
mkIf
|
||||||
mkOption
|
mkOption
|
||||||
optional
|
optional
|
||||||
optionalString
|
|
||||||
optionals
|
optionals
|
||||||
|
optionalString
|
||||||
types
|
types
|
||||||
unique
|
unique
|
||||||
;
|
;
|
||||||
|
@ -64,7 +65,13 @@
|
||||||
|
|
||||||
provisioningScript = pkgs.writeShellScript "post-start-provision" (''
|
provisioningScript = pkgs.writeShellScript "post-start-provision" (''
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
export INFLUX_HOST="http://"${escapeShellArg (cfg.settings.http-bind-address or "localhost:8086")}
|
export INFLUX_HOST="http://"${escapeShellArg (
|
||||||
|
if
|
||||||
|
! hasAttr "http-bind-address" cfg.settings
|
||||||
|
|| hasInfix "0.0.0.0" cfg.settings.http-bind-address
|
||||||
|
then "localhost:8086"
|
||||||
|
else cfg.settings.http-bind-address
|
||||||
|
)}
|
||||||
|
|
||||||
# Wait for the influxdb server to come online
|
# Wait for the influxdb server to come online
|
||||||
count=0
|
count=0
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue