mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-01-19 14:13:34 +01:00
04063d664b
* fix bin folder and workflows as far its possible cleanup of dockerfile changed paths of scripts add lock file fix working directory for workflows fix windows bin fix travis (is travis used anyway?) fix package refs remove pnpm-lock file in root as these conflicts with the docker volume setup optimize comments use install again refactor prod image call to run fix --workspace can only be used inside a workspace correct comment try fix pipeline try fix pipeline for upgrade-from-latest-release install all deps smaller adjustments save update dockerfile remove workspace command fix run test command start repair latest release workflow start repair latest release workflow start repair latest release workflow further repairs * remove test plugin from docker compose
26 lines
1 KiB
JavaScript
Executable file
26 lines
1 KiB
JavaScript
Executable file
#!/usr/bin/env node
|
|
|
|
// Checks the health of Etherpad by visiting http://localhost:9001/health. Returns 0 on success, 1
|
|
// on error as required by the Dockerfile HEALTHCHECK instruction.
|
|
|
|
'use strict';
|
|
|
|
// As of v14, Node.js does not exit when there is an unhandled Promise rejection. Convert an
|
|
// unhandled rejection into an uncaught exception, which does cause Node.js to exit.
|
|
process.on('unhandledRejection', (err) => { throw err; });
|
|
|
|
const assert = require('assert').strict;
|
|
const superagent = require('superagent');
|
|
|
|
(async () => {
|
|
const res = await superagent.get('http://localhost:9001/health')
|
|
.accept('application/health+json')
|
|
.buffer(true)
|
|
.parse(superagent.parse['application/json']);
|
|
assert(res.ok, `Unexpected HTTP status: ${res.status}`);
|
|
assert.equal(res.type, 'application/health+json');
|
|
const {body: {status} = {}} = res;
|
|
assert(status != null);
|
|
assert.equal(typeof status, 'string');
|
|
assert(['pass', 'ok', 'up'].includes(status.toLowerCase()), `Unexpected status: ${status}`);
|
|
})();
|