commit 2a432784ce5d375187df177d50f6d0b97c05c634
parent 651bd55ef3d0ff3c54a464e5ca690ca86ac8be17
Author: Juan <juan@fedi.ovh>
Date: Mon, 18 May 2026 11:54:07 +0200
fix(serve): detectar httpd standalone y busybox-extras
el target serve solo probaba `busybox httpd` (como applet), que en Alpine
moderno no esta activado en busybox principal — esta en busybox-extras
como binario aparte o /usr/sbin/httpd. ahora probamos en orden:
darkhttpd, httpd standalone, busybox-extras httpd, busybox httpd applet,
python3.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Diffstat:
1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/Makefile b/Makefile
@@ -23,14 +23,23 @@ vendor/smu:
mkdir -p vendor
git clone --depth=1 https://github.com/Gottox/smu.git vendor/smu
-# httpd minimo (busybox o python -m http.server como fallback)
+# httpd minimo: probamos en orden darkhttpd, httpd (busybox-extras o standalone),
+# busybox httpd como applet, y python como fallback universal.
serve: build
- @if command -v busybox >/dev/null 2>&1; then \
- echo "serving $(OUT)/ on http://localhost:$(PORT)"; \
+ @echo "serving $(OUT)/ on http://localhost:$(PORT)"; \
+ if command -v darkhttpd >/dev/null 2>&1; then \
+ darkhttpd $(OUT) --port $(PORT); \
+ elif command -v httpd >/dev/null 2>&1; then \
+ httpd -f -p $(PORT) -h $(OUT); \
+ elif command -v busybox-extras >/dev/null 2>&1; then \
+ busybox-extras httpd -f -p $(PORT) -h $(OUT); \
+ elif command -v busybox >/dev/null 2>&1 && busybox --list 2>/dev/null | grep -qx httpd; then \
busybox httpd -f -p $(PORT) -h $(OUT); \
- else \
- echo "serving $(OUT)/ on http://localhost:$(PORT) (python)"; \
+ elif command -v python3 >/dev/null 2>&1; then \
cd $(OUT) && python3 -m http.server $(PORT); \
+ else \
+ echo "no httpd encontrado. instala darkhttpd, busybox-extras o python3" >&2; \
+ exit 1; \
fi
install: build