fix: auto-detect all LAN IPs for dev auth and HMR

No more manual LAN_HOST or BETTER_AUTH_TRUSTED_ORIGINS for dev.
Uses os.networkInterfaces() to allow all machine IPs automatically.
This commit is contained in:
2026-03-24 03:35:02 +03:00
parent 4cae7b48ef
commit 0e53fba726
3 changed files with 22 additions and 21 deletions

View File

@@ -1377,17 +1377,6 @@ cmd_dev() {
log_warn "MinIO ещё не готов — bucket создастся при следующем запуске"
fi
# Автоопределение LAN IP для auth
local lan_ip
lan_ip=$(hostname -I 2>/dev/null | awk '{print $1}' || true)
if [[ -n "$lan_ip" && -z "$(env_get LAN_HOST)" ]]; then
log_info "LAN IP: ${lan_ip}"
if ! grep -q "^LAN_HOST=" .env 2>/dev/null; then
echo "LAN_HOST=${lan_ip}" >> .env
log_ok "LAN_HOST=${lan_ip} добавлен в .env"
fi
fi
# Запуск
echo ""
log_ok "${GREEN}${BOLD}Готово! Запускаю dev-сервер...${NC}"