- Split REPO_ROOT and PROJECT_DIR for different purposes - REPO_ROOT: Repository-wide configs (.env, system configs) - PROJECT_DIR: Lua-specific working directory (src/, cd) - Fix config detection across development and production environments Changes: - REPO_ROOT="$(dirname "$(dirname "$SCRIPT_DIR")")" # 2 levels up for .env - PROJECT_DIR="$(dirname "$SCRIPT_DIR")" # 1 level up for src/ - Config loading uses REPO_ROOT (.env location) - Working directory and Lua paths use PROJECT_DIR (furt-lua/) Tested on: - karl (Linux/Development): .env loading + lua51 execution ✅ - walter (OpenBSD/Production): system config + lua execution ✅ Cross-platform SMTP functionality verified: - karl: Full E2E test with successful mail delivery - walter: HTTP server + config detection working Fixes #68 (Universal Config Detection) Fixes #70 (karl start.sh regression after universal script update)
This commit is contained in:
parent
bb2bed80a6
commit
010371a9a7
1 changed files with 5 additions and 4 deletions
|
|
@ -12,7 +12,8 @@ NC='\033[0m' # No Color
|
||||||
|
|
||||||
# Script directory (POSIX-compatible)
|
# Script directory (POSIX-compatible)
|
||||||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||||
PROJECT_DIR="$(dirname "$SCRIPT_DIR")"
|
PROJECT_DIR="$(dirname "$SCRIPT_DIR")" # für src/, cd
|
||||||
|
REPO_ROOT="$(dirname "$(dirname "$SCRIPT_DIR")")" # für .env
|
||||||
|
|
||||||
echo -e "${GREEN}=== Furt Lua HTTP-Server Startup ===${NC}"
|
echo -e "${GREEN}=== Furt Lua HTTP-Server Startup ===${NC}"
|
||||||
|
|
||||||
|
|
@ -21,9 +22,9 @@ echo -e "${YELLOW}Checking dependencies...${NC}"
|
||||||
|
|
||||||
# Load environment variables - Universal Config Detection
|
# Load environment variables - Universal Config Detection
|
||||||
echo -e "${YELLOW}Loading environment variables...${NC}"
|
echo -e "${YELLOW}Loading environment variables...${NC}"
|
||||||
if [ -f "$PROJECT_DIR/.env" ]; then
|
if [ -f "$REPO_ROOT/.env" ]; then
|
||||||
echo -e "${GREEN}[OK]${NC} Loading from $PROJECT_DIR/.env"
|
echo -e "${GREEN}[OK]${NC} Loading from $REPO_ROOT/.env"
|
||||||
export $(grep -v '^#' "$PROJECT_DIR/.env" | grep -v '^$' | xargs)
|
export $(grep -v '^#' "$REPO_ROOT/.env" | grep -v '^$' | xargs)
|
||||||
elif [ -f "/usr/local/etc/furt/environment" ]; then
|
elif [ -f "/usr/local/etc/furt/environment" ]; then
|
||||||
echo -e "${GREEN}[OK]${NC} Loading from /usr/local/etc/furt/environment"
|
echo -e "${GREEN}[OK]${NC} Loading from /usr/local/etc/furt/environment"
|
||||||
export $(grep -v '^#' /usr/local/etc/furt/environment | grep -v '^$' | xargs)
|
export $(grep -v '^#' /usr/local/etc/furt/environment | grep -v '^$' | xargs)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue