carta-controller 2.0.4-dev → 3.0.0-beta.1c
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/.prettierrc.json +18 -0
- package/README.md +3 -3
- package/config/snippet_schema.json +44 -0
- package/dist/auth/google.js.map +1 -1
- package/dist/auth/index.js +1 -1
- package/dist/auth/ldap.js +2 -2
- package/dist/auth/ldap.js.map +1 -1
- package/dist/auth/local.js +1 -1
- package/dist/auth/local.js.map +1 -1
- package/dist/auth/pam.js.map +1 -1
- package/dist/controllerTests.js +14 -11
- package/dist/database.js +93 -0
- package/dist/index.js +2 -2
- package/dist/serverHandlers.js +19 -17
- package/dist/util.js +3 -3
- package/docs/_build/doctrees/environment.pickle +0 -0
- package/docs/_build/doctrees/index.doctree +0 -0
- package/docs/_build/doctrees/introduction.doctree +0 -0
- package/docs/_build/html/.buildinfo +1 -1
- package/docs/_build/html/_sources/index.rst.txt +2 -2
- package/docs/_build/html/_sources/introduction.rst.txt +1 -1
- package/docs/_build/html/_static/config/snippet_schema.json +44 -0
- package/docs/_build/html/_static/documentation_options.js +1 -1
- package/docs/_build/html/configuration.html +1 -1
- package/docs/_build/html/genindex.html +1 -1
- package/docs/_build/html/index.html +2 -2
- package/docs/_build/html/installation.html +1 -1
- package/docs/_build/html/introduction.html +2 -2
- package/docs/_build/html/schema.html +1 -1
- package/docs/_build/html/search.html +1 -1
- package/docs/_build/html/ubuntu_focal_instructions.html +1 -1
- package/docs/src/conf.py +1 -1
- package/docs/src/index.rst +3 -3
- package/docs/src/installation.rst +2 -2
- package/docs/src/introduction.rst +1 -1
- package/docs/src/ubuntu_focal_instructions.rst +2 -2
- package/package.json +6 -3
- package/views/templated.pug +1 -1
package/.prettierrc.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"arrowParens": "avoid",
|
|
3
|
+
"bracketSpacing": false,
|
|
4
|
+
"embeddedLanguageFormatting": "auto",
|
|
5
|
+
"htmlWhitespaceSensitivity": "css",
|
|
6
|
+
"insertPragma": false,
|
|
7
|
+
"jsxBracketSameLine": false,
|
|
8
|
+
"jsxSingleQuote": false,
|
|
9
|
+
"proseWrap": "preserve",
|
|
10
|
+
"quoteProps": "as-needed",
|
|
11
|
+
"requirePragma": false,
|
|
12
|
+
"semi": true,
|
|
13
|
+
"singleQuote": false,
|
|
14
|
+
"trailingComma": "none",
|
|
15
|
+
"useTabs": false,
|
|
16
|
+
"printWidth": 240,
|
|
17
|
+
"tabWidth": 4
|
|
18
|
+
}
|
package/README.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# CARTA Controller
|
|
2
2
|
|
|
3
|
-
[](https://npmjs.org/package/carta-controller "View this project on npm")
|
|
3
|
+
[](https://github.com/CARTAvis/carta-backend/releases/tag/v3.0.0-beta.1c)
|
|
4
|
+
[](https://npmjs.org/package/carta-controller "View this project on npm")
|
|
5
5
|

|
|
6
6
|

|
|
7
7
|
|
|
8
8
|
The CARTA controller provides a simple dashboard which authenticates users and allows them to manage their CARTA backend processes. It also serves static frontend code to clients, and dynamically redirects authenticated client connections to the appropriate backend processes. The controller can either handle authentication itself, or delegate it to an external OAuth2-based authentication server.
|
|
9
9
|
|
|
10
|
-
For installation and configuration instructions, and more detailed information about the controller's features, please consult [the full documentation on ReadTheDocs](https://carta-controller.readthedocs.io/en/
|
|
10
|
+
For installation and configuration instructions, and more detailed information about the controller's features, please consult [the full documentation on ReadTheDocs](https://carta-controller.readthedocs.io/en/dev/).
|
|
11
11
|
|
|
12
12
|
If you encounter a problem with the controller or documentation, please submit an issue in the controller repo. If you need assistance in configuration or deployment, please contact the [CARTA helpdesk](mailto:carta_helpdesk@asiaa.sinica.edu.tw).
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"title": "Snippet",
|
|
4
|
+
"description": "Schema for CARTA Snippet (Version 1)",
|
|
5
|
+
"$id": "carta_snippet_1",
|
|
6
|
+
"required": ["snippetVersion", "frontendVersion", "code"],
|
|
7
|
+
"properties": {
|
|
8
|
+
"snippetVersion": {
|
|
9
|
+
"description": "The version of the snippet contained",
|
|
10
|
+
"type": "integer",
|
|
11
|
+
"minimum": 1,
|
|
12
|
+
"maximum": 1
|
|
13
|
+
},
|
|
14
|
+
"frontendVersion": {
|
|
15
|
+
"description": "The version of the frontend targeted by this snippet",
|
|
16
|
+
"type": "string"
|
|
17
|
+
},
|
|
18
|
+
"code": {
|
|
19
|
+
"description": "Snippet source code",
|
|
20
|
+
"type": "string"
|
|
21
|
+
},
|
|
22
|
+
"tags": {
|
|
23
|
+
"description": "List of tags associated with this snippet",
|
|
24
|
+
"type": "array",
|
|
25
|
+
"items": {
|
|
26
|
+
"type": "string"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"categories": {
|
|
30
|
+
"description": "List of categories under which to place this snippet",
|
|
31
|
+
"type": "array",
|
|
32
|
+
"items": {
|
|
33
|
+
"type": "string"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"requires": {
|
|
37
|
+
"description": "List of snippets (by name) which need to be run before running this snippet",
|
|
38
|
+
"type": "array",
|
|
39
|
+
"items": {
|
|
40
|
+
"type": "string"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
package/dist/auth/google.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"google.js","sourceRoot":"","sources":["../../src/auth/google.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,6DAAiD;AAEpC,QAAA,kBAAkB,GAAG,CAAC,qBAAqB,EAAE,6BAA6B,CAAC,
|
|
1
|
+
{"version":3,"file":"google.js","sourceRoot":"","sources":["../../src/auth/google.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,6DAAiD;AAEpC,QAAA,kBAAkB,GAAG,CAAC,qBAAqB,EAAE,6BAA6B,CAAC,CAAC;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7 @@ const util_1 = require("../util");
|
|
|
8
8
|
let ldap;
|
|
9
9
|
function getLdapLoginHandler(authConf) {
|
|
10
10
|
ldap = new LdapAuth(authConf.ldapOptions);
|
|
11
|
-
ldap.on(
|
|
11
|
+
ldap.on("error", err => console.error("LdapAuth: ", err));
|
|
12
12
|
setTimeout(() => {
|
|
13
13
|
var _a, _b;
|
|
14
14
|
const ldapConnected = (_b = (_a = ldap) === null || _a === void 0 ? void 0 : _a._userClient) === null || _b === void 0 ? void 0 : _b.connected;
|
|
@@ -53,7 +53,7 @@ function getLdapLoginHandler(authConf) {
|
|
|
53
53
|
console.log(`TLS error encountered. Reconnecting to the LDAP server!`);
|
|
54
54
|
ldap.close();
|
|
55
55
|
ldap = new LdapAuth(authConf.ldapOptions);
|
|
56
|
-
ldap.on(
|
|
56
|
+
ldap.on("error", err => console.error("LdapAuth: ", err));
|
|
57
57
|
// Wait for the connection to be re-established
|
|
58
58
|
setTimeout(() => {
|
|
59
59
|
ldap.authenticate(username, password, handleAuth);
|
package/dist/auth/ldap.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ldap.js","sourceRoot":"","sources":["../../src/auth/ldap.ts"],"names":[],"mappings":";;;AACA,iCAAiC;AACjC,0CAA0C;AAE1C,mCAA4C;AAC5C,kCAAiD;
|
|
1
|
+
{"version":3,"file":"ldap.js","sourceRoot":"","sources":["../../src/auth/ldap.ts"],"names":[],"mappings":";;;AACA,iCAAiC;AACjC,0CAA0C;AAE1C,mCAA4C;AAC5C,kCAAiD;AAEjD,IAAI,IAAc,CAAC;AAEnB,SAAgB,mBAAmB,CAAC,QAA6B;IAC7D,IAAI,GAAG,IAAI,QAAQ,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;IAC1C,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,CAAC,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,YAAY,EAAE,GAAG,CAAC,CAAC,CAAC;IAC1D,UAAU,C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}
|
package/dist/auth/local.js
CHANGED
|
@@ -53,7 +53,7 @@ function addTokensToResponse(authConf, username, res) {
|
|
|
53
53
|
exports.addTokensToResponse = addTokensToResponse;
|
|
54
54
|
function generateLocalVerifier(verifierMap, authConf) {
|
|
55
55
|
const publicKey = fs.readFileSync(authConf.publicKeyLocation);
|
|
56
|
-
verifierMap.set(authConf.issuer,
|
|
56
|
+
verifierMap.set(authConf.issuer, cookieString => {
|
|
57
57
|
const payload = jwt.verify(cookieString, publicKey, { algorithm: authConf.keyAlgorithm });
|
|
58
58
|
if (payload && payload.iss === authConf.issuer) {
|
|
59
59
|
return payload;
|
package/dist/auth/local.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local.js","sourceRoot":"","sources":["../../src/auth/local.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,yBAAyB;AACzB,oCAAoC;AAGpC,iCAAiC;AACjC,mCAAoC;AACpC,yBAA0B;AAC1B,sCAAwC;AAExC,IAAI,UAAkB,CAAC;AAEvB,SAAgB,aAAa,CAAC,QAA8B,EAAE,QAAgB,EAAE,YAAqB;IACjG,IAAI,CAAC,UAAU,EAAE;QACb,UAAU,GAAG,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC;KAC7D;IACD,IAAI,CAAC,QAAQ,IAAI,CAAC,UAAU,EAAE;QAC1B,OAAO,IAAI,CAAC;KACf;IACD,OAAO,GAAG,CAAC,IAAI,
|
|
1
|
+
{"version":3,"file":"local.js","sourceRoot":"","sources":["../../src/auth/local.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,yBAAyB;AACzB,oCAAoC;AAGpC,iCAAiC;AACjC,mCAAoC;AACpC,yBAA0B;AAC1B,sCAAwC;AAExC,IAAI,UAAkB,CAAC;AAEvB,SAAgB,aAAa,CAAC,QAA8B,EAAE,QAAgB,EAAE,YAAqB;IACjG,IAAI,CAAC,UAAU,EAAE;QACb,UAAU,GAAG,EAAE,CAAC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AAC,CAAC,IAAI,CAAC,EAAC,UAAU,EAAE,GAAG,EAAE,OAAO,EAAE,iCAAiC,EAAC,CAAC,CAAC;aAC9F;iBAAM;gBACH,IAAI;oBACA,MAAM,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;oBACjC,OAAO,CAAC,GAAG,CAAC,yBAAyB,QAAQ,aAAa,GAAG,YAAY,CAAC,CAAC;oBAC3E,OAAO,2BAAmB,CAAC,QAAQ,EAAE,QAAQ,EAAE,GAAG,CAAC,CAAC;iBACvD;gBAAC,OAAO,CAAC,EAAE;oBACR,OAAO,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAC,UAAU,EAAE,GAAG,EAAE,OAAO,EAAE,qBAAqB,EAAC,CAAC,CAAC;iBAClF;aACJ;QACL,CAAC,CAAC,CAAC;IACP,CAAC,CAAC;AACN,CAAC;AAzBD,gDAyBC"}
|
package/dist/controllerTests.js
CHANGED
|
@@ -49,10 +49,7 @@ function runTests(username) {
|
|
|
49
49
|
}
|
|
50
50
|
exports.runTests = runTests;
|
|
51
51
|
function testLog(username) {
|
|
52
|
-
const logLocation = config_1.ServerConfig.logFileTemplate
|
|
53
|
-
.replace("{username}", username)
|
|
54
|
-
.replace("{pid}", "9999")
|
|
55
|
-
.replace("{datetime}", moment().format("YYYYMMDD.h_mm_ss"));
|
|
52
|
+
const logLocation = config_1.ServerConfig.logFileTemplate.replace("{username}", username).replace("{pid}", "9999").replace("{datetime}", moment().format("YYYYMMDD.h_mm_ss"));
|
|
56
53
|
try {
|
|
57
54
|
const logStream = fs.createWriteStream(logLocation, { flags: "a" });
|
|
58
55
|
logStream.write("test");
|
|
@@ -182,14 +179,20 @@ function testBackendStartup(username) {
|
|
|
182
179
|
const port = config_1.ServerConfig.backendPorts.max - 1;
|
|
183
180
|
let args = [
|
|
184
181
|
"--preserve-env=CARTA_AUTH_TOKEN",
|
|
185
|
-
"-u",
|
|
182
|
+
"-u",
|
|
183
|
+
`${username}`,
|
|
186
184
|
config_1.ServerConfig.processCommand,
|
|
187
|
-
"--no_http",
|
|
188
|
-
"
|
|
189
|
-
"--
|
|
190
|
-
"
|
|
191
|
-
"--
|
|
192
|
-
config_1.ServerConfig.
|
|
185
|
+
"--no_http",
|
|
186
|
+
"true",
|
|
187
|
+
"--debug_no_auth",
|
|
188
|
+
"true",
|
|
189
|
+
"--no_log",
|
|
190
|
+
config_1.ServerConfig.logFileTemplate ? "true" : "false",
|
|
191
|
+
"--port",
|
|
192
|
+
`${port}`,
|
|
193
|
+
"--top_level_folder",
|
|
194
|
+
config_1.ServerConfig.rootFolderTemplate.replace("{username}", username),
|
|
195
|
+
config_1.ServerConfig.baseFolderTemplate.replace("{username}", username)
|
|
193
196
|
];
|
|
194
197
|
if (config_1.ServerConfig.additionalArgs) {
|
|
195
198
|
args = args.concat(config_1.ServerConfig.additionalArgs);
|
package/dist/database.js
CHANGED
|
@@ -19,15 +19,19 @@ const util_1 = require("./util");
|
|
|
19
19
|
const config_1 = require("./config");
|
|
20
20
|
const PREFERENCE_SCHEMA_VERSION = 2;
|
|
21
21
|
const LAYOUT_SCHEMA_VERSION = 2;
|
|
22
|
+
const SNIPPET_SCHEMA_VERSION = 1;
|
|
22
23
|
const preferenceSchema = require("../config/preference_schema_2.json");
|
|
23
24
|
const layoutSchema = require("../config/layout_schema_2.json");
|
|
25
|
+
const snippetSchema = require("../config/snippet_schema.json");
|
|
24
26
|
const ajv = new ajv_1.default({ useDefaults: true, strictTypes: false });
|
|
25
27
|
ajv_formats_1.default(ajv);
|
|
26
28
|
const validatePreferences = ajv.compile(preferenceSchema);
|
|
27
29
|
const validateLayout = ajv.compile(layoutSchema);
|
|
30
|
+
const validateSnippet = ajv.compile(snippetSchema);
|
|
28
31
|
let client;
|
|
29
32
|
let preferenceCollection;
|
|
30
33
|
let layoutsCollection;
|
|
34
|
+
let snippetsCollection;
|
|
31
35
|
function updateUsernameIndex(collection, unique) {
|
|
32
36
|
return __awaiter(this, void 0, void 0, function* () {
|
|
33
37
|
const hasIndex = yield collection.indexExists("username");
|
|
@@ -57,11 +61,13 @@ function initDB() {
|
|
|
57
61
|
client = yield mongodb_1.MongoClient.connect(config_1.ServerConfig.database.uri, { useUnifiedTopology: true });
|
|
58
62
|
const db = yield client.db(config_1.ServerConfig.database.databaseName);
|
|
59
63
|
layoutsCollection = yield createOrGetCollection(db, "layouts");
|
|
64
|
+
snippetsCollection = yield createOrGetCollection(db, "snippets");
|
|
60
65
|
preferenceCollection = yield createOrGetCollection(db, "preferences");
|
|
61
66
|
// Remove any existing validation in preferences collection
|
|
62
67
|
yield db.command({ collMod: "preferences", validator: {}, validationLevel: "off" });
|
|
63
68
|
// Update collection indices if necessary
|
|
64
69
|
yield updateUsernameIndex(layoutsCollection, false);
|
|
70
|
+
yield updateUsernameIndex(snippetsCollection, false);
|
|
65
71
|
yield updateUsernameIndex(preferenceCollection, true);
|
|
66
72
|
console.log(`Connected to server ${config_1.ServerConfig.database.uri} and database ${config_1.ServerConfig.database.databaseName}`);
|
|
67
73
|
}
|
|
@@ -253,6 +259,90 @@ function handleClearLayout(req, res, next) {
|
|
|
253
259
|
}
|
|
254
260
|
});
|
|
255
261
|
}
|
|
262
|
+
function handleGetSnippets(req, res, next) {
|
|
263
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
264
|
+
if (!req.username) {
|
|
265
|
+
return next({ statusCode: 403, message: "Invalid username" });
|
|
266
|
+
}
|
|
267
|
+
if (!snippetsCollection) {
|
|
268
|
+
return next({ statusCode: 501, message: "Database not configured" });
|
|
269
|
+
}
|
|
270
|
+
try {
|
|
271
|
+
const snippetList = yield snippetsCollection.find({ username: req.username }, { projection: { _id: 0, username: 0 } }).toArray();
|
|
272
|
+
const snippets = {};
|
|
273
|
+
for (const entry of snippetList) {
|
|
274
|
+
if (entry.name && entry.snippet) {
|
|
275
|
+
snippets[entry.name] = entry.snippet;
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
res.json({ success: true, snippets });
|
|
279
|
+
}
|
|
280
|
+
catch (err) {
|
|
281
|
+
util_1.verboseError(err);
|
|
282
|
+
return next({ statusCode: 500, message: "Problem retrieving snippets" });
|
|
283
|
+
}
|
|
284
|
+
});
|
|
285
|
+
}
|
|
286
|
+
function handleSetSnippet(req, res, next) {
|
|
287
|
+
var _a, _b, _c;
|
|
288
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
289
|
+
if (!req.username) {
|
|
290
|
+
return next({ statusCode: 403, message: "Invalid username" });
|
|
291
|
+
}
|
|
292
|
+
if (!snippetsCollection) {
|
|
293
|
+
return next({ statusCode: 501, message: "Database not configured" });
|
|
294
|
+
}
|
|
295
|
+
const snippetName = (_a = req.body) === null || _a === void 0 ? void 0 : _a.snippetName;
|
|
296
|
+
const snippet = (_b = req.body) === null || _b === void 0 ? void 0 : _b.snippet;
|
|
297
|
+
// Check for malformed update
|
|
298
|
+
if (!snippetName || !snippet || snippet.snippetVersion !== SNIPPET_SCHEMA_VERSION) {
|
|
299
|
+
return next({ statusCode: 400, message: "Malformed snippet update" });
|
|
300
|
+
}
|
|
301
|
+
const validUpdate = validateSnippet(snippet);
|
|
302
|
+
if (!validUpdate) {
|
|
303
|
+
console.log(validateSnippet.errors);
|
|
304
|
+
return next({ statusCode: 400, message: "Malformed snippet update" });
|
|
305
|
+
}
|
|
306
|
+
try {
|
|
307
|
+
const updateResult = yield snippetsCollection.updateOne({ username: req.username, name: snippetName, snippet }, { $set: { snippet } }, { upsert: true });
|
|
308
|
+
if ((_c = updateResult.result) === null || _c === void 0 ? void 0 : _c.ok) {
|
|
309
|
+
res.json({ success: true });
|
|
310
|
+
}
|
|
311
|
+
else {
|
|
312
|
+
return next({ statusCode: 500, message: "Problem updating snippet" });
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
catch (err) {
|
|
316
|
+
util_1.verboseError(err);
|
|
317
|
+
return next({ statusCode: 500, message: err.errmsg });
|
|
318
|
+
}
|
|
319
|
+
});
|
|
320
|
+
}
|
|
321
|
+
function handleClearSnippet(req, res, next) {
|
|
322
|
+
var _a, _b;
|
|
323
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
324
|
+
if (!req.username) {
|
|
325
|
+
return next({ statusCode: 403, message: "Invalid username" });
|
|
326
|
+
}
|
|
327
|
+
if (!snippetsCollection) {
|
|
328
|
+
return next({ statusCode: 501, message: "Database not configured" });
|
|
329
|
+
}
|
|
330
|
+
const snippetName = (_a = req.body) === null || _a === void 0 ? void 0 : _a.snippetName;
|
|
331
|
+
try {
|
|
332
|
+
const deleteResult = yield snippetsCollection.deleteOne({ username: req.username, name: snippetName });
|
|
333
|
+
if ((_b = deleteResult.result) === null || _b === void 0 ? void 0 : _b.ok) {
|
|
334
|
+
res.json({ success: true });
|
|
335
|
+
}
|
|
336
|
+
else {
|
|
337
|
+
return next({ statusCode: 500, message: "Problem clearing snippet" });
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
catch (err) {
|
|
341
|
+
console.log(err);
|
|
342
|
+
return next({ statusCode: 500, message: "Problem clearing snippet" });
|
|
343
|
+
}
|
|
344
|
+
});
|
|
345
|
+
}
|
|
256
346
|
exports.databaseRouter = express.Router();
|
|
257
347
|
exports.databaseRouter.get("/preferences", auth_1.authGuard, util_1.noCache, handleGetPreferences);
|
|
258
348
|
exports.databaseRouter.put("/preferences", auth_1.authGuard, util_1.noCache, handleSetPreferences);
|
|
@@ -260,4 +350,7 @@ exports.databaseRouter.delete("/preferences", auth_1.authGuard, util_1.noCache,
|
|
|
260
350
|
exports.databaseRouter.get("/layouts", auth_1.authGuard, util_1.noCache, handleGetLayouts);
|
|
261
351
|
exports.databaseRouter.put("/layout", auth_1.authGuard, util_1.noCache, handleSetLayout);
|
|
262
352
|
exports.databaseRouter.delete("/layout", auth_1.authGuard, util_1.noCache, handleClearLayout);
|
|
353
|
+
exports.databaseRouter.get("/snippets", auth_1.authGuard, util_1.noCache, handleGetSnippets);
|
|
354
|
+
exports.databaseRouter.put("/snippet", auth_1.authGuard, util_1.noCache, handleSetSnippet);
|
|
355
|
+
exports.databaseRouter.delete("/snippet", auth_1.authGuard, util_1.noCache, handleClearSnippet);
|
|
263
356
|
//# sourceMappingURL=database.js.map
|
package/dist/index.js
CHANGED
|
@@ -57,7 +57,7 @@ else {
|
|
|
57
57
|
// Prevent caching of the frontend HTML code
|
|
58
58
|
const staticHeaderHandler = (res, path) => {
|
|
59
59
|
if (path.endsWith(".html")) {
|
|
60
|
-
res.setHeader("Cache-Control",
|
|
60
|
+
res.setHeader("Cache-Control", "no-cache");
|
|
61
61
|
}
|
|
62
62
|
};
|
|
63
63
|
if (config_1.ServerConfig.frontendPath) {
|
|
@@ -73,7 +73,7 @@ else {
|
|
|
73
73
|
let bannerDataUri;
|
|
74
74
|
if ((_a = config_1.ServerConfig.dashboard) === null || _a === void 0 ? void 0 : _a.bannerImage) {
|
|
75
75
|
const isBannerSvg = config_1.ServerConfig.dashboard.bannerImage.toLowerCase().endsWith(".svg");
|
|
76
|
-
const bannerDataBase64 = fs.readFileSync(config_1.ServerConfig.dashboard.bannerImage,
|
|
76
|
+
const bannerDataBase64 = fs.readFileSync(config_1.ServerConfig.dashboard.bannerImage, "base64");
|
|
77
77
|
if (isBannerSvg) {
|
|
78
78
|
bannerDataUri = "data:image/svg+xml;base64," + bannerDataBase64;
|
|
79
79
|
}
|
package/dist/serverHandlers.js
CHANGED
|
@@ -27,8 +27,8 @@ const processMap = new Map();
|
|
|
27
27
|
const logMap = new Map();
|
|
28
28
|
const LOG_LIMIT = 1000;
|
|
29
29
|
const userProcessesMetric = io.metric({
|
|
30
|
-
name:
|
|
31
|
-
id:
|
|
30
|
+
name: "Active Backend Processes",
|
|
31
|
+
id: "app/realtime/backend"
|
|
32
32
|
});
|
|
33
33
|
function appendLog(username, output) {
|
|
34
34
|
if (!username) {
|
|
@@ -98,7 +98,7 @@ function handleCheckServer(req, res) {
|
|
|
98
98
|
if (existingProcess) {
|
|
99
99
|
res.json({
|
|
100
100
|
success: true,
|
|
101
|
-
running: true
|
|
101
|
+
running: true
|
|
102
102
|
});
|
|
103
103
|
}
|
|
104
104
|
else {
|
|
@@ -178,13 +178,18 @@ function startServer(username) {
|
|
|
178
178
|
}
|
|
179
179
|
let args = [
|
|
180
180
|
"--preserve-env=CARTA_AUTH_TOKEN",
|
|
181
|
-
"-u",
|
|
181
|
+
"-u",
|
|
182
|
+
`${username}`,
|
|
182
183
|
config_1.ServerConfig.processCommand,
|
|
183
|
-
"--no_http",
|
|
184
|
-
"
|
|
185
|
-
"--
|
|
186
|
-
|
|
187
|
-
|
|
184
|
+
"--no_http",
|
|
185
|
+
"true",
|
|
186
|
+
"--no_log",
|
|
187
|
+
config_1.ServerConfig.logFileTemplate ? "true" : "false",
|
|
188
|
+
"--port",
|
|
189
|
+
`${port}`,
|
|
190
|
+
"--top_level_folder",
|
|
191
|
+
config_1.ServerConfig.rootFolderTemplate.replace("{username}", username),
|
|
192
|
+
config_1.ServerConfig.baseFolderTemplate.replace("{username}", username)
|
|
188
193
|
];
|
|
189
194
|
if (config_1.ServerConfig.additionalArgs) {
|
|
190
195
|
args = args.concat(config_1.ServerConfig.additionalArgs);
|
|
@@ -194,19 +199,16 @@ function startServer(username) {
|
|
|
194
199
|
setPendingProcess(username, port, headerToken, child);
|
|
195
200
|
let logLocation;
|
|
196
201
|
if (config_1.ServerConfig.logFileTemplate) {
|
|
197
|
-
logLocation = config_1.ServerConfig.logFileTemplate
|
|
198
|
-
.replace("{username}", username)
|
|
199
|
-
.replace("{pid}", child.pid.toString())
|
|
200
|
-
.replace("{datetime}", moment().format("YYYYMMDD.h_mm_ss"));
|
|
202
|
+
logLocation = config_1.ServerConfig.logFileTemplate.replace("{username}", username).replace("{pid}", child.pid.toString()).replace("{datetime}", moment().format("YYYYMMDD.h_mm_ss"));
|
|
201
203
|
try {
|
|
202
204
|
logStream = fs.createWriteStream(logLocation, { flags: "a" });
|
|
203
205
|
child.stdout.pipe(logStream);
|
|
204
206
|
child.stderr.pipe(logStream);
|
|
205
|
-
child.stdout.on(
|
|
207
|
+
child.stdout.on("data", function (data) {
|
|
206
208
|
const line = data.toString();
|
|
207
209
|
appendLog(username, line);
|
|
208
210
|
});
|
|
209
|
-
child.stderr.on(
|
|
211
|
+
child.stderr.on("data", function (data) {
|
|
210
212
|
const line = data.toString();
|
|
211
213
|
appendLog(username, line);
|
|
212
214
|
});
|
|
@@ -218,12 +220,12 @@ function startServer(username) {
|
|
|
218
220
|
}
|
|
219
221
|
else {
|
|
220
222
|
logLocation = "stdout";
|
|
221
|
-
child.stdout.on(
|
|
223
|
+
child.stdout.on("data", function (data) {
|
|
222
224
|
const line = data.toString();
|
|
223
225
|
appendLog(username, line);
|
|
224
226
|
console.log(line);
|
|
225
227
|
});
|
|
226
|
-
child.stderr.on(
|
|
228
|
+
child.stderr.on("data", function (data) {
|
|
227
229
|
const line = data.toString();
|
|
228
230
|
appendLog(username, line);
|
|
229
231
|
console.log(line);
|
package/dist/util.js
CHANGED
|
@@ -21,9 +21,9 @@ function delay(delay) {
|
|
|
21
21
|
}
|
|
22
22
|
exports.delay = delay;
|
|
23
23
|
function noCache(req, res, next) {
|
|
24
|
-
res.header(
|
|
25
|
-
res.header(
|
|
26
|
-
res.header(
|
|
24
|
+
res.header("Cache-Control", "private, no-cache, no-store, must-revalidate");
|
|
25
|
+
res.header("Expires", "-1");
|
|
26
|
+
res.header("Pragma", "no-cache");
|
|
27
27
|
next();
|
|
28
28
|
}
|
|
29
29
|
exports.noCache = noCache;
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
# Sphinx build info version 1
|
|
2
2
|
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
|
|
3
|
-
config:
|
|
3
|
+
config: 02e0bf15a989b53b5ebda6fdb8e66ecb
|
|
4
4
|
tags: 645f666f9bcd5a90fca523b33c5a78b7
|
|
@@ -22,9 +22,9 @@ Detailed :ref:`step-by-step instructions<focal_instructions>` are provided for U
|
|
|
22
22
|
ubuntu_focal_instructions
|
|
23
23
|
schema
|
|
24
24
|
|
|
25
|
-
.. |backend-github| image:: https://img.shields.io/badge/CARTA%20Version-
|
|
25
|
+
.. |backend-github| image:: https://img.shields.io/badge/CARTA%20Version-3.0.0--beta.1c-brightgreen
|
|
26
26
|
:alt: View this backend version on GitHub
|
|
27
|
-
:target: https://github.com/CARTAvis/carta-backend/releases/tag/
|
|
27
|
+
:target: https://github.com/CARTAvis/carta-backend/releases/tag/v3.0.0-beta.1c
|
|
28
28
|
|
|
29
29
|
.. |npm-package| image:: https://img.shields.io/npm/v/carta-controller/dev.svg?style=flat
|
|
30
30
|
:alt: View this project on npm
|
|
@@ -10,7 +10,7 @@ The CARTA controller provides a simple dashboard which authenticates users and a
|
|
|
10
10
|
Dependencies
|
|
11
11
|
------------
|
|
12
12
|
|
|
13
|
-
To allow the controller to serve CARTA sessions, you must give it access to an executable CARTA backend, which can be either a compiled executable or a container. If you want to use a non-standard version of the CARTA frontend, you must also build it, and adjust the controller configuration to point to it. You should use the ``
|
|
13
|
+
To allow the controller to serve CARTA sessions, you must give it access to an executable CARTA backend, which can be either a compiled executable or a container. If you want to use a non-standard version of the CARTA frontend, you must also build it, and adjust the controller configuration to point to it. You should use the ``v3.0.0-beta.1c`` tag of `the CARTA backend <https://github.com/CARTAvis/carta-backend>`_.
|
|
14
14
|
|
|
15
15
|
By default, the controller runs on port 8000. It should be run behind a proxy, so that it can be accessed via HTTP and HTTPS.
|
|
16
16
|
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"title": "Snippet",
|
|
4
|
+
"description": "Schema for CARTA Snippet (Version 1)",
|
|
5
|
+
"$id": "carta_snippet_1",
|
|
6
|
+
"required": ["snippetVersion", "frontendVersion", "code"],
|
|
7
|
+
"properties": {
|
|
8
|
+
"snippetVersion": {
|
|
9
|
+
"description": "The version of the snippet contained",
|
|
10
|
+
"type": "integer",
|
|
11
|
+
"minimum": 1,
|
|
12
|
+
"maximum": 1
|
|
13
|
+
},
|
|
14
|
+
"frontendVersion": {
|
|
15
|
+
"description": "The version of the frontend targeted by this snippet",
|
|
16
|
+
"type": "string"
|
|
17
|
+
},
|
|
18
|
+
"code": {
|
|
19
|
+
"description": "Snippet source code",
|
|
20
|
+
"type": "string"
|
|
21
|
+
},
|
|
22
|
+
"tags": {
|
|
23
|
+
"description": "List of tags associated with this snippet",
|
|
24
|
+
"type": "array",
|
|
25
|
+
"items": {
|
|
26
|
+
"type": "string"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"categories": {
|
|
30
|
+
"description": "List of categories under which to place this snippet",
|
|
31
|
+
"type": "array",
|
|
32
|
+
"items": {
|
|
33
|
+
"type": "string"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"requires": {
|
|
37
|
+
"description": "List of snippets (by name) which need to be run before running this snippet",
|
|
38
|
+
"type": "array",
|
|
39
|
+
"items": {
|
|
40
|
+
"type": "string"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
9
9
|
|
|
10
|
-
<title>CARTA Controller — CARTA Controller
|
|
10
|
+
<title>CARTA Controller — CARTA Controller 3.0.0-beta.1c documentation</title>
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
@@ -156,7 +156,7 @@
|
|
|
156
156
|
|
|
157
157
|
<div class="section" id="carta-controller">
|
|
158
158
|
<h1>CARTA Controller<a class="headerlink" href="#carta-controller" title="Permalink to this headline">¶</a></h1>
|
|
159
|
-
<p><a class="reference external" href="https://github.com/CARTAvis/carta-backend/releases/tag/
|
|
159
|
+
<p><a class="reference external" href="https://github.com/CARTAvis/carta-backend/releases/tag/v3.0.0-beta.1c"><img alt="View this backend version on GitHub" src="https://img.shields.io/badge/CARTA%20Version-3.0.0--beta.1c-brightgreen" /></a> <a class="reference external" href="https://npmjs.org/package/carta-controller"><img alt="View this project on npm" src="https://img.shields.io/npm/v/carta-controller/dev.svg?style=flat" /></a> <img alt="Last commit" src="https://img.shields.io/github/last-commit/CARTAvis/carta-controller" /> <img alt="Commit activity" src="https://img.shields.io/github/commit-activity/m/CARTAvis/carta-controller" /></p>
|
|
160
160
|
<p>CARTA is the Cube Analysis and Rendering Tool for Astronomy. This document describes the installation and configuration process for the controller component.</p>
|
|
161
161
|
<p>Detailed <a class="reference internal" href="ubuntu_focal_instructions.html#focal-instructions"><span class="std std-ref">step-by-step instructions</span></a> are provided for Ubuntu 20.04 (Focal Fossa).</p>
|
|
162
162
|
<div class="toctree-wrapper compound">
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
9
9
|
|
|
10
|
-
<title>Introduction — CARTA Controller
|
|
10
|
+
<title>Introduction — CARTA Controller 3.0.0-beta.1c documentation</title>
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
@@ -166,7 +166,7 @@
|
|
|
166
166
|
<p>The CARTA controller provides a simple dashboard which authenticates users and allows them to manage their CARTA backend processes. It also serves static frontend code to clients, and dynamically redirects authenticated client connections to the appropriate backend processes. The controller can either handle authentication itself, or delegate it to an external OAuth2-based authentication server.</p>
|
|
167
167
|
<div class="section" id="dependencies">
|
|
168
168
|
<span id="id2"></span><h2>Dependencies<a class="headerlink" href="#dependencies" title="Permalink to this headline">¶</a></h2>
|
|
169
|
-
<p>To allow the controller to serve CARTA sessions, you must give it access to an executable CARTA backend, which can be either a compiled executable or a container. If you want to use a non-standard version of the CARTA frontend, you must also build it, and adjust the controller configuration to point to it. You should use the <code class="docutils literal notranslate"><span class="pre">
|
|
169
|
+
<p>To allow the controller to serve CARTA sessions, you must give it access to an executable CARTA backend, which can be either a compiled executable or a container. If you want to use a non-standard version of the CARTA frontend, you must also build it, and adjust the controller configuration to point to it. You should use the <code class="docutils literal notranslate"><span class="pre">v3.0.0-beta.1c</span></code> tag of <a class="reference external" href="https://github.com/CARTAvis/carta-backend">the CARTA backend</a>.</p>
|
|
170
170
|
<p>By default, the controller runs on port 8000. It should be run behind a proxy, so that it can be accessed via HTTP and HTTPS.</p>
|
|
171
171
|
<p>MongoDB is required for storing user preferences, layouts and (in the near future) controller metrics.</p>
|
|
172
172
|
<p>You also need a working <a class="reference external" href="https://nodejs.org/en/about/releases/">NodeJS LTS</a> installation with NPM. Use <code class="docutils literal notranslate"><span class="pre">npm</span> <span class="pre">install</span></code> to install all Node dependencies.</p>
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
9
9
|
|
|
10
|
-
<title>CARTA configuration schema — CARTA Controller
|
|
10
|
+
<title>CARTA configuration schema — CARTA Controller 3.0.0-beta.1c documentation</title>
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
9
9
|
|
|
10
|
-
<title>Step-by-step instructions for Ubuntu 20.04.2 (Focal Fossa) — CARTA Controller
|
|
10
|
+
<title>Step-by-step instructions for Ubuntu 20.04.2 (Focal Fossa) — CARTA Controller 3.0.0-beta.1c documentation</title>
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
package/docs/src/conf.py
CHANGED
|
@@ -22,7 +22,7 @@ copyright = '2021, Angus Comrie, Adrianna Pińska and Robert Simmonds'
|
|
|
22
22
|
author = 'Angus Comrie, Adrianna Pińska and Robert Simmonds'
|
|
23
23
|
|
|
24
24
|
# The full version, including alpha/beta/rc tags
|
|
25
|
-
release = '
|
|
25
|
+
release = '3.0.0-beta.1c'
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
# -- General configuration ---------------------------------------------------
|
package/docs/src/index.rst
CHANGED
|
@@ -22,11 +22,11 @@ Detailed :ref:`step-by-step instructions<focal_instructions>` are provided for U
|
|
|
22
22
|
ubuntu_focal_instructions
|
|
23
23
|
schema
|
|
24
24
|
|
|
25
|
-
.. |backend-github| image:: https://img.shields.io/badge/CARTA%20Version-
|
|
25
|
+
.. |backend-github| image:: https://img.shields.io/badge/CARTA%20Version-3.0.0--beta.1c-brightgreen
|
|
26
26
|
:alt: View this backend version on GitHub
|
|
27
|
-
:target: https://github.com/CARTAvis/carta-backend/releases/tag/
|
|
27
|
+
:target: https://github.com/CARTAvis/carta-backend/releases/tag/v3.0.0-beta.1c
|
|
28
28
|
|
|
29
|
-
.. |npm-package| image:: https://img.shields.io/npm/v/carta-controller.svg?style=flat
|
|
29
|
+
.. |npm-package| image:: https://img.shields.io/npm/v/carta-controller/dev.svg?style=flat
|
|
30
30
|
:alt: View this project on npm
|
|
31
31
|
:target: https://npmjs.org/package/carta-controller
|
|
32
32
|
|
|
@@ -8,7 +8,7 @@ Installation
|
|
|
8
8
|
Installing the backend
|
|
9
9
|
----------------------
|
|
10
10
|
|
|
11
|
-
We provide `binary Debian packages <https://launchpad.net/~cartavis-team/+archive/ubuntu/carta>`_ of the latest development and release versions of the CARTA backend for Ubuntu 20.04 (Focal Fossa) and Ubuntu 18.04 (Bionic Beaver). You can install the development version with all dependencies by adding our PPA to your system and running ``apt-get install carta-backend``. Please refer to our :ref:`Ubuntu Focal instructions<focal_instructions>` for more details.
|
|
11
|
+
We provide `binary Debian packages <https://launchpad.net/~cartavis-team/+archive/ubuntu/carta>`_ of the latest development and release versions of the CARTA backend for Ubuntu 20.04 (Focal Fossa) and Ubuntu 18.04 (Bionic Beaver). You can install the development version with all dependencies by adding our PPA to your system and running ``apt-get install carta-backend-beta``. Please refer to our :ref:`Ubuntu Focal instructions<focal_instructions>` for more details.
|
|
12
12
|
|
|
13
13
|
.. note::
|
|
14
14
|
|
|
@@ -28,7 +28,7 @@ If you install the controller from NPM, the corresponding packaged version of th
|
|
|
28
28
|
Installing the controller
|
|
29
29
|
-------------------------
|
|
30
30
|
|
|
31
|
-
You can install the development version of the CARTA controller from NPM by running ``npm install -g carta-controller@
|
|
31
|
+
You can install the development version of the CARTA controller from NPM by running ``npm install -g carta-controller@dev``, or from GitHub by cloning the `controller repository <https://github.com/CARTAvis/carta-controller/>`_ and running ``npm install``.
|
|
32
32
|
|
|
33
33
|
.. _run_controller:
|
|
34
34
|
|
|
@@ -10,7 +10,7 @@ The CARTA controller provides a simple dashboard which authenticates users and a
|
|
|
10
10
|
Dependencies
|
|
11
11
|
------------
|
|
12
12
|
|
|
13
|
-
To allow the controller to serve CARTA sessions, you must give it access to an executable CARTA backend, which can be either a compiled executable or a container. If you want to use a non-standard version of the CARTA frontend, you must also build it, and adjust the controller configuration to point to it. You should use the ``
|
|
13
|
+
To allow the controller to serve CARTA sessions, you must give it access to an executable CARTA backend, which can be either a compiled executable or a container. If you want to use a non-standard version of the CARTA frontend, you must also build it, and adjust the controller configuration to point to it. You should use the ``v3.0.0-beta.1c`` tag of `the CARTA backend <https://github.com/CARTAvis/carta-backend>`_.
|
|
14
14
|
|
|
15
15
|
By default, the controller runs on port 8000. It should be run behind a proxy, so that it can be accessed via HTTP and HTTPS.
|
|
16
16
|
|
|
@@ -20,7 +20,7 @@ Install the CARTA backend and other required packages
|
|
|
20
20
|
sudo apt-get update
|
|
21
21
|
|
|
22
22
|
# Install the development backend package with all dependencies
|
|
23
|
-
sudo apt-get install carta-backend
|
|
23
|
+
sudo apt-get install carta-backend-beta
|
|
24
24
|
|
|
25
25
|
# Install additional packages
|
|
26
26
|
sudo apt-get install nginx g++ mongodb make curl
|
|
@@ -74,7 +74,7 @@ Install CARTA controller
|
|
|
74
74
|
sudo apt-get install -y nodejs build-essential
|
|
75
75
|
|
|
76
76
|
# Install carta-controller (includes frontend config)
|
|
77
|
-
sudo npm install -g --unsafe-perm carta-controller@
|
|
77
|
+
sudo npm install -g --unsafe-perm carta-controller@dev
|
|
78
78
|
|
|
79
79
|
# Install PM2 node service
|
|
80
80
|
sudo npm install -g pm2
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "carta-controller",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0-beta.1c",
|
|
4
4
|
"description": "NodeJS-based controller for CARTA",
|
|
5
5
|
"repository": "https://github.com/CARTAvis/carta-controller",
|
|
6
6
|
"homepage": "https://www.cartavis.org",
|
|
@@ -12,6 +12,8 @@
|
|
|
12
12
|
"scripts": {
|
|
13
13
|
"start": "npx ts-node src/index.ts",
|
|
14
14
|
"test": "npx ts-node src/index.ts --test",
|
|
15
|
+
"reformat": "npx prettier --write ./src",
|
|
16
|
+
"checkformat": "npx prettier --check ./src",
|
|
15
17
|
"prepare": "npx tsc"
|
|
16
18
|
},
|
|
17
19
|
"author": "",
|
|
@@ -21,7 +23,7 @@
|
|
|
21
23
|
"ajv": "^8.2.0",
|
|
22
24
|
"ajv-formats": "^2.1.0",
|
|
23
25
|
"body-parser": "^1.19.0",
|
|
24
|
-
"carta-frontend": "^
|
|
26
|
+
"carta-frontend": "^3.0.0-beta.1c",
|
|
25
27
|
"chalk": "^4.1.1",
|
|
26
28
|
"compression": "^1.7.4",
|
|
27
29
|
"cookie-parser": "^1.4.5",
|
|
@@ -50,7 +52,6 @@
|
|
|
50
52
|
"yargs": "^17.0.1"
|
|
51
53
|
},
|
|
52
54
|
"devDependencies": {
|
|
53
|
-
"@types/tcp-port-used": "^1.0.0",
|
|
54
55
|
"@types/compression": "^1.7.0",
|
|
55
56
|
"@types/cookie-parser": "^1.4.2",
|
|
56
57
|
"@types/cors": "^2.8.10",
|
|
@@ -61,9 +62,11 @@
|
|
|
61
62
|
"@types/mongodb": "^3.6.12",
|
|
62
63
|
"@types/ms": "^0.7.31",
|
|
63
64
|
"@types/node": "^14.14.44",
|
|
65
|
+
"@types/tcp-port-used": "^1.0.0",
|
|
64
66
|
"@types/uuid": "^8.3.0",
|
|
65
67
|
"@types/websocket": "^1.0.2",
|
|
66
68
|
"@types/yargs": "^16.0.1",
|
|
69
|
+
"prettier": "2.3.2",
|
|
67
70
|
"ts-node": "^9.1.1",
|
|
68
71
|
"typescript": "^4.2.4"
|
|
69
72
|
}
|
package/views/templated.pug
CHANGED