mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-12-10 05:36:15 +08:00
Read fixed bytes size from /dev/urandom (#3052)
Co-authored-by: José Valim <jose.valim@gmail.com>
This commit is contained in:
parent
62f85951b8
commit
dd8ce5439c
2 changed files with 2 additions and 2 deletions
|
|
@ -15,6 +15,6 @@ export PATH="${vendor_dir}/otp/erts-<%= @release.erts_version%>/bin:${vendor_dir
|
||||||
if [ ! -z "${LIVEBOOK_NODE}" ]; then export RELEASE_NODE=${LIVEBOOK_NODE}; fi
|
if [ ! -z "${LIVEBOOK_NODE}" ]; then export RELEASE_NODE=${LIVEBOOK_NODE}; fi
|
||||||
if [ ! -z "${LIVEBOOK_COOKIE}" ]; then export RELEASE_COOKIE=${LIVEBOOK_COOKIE}; fi
|
if [ ! -z "${LIVEBOOK_COOKIE}" ]; then export RELEASE_COOKIE=${LIVEBOOK_COOKIE}; fi
|
||||||
|
|
||||||
export RELEASE_COOKIE="${RELEASE_COOKIE:-$(cat /dev/urandom | env LC_ALL=C tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)}"
|
export RELEASE_COOKIE="${RELEASE_COOKIE:-$(head -c 512 /dev/urandom | env LC_ALL=C tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)}"
|
||||||
|
|
||||||
cd $HOME
|
cd $HOME
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ else
|
||||||
# specifically want the temporary node cookie to be random, rather than
|
# specifically want the temporary node cookie to be random, rather than
|
||||||
# a fixed value. Note that this value is overriden on boot, so other
|
# a fixed value. Note that this value is overriden on boot, so other
|
||||||
# than being the initial node cookie, we don't really use it.
|
# than being the initial node cookie, we don't really use it.
|
||||||
export RELEASE_COOKIE="${RELEASE_COOKIE:-$(cat /dev/urandom | env LC_ALL=C tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)}"
|
export RELEASE_COOKIE="${RELEASE_COOKIE:-$(head -c 512 /dev/urandom | env LC_ALL=C tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)}"
|
||||||
|
|
||||||
cd $HOME
|
cd $HOME
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue