v0.4.2
This commit is contained in:
+1
-2
@@ -6,7 +6,6 @@ All operator-facing scripts live in this directory.
|
||||
- `update.sh` — safe in-place update with SQLite/config/binary backup and automatic rollback on failed health check.
|
||||
- `service.sh` — start, stop, restart, status, logs and health helper.
|
||||
- `dev.sh` — development build/run/check workflow.
|
||||
- `build-web.sh` — local/offline Tailwind CSS build; use `--install` once to install the development dependency.
|
||||
- `smoke.sh` — HTTP/API smoke test used by `dev.sh --check`.
|
||||
- `generate_ha_migration.py` — legacy/manual Home Assistant entity mapping helper.
|
||||
- `install-lxc.sh` — compatibility alias for `install.sh`.
|
||||
@@ -17,4 +16,4 @@ All operator-facing scripts live in this directory.
|
||||
- `configure-gree-network.sh <interface>` — configures a dedicated GREE NIC, automatic subnet broadcast, disables the simulator, and restarts the service.
|
||||
- `network-debug.sh <interface> [broadcast-ip]` — prints interface/routing diagnostics and a tcpdump command.
|
||||
|
||||
The running controller never uses a CDN. `web/styles.css` is embedded into the Rust binary. Tailwind is only a local development/build tool.
|
||||
The running controller never uses a CDN or Node.js. `web/styles.css` is a normal static CSS file embedded into the Rust binary; there is no CSS build step.
|
||||
|
||||
Binary file not shown.
@@ -1,52 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -Eeuo pipefail
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
# shellcheck source=common.sh
|
||||
source "$SCRIPT_DIR/common.sh"
|
||||
cd "$PROJECT_ROOT"
|
||||
|
||||
INSTALL=0
|
||||
WATCH=0
|
||||
|
||||
usage() {
|
||||
cat <<'TXT'
|
||||
Build the embedded Web UI CSS with the local Tailwind CLI.
|
||||
|
||||
Usage:
|
||||
./scripts/build-web.sh
|
||||
./scripts/build-web.sh --install install npm dev dependencies first
|
||||
./scripts/build-web.sh --watch rebuild CSS while editing web files
|
||||
|
||||
The controller never loads Tailwind or any CSS from a CDN. web/styles.css is
|
||||
committed and embedded into the Rust binary, so Node.js is not required at runtime.
|
||||
TXT
|
||||
}
|
||||
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case "$1" in
|
||||
--install) INSTALL=1; shift ;;
|
||||
--watch) WATCH=1; shift ;;
|
||||
-h|--help) usage; exit 0 ;;
|
||||
*) echo "Unknown argument: $1" >&2; usage; exit 2 ;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [[ "$INSTALL" -eq 1 ]]; then
|
||||
command -v npm >/dev/null 2>&1 || fail "npm is required for --install. Install Node.js/npm first."
|
||||
say "Installing local Tailwind build dependency"
|
||||
npm install --no-audit --no-fund
|
||||
fi
|
||||
|
||||
TAILWIND="$PROJECT_ROOT/node_modules/.bin/tailwindcss"
|
||||
if [[ ! -x "$TAILWIND" ]]; then
|
||||
fail "Local Tailwind CLI is missing. Run: ./scripts/build-web.sh --install"
|
||||
fi
|
||||
|
||||
if [[ "$WATCH" -eq 1 ]]; then
|
||||
say "Watching the Web UI with local Tailwind"
|
||||
exec "$TAILWIND" -c ./tailwind.config.js -i ./web/tailwind.input.css -o ./web/styles.css --watch
|
||||
fi
|
||||
|
||||
say "Building the Web UI with local Tailwind"
|
||||
"$TAILWIND" -c ./tailwind.config.js -i ./web/tailwind.input.css -o ./web/styles.css --minify
|
||||
say "Generated web/styles.css"
|
||||
@@ -60,14 +60,6 @@ install_build_dependencies() {
|
||||
fi
|
||||
}
|
||||
|
||||
build_web_assets_if_available() {
|
||||
local tailwind="$PROJECT_ROOT/node_modules/.bin/tailwindcss"
|
||||
if [[ -x "$tailwind" ]]; then
|
||||
"$PROJECT_ROOT/scripts/build-web.sh"
|
||||
else
|
||||
say "Using committed offline Web UI CSS (web/styles.css)"
|
||||
fi
|
||||
}
|
||||
|
||||
ensure_rust() {
|
||||
if command -v cargo >/dev/null 2>&1; then
|
||||
|
||||
@@ -46,7 +46,6 @@ else
|
||||
command -v cargo >/dev/null 2>&1 || fail "Cargo is not installed and --no-install was requested."
|
||||
fi
|
||||
|
||||
build_web_assets_if_available
|
||||
|
||||
if [[ ! -f .env ]]; then
|
||||
cp .env.example .env
|
||||
|
||||
@@ -38,7 +38,6 @@ if [[ -x "$INSTALL_BINARY" && -f "$SERVICE_FILE" ]]; then
|
||||
fi
|
||||
install_build_dependencies
|
||||
ensure_rust
|
||||
build_web_assets_if_available
|
||||
|
||||
if command -v systemd-detect-virt >/dev/null 2>&1; then
|
||||
virt="$(systemd-detect-virt --container 2>/dev/null || true)"
|
||||
|
||||
@@ -45,6 +45,11 @@ curl -fsS -X POST -H 'Content-Type: application/json' \
|
||||
-d '{"name":"Test","device_id":"sim-salon","enabled":true,"mode":"cool","setpoint":23,"hysteresis":0.6,"min_on_seconds":0,"min_off_seconds":0,"sensor_source":"device"}' \
|
||||
"http://127.0.0.1:$PORT/api/zones" >"$TMP/zone.json"
|
||||
grep -q '"name":"Test"' "$TMP/zone.json"
|
||||
ZONE_ID="$(python3 -c 'import json,sys; print(json.load(open(sys.argv[1]))["id"])' "$TMP/zone.json")"
|
||||
sleep 3
|
||||
curl -fsS "http://127.0.0.1:$PORT/api/history?zone_id=$ZONE_ID&hours=1" >"$TMP/history.json"
|
||||
grep -q '"readings"' "$TMP/history.json"
|
||||
grep -q '"control_temperature"' "$TMP/history.json"
|
||||
|
||||
curl -fsS "http://127.0.0.1:$PORT/api/readings?device_id=sim-salon&hours=1" >"$TMP/readings.json"
|
||||
grep -q '"readings"' "$TMP/readings.json"
|
||||
|
||||
@@ -40,7 +40,6 @@ require_systemd
|
||||
|
||||
install_build_dependencies
|
||||
ensure_rust
|
||||
build_web_assets_if_available
|
||||
version="$(project_version)"
|
||||
say "Preparing update to GREE Controller ${version:-unknown}"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user