__netbox: replaced secret key character set

The used character set should now only contain characters used by the
`netbox/generate_secret_key.py` program. Finially got correct escaping.
This commit is contained in:
matze 2020-09-08 19:52:03 +02:00
parent 549feb87f9
commit 5d437839f6

View file

@ -53,8 +53,9 @@ else
# Can be done over netbox/generate_secret_key.py too, but it can't be # Can be done over netbox/generate_secret_key.py too, but it can't be
# generated right now where it's required (only if it's preloaded for # generated right now where it's required (only if it's preloaded for
# this type to execute it now). # this type to execute it now).
# Generates a 50-character long key (without ' cause of python quotes) # Generates a 50-character long key with the same character set like
SECRET_KEY="$(tr -cd '[:graph:]' < /dev/urandom | tr -d \' | head -c50)" # the helper script. Must escape the '-' to be no character range.
SECRET_KEY="$(tr -cd '!@#$%^&*(\-_=+)[:alnum:]' < /dev/urandom | head -c50)"
fi fi
export SECRET_KEY export SECRET_KEY