frugal-iot-server 2.0.9 → 2.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env zsh
2
2
  #
3
- # Report the state of a Frugal IoT installation, for working out why something in INSTALLATION.md
3
+ # Report the state of a Frugal IoT installation, for working out why something in docs/INSTALLATION.md
4
4
  # did not do what it said it would. It only looks - it changes nothing.
5
5
  #
6
6
  # Run it from the directory the server is installed in (the one holding frugal-iot.db):
@@ -85,7 +85,7 @@ for c in node npm sqlite3 zsh mosquitto mosquitto_passwd mosquitto_sub; do
85
85
  esac
86
86
  else
87
87
  item "$c: NOT INSTALLED"
88
- [[ $c == (node|npm|sqlite3) ]] && problem "$c is not installed - see INSTALLATION.md step 3"
88
+ [[ $c == (node|npm|sqlite3) ]] && problem "$c is not installed - see docs/INSTALLATION.md step 3"
89
89
  fi
90
90
  done
91
91
 
@@ -355,7 +355,7 @@ broker_setting() { # name -> value from the broker's own configuration, sudo on
355
355
  broker_setting acl_file; ACLFILE="$BROKER_SETTING"
356
356
  if [[ -z "$ACLFILE" ]]; then
357
357
  item "acl_file: NOT SET - every account that can log in can reach every topic, across all organizations"
358
- problem "The broker has no acl_file. Re-run the install script, or see INSTALLATION.md 'Turn on access control'"
358
+ problem "The broker has no acl_file. Re-run the install script, or see docs/INSTALLATION.md 'Turn on access control'"
359
359
  else
360
360
  item "acl_file: $ACLFILE"
361
361
  if [[ -r "$ACLFILE" ]] || { have sudo && sudo -n test -r "$ACLFILE" 2>/dev/null; }; then
@@ -608,7 +608,7 @@ else
608
608
  fi
609
609
 
610
610
  # Swapping to an SD card wears it fast. On a Pi 4 there should be little or none; a Pi Zero W may
611
- # need some. See INSTALLATION.md, "Wear and tear on the SD card".
611
+ # need some. See docs/INSTALLATION.md, "Wear and tear on the SD card".
612
612
  if have free; then
613
613
  item "swap: $(free -h | awk '/^Swap:/ {print $3 " used of " $2}')"
614
614
  fi
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  /*
3
- * Issue, list or revoke the tokens Grafana uses to read an organization's history (GRAFANA.md).
3
+ * Issue, list or revoke the tokens Grafana uses to read an organization's history (docs/GRAFANA.md).
4
4
  *
5
5
  * npx --no frugal-iot-grafana-token add <org> <username> <name> prints the token - once, it is not kept
6
6
  * npx --no frugal-iot-grafana-token list <org>
package/scripts/init.zsh CHANGED
@@ -48,7 +48,11 @@ copy_if_missing() {
48
48
  fi
49
49
  elif [[ -e "$from" ]]; then
50
50
  mkdir -p "${to:h}"
51
- cp "$from" "$to"
51
+ # extras/ holds a directory (grafana/) as well as files, and a plain cp refuses a directory -
52
+ # which under "set -e" ended the whole init, after server.yaml had been created but before it
53
+ # was pointed at node_modules. The re-run then saw an existing server.yaml and left it alone, so
54
+ # "/" 404ed. -R for a directory, so a failure here cannot strand a half-initialised install.
55
+ if [[ -d "$from" ]]; then cp -R "$from" "$to"; else cp "$from" "$to"; fi
52
56
  COPIED+=("$to")
53
57
  echo " created ${to}"
54
58
  fi