Universal Config Detection für start.sh - Multi-Distribution Support #68

Closed
opened 2025-06-22 11:32:49 +02:00 by Michael · 1 comment
Michael commented 2025-06-22 11:32:49 +02:00 (Migrated from gitea.dragons-at-work.de)

Problem

Das aktuelle start.sh Script funktioniert nur für Development (../.env) aber nicht für Package-Installationen auf verschiedenen Distributionen.

Requirements

Distribution-spezifische Config-Paths:

  • Development: ../.env (Git-Checkout)
  • Debian/Ubuntu: /etc/furt/environment
  • OpenBSD: /usr/local/etc/furt/environment
  • Arch/RHEL: /etc/furt/environment
  • FreeBSD: /usr/local/etc/furt/environment

Implementierung

Universelle Config-Detection-Funktion in start.sh die alle Standard-Paths abfragt:

detect_config() {
    # Development (Git-Checkout)
    if [ -f "../.env" ]; then
        . ../.env
        echo "Loaded development config: ../.env"
        return 0
    fi
    
    # Package-Installation - verschiedene Paths
    for config_path in \
        "/etc/furt/environment" \
        "/usr/local/etc/furt/environment" \
        "/opt/furt/environment"
    do
        if [ -f "$config_path" ]; then
            . "$config_path"
            echo "Loaded system config: $config_path"
            return 0
        fi
    done
    
    echo "No config found - using defaults"
    return 1
}

Acceptance Criteria

  • Development-Mode funktioniert (../.env wird geladen)
  • OpenBSD Package-Installation funktioniert (/usr/local/etc/furt/environment)
  • Debian/Ubuntu Package-Installation funktioniert (/etc/furt/environment)
  • Fallback auf Defaults wenn keine Config gefunden
  • Informative Ausgabe welche Config geladen wurde
  • Backward-Compatibility zu aktuellem Verhalten

Context

Vorbereitung für Open-Source-Release und Package-Manager-Support für verschiedene Distributionen.

Technical Notes

  • Script muss POSIX-shell-kompatibel bleiben (kein Bash-spezifisches)
  • Config-Loading muss secure sein (keine Code-Injection)
  • Environment-Variables müssen korrekt exportiert werden

Priority

Medium - Wichtig für Package-Releases aber blockiert nicht aktuelle Development

## Problem Das aktuelle start.sh Script funktioniert nur für Development (`../.env`) aber nicht für Package-Installationen auf verschiedenen Distributionen. ## Requirements **Distribution-spezifische Config-Paths:** - **Development:** `../.env` (Git-Checkout) - **Debian/Ubuntu:** `/etc/furt/environment` - **OpenBSD:** `/usr/local/etc/furt/environment` - **Arch/RHEL:** `/etc/furt/environment` - **FreeBSD:** `/usr/local/etc/furt/environment` ## Implementierung Universelle Config-Detection-Funktion in start.sh die alle Standard-Paths abfragt: ```bash detect_config() { # Development (Git-Checkout) if [ -f "../.env" ]; then . ../.env echo "Loaded development config: ../.env" return 0 fi # Package-Installation - verschiedene Paths for config_path in \ "/etc/furt/environment" \ "/usr/local/etc/furt/environment" \ "/opt/furt/environment" do if [ -f "$config_path" ]; then . "$config_path" echo "Loaded system config: $config_path" return 0 fi done echo "No config found - using defaults" return 1 } ``` ## Acceptance Criteria - [x] Development-Mode funktioniert (`../.env` wird geladen) - [x] OpenBSD Package-Installation funktioniert (`/usr/local/etc/furt/environment`) - [ ] Debian/Ubuntu Package-Installation funktioniert (`/etc/furt/environment`) - [ ] Fallback auf Defaults wenn keine Config gefunden - [x] Informative Ausgabe welche Config geladen wurde - [x] Backward-Compatibility zu aktuellem Verhalten ## Context Vorbereitung für Open-Source-Release und Package-Manager-Support für verschiedene Distributionen. ## Technical Notes - Script muss POSIX-shell-kompatibel bleiben (kein Bash-spezifisches) - Config-Loading muss secure sein (keine Code-Injection) - Environment-Variables müssen korrekt exportiert werden ## Priority Medium - Wichtig für Package-Releases aber blockiert nicht aktuelle Development
Michael commented 2025-06-22 20:27:24 +02:00 (Migrated from gitea.dragons-at-work.de)

Universal Config Detection Complete

Implementation successful: start.sh läuft universell auf beiden Systemen.

Config-Hierarchie funktional:

  • karl: /home/michael/Develop/DAW/furt/.env
  • walter: /usr/local/etc/furt/environment
  • Fallback: System configs in /etc/furt/environment

Cross-Platform-Verification:

  • OpenBSD + Linux compatibility confirmed
  • Service-User (_furt) and development-user both supported
  • POSIX-compliant script execution

Related Issues:

  • Issue DAW/furt#70: karl regression (resolved)
  • Issue DAW/furt#71: Config-strategy expansion (ongoing)
  • walter SSL: luasec integration (separate issue)

Production-Ready: furt-lua universelle Deployment achieved.

## Universal Config Detection Complete ✅ **Implementation successful:** start.sh läuft universell auf beiden Systemen. **Config-Hierarchie funktional:** - **karl:** /home/michael/Develop/DAW/furt/.env ✅ - **walter:** /usr/local/etc/furt/environment ✅ - **Fallback:** System configs in /etc/furt/environment **Cross-Platform-Verification:** - **OpenBSD + Linux** compatibility confirmed - **Service-User** (_furt) and development-user both supported - **POSIX-compliant** script execution **Related Issues:** - Issue DAW/furt#70: karl regression (resolved) - Issue DAW/furt#71: Config-strategy expansion (ongoing) - walter SSL: luasec integration (separate issue) **Production-Ready:** furt-lua universelle Deployment achieved.
michael added this to the v0.1.2 - Gateway Basics milestone 2025-08-14 05:21:02 +02:00
michael added
status
done
and removed
status
to-go
labels 2025-08-14 07:21:09 +02:00
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: DAW/furt#68
No description provided.