Improve temp proxy install UX
This commit is contained in:
parent
011c7094b2
commit
09ee968422
2 changed files with 43 additions and 2 deletions
17
install.sh
17
install.sh
|
|
@ -2955,14 +2955,27 @@ print_completion() {
|
||||||
echo " Uninstall: curl -sSL https://raw.githubusercontent.com/rcourtman/Pulse/main/install.sh | bash -s -- --uninstall"
|
echo " Uninstall: curl -sSL https://raw.githubusercontent.com/rcourtman/Pulse/main/install.sh | bash -s -- --uninstall"
|
||||||
|
|
||||||
local proxy_status="Not installed"
|
local proxy_status="Not installed"
|
||||||
if [[ -S /run/pulse-sensor-proxy/pulse-sensor-proxy.sock ]]; then
|
local pending_file="/etc/pulse-sensor-proxy/pending-control-plane.env"
|
||||||
proxy_status="Installed (host socket present)"
|
local control_token_file="/etc/pulse-sensor-proxy/.pulse-control-token"
|
||||||
|
|
||||||
|
if [[ "$HOST_PROXY_INSTALLED" == true ]]; then
|
||||||
|
if [[ -f "$control_token_file" ]]; then
|
||||||
|
proxy_status="Installed (control-plane sync active)"
|
||||||
|
elif [[ -f "$pending_file" ]]; then
|
||||||
|
proxy_status="Installed (waiting for Pulse to register host)"
|
||||||
|
else
|
||||||
|
proxy_status="Installed (local allow list)"
|
||||||
|
fi
|
||||||
elif [[ "$HOST_PROXY_REQUESTED" == true ]]; then
|
elif [[ "$HOST_PROXY_REQUESTED" == true ]]; then
|
||||||
proxy_status="Install requested (pending)"
|
proxy_status="Install requested (pending)"
|
||||||
fi
|
fi
|
||||||
echo
|
echo
|
||||||
echo -e "${YELLOW}Temperature proxy:${NC} ${proxy_status}"
|
echo -e "${YELLOW}Temperature proxy:${NC} ${proxy_status}"
|
||||||
|
|
||||||
|
if [[ "$HOST_PROXY_INSTALLED" == true && -f "$pending_file" ]]; then
|
||||||
|
echo " Add this host in Pulse (Settings → Nodes) and the proxy will auto-register."
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ "$IN_CONTAINER" == "true" ]]; then
|
if [[ "$IN_CONTAINER" == "true" ]]; then
|
||||||
local proxy_ctid="${DETECTED_CTID:-<your-container-id>}"
|
local proxy_ctid="${DETECTED_CTID:-<your-container-id>}"
|
||||||
echo
|
echo
|
||||||
|
|
|
||||||
|
|
@ -322,6 +322,34 @@ write_inline_allowed_nodes() {
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
python3 - "$CONFIG_FILE" <<'PY'
|
||||||
|
import sys
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
path = Path(sys.argv[1])
|
||||||
|
if not path.exists():
|
||||||
|
sys.exit(0)
|
||||||
|
|
||||||
|
lines = path.read_text().splitlines()
|
||||||
|
result = []
|
||||||
|
skip = False
|
||||||
|
seen = False
|
||||||
|
for line in lines:
|
||||||
|
stripped = line.strip()
|
||||||
|
if stripped.startswith("allowed_nodes:"):
|
||||||
|
if seen:
|
||||||
|
skip = True
|
||||||
|
continue
|
||||||
|
seen = True
|
||||||
|
if skip:
|
||||||
|
if stripped.startswith("#") or stripped.startswith("-") or stripped == "" or line.startswith((" ", "\t")):
|
||||||
|
continue
|
||||||
|
skip = False
|
||||||
|
result.append(line)
|
||||||
|
|
||||||
|
path.write_text("\n".join(result).rstrip() + "\n")
|
||||||
|
PY
|
||||||
|
|
||||||
python3 - "$CONFIG_FILE" "$comment_line" "${nodes[@]}" <<'PY'
|
python3 - "$CONFIG_FILE" "$comment_line" "${nodes[@]}" <<'PY'
|
||||||
import sys
|
import sys
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue