refactor: standardize developer text and identifiers in English
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
#!/usr/bin/env bash
|
||||
# =============================================================
|
||||
# start.sh — Avvia Node-RED 5.0 in locale per s2s-reasoning-engine
|
||||
# start.sh — Run Node-RED 5.0 locally for s2s-reasoning-engine
|
||||
#
|
||||
# Uso:
|
||||
# ./start.sh # porta default 1881
|
||||
# PORT=1900 ./start.sh # porta custom
|
||||
# LOG_LEVEL=debug ./start.sh # log più dettagliato
|
||||
# DEBUG=nodes:* ./start.sh # debug Node-RED interno
|
||||
# Usage:
|
||||
# ./start.sh # default port 1881
|
||||
# PORT=1900 ./start.sh # custom port
|
||||
# LOG_LEVEL=debug ./start.sh # detailed logging
|
||||
# DEBUG=nodes:* ./start.sh # internal Node-RED diagnostics
|
||||
# Stop: Ctrl+C
|
||||
# =============================================================
|
||||
set -euo pipefail
|
||||
@@ -17,8 +17,8 @@ PARENT_DIR="$(dirname "$ROOT_DIR")"
|
||||
cd "$ROOT_DIR"
|
||||
|
||||
# ----------------------------------------------------------
|
||||
# 1) Carica env: prima locale .env (se esiste) poi padre ../.env
|
||||
# Il file locale sovrascrive il padre se c'è lo stesso var.
|
||||
# 1) Load the local .env first, then the parent ../.env when present.
|
||||
# The parent file takes precedence when both define the same variable.
|
||||
# ----------------------------------------------------------
|
||||
set -a
|
||||
if [ -f "$ROOT_DIR/.env" ]; then
|
||||
@@ -34,7 +34,7 @@ fi
|
||||
set +a
|
||||
|
||||
# ----------------------------------------------------------
|
||||
# 2) Parametri runtime Node-RED
|
||||
# 2) Node-RED runtime parameters
|
||||
# ----------------------------------------------------------
|
||||
PORT="${PORT:-${NODE_RED_PORT:-1881}}"
|
||||
export PORT
|
||||
@@ -43,11 +43,11 @@ export NODE_RED_LOG_LEVEL="${LOG_LEVEL:-${NODE_RED_LOG_LEVEL:-info}}"
|
||||
export NODE_RED_CREDENTIAL_SECRET="${NODE_RED_CREDENTIAL_SECRET:-s2s-reasoning-local-dev}"
|
||||
export FLOWS="${FLOWS:-$ROOT_DIR/.node-red/flows.json}"
|
||||
|
||||
# UserDir locale (tutto dentro la cartella corrente, NO ~/.node-red)
|
||||
# Local user directory; keep state here rather than in ~/.node-red.
|
||||
USERDIR="${USERDIR:-$ROOT_DIR/.node-red}"
|
||||
SETTINGS="${SETTINGS:-$USERDIR/settings.js}"
|
||||
|
||||
# Assicura che la userDir esista e i file base siano presenti.
|
||||
# Create the user directory and refresh its configuration from the source files.
|
||||
mkdir -p "$USERDIR"
|
||||
if [ ! -f "$SETTINGS" ] || [ "$ROOT_DIR/settings.js" -nt "$SETTINGS" ]; then
|
||||
cp -f "$ROOT_DIR/settings.js" "$SETTINGS"
|
||||
@@ -58,15 +58,15 @@ if [ ! -f "$FLOWS" ] || [ "$ROOT_DIR/flows.json" -nt "$FLOWS" ]; then
|
||||
echo "[init] copied flows.json -> $FLOWS"
|
||||
fi
|
||||
|
||||
# Verifica node_modules installati
|
||||
# Check that the local Node-RED dependencies are installed.
|
||||
if [ ! -d "$ROOT_DIR/node_modules/node-red" ]; then
|
||||
echo "[init] node_modules non trovati. Avvio npm install..."
|
||||
echo "[init] node_modules was not found. Running npm install..."
|
||||
npm install --no-audit --no-fund
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "╔════════════════════════════════════════════════════════════╗"
|
||||
echo "║ s2s-reasoning-engine — Node-RED v5 locale ║"
|
||||
echo "║ s2s-reasoning-engine — Local Node-RED v5 ║"
|
||||
echo "╠════════════════════════════════════════════════════════════╣"
|
||||
echo "║ Editor: http://localhost:${PORT}/ ║"
|
||||
echo "║ API: http://localhost:${PORT}/api/reasoning ║"
|
||||
@@ -76,7 +76,7 @@ echo "╚═══════════════════════
|
||||
echo ""
|
||||
|
||||
# ----------------------------------------------------------
|
||||
# 3) Avvio Node-RED
|
||||
# 3) Start Node-RED
|
||||
# ----------------------------------------------------------
|
||||
exec "$ROOT_DIR/node_modules/.bin/node-red" \
|
||||
--userDir "$USERDIR" \
|
||||
|
||||
Reference in New Issue
Block a user