clavarium 0.2.41-next.1 → 0.2.43-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.
- package/deploy/updater.mjs +10 -6
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/web/app.js +1 -1
- package/web/index.html +1 -1
package/deploy/updater.mjs
CHANGED
|
@@ -274,7 +274,7 @@ export class Updater {
|
|
|
274
274
|
this.restart = restart ?? (() => this.#restart());
|
|
275
275
|
/* What was seen when the server did not come up: its journal, its unit, who holds its port. */
|
|
276
276
|
this.diagnose = diagnose ?? (() => this.#diagnose());
|
|
277
|
-
this.health = health ?? ((release) => this.#health(release));
|
|
277
|
+
this.health = health ?? ((release, opts) => this.#health(release, opts));
|
|
278
278
|
this.backup = backup ?? ((app) => this.#backup(app));
|
|
279
279
|
this.restoreData = restoreData ?? ((app, archive) => this.#restoreData(app, archive));
|
|
280
280
|
this.installPrivileged = installPrivileged ?? ((app) => this.#installPrivileged(app));
|
|
@@ -606,13 +606,16 @@ export class Updater {
|
|
|
606
606
|
await this.installPrivileged(release.app);
|
|
607
607
|
} catch (error) { return `it could not be put in place: ${error.message}`; }
|
|
608
608
|
this.#step(action, version, 'Restarting');
|
|
609
|
-
|
|
609
|
+
/* Once the new server answers, the maintenance page is gone but a minute or two of
|
|
610
|
+
watching that it stays up is left: said as "Confirming", not "Restarting", so a page
|
|
611
|
+
back up does not look stuck restarting (deploy/updater.mjs, #health onUp). */
|
|
612
|
+
return this.#restartAndCheck(release, () => this.#step(action, version, 'Confirming'));
|
|
610
613
|
}
|
|
611
614
|
/* '' when it came up, or why not. */
|
|
612
|
-
async #restartAndCheck(release) {
|
|
615
|
+
async #restartAndCheck(release, onUp) {
|
|
613
616
|
const r = await this.restart().catch((e) => ({ code: 1, stderr: e.message }));
|
|
614
617
|
if (r?.code) return `the server did not restart: ${lastLine(r)}`;
|
|
615
|
-
const h = await this.health(release).catch((e) => e.message || 'no answer');
|
|
618
|
+
const h = await this.health(release, { onUp }).catch((e) => e.message || 'no answer');
|
|
616
619
|
return h || '';
|
|
617
620
|
}
|
|
618
621
|
|
|
@@ -802,7 +805,7 @@ export class Updater {
|
|
|
802
805
|
|
|
803
806
|
/* Comes up (answers, from this release) within healthMs, then STAYS up: watched until watchMs after
|
|
804
807
|
the restart; one restart by systemd is forgiven if it answers at the end, not two. */
|
|
805
|
-
async #health(release) {
|
|
808
|
+
async #health(release, { onUp } = {}) {
|
|
806
809
|
const { clock, sleep } = this.#o;
|
|
807
810
|
const start = clock();
|
|
808
811
|
const target = realpathSync(release.dir);
|
|
@@ -820,7 +823,8 @@ export class Updater {
|
|
|
820
823
|
if (clock() - start > this.#o.healthMs) return said;
|
|
821
824
|
await sleep(1000);
|
|
822
825
|
}
|
|
823
|
-
/*
|
|
826
|
+
/* It answers, from this release: the maintenance page gives way. Now it must stay up. */
|
|
827
|
+
onUp?.();
|
|
824
828
|
const until = Math.max(start + this.#o.watchMs, clock() + this.#o.settleMs);
|
|
825
829
|
let restarts = 0;
|
|
826
830
|
while (clock() < until) {
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clavarium",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.43-next.1",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "clavarium",
|
|
9
|
-
"version": "0.2.
|
|
9
|
+
"version": "0.2.43-next.1",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@xterm/addon-fit": "^0.11.0",
|
package/package.json
CHANGED
package/web/app.js
CHANGED
|
@@ -4681,7 +4681,7 @@
|
|
|
4681
4681
|
$('updates-state').textContent = running ? `${running.action === 'back' ? 'Going back to' : 'Updating to'} ${running.version}: ${running.step.toLowerCase()}...`
|
|
4682
4682
|
: u.checkError ? 'Could not check just now.'
|
|
4683
4683
|
: u.available ? `${u.available} is out.`
|
|
4684
|
-
: u.checkedAt ? `
|
|
4684
|
+
: u.checkedAt ? `Nothing newer to install · checked ${sinceWords(u.checkedAt)}` : 'Nothing newer to install';
|
|
4685
4685
|
$('updates-check').disabled = Boolean(running);
|
|
4686
4686
|
$('updates-offer').hidden = !u.available || Boolean(running);
|
|
4687
4687
|
/* A version that already failed here is not offered as usual: tried again only on purpose, warned. */
|
package/web/index.html
CHANGED
|
@@ -714,7 +714,7 @@
|
|
|
714
714
|
<div id="updates-settings" class="set-rows">
|
|
715
715
|
<div class="set-row"><div class="set-what"><label for="updates-mode">Mode</label><small>When updates are installed</small></div><div class="set-control"><select id="updates-mode"><option value="auto">Automatic, in a window</option><option value="asap">As soon as out</option><option value="ask">Ask me</option><option value="off">Off</option></select></div></div>
|
|
716
716
|
<div class="set-row" id="updates-window-row"><div class="set-what"><label for="updates-from" id="updates-window-label">Window</label><small>Hours when it may restart</small></div><div class="set-control"><span id="updates-window" class="updates-window"><input type="time" id="updates-from" aria-label="From"><span aria-hidden="true">to</span><input type="time" id="updates-to" aria-label="To"></span></div></div>
|
|
717
|
-
<div class="set-row"><div class="set-what"><label for="updates-channel">Channel</label><small>
|
|
717
|
+
<div class="set-row"><div class="set-what"><label for="updates-channel">Channel</label><small>Which builds to follow; you update only to a version newer than this one</small></div><div class="set-control"><select id="updates-channel"><option value="next">Next (earliest tests)</option><option value="beta">Beta (nearly ready)</option><option value="latest">Stable</option></select></div></div>
|
|
718
718
|
<!-- What the front serves to a browser (server/certificate.mjs). -->
|
|
719
719
|
<div class="set-row" id="updates-certificate-row" hidden><div class="set-what"><span>Certificate</span><small id="updates-certificate" role="status"></small></div></div>
|
|
720
720
|
</div>
|