Kobo: fetch via busybox wget en HTTP direct (curl absent) + port 8899

This commit is contained in:
2026-06-15 11:55:12 +02:00
parent b4cfb74792
commit edf1a81b21
3 changed files with 17 additions and 4 deletions

View File

@@ -5,6 +5,9 @@ services:
container_name: monitorink
restart: unless-stopped
env_file: .env
# Port HTTP direct sur le LAN pour la Kobo (busybox wget, sans Caddy/TLS).
ports:
- "8899:8080"
volumes:
# Login Claude ISOLÉ dédié à Monitorink (lecture/écriture pour le refresh du token).
# Créé via: CLAUDE_CONFIG_DIR=/home/jerem/.monitorink-claude claude auth login

View File

@@ -1,13 +1,16 @@
#!/bin/sh
# Monitorink — point d'entrée lancé par NickelMenu.
export LC_ALL="en_US.UTF-8"
# PATH complet : l'environnement NickelMenu est minimal (curl/ip absents sinon).
export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:$PATH"
BASE="/mnt/onboard/.adds/Monitorink"
LOG="$BASE/monitorink.log" # sur la partition USB-visible (debug via USB)
cd "$BASE" || exit 1
# --- Configuration (adapter au besoin) ---
export MONITORINK_URL="https://monitorink.homelab.nestor-server.fr/image.png"
# HTTP direct vers l'IP du homelab (busybox wget, pas de curl/DNS/TLS requis).
export MONITORINK_URL="http://192.168.0.43:8899/image.png"
export MONITORINK_REFRESH=600
echo "===== monitorink start $(date) =====" >> "$LOG"

View File

@@ -18,6 +18,13 @@ BUSYBOX="./bin/busybox_kobo"
log() { echo "[$(date '+%H:%M:%S')] $*"; }
fetch() {
# busybox wget (toujours présent), fallback curl si dispo dans le PATH.
"$BUSYBOX" wget -q -T 30 -O "$TMP" "$IMAGE_URL" 2>/dev/null && return 0
command -v curl >/dev/null 2>&1 && curl -fsSL -m 30 -o "$TMP" "$IMAGE_URL" 2>/dev/null && return 0
return 1
}
# Ferme les FD hérités pour ne pas bloquer l'éjection USB.
exec 3>&- 2>/dev/null
@@ -55,11 +62,11 @@ while true; do
./scripts/obtain-ip.sh >/dev/null 2>&1
log "ip: $(ip addr show 2>/dev/null | grep -o 'inet [0-9.]*' | grep -v '127.0' | head -1)"
if curl -fsSL -m 30 -o "$TMP" "$IMAGE_URL"; then
log "curl OK ($(wc -c < "$TMP" 2>/dev/null) octets)"
if fetch; then
log "fetch OK ($(wc -c < "$TMP" 2>/dev/null) octets)"
display
else
log "curl ECHEC (rc=$?)"
log "fetch ECHEC"
"$FBINK" -pmh "Monitorink : image indisponible ($(date '+%H:%M'))"
fi