@atriumchat/install 0.7.1 → 0.7.2

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.1
1
+ # Atrium 0.7.2
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.1/install.sh | sh
16
+ curl -fsSL https://cdn.jsdelivr.net/npm/@atriumchat/install@0.7.2/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.1
56
- RELEASE_SHA256=a731cb23ffd5a273796c3ffffde28ea9da6b62a5abeb80e3ca9b571fbc16b90b
55
+ RELEASE_VERSION=0.7.2
56
+ RELEASE_SHA256=36f0ee977dc5bc784b541d270830179e924eefe691a5164463a302f896d04907
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:d4f63d2b370a9fe686e2f01c92092fa7730b2baef045c42b1f3d4cbce0463f24
61
+ RELEASE_APP_DIGEST=sha256:7e0aa37b22725f7cd1ce91b882a0c0611fdc214cb2c2b1937363ea398c9b15e1
62
62
  RELEASE_CADDY_DIGEST=sha256:cd2cf5a7985bb21afa94786e9779dcf972b89e7e281a0a9b616acc659ce30bbf
63
63
 
64
64
  # == gum, for this run only.
@@ -438,12 +438,27 @@ wait_dns() {
438
438
  for i in $(seq 1 60); do
439
439
  check_dns
440
440
  progress sub "Записей на месте: $DNS_HITS из 3"
441
- (( DNS_OK )) && break
441
+ (( DNS_OK )) && dns_everywhere && break
442
+ (( DNS_OK )) && progress sub "Адрес расходится по интернету"
442
443
  sleep 3
443
444
  done
444
445
  progress "done" address
445
446
  }
446
447
 
448
+ # Every name answers from both Cloudflare and Google with this server's address. Let's Encrypt asks from its own
449
+ # resolvers, and a name one big resolver has while another still fails it (dedyn.io's delegation shows up a little
450
+ # later in some) can fail the certificate; Caddy then waits longer and longer before it tries again (step_https).
451
+ dns_everywhere() {
452
+ local host url out
453
+ for host in "$DOMAIN" "app.$DOMAIN" "$TURN_HOST.$DOMAIN"; do
454
+ for url in "https://cloudflare-dns.com/dns-query?name=$host&type=A" "https://dns.google/resolve?name=$host&type=A"; do
455
+ out=$(curl -fsS --max-time 5 -H 'accept: application/dns-json' "$url" 2>/dev/null) || return 1
456
+ [[ $out == *'"Status":0'* || $out == *'"Status": 0'* ]] || return 1
457
+ [[ -z ${SERVER_IP:-} || $out == *"\"$SERVER_IP\""* ]] || return 1
458
+ done
459
+ done
460
+ }
461
+
447
462
  print_checks() {
448
463
  local item
449
464
  for item in "${CHECK_LINES[@]}"; do
@@ -1076,11 +1091,20 @@ step_up() {
1076
1091
  docker image prune -f
1077
1092
  }
1078
1093
 
1094
+ # The certificate. Caddy asks for it as it starts; when that first try fails (the name not seen everywhere yet), it
1095
+ # waits a minute, then two, four… before the next. A minute without one, Caddy is started again, which asks at once:
1096
+ # the certificate comes within a minute of the name being everywhere instead of after Caddy's next turn. Four minutes
1097
+ # in all; past that it's left to Caddy and the install still ends (screen_done says so).
1079
1098
  step_https() {
1080
1099
  local i
1100
+ cd "$ATRIUM_DIR/deploy" || return
1081
1101
  progress sub "Ждём сертификат от Let's Encrypt"
1082
- for i in $(seq 1 30); do
1102
+ for i in $(seq 1 80); do
1083
1103
  curl -fsS --max-time 5 -o /dev/null --resolve "app.$DOMAIN:443:127.0.0.1" "https://app.$DOMAIN/api/setup" && return 0
1104
+ if (( i % 20 == 0 )); then
1105
+ progress sub "Просим сертификат ещё раз"
1106
+ docker compose restart caddy >/dev/null 2>&1 || true
1107
+ fi
1084
1108
  sleep 3
1085
1109
  done
1086
1110
  return 1
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@atriumchat/install",
3
- "version": "0.7.1",
3
+ "version": "0.7.2",
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.1.tar.gz", "LICENSE"]
9
+ "files": ["install.sh", "atrium-0.7.2.tar.gz", "LICENSE"]
10
10
  }
Binary file