daveappserver 0.6.16 → 0.6.18
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/appserver.js +21 -3
- package/package.json +1 -1
package/appserver.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var myVersion = "0.6.
|
|
1
|
+
var myVersion = "0.6.18", myProductName = "daveAppServer";
|
|
2
2
|
|
|
3
3
|
exports.start = startup;
|
|
4
4
|
exports.notifySocketSubscribers = notifySocketSubscribers;
|
|
@@ -64,6 +64,8 @@ var config = {
|
|
|
64
64
|
|
|
65
65
|
flSecureWebsocket: false, //2/8/23 by DW
|
|
66
66
|
|
|
67
|
+
flUseS3ForStorage: false, //2/15/23 by DW
|
|
68
|
+
|
|
67
69
|
isUserInDatabase: function (screenname, callback) { //2/6/23 by DW
|
|
68
70
|
callback (false);
|
|
69
71
|
},
|
|
@@ -238,7 +240,7 @@ function cleanFileStats (stats) { //4/19/21 by DW
|
|
|
238
240
|
}
|
|
239
241
|
var cleanStats = {
|
|
240
242
|
size: stats.size, //number of bytes in file
|
|
241
|
-
whenAccessed: formatDate (stats.atime), //when last
|
|
243
|
+
whenAccessed: formatDate (stats.atime), //when last read
|
|
242
244
|
whenCreated: formatDate (stats.birthtime),
|
|
243
245
|
whenModified: formatDate (stats.mtime),
|
|
244
246
|
flPrivate: stats.flPrivate
|
|
@@ -414,7 +416,23 @@ function cleanFileStats (stats) { //4/19/21 by DW
|
|
|
414
416
|
}
|
|
415
417
|
|
|
416
418
|
function getFileFromS3 (screenname, relpath, flprivate, callback) {
|
|
417
|
-
|
|
419
|
+
function formatDate (d) {
|
|
420
|
+
return (new Date (d).toUTCString ());
|
|
421
|
+
}
|
|
422
|
+
s3.getObject (getS3FilePath (screenname, relpath, flprivate), function (err, data) {
|
|
423
|
+
if (err) {
|
|
424
|
+
callback (err);
|
|
425
|
+
}
|
|
426
|
+
else {
|
|
427
|
+
var data = {
|
|
428
|
+
filedata: data.Body.toString (),
|
|
429
|
+
filestats: {
|
|
430
|
+
whenModified: formatDate (data.LastModified)
|
|
431
|
+
}
|
|
432
|
+
};
|
|
433
|
+
callback (undefined, data);
|
|
434
|
+
}
|
|
435
|
+
});
|
|
418
436
|
}
|
|
419
437
|
function saveFileToS3 (screenname, relpath, type, flprivate, filetext, callback) {
|
|
420
438
|
const acl = undefined; //use the default
|