2024-06-25 00:36:49 +08:00
|
|
|
if [ "$LIVEBOOK_CLUSTER" = "auto" ] && [ ! -z "$FLY_APP_NAME" ]; then
|
2024-03-23 00:22:18 +08:00
|
|
|
export LIVEBOOK_CLUSTER="dns:${FLY_APP_NAME}.internal"
|
2024-06-26 04:13:22 +08:00
|
|
|
|
|
|
|
case "$ERL_AFLAGS $ERL_ZFLAGS" in
|
|
|
|
*"-proto_dist"*) ;;
|
|
|
|
*)
|
|
|
|
export ERL_AFLAGS="$ERL_AFLAGS -proto_dist inet6_tcp"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2024-06-26 02:55:35 +08:00
|
|
|
if [ -z "${LIVEBOOK_NODE}" ];
|
2024-06-14 00:03:28 +08:00
|
|
|
then export LIVEBOOK_NODE="${FLY_APP_NAME}-${FLY_IMAGE_REF##*-}@${FLY_PRIVATE_IP}";
|
|
|
|
fi
|
2024-03-23 00:22:18 +08:00
|
|
|
fi
|
|
|
|
|
2023-10-25 17:57:00 +08:00
|
|
|
if [ -f "${RELEASE_ROOT}/user/env.sh" ]; then
|
|
|
|
. "${RELEASE_ROOT}/user/env.sh"
|
2023-10-24 22:46:40 +08:00
|
|
|
fi
|
|
|
|
|
2024-05-09 22:17:40 +08:00
|
|
|
if [ "$LIVEBOOK_EPMDLESS" = "true" ] || [ "$LIVEBOOK_EPMDLESS" = "1" ]; then
|
2024-05-08 16:05:01 +08:00
|
|
|
export ELIXIR_ERL_OPTIONS="${ELIXIR_ERL_OPTIONS} -epmd_module Elixir.Livebook.EPMD -start_epmd false -erl_epmd_port 0"
|
|
|
|
fi
|
|
|
|
|
2024-06-14 00:03:28 +08:00
|
|
|
export RELEASE_MODE="interactive"
|
|
|
|
export RELEASE_DISTRIBUTION="none"
|
|
|
|
|
|
|
|
# Mirror these values, so that it is easier to use "bin/release rpc",
|
|
|
|
# though it still requires setting RELEASE_DISTRIBUTION=name
|
|
|
|
if [ ! -z "${LIVEBOOK_NODE}" ]; then export RELEASE_NODE=${LIVEBOOK_NODE}; fi
|
2023-10-24 20:41:49 +08:00
|
|
|
if [ ! -z "${LIVEBOOK_COOKIE}" ]; then export RELEASE_COOKIE=${LIVEBOOK_COOKIE}; fi
|
2024-06-14 00:03:28 +08:00
|
|
|
|
|
|
|
# We remove the COOKIE file when assembling the release, because we
|
|
|
|
# don't want to share the same cookie across users. The Elixir release
|
|
|
|
# script attempts to read from that file, which would fail, therefore
|
|
|
|
# we need to set it here. Also there is a very tiny time gap between we
|
|
|
|
# start distribution and set the cookie during application boot, so we
|
|
|
|
# specifically want the temporary node cookie to be random, rather than
|
|
|
|
# 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.
|
|
|
|
export RELEASE_COOKIE="${RELEASE_COOKIE:-$(cat /dev/urandom | env LC_ALL=C tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)}"
|