mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-05-12 14:07:28 +00:00
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"
|
||||
|
||||
local proxy_status="Not installed"
|
||||
if [[ -S /run/pulse-sensor-proxy/pulse-sensor-proxy.sock ]]; then
|
||||
proxy_status="Installed (host socket present)"
|
||||
local pending_file="/etc/pulse-sensor-proxy/pending-control-plane.env"
|
||||
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
|
||||
proxy_status="Install requested (pending)"
|
||||
fi
|
||||
echo
|
||||
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
|
||||
local proxy_ctid="${DETECTED_CTID:-<your-container-id>}"
|
||||
echo
|
||||
|
|
|
|||
|
|
@ -322,6 +322,34 @@ write_inline_allowed_nodes() {
|
|||
return
|
||||
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'
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue