clavarium 0.2.13 → 0.2.14-next.1

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.
@@ -51,6 +51,9 @@
51
51
  # "git read" has its own fixed codes, listed at that verb.
52
52
  # ---------------------------------------------------------------------------
53
53
  set -euo pipefail
54
+ # Every command read here speaks the neutral language: numbers with a point, the same words on any
55
+ # server (a server in French wrote "1756345,00", and the room set aside on its disk was not seen).
56
+ export LC_ALL=C
54
57
 
55
58
  MULTIPASS="multipass"
56
59
  IMAGE="24.04"
@@ -705,15 +708,17 @@ case "$AREA $VERB" in
705
708
  # lvroom <mount point> <volume> <group> <free MB> <file system>
706
709
  [ $# -eq 0 ] || usage
707
710
  if [ "$SAY" = "yes" ]; then echo "findmnt; lvs; vgs (read-only)"; exit 0; fi
708
- command -v lvs >/dev/null 2>&1 || exit 0
711
+ # lvwhy <mount point> <what was read> (its room could not be read: said, for the page)
712
+ command -v lvs >/dev/null 2>&1 || { echo "lvwhy / no-lvm-tools"; exit 0; }
709
713
  for at in / $(findmnt -rn -o TARGET | grep -E '^/(mnt|media)/[A-Za-z0-9/._-]+$|^/home$' || true); do
710
714
  # (Most mounts are no logical volume: under pipefail, a refusal of lvs must not stop this program.)
711
715
  src="$(findmnt -nvo SOURCE -- "$at" 2>/dev/null || true)"; [ -n "$src" ] || continue
712
716
  fs="$(findmnt -nvo FSTYPE -- "$at" 2>/dev/null || true)"
713
- vg="$( { lvs --noheadings -o vg_name -- "$src" 2>/dev/null || true; } | tr -d ' ')"
717
+ vg="$( { LC_ALL=C lvs --noheadings -o vg_name -- "$src" 2>/dev/null || true; } | tr -d ' ')"
714
718
  [ -n "$vg" ] || continue
715
- free="$( { vgs --noheadings --units m --nosuffix -o vg_free -- "$vg" 2>/dev/null || true; } | tr -d ' ' | cut -d. -f1)"
716
- [[ "$free" =~ ^[0-9]+$ ]] || continue
719
+ # In the C locale: a server in French writes "1756345,00", which is no whole number.
720
+ free="$( { LC_ALL=C vgs --noheadings --units m --nosuffix -o vg_free -- "$vg" 2>/dev/null || true; } | tr -d ' ' | tr ',' '.' | cut -d. -f1)"
721
+ [[ "$free" =~ ^[0-9]+$ ]] || { printf 'lvwhy %s %s\n' "$at" "$(printf '%s' "${free:-empty}" | tr -c 'A-Za-z0-9.,_-' '_' | cut -c1-40)"; continue; }
717
722
  printf 'lvroom %s %s %s %s %s\n' "$at" "$src" "$vg" "$free" "$fs"
718
723
  done
719
724
  exit 0 ;;
@@ -727,11 +732,11 @@ case "$AREA $VERB" in
727
732
  mountpoint -q -- "$1" || refuse "nothing is mounted at $1"
728
733
  src="$(findmnt -nvo SOURCE -- "$1")"; fs="$(findmnt -nvo FSTYPE -- "$1")"
729
734
  case "$fs" in ext4|xfs) : ;; *) refuse "$1 holds $fs: only ext4 and xfs are grown here" ;; esac
730
- vg="$( { lvs --noheadings -o vg_name -- "$src" 2>/dev/null || true; } | tr -d ' ')"
735
+ vg="$( { LC_ALL=C lvs --noheadings -o vg_name -- "$src" 2>/dev/null || true; } | tr -d ' ')"
731
736
  [ -n "$vg" ] || refuse "$1 is not on a logical volume: nothing set aside to give it"
732
- free="$( { vgs --noheadings --units m --nosuffix -o vg_free -- "$vg" 2>/dev/null || true; } | tr -d ' ' | cut -d. -f1)"
737
+ free="$( { LC_ALL=C vgs --noheadings --units m --nosuffix -o vg_free -- "$vg" 2>/dev/null || true; } | tr -d ' ' | tr ',' '.' | cut -d. -f1)"
733
738
  [ "${free:-0}" -ge 1024 ] || refuse "less than 1 GB set aside in $vg: nothing worth giving"
734
- lvextend -q -r -l +100%FREE -- "$src" >/dev/null 2>&1 || refuse "the volume of $1 could not be grown"
739
+ LC_ALL=C lvextend -q -r -l +100%FREE -- "$src" >/dev/null 2>&1 || refuse "the volume of $1 could not be grown"
735
740
  printf 'grown %s %s\n' "$1" "$(df -Pm -- "$1" | awk 'NR==2 {print $2}')"
