@atriumchat/install 0.7.0 → 0.7.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/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Atrium 0.7.0
1
+ # Atrium 0.7.1
2
2
 
3
3
  Установщик Atrium и архив релиза, который он распаковывает.
4
4
 
@@ -13,7 +13,7 @@ npx @atriumchat/install
13
13
  Без Node:
14
14
 
15
15
  ```sh
16
- curl -fsSL https://cdn.jsdelivr.net/npm/@atriumchat/install@0.7.0/install.sh | sh
16
+ curl -fsSL https://cdn.jsdelivr.net/npm/@atriumchat/install@0.7.1/install.sh | sh
17
17
  ```
18
18
 
19
19
  Основной адрес и исходники: https://github.com/atriumchat/atrium
Binary file
package/install.sh CHANGED
@@ -52,13 +52,13 @@ shopt -u patsub_replacement 2>/dev/null || true
52
52
  umask 022
53
53
 
54
54
  # == The release this installer puts on the server. deploy/release.sh rewrites these lines.
55
- RELEASE_VERSION=0.7.0
56
- RELEASE_SHA256=bdcf551ad4a4bef983bc8892a5016469514a9d31c5e9b5d69d7e4faf811384b2
55
+ RELEASE_VERSION=0.7.1
56
+ RELEASE_SHA256=a731cb23ffd5a273796c3ffffde28ea9da6b62a5abeb80e3ca9b571fbc16b90b
57
57
  RELEASE_REPO=atriumchat/atrium
58
58
  # The npm package that mirrors each release's install.sh and tarball (deploy/release.sh publishes it).
59
59
  RELEASE_NPM=@atriumchat/install
60
60
  RELEASE_REGISTRY=ghcr.io/atriumchat
61
- RELEASE_APP_DIGEST=sha256:1d4e6b5773fdbe7594487528c73b12feb8919caf86265bdfa8f330b55beeae0f
61
+ RELEASE_APP_DIGEST=sha256:d4f63d2b370a9fe686e2f01c92092fa7730b2baef045c42b1f3d4cbce0463f24
62
62
  RELEASE_CADDY_DIGEST=sha256:cd2cf5a7985bb21afa94786e9779dcf972b89e7e281a0a9b616acc659ce30bbf
63
63
 
64
64
  # == gum, for this run only.
@@ -411,12 +411,26 @@ add_app_key() {
411
411
  chmod 700 /root/.ssh
412
412
  touch /root/.ssh/authorized_keys
413
413
  chmod 600 /root/.ssh/authorized_keys
414
- grep -qxF "$key" /root/.ssh/authorized_keys || printf '%s\n' "$key" >>/root/.ssh/authorized_keys
414
+ # Already there (a run again from the app), maybe already pinned to the agent: once is enough.
415
+ grep -qF "${key#ssh-ed25519 }" /root/.ssh/authorized_keys || printf '%s\n' "$key" >>/root/.ssh/authorized_keys
415
416
  log "desktop app key added for root"
416
417
  }
417
418
 
419
+ # Once Atrium runs, the desktop app's key (the line with the comment atrium-app) stops being root: it is pinned to
420
+ # deploy/atrium-agent, which only understands status, update, backup and logs, and loses forwarding and a terminal.
421
+ # The install itself still had the full key (it may need running again); an update pins servers installed before.
422
+ lock_app_key() {
423
+ local f=/root/.ssh/authorized_keys agent=$ATRIUM_DIR/deploy/atrium-agent
424
+ [[ -f $f && -x $agent ]] || return 0
425
+ grep -Eq '^ssh-ed25519 [^ ]+ atrium-app[[:space:]]*$' "$f" || return 0
426
+ sed -i -E "s|^(ssh-ed25519 [^ ]+ atrium-app)[[:space:]]*\$|restrict,command=\"$agent\" \\1|" "$f"
427
+ log "desktop app key pinned to $agent"
428
+ }
429
+
418
430
  # The desktop app sets the address up just before it installs (a free name on dedyn.io, or the person's own
