clavarium 0.1.0-next.9 → 0.1.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.
package/deploy/install.sh CHANGED
@@ -263,15 +263,22 @@ if [ "$KEEP_RELEASE" = "yes" ]; then
263
263
  release="$(basename "$(readlink -f "$CODE/current")")"
264
264
  echo " the release that runs is kept: $release"
265
265
  else
266
- if [ -n "$VERSION" ]; then
266
+ if [ -n "$VERSION" ] && [ -L "$CODE/current" ] && [ "$(basename "$(readlink -f "$CODE/current")")" = "$VERSION" ]; then
267
+ # Run again with the version that runs already (a step after it failed, a
268
+ # DNS record made late): kept as it is, and the rest goes on.
269
+ release="$VERSION"
270
+ echo " clavarium@$VERSION runs here already: kept"
271
+ elif [ -n "$VERSION" ]; then
267
272
  echo " clavarium@$VERSION from npm: fetched, checked, built, tried (a few minutes)"
268
273
  release="$(updater prepare --version "$VERSION")" || refuse "clavarium@$VERSION was not installed (above: why)"
269
274
  else
270
275
  echo " the working tree $FROM_DIR (development): copied, built, tried"
271
276
  release="$(updater prepare --from-dir "$FROM_DIR")" || refuse "the working tree was not installed (above: why)"
272
277
  fi
273
- systemctl stop clavarium.service 2>/dev/null || true
274
- updater switch "$release"
278
+ if [ "$(basename "$(readlink -f "$CODE/current" 2>/dev/null)")" != "$release" ]; then
279
+ systemctl stop clavarium.service 2>/dev/null || true
280
+ updater switch "$release"
281
+ fi
275
282
  fi
276
283
  APP="$CODE/current/app"
277
284
  NODE="$CODE/current/node/bin/node"
@@ -701,7 +708,7 @@ elif [ -n "$RELAY" ]; then
701
708
  # It is a PUBLIC key: showing it is safe; it lets the relay know this machine.
702
709
  if command -v qrencode >/dev/null 2>&1 || apt-get install -y -qq qrencode >/dev/null 2>&1; then
703
710
  echo "The same key, to read with a phone or a tablet:"
704
- qrencode -t ANSIUTF8 -m 2 -- "$TUNNEL_KEY" || true
711
+ qrencode -t ANSI -m 1 -l L -- "$TUNNEL_KEY" || true
705
712
  fi
706
713
  echo "It will print this, and it must be the same: $RELAY_PRINT"
707
714
  echo "The name $DOMAIN must lead to the relay."
package/deploy/online.mjs CHANGED
@@ -81,9 +81,9 @@ export function parseOnline(args) {
81
81
  }
82
82
  }
83
83
  if (o.relay && o.port) throw new Bad('say how it will be reached: --relay HOST or --port, not both');
84
- /* Neither: through a relay that does not exist yet -- its key is shown first,
85
- and its address asked once the operator has made it with that key. */
86
- if (!o.relay && !o.port) o.askRelay = true;
84
+ /* Neither: the usual case -- the domain points to the relay, which is
85
+ reached by the domain itself (its address is not needed). */
86
+ if (!o.relay && !o.port) o.relay = o.domain;
87
87
  if (!DOMAIN.test(o.domain)) throw new Bad('--domain is a host name, lower case, like clav.example.com');
88
88
  o.admin ||= `admin@${o.domain}`;
89
89
  if (!EMAIL.test(o.admin)) throw new Bad('--admin is an e-mail address, lower case');
@@ -124,7 +124,7 @@ export async function ensureKeys(sys, P = PATHS) {
124
124
  }
125
125
 
126
126
  async function qr(sys, text) {
127
- const r = await sys.run(['qrencode', '-t', 'ANSIUTF8', '-m', '2', '--', text]);
127
+ const r = await sys.run(['qrencode', '-t', 'ANSI', '-m', '1', '-l', 'L', '--', text]);
128
128
  if (r.code === 0 && r.out) sys.print(r.out.replace(/\n$/, ''));
129
129
  }
130
130
 
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "clavarium",
3
- "version": "0.1.0-next.9",
3
+ "version": "0.1.1",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "clavarium",
9
- "version": "0.1.0-next.9",
9
+ "version": "0.1.1",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@xterm/addon-fit": "^0.11.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clavarium",
3
- "version": "0.1.0-next.9",
3
+ "version": "0.1.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.",