736
741
  exit 0 ;;
737
742
  "disks mount")
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "clavarium",
3
- "version": "0.2.13",
3
+ "version": "0.2.14-next.1",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "clavarium",
9
- "version": "0.2.13",
9
+ "version": "0.2.14-next.1",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@xterm/addon-fit": "^0.11.0",
13
13
  "@xterm/xterm": "^6.0.0",
14
- "clavarium-parley": "0.10.2",
14
+ "clavarium-parley": "0.10.3-next.1",
15
15
  "mermaid": "11.17.2",
16
16
  "node-pty": "^1.1.0",
17
17
  "pdfjs-dist": "6.4.299",
@@ -686,9 +686,9 @@
686
686
  }
687
687
  },
688
688
  "node_modules/clavarium-parley": {
689
- "version": "0.10.2",
690
- "resolved": "https://registry.npmjs.org/clavarium-parley/-/clavarium-parley-0.10.2.tgz",
691
- "integrity": "sha512-HM4zDrSmqEjIxopah+Ykscg871C5BysEDuAWEARUw9iG2I+0cA87L/qHh+s1tiZjsrmIJ2iodvSyxLzxgoHebg==",
689
+ "version": "0.10.3-next.1",
690
+ "resolved": "https://registry.npmjs.org/clavarium-parley/-/clavarium-parley-0.10.3-next.1.tgz",
691
+ "integrity": "sha512-2v6YF/IOfASYqWe7k6f/yskPA4ZShvS4WAt0O6oLDfiSKyBo3YTpuOYIXYNZQesiR7rDQ/ZBZauUCvx2aB26Mw==",
692
692
  "license": "MIT",
693
693
  "bin": {
694
694
  "parley": "bin/parley.mjs",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clavarium",
3
- "version": "0.2.13",
3
+ "version": "0.2.14-next.1",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "description": "A conversation is a VM with a terminal in it. Everything else is a folder.",
@@ -44,7 +44,7 @@
44
44
  "dependencies": {
45
45
  "@xterm/addon-fit": "^0.11.0",
46
46
  "@xterm/xterm": "^6.0.0",
47
- "clavarium-parley": "0.10.2",
47
+ "clavarium-parley": "0.10.3-next.1",
48
48
  "mermaid": "11.17.2",
49
49
  "node-pty": "^1.1.0",
50
50
  "pdfjs-dist": "6.4.299",
@@ -114,9 +114,12 @@ export class MachinesMove {
114
114
  const disks = readDisks(r.stdout);
115
115
  /* Room set aside and not used (a logical volume made small at installation): said on its disk, offered. */
116
116
  const rooms = room.code === 0 ? readRooms(room.stdout) : [];
117
+ /* What could not be read, said on its disk: nobody has to type a command on the server to know. */
118
+ const why = room.code === 0 ? String(room.stdout).split('\n').map((l) => /^lvwhy (\/[A-Za-z0-9/._-]*) ([A-Za-z0-9.,_-]{1,40})$/.exec(l.trim())).filter(Boolean).map((m) => ({ mount: m[1], read: m[2] })) : [{ mount: '/', read: `exit ${room.code}` }];
117
119
  for (const d of disks) {
118
120
  const mounts = d.parts.map((p) => p.mount).filter(Boolean);
119
121
  d.unused = rooms.filter((x) => mounts.includes(x.mount) || (d.system && x.mount === '/'));
122
+ d.unreadable = why.filter((x) => mounts.includes(x.mount) || (d.system && x.mount === '/'));
120
123
  }
121
124
  const now = places?.now?.place ?? null;
122
125
  for (const d of disks) for (const p of d.parts) {
package/web/app.js CHANGED
@@ -3841,6 +3841,8 @@
3841
3841
  });
3842
3842
  box.append(go); card.append(box);
3843
3843
  }
3844
+ /* Its volume's room could not be read: said as it was read, so that it can be put right. */
3845
+ for (const w of d.unreadable ?? []) card.append(el('p', 'hint', w.read === 'no-lvm-tools' ? 'Whether part of this disk is set aside and unused cannot be told: the LVM tools are not installed on this server.' : `Part of this disk may be set aside and unused, but its size could not be read (it said "${w.read}"). Please send this line to whoever looks after Clavarium.`));
3844
3846
  /* PREPARE: erase it, one file system on it, mounted. Its name typed again. */
3845
3847
  if (!d.prepare) {
3846
3848
  const box = el('div', 'disk-prepare');