aprs.me/rel/env.sh.eex
Graham McIntire 75ceb73607
Fix Erlang clustering: use IP-based node names with DNS strategy
DNSSRV strategy resolves to IP-based names but nodes were named by
pod name, causing connection failures. Switch to DNS strategy with
IP-based node naming so libcluster discovery matches actual node names.
2026-02-19 16:01:20 -06:00

34 lines
1.1 KiB
Elixir

#!/bin/sh
# # Sets and enables heart (recommended only in daemon mode)
# case $RELEASE_COMMAND in
# daemon*)
# HEART_COMMAND="$RELEASE_ROOT/bin/$RELEASE_NAME $RELEASE_COMMAND"
# export HEART_COMMAND
# export ELIXIR_ERL_OPTIONS="-heart"
# ;;
# *)
# ;;
# esac
# # Set the release to load code on demand (interactive) instead of preloading (embedded).
# export RELEASE_MODE=interactive
# Set the release to work across nodes.
# RELEASE_DISTRIBUTION must be "sname" (local), "name" (distributed) or "none".
export RELEASE_DISTRIBUTION=name
# Check if we're in Kubernetes (POD_IP will be set)
if [ -n "$POD_IP" ]; then
# Use pod IP for Erlang distribution — matches libcluster DNS strategy
export RELEASE_NODE=${RELEASE_NODE:-<%= @release.name %>@${POD_IP}}
else
# Fallback to Dokku naming for non-Kubernetes deployments
export RELEASE_NODE=<%= @release.name %>@${DOKKU_APP_NAME:-aprsme}.web.${DOKKU_APP_INSTANCE:-1}
fi
export RELEASE_COOKIE=${RELEASE_COOKIE:-Euta32aoLfgADYz3TiSCpQP0Y3iD7AD3zu0ycYWI5lQ=}
#ip=$(grep fly-local-6pn /etc/hosts | cut -f 1)
#export RELEASE_DISTRIBUTION=name
#export RELEASE_NODE=$FLY_APP_NAME@$ip