mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-09-10 15:04:25 +08:00
Ensure we don't use a new cookie on every boot
This commit is contained in:
parent
10da0a2311
commit
497f372140
2 changed files with 4 additions and 2 deletions
|
@ -9,7 +9,8 @@ export LIVEBOOK_PORT=0
|
|||
cookie_path="${RELEASE_ROOT}/releases/COOKIE"
|
||||
if [ ! -f $cookie_path ]; then
|
||||
RELEASE_COOKIE=$(cat /dev/urandom | env LC_ALL=C tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
|
||||
[[ $RELEASE_COOKIE > $cookie_path ]] || export RELEASE_COOKIE
|
||||
echo "$RELEASE_COOKIE" > "$cookie_path"
|
||||
[ $? -eq 0 ] || export RELEASE_COOKIE
|
||||
fi
|
||||
|
||||
cd $HOME
|
||||
|
|
|
@ -4,5 +4,6 @@ export RELEASE_MODE=interactive
|
|||
cookie_path="${RELEASE_ROOT}/releases/COOKIE"
|
||||
if [ ! -f $cookie_path ]; then
|
||||
RELEASE_COOKIE=$(cat /dev/urandom | env LC_ALL=C tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
|
||||
[[ $RELEASE_COOKIE > $cookie_path ]] || export RELEASE_COOKIE
|
||||
echo "$RELEASE_COOKIE" > "$cookie_path"
|
||||
[ $? -eq 0 ] || export RELEASE_COOKIE
|
||||
fi
|
||||
|
|
Loading…
Add table
Reference in a new issue