cloudcms-server 4.0.0-beta.2 → 4.0.0-beta.20
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 +0 -5
- package/cloudcms-server.iml +1 -0
- package/index.js +58 -32
- package/middleware/authentication/authentication.js +40 -12
- package/middleware/authentication/providers/saml.js +8 -4
- package/middleware/awareness/awareness.js +8 -7
- package/middleware/awareness/plugins/api_event.js +105 -0
- package/middleware/awareness/plugins/editorial.js +54 -3
- package/middleware/awareness/plugins/resources.js +13 -5
- package/middleware/config/adapter.js +0 -44
- package/middleware/deployment/deployment.js +22 -24
- package/middleware/driver/driver.js +24 -1
- package/middleware/driver-config/driver-config.js +0 -6
- package/middleware/modules/modules.js +11 -5
- package/middleware/perf/perf.js +3 -2
- package/middleware/registration/registration.js +0 -5
- package/middleware/stores/engines/empty.js +0 -4
- package/middleware/stores/engines/fs-caching-adapter.js +0 -5
- package/middleware/stores/engines/fs.js +0 -9
- package/middleware/stores/engines/s3.js +0 -5
- package/middleware/stores/engines/s3fs.js +0 -5
- package/middleware/stores/multistore.js +0 -29
- package/middleware/stores/store.js +0 -10
- package/middleware/stores/stores.js +2 -2
- package/middleware/virtual-config/virtual-config.js +253 -206
- package/middleware/virtual-files/virtual-files.js +0 -3
- package/middleware/welcome/welcome.js +0 -3
- package/notifications/notifications.js +72 -10
- package/notifications/providers/kafka.js +182 -0
- package/notifications/providers/stomp.js +4 -0
- package/package.json +40 -56
- package/server/index.js +216 -123
- package/server/standalone.js +1 -6
- package/util/auth.js +10 -4
- package/util/cloudcms.js +77 -35
- package/util/loaders.js +113 -0
- package/util/proxy-factory.js +143 -168
- package/util/request.js +6 -2
- package/util/workqueue.js +111 -0
- package/.last_command +0 -7
- package/duster/helpers/core/cloudcms/associations.js +0 -34
- package/duster/helpers/core/cloudcms/beta/markdown.js +0 -46
- package/duster/helpers/core/cloudcms/beta/nodeAttachmentText.js +0 -46
- package/duster/helpers/core/cloudcms/beta/params.js +0 -33
- package/duster/helpers/core/cloudcms/beta/processTemplate.js +0 -82
- package/duster/helpers/core/cloudcms/content.js +0 -34
- package/duster/helpers/core/cloudcms/expand.js +0 -38
- package/duster/helpers/core/cloudcms/form.js +0 -34
- package/duster/helpers/core/cloudcms/query.js +0 -34
- package/duster/helpers/core/cloudcms/queryOne.js +0 -34
- package/duster/helpers/core/cloudcms/relatives.js +0 -34
- package/duster/helpers/core/cloudcms/search.js +0 -34
- package/duster/helpers/core/cloudcms/searchOne.js +0 -34
- package/duster/helpers/core/cloudcms/wcm/dependency.js +0 -83
- package/duster/helpers/core/cloudcms/wcm/fragment.js +0 -34
- package/duster/helpers/core/dev/debug.js +0 -42
- package/duster/helpers/core/dom/block.js +0 -49
- package/duster/helpers/core/dom/include.js +0 -38
- package/duster/helpers/core/dom/layout.js +0 -49
- package/duster/helpers/core/dom/link.js +0 -81
- package/duster/helpers/core/dom/resource.js +0 -77
- package/duster/helpers/core/engine.js +0 -1580
- package/duster/helpers/core/ice/value.js +0 -65
- package/duster/helpers/core/index.js +0 -49
- package/duster/helpers/core/operators/if.js +0 -64
- package/duster/helpers/core/operators/iter.js +0 -45
- package/duster/helpers/core/operators/iterate.js +0 -129
- package/duster/helpers/sample/nyt.js +0 -114
- package/duster/index.js +0 -319
- package/duster/support.js +0 -436
- package/duster/tracker.js +0 -262
- package/middleware/authentication/providers/cas.js +0 -73
- package/middleware/authentication/providers/facebook.js +0 -120
- package/middleware/authentication/providers/github.js +0 -88
- package/middleware/authentication/providers/linkedin.js +0 -112
- package/middleware/authentication/providers/twitter.js +0 -120
- package/middleware/server-tags/server-tags.js +0 -113
- package/middleware/wcm/wcm.js +0 -1437
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
var util = require("../../util/util");
|
|
2
|
-
var duster = require("../../duster/index");
|
|
3
2
|
|
|
4
3
|
/**
|
|
5
4
|
* Deployment middleware.
|
|
@@ -299,10 +298,6 @@ exports = module.exports = function()
|
|
|
299
298
|
logFn("Invalidating application cache for application: " + descriptor.application.id);
|
|
300
299
|
process.cache.invalidateCacheForApp(descriptor.application.id);
|
|
301
300
|
|
|
302
|
-
// invalidate "duster" cache for this application
|
|
303
|
-
logFn("Invalidating duster cache for application: " + descriptor.application.id);
|
|
304
|
-
duster.invalidateCacheForApp(descriptor.application.id);
|
|
305
|
-
|
|
306
301
|
// invalidate gitana driver for this application
|
|
307
302
|
process.broadcast.publish("application_invalidation", {
|
|
308
303
|
"applicationId": descriptor.application.id,
|
|
@@ -348,36 +343,39 @@ exports = module.exports = function()
|
|
|
348
343
|
var rootStore = stores.root;
|
|
349
344
|
rootStore.allocated(function(allocated) {
|
|
350
345
|
|
|
346
|
+
console.log("H2: " + allocated);
|
|
351
347
|
if (!allocated) {
|
|
352
|
-
|
|
348
|
+
callback({
|
|
353
349
|
"message": "The application cannot be started because it is not deployed."
|
|
354
350
|
});
|
|
355
351
|
}
|
|
352
|
+
else
|
|
353
|
+
{
|
|
354
|
+
rootStore.readFile("descriptor.json", function (err, data) {
|
|
356
355
|
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
return callback(err);
|
|
361
|
-
}
|
|
356
|
+
if (err) {
|
|
357
|
+
return callback(err);
|
|
358
|
+
}
|
|
362
359
|
|
|
363
|
-
|
|
360
|
+
data = JSON.parse(data);
|
|
364
361
|
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
362
|
+
// is it already started?
|
|
363
|
+
if (data.active) {
|
|
364
|
+
return callback({
|
|
365
|
+
"message": "The application is already started"
|
|
366
|
+
});
|
|
367
|
+
}
|
|
371
368
|
|
|
372
|
-
|
|
369
|
+
data.active = true;
|
|
373
370
|
|
|
374
|
-
|
|
371
|
+
logFn("Starting application: " + data.application.id + " with host: " + host);
|
|
375
372
|
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
373
|
+
rootStore.writeFile("descriptor.json", JSON.stringify(data, null, " "), function (err) {
|
|
374
|
+
console.log("Start error: "+ err);
|
|
375
|
+
callback(err);
|
|
376
|
+
});
|
|
379
377
|
});
|
|
380
|
-
}
|
|
378
|
+
}
|
|
381
379
|
});
|
|
382
380
|
});
|
|
383
381
|
});
|
|
@@ -3,6 +3,8 @@ var http = require('http');
|
|
|
3
3
|
var util = require("../../util/util");
|
|
4
4
|
var async = require("async");
|
|
5
5
|
|
|
6
|
+
var Loaders = require("../../util/loaders");
|
|
7
|
+
|
|
6
8
|
var Gitana = require("gitana");
|
|
7
9
|
|
|
8
10
|
////////////////////////////////////////////////////////////////////////////
|
|
@@ -38,6 +40,27 @@ exports = module.exports = function()
|
|
|
38
40
|
var r = {};
|
|
39
41
|
|
|
40
42
|
var doConnect = r.doConnect = function(req, gitanaConfig, callback)
|
|
43
|
+
{
|
|
44
|
+
var key = JSON.stringify(gitanaConfig);
|
|
45
|
+
|
|
46
|
+
var loader = function(req, gitanaConfig)
|
|
47
|
+
{
|
|
48
|
+
return function(cb)
|
|
49
|
+
{
|
|
50
|
+
_doConnect(req, gitanaConfig, function(err) {
|
|
51
|
+
cb.call(this, err);
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
}(req, gitanaConfig);
|
|
55
|
+
|
|
56
|
+
var exclusiveLoader = Loaders.exclusive(loader, key, process.defaultExclusiveLockTimeoutMs);
|
|
57
|
+
|
|
58
|
+
exclusiveLoader(function(err) {
|
|
59
|
+
callback.call(this, err);
|
|
60
|
+
});
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
var _doConnect = function(req, gitanaConfig, callback)
|
|
41
64
|
{
|
|
42
65
|
// either connect anew or re-use an existing connection to Cloud CMS for this application
|
|
43
66
|
Gitana.connect(gitanaConfig, function(err) {
|
|
@@ -45,7 +68,7 @@ exports = module.exports = function()
|
|
|
45
68
|
if (err)
|
|
46
69
|
{
|
|
47
70
|
// log as much as we can
|
|
48
|
-
if(process.env.NODE_ENV === "production")
|
|
71
|
+
if (process.env.NODE_ENV === "production")
|
|
49
72
|
{
|
|
50
73
|
console.warn("Error connecting driver (domainHost=" + req.domainHost + ", virtualHost: " + req.virtualHost + ", err: " + JSON.stringify(err));
|
|
51
74
|
}
|
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
var path = require('path');
|
|
2
|
-
var http = require('http');
|
|
3
|
-
var request = require('request');
|
|
4
1
|
var util = require("../../util/util");
|
|
5
|
-
var Gitana = require("gitana");
|
|
6
|
-
|
|
7
|
-
var fs = require("fs");
|
|
8
2
|
|
|
9
3
|
/**
|
|
10
4
|
* Retrieves local driver configuration for hosts from Cloud CMS.
|
|
@@ -55,14 +55,20 @@ exports = module.exports = function()
|
|
|
55
55
|
});
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
|
|
58
|
+
var source = moduleConfig.source40;
|
|
59
|
+
if (!source)
|
|
60
|
+
{
|
|
61
|
+
source = moduleConfig.source;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
if (!source)
|
|
59
65
|
{
|
|
60
66
|
return callback({
|
|
61
67
|
"message": "Missing module config source settings"
|
|
62
68
|
});
|
|
63
69
|
}
|
|
64
70
|
|
|
65
|
-
var sourceType =
|
|
71
|
+
var sourceType = source.type;
|
|
66
72
|
if (!sourceType)
|
|
67
73
|
{
|
|
68
74
|
return callback({
|
|
@@ -70,7 +76,7 @@ exports = module.exports = function()
|
|
|
70
76
|
});
|
|
71
77
|
}
|
|
72
78
|
|
|
73
|
-
var sourceUrl =
|
|
79
|
+
var sourceUrl = source.uri;
|
|
74
80
|
if (!sourceUrl)
|
|
75
81
|
{
|
|
76
82
|
return callback({
|
|
@@ -78,12 +84,12 @@ exports = module.exports = function()
|
|
|
78
84
|
});
|
|
79
85
|
}
|
|
80
86
|
|
|
81
|
-
var sourcePath =
|
|
87
|
+
var sourcePath = source.path;
|
|
82
88
|
if (!sourcePath) {
|
|
83
89
|
sourcePath = "/";
|
|
84
90
|
}
|
|
85
91
|
|
|
86
|
-
var sourceBranch =
|
|
92
|
+
var sourceBranch = source.branch;
|
|
87
93
|
if (!sourceBranch) {
|
|
88
94
|
sourceBranch = "master";
|
|
89
95
|
}
|
package/middleware/perf/perf.js
CHANGED
|
@@ -194,8 +194,9 @@ exports = module.exports = function()
|
|
|
194
194
|
car = filename;
|
|
195
195
|
}
|
|
196
196
|
var regex1 = new RegExp("-[0-9a-f]{32}$"); // md5
|
|
197
|
-
var regex2 = new RegExp("-[0-9]{13}$"); // timestamp
|
|
198
|
-
|
|
197
|
+
var regex2 = new RegExp("-[0-9]{13}$"); // timestamp?
|
|
198
|
+
var regex3 = new RegExp("-[0-9]{10}$"); // epoch millis
|
|
199
|
+
if (regex1.test(car) || regex2.test(car) || regex3.test(car))
|
|
199
200
|
{
|
|
200
201
|
var x = car.lastIndexOf("-");
|
|
201
202
|
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
var path = require('path');
|
|
2
|
-
var fs = require('fs');
|
|
3
|
-
var http = require('http');
|
|
4
1
|
var util = require("../../util/util");
|
|
5
|
-
var Gitana = require("gitana");
|
|
6
|
-
var duster = require("../../duster/index");
|
|
7
2
|
var async = require("async");
|
|
8
3
|
var auth = require("../../util/auth");
|
|
9
4
|
|
|
@@ -84,10 +84,6 @@ exports = module.exports = function(engineId, engineType, engineConfig)
|
|
|
84
84
|
callback(null, null); //data
|
|
85
85
|
};
|
|
86
86
|
|
|
87
|
-
r.watchDirectory = function(directoryPath, onChange)
|
|
88
|
-
{
|
|
89
|
-
};
|
|
90
|
-
|
|
91
87
|
r.moveFile = function(originalFilePath, newFilePath, callback)
|
|
92
88
|
{
|
|
93
89
|
callback(null);
|
|
@@ -442,11 +442,6 @@ exports = module.exports = function(remoteStore, settings)
|
|
|
442
442
|
cacheStore.readFile(filePath, callback);
|
|
443
443
|
};
|
|
444
444
|
|
|
445
|
-
r.watchDirectory = function(directoryPath, onChange)
|
|
446
|
-
{
|
|
447
|
-
// NOT IMPLEMENTED
|
|
448
|
-
};
|
|
449
|
-
|
|
450
445
|
r.moveFile = function(originalFilePath, newFilePath, callback)
|
|
451
446
|
{
|
|
452
447
|
remoteStore.moveFile(originalFilePath, newFilePath, function(err) {
|
|
@@ -4,8 +4,6 @@ var http = require('http');
|
|
|
4
4
|
|
|
5
5
|
var util = require("../../../util/util");
|
|
6
6
|
|
|
7
|
-
var watch = require("watch");
|
|
8
|
-
|
|
9
7
|
var async = require("async");
|
|
10
8
|
|
|
11
9
|
/**
|
|
@@ -217,13 +215,6 @@ exports = module.exports = function(engineConfig)
|
|
|
217
215
|
});
|
|
218
216
|
};
|
|
219
217
|
|
|
220
|
-
r.watchDirectory = function(directoryPath, onChange)
|
|
221
|
-
{
|
|
222
|
-
watch.watchTree(toStoragePath(directoryPath), function(f, curr, prev) {
|
|
223
|
-
onChange(f, curr, prev);
|
|
224
|
-
});
|
|
225
|
-
};
|
|
226
|
-
|
|
227
218
|
r.moveFile = function(originalFilePath, newFilePath, callback)
|
|
228
219
|
{
|
|
229
220
|
fs.rename(toStoragePath(originalFilePath), newFilePath, function(err) {
|
|
@@ -406,11 +406,6 @@ exports = module.exports = function(engineConfig)
|
|
|
406
406
|
});
|
|
407
407
|
};
|
|
408
408
|
|
|
409
|
-
// NOT IMPLEMENTED IN S3
|
|
410
|
-
r.watchDirectory = function(directoryPath, onChange)
|
|
411
|
-
{
|
|
412
|
-
};
|
|
413
|
-
|
|
414
409
|
r.moveFile = function(originalFilePath, newFilePath, callback)
|
|
415
410
|
{
|
|
416
411
|
var originalKey = _toKey(originalFilePath);
|
|
@@ -79,11 +79,6 @@ exports = module.exports = function(engineConfig)
|
|
|
79
79
|
cachingAdapter.readFile(filePath, callback);
|
|
80
80
|
};
|
|
81
81
|
|
|
82
|
-
r.watchDirectory = function(directoryPath, onChange)
|
|
83
|
-
{
|
|
84
|
-
cachingAdapter.watchDirectory(directoryPath, onChange);
|
|
85
|
-
};
|
|
86
|
-
|
|
87
82
|
r.moveFile = function(originalFilePath, newFilePath, callback)
|
|
88
83
|
{
|
|
89
84
|
cachingAdapter.moveFile(originalFilePath, newFilePath, callback);
|
|
@@ -283,35 +283,6 @@ exports = module.exports = function(originalStores)
|
|
|
283
283
|
});
|
|
284
284
|
};
|
|
285
285
|
|
|
286
|
-
r.watchDirectory = function(directoryPath, onChange)
|
|
287
|
-
{
|
|
288
|
-
findFileStores(directoryPath, function(err, stores) {
|
|
289
|
-
|
|
290
|
-
if (err) {
|
|
291
|
-
return;
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
if (stores.length === 0) {
|
|
295
|
-
return;
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
var fns = [];
|
|
299
|
-
for (var i = 0; i < stores.length; i++)
|
|
300
|
-
{
|
|
301
|
-
var fn = function(s, directoryPath) {
|
|
302
|
-
return function(done) {
|
|
303
|
-
s.watchDirectory(directoryPath, onChange);
|
|
304
|
-
done();
|
|
305
|
-
}
|
|
306
|
-
}(stores[i], directoryPath);
|
|
307
|
-
fns.push(fn);
|
|
308
|
-
}
|
|
309
|
-
async.series(fns, function() {
|
|
310
|
-
// done
|
|
311
|
-
});
|
|
312
|
-
});
|
|
313
|
-
};
|
|
314
|
-
|
|
315
286
|
r.moveFile = function(originalFilePath, newFilePath, callback)
|
|
316
287
|
{
|
|
317
288
|
// TODO: not implemented
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
var request = require('request');
|
|
2
1
|
var path = require('path');
|
|
3
2
|
|
|
4
3
|
var util = require("../../util/util");
|
|
@@ -239,15 +238,6 @@ exports = module.exports = function(engine, engineType, engineId, engineConfigur
|
|
|
239
238
|
});
|
|
240
239
|
};
|
|
241
240
|
|
|
242
|
-
r.watchDirectory = function(directoryPath, onChange)
|
|
243
|
-
{
|
|
244
|
-
debugStart("Start store.watchDirectory: " + _enginePath(directoryPath));
|
|
245
|
-
engine.watchDirectory(_enginePath(directoryPath), function(f, curr, prev) {
|
|
246
|
-
debugFinish("Finish store.watchDirectory");
|
|
247
|
-
onChange(f, curr, prev);
|
|
248
|
-
});
|
|
249
|
-
};
|
|
250
|
-
|
|
251
241
|
r.moveFile = function(originalFilePath, newFilePath, callback)
|
|
252
242
|
{
|
|
253
243
|
debugStart("Start store.moveFile");
|
|
@@ -417,7 +417,7 @@ exports = module.exports = function()
|
|
|
417
417
|
var moduleStoreType = moduleDescriptors[i].store;
|
|
418
418
|
var modulePath = moduleDescriptors[i].path;
|
|
419
419
|
|
|
420
|
-
|
|
420
|
+
console.log("Config Store - Module Path: " + modulePath + ", type: " + moduleStoreType);
|
|
421
421
|
|
|
422
422
|
var storePath = path.join(modulePath, "config");
|
|
423
423
|
if (moduleStoreType === "modules")
|
|
@@ -520,7 +520,7 @@ exports = module.exports = function()
|
|
|
520
520
|
callback();
|
|
521
521
|
});
|
|
522
522
|
};
|
|
523
|
-
|
|
523
|
+
|
|
524
524
|
process.cache.read("module-descriptors-" + host, function(err, moduleDescriptors) {
|
|
525
525
|
|
|
526
526
|
moduleDescriptors = null;
|