tweak password generation
This commit is contained in:
parent
162a2138be
commit
f9cdd4f073
|
@ -38,12 +38,12 @@
|
|||
exec 3>&1 >&2
|
||||
mkdir -p /var/lib/grafana
|
||||
if [ ! -s /var/lib/grafana/admin.pw ]; then
|
||||
head -c 30 /dev/urandom | base64 > /var/lib/grafana/admin.pw
|
||||
tr -dc _A-Z-a-z-0-9 </dev/urandom | head -c$\{1:-32} > /var/lib/grafana/admin.pw
|
||||
chmod 400 /var/lib/grafana/admin.pw
|
||||
chown grafana:grafana /var/lib/grafana/admin.pw
|
||||
fi
|
||||
if [ ! -s /var/lib/grafana/security.key ]; then
|
||||
head -c 30 /dev/urandom | base64 > /var/lib/grafana/security.key
|
||||
tr -dc _A-Z-a-z-0-9 </dev/urandom | head -c$\{1:-32} > /var/lib/grafana/security.key
|
||||
chmod 400 /var/lib/grafana/security.key
|
||||
chown grafana:grafana /var/lib/grafana/security.key
|
||||
fi
|
||||
|
|
|
@ -49,15 +49,15 @@
|
|||
set -euo pipefail
|
||||
if [ ! -s /var/lib/influxdb/admin.pw ]; then
|
||||
INIT=1
|
||||
head -c 30 /dev/urandom | base64 > /var/lib/influxdb/admin.pw
|
||||
tr -dc _A-Z-a-z-0-9 </dev/urandom | head -c$\{1:-32} > /var/lib/influxdb/admin.pw
|
||||
chmod 400 /var/lib/influxdb/admin.pw
|
||||
fi
|
||||
if [ ! -s /var/lib/influxdb/knotendaten.pw ]; then
|
||||
head -c 30 /dev/urandom | base64 > /var/lib/influxdb/knotendaten.pw
|
||||
tr -dc _A-Z-a-z-0-9 </dev/urandom | head -c$\{1:-32} > /var/lib/influxdb/knotendaten.pw
|
||||
chmod 400 /var/lib/influxdb/knotendaten.pw
|
||||
fi
|
||||
if [ ! -s /var/lib/influxdb/grafana.pw ]; then
|
||||
head -c 30 /dev/urandom | base64 > /var/lib/influxdb/grafana.pw
|
||||
tr -dc _A-Z-a-z-0-9 </dev/urandom | head -c$\{1:-32} > /var/lib/influxdb/grafana.pw
|
||||
chmod 400 /var/lib/influxdb/grafana.pw
|
||||
fi
|
||||
until ${pkgs.curl}/bin/curl --connect-timeout 1 http://127.0.0.1:8086/ping; do
|
||||
|
|
Loading…
Reference in a new issue