419
- # records), so the installer waits for the names to answer here: the certificates can then come at once.
431
+ # records), and a new name can take minutes to reach every resolver. Only the start and the certificates need it, so
432
+ # the installer waits here after everything else is done (install_all): the wait mostly hides behind Docker and the
433
+ # images instead of holding the install up from its second step.
420
434
  wait_dns() {
421
435
  [[ ${ATRIUM_PROGRESS:-} == 1 ]] || return 0
422
436
  local i
@@ -810,7 +824,7 @@ step_files() {
810
824
  progress sub "Раскладываем файлы"
811
825
  mkdir -p "$stage" || return
812
826
  tar -xzf "$tgz" -C "$stage" --strip-components=1 --no-same-owner || return
813
- for f in deploy/docker-compose.yml deploy/Caddyfile deploy/backup.sh deploy/livekit.yaml.tmpl; do
827
+ for f in deploy/docker-compose.yml deploy/Caddyfile deploy/backup.sh deploy/atrium-agent deploy/livekit.yaml.tmpl; do
814
828
  [[ -f $stage/$f ]] || { echo "Release has no $f"; return 1; }
815
829
  done
816
830
  mkdir -p "$ATRIUM_DIR/deploy" "$ATRIUM_DIR/landing" || return
@@ -819,7 +833,7 @@ step_files() {
819
833
  touch "$ATRIUM_TMP/caddyfile-changed" || return
820
834
  fi
821
835
  install -m 644 "$stage/deploy/docker-compose.yml" "$stage/deploy/Caddyfile" "$stage/deploy/livekit.yaml.tmpl" "$ATRIUM_DIR/deploy/" || return
822
- install -m 755 "$stage/deploy/backup.sh" "$ATRIUM_DIR/deploy/" || return
836
+ install -m 755 "$stage/deploy/backup.sh" "$stage/deploy/atrium-agent" "$ATRIUM_DIR/deploy/" || return
823
837
  return 0
824
838
  }
825
839
 
@@ -1120,6 +1134,10 @@ install_all() {
1120
1134
  run "Настройки и ключи" step_config
1121
1135
  if [[ -d /run/systemd/system ]]; then run "Ночные бэкапы" step_backups; fi
1122
1136
  run "Скачиваем образы" step_pull
1137
+ if [[ ${ATRIUM_PROGRESS:-} == 1 ]]; then
1138
+ wait_dns
1139
+ check_dns
1140
+ fi
1123
1141
  run "Запуск" step_up
1124
1142
  HTTPS_OK=0
1125
1143
  if (( DNS_OK )); then
@@ -1387,14 +1405,15 @@ run_quiet() {
1387
1405
  die "Сервер не готов."
1388
1406
  fi
1389
1407
  progress "done" check
1390
- wait_dns
1408
+ # From the desktop app the address is waited for later, right before the start (install_all).
1391
1409
  check_dns
1392
- if (( ! DNS_OK )); then
1410
+ if (( ! DNS_OK )) && [[ ${ATRIUM_PROGRESS:-} != 1 ]]; then
1393
1411
  say
1394
1412
  warn "DNS ещё не готов:"
1395
1413
  print_dns
1396
1414
  fi
1397
1415
  install_all
1416
+ lock_app_key
1398
1417
  screen_done
1399
1418
  }
1400
1419
 
@@ -1432,6 +1451,7 @@ wizard() {
1432
1451
  header 4
1433
1452
  title "Установка"
1434
1453
  install_all
1454
+ lock_app_key
1435
1455
  screen_done
1436
1456
  return
1437
1457
  ;;
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@atriumchat/install",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "description": "Atrium installer and release files: npx @atriumchat/install, or curl -fsSL https://cdn.jsdelivr.net/npm/@atriumchat/install/install.sh | sh",
5
5
  "homepage": "https://github.com/atriumchat/atrium",
6
6
  "repository": { "type": "git", "url": "git+https://github.com/atriumchat/atrium.git" },
7
7
  "license": "AGPL-3.0-only",
8
8
  "bin": { "atrium-install": "install.sh" },
9
- "files": ["install.sh", "atrium-0.7.0.tar.gz", "LICENSE"]
9
+ "files": ["install.sh", "atrium-0.7.1.tar.gz", "LICENSE"]
10
10
  }
Binary file