mirror of
https://github.com/wireadmin/wireadmin
synced 2025-05-01 18:58:07 +00:00
update password hashing script
This commit is contained in:
parent
39e79be429
commit
3309450063
@ -75,12 +75,12 @@ EOF
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Checking if there is `UI_PASSWORD` environment variable
|
# Checking if there is `UI_PASSWORD` environment variable
|
||||||
# if there was, converting it to hex and storing it to
|
# if there was, converting it to sha256 and storing it to
|
||||||
# the .env
|
# the .env
|
||||||
if [ -n "$UI_PASSWORD" ]; then
|
if [ -n "$UI_PASSWORD" ]; then
|
||||||
sed -i '/^HASHED_PASSWORD/d' "${ENV_FILE}"
|
sed -i '/^HASHED_PASSWORD/d' "${ENV_FILE}"
|
||||||
tee -a "${ENV_FILE}" &>/dev/null <<EOF
|
tee -a "${ENV_FILE}" &>/dev/null <<EOF
|
||||||
HASHED_PASSWORD=$(printf "%s" "${UI_PASSWORD}" | od -A n -t x1 | tr -d ' \n')
|
HASHED_PASSWORD=$(checksum hash -a sha256 -C "${UI_PASSWORD}")
|
||||||
EOF
|
EOF
|
||||||
unset UI_PASSWORD
|
unset UI_PASSWORD
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user