#!/bin/sh set -eu umask 077 ROOT=$(CDPATH='' cd -- "$(dirname -- "$0")/.." && pwd) target="$ROOT/.env.e2e" if [ -f "$target" ]; then chmod 600 "$target" updated=false if ! grep -q '^TRAEFIK_RETRY_ATTEMPTS=' "$target"; then printf '\nTRAEFIK_RETRY_ATTEMPTS=3\n' >>"$target" updated=true fi if grep -q '^E2E_BASE_URL=http://proxy$' "$target"; then sed -i \ -e 's|^E2E_BASE_URL=http://proxy$|E2E_BASE_URL=https://proxy|' \ -e 's|^PHX_SCHEME=http$|PHX_SCHEME=https|' \ -e 's|^PHX_URL_PORT=80$|PHX_URL_PORT=443|' \ -e 's|^MAP_TILE_URL=http://proxy/|MAP_TILE_URL=https://proxy/|' \ "$target" updated=true fi chmod 600 "$target" if [ "$updated" = true ]; then echo "Updated non-secret E2E transport inputs; existing secrets were preserved." else echo ".env.e2e already exists; no secret or experiment input was changed." fi exit 0 fi postgres_password=$(openssl rand -hex 32) secret_key_base=$(openssl rand -hex 64) handover_secret=$(openssl rand -hex 64) release_cookie=$(openssl rand -hex 64) metrics_token=$(openssl rand -hex 32) cat >"$target" <