mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-13 07:04:53 +09:00
Add winston based logger for master, slave, ctl, lib, and web_ui code. Logging done from slaves and instances are sent to the master server and tagged with the instance and/or slave it originated from. This allows for example error messages to propagate back to the source that iniated the action. The master server also stores the log to allow it to be queried at a later point. For slaves a copy of the slave's log is also stored locally.
34 lines
952 B
JavaScript
34 lines
952 B
JavaScript
"use strict";
|
|
const assert = require("assert");
|
|
const fs = require("fs-extra");
|
|
const path = require("path");
|
|
|
|
const generateSslCert = require("@clusterio/master/src/generate_ssl_cert");
|
|
|
|
describe("generate_ssl_cert", function() {
|
|
let testDir = path.join("temp", "test", "certTest");
|
|
before(async function() {
|
|
await fs.remove(testDir);
|
|
});
|
|
|
|
it("Creates a folder with a .crt and .key file in it", async function() {
|
|
this.timeout(1000);
|
|
// eslint-disable-next-line no-process-env
|
|
if (process.env.FAST_TEST) {
|
|
this.skip();
|
|
}
|
|
|
|
let certPath = path.join(testDir, "cert.crt");
|
|
let privKeyPath = path.join(testDir, "cert.key");
|
|
|
|
await generateSslCert({
|
|
bits: 512, // This is too small for real world usage, but faster to test
|
|
sslCertPath: certPath,
|
|
sslPrivKeyPath: privKeyPath,
|
|
});
|
|
|
|
assert(await fs.exists(certPath), "cert file was not created");
|
|
assert(await fs.exists(privKeyPath), "key file was not created");
|
|
});
|
|
});
|