Organizes 11 projects for Cerbo GX/Venus OS into a single repository: - axiom-nmea: Raymarine LightHouse protocol decoder - dbus-generator-ramp: Generator current ramp controller - dbus-lightning: Blitzortung lightning monitor - dbus-meteoblue-forecast: Meteoblue weather forecast - dbus-no-foreign-land: noforeignland.com tracking - dbus-tides: Tide prediction from depth + harmonics - dbus-vrm-history: VRM cloud history proxy - dbus-windy-station: Windy.com weather upload - mfd-custom-app: MFD app deployment package - venus-html5-app: Custom Victron HTML5 app fork - watermaker: Watermaker PLC control UI Adds root README, .gitignore, project template, and per-project .gitignore files. Sensitive config files excluded via .gitignore with .example templates provided. Made-with: Cursor
45 lines
1.5 KiB
Bash
45 lines
1.5 KiB
Bash
#!/bin/sh
|
|
#
|
|
# Apply nginx location override to serve the custom MFD app from /data/www/app/
|
|
#
|
|
# VenusOS generates its nginx config at runtime in /run/nginx/sites-enabled/.
|
|
# The stock config sets root to /var/www/venus, so /app/ serves the stock app
|
|
# from /var/www/venus/app/. This script injects a location block so /app/
|
|
# serves from /data/www/app/ instead, with the stock app at /default/app/.
|
|
#
|
|
# Called from rc.local on boot (backgrounded) and directly during install.
|
|
|
|
[ -d /data/www/app ] || exit 0
|
|
|
|
# Wait for nginx runtime config to be generated (may take a moment on boot)
|
|
n=0
|
|
while [ $n -lt 60 ]; do
|
|
conf=$(ls /run/nginx/sites-enabled/* 2>/dev/null | head -n 1)
|
|
[ -n "$conf" ] && break
|
|
n=$((n + 1))
|
|
sleep 1
|
|
done
|
|
|
|
if [ -z "$conf" ]; then
|
|
logger -t mfd-custom-app "nginx config not found after 60s, cannot apply override"
|
|
exit 1
|
|
fi
|
|
|
|
# Skip if already applied
|
|
grep -q "mfd-custom-app-override" "$conf" && exit 0
|
|
|
|
# Write location blocks to a temp file (avoids $uri being expanded by the shell)
|
|
cat > /tmp/mfd-nginx-override.txt << 'OVERRIDE'
|
|
|
|
# mfd-custom-app-override
|
|
location ^~ /app/ { root /data/www; }
|
|
location ^~ /default/app/ { alias /var/www/venus/app/; }
|
|
OVERRIDE
|
|
|
|
# Inject after each 'root /var/www/venus;' (applies to both http and https blocks)
|
|
sed -i '/root \/var\/www\/venus;/r /tmp/mfd-nginx-override.txt' "$conf"
|
|
rm -f /tmp/mfd-nginx-override.txt
|
|
|
|
nginx -s reload 2>/dev/null
|
|
logger -t mfd-custom-app "nginx override applied, custom app serving at /app/"
|