isite 2024.8.5 → 2024.8.6
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/LICENSE +21 -21
- package/README.md +1384 -1387
- package/apps/charts/site_files/html/PieChart.html +35 -35
- package/apps/charts/site_files/html/PieChart2.html +35 -35
- package/apps/charts/site_files/html/XYChart.html +42 -42
- package/apps/charts/site_files/html/column.html +60 -60
- package/apps/charts/site_files/html/gauge.html +44 -44
- package/apps/charts/site_files/html/index.html +92 -92
- package/apps/charts/site_files/html/line-graph.html +42 -42
- package/apps/charts/site_files/html/pie-chart-rounded-corners.html +38 -38
- package/apps/charts/site_files/html/simple-3D-pie-chart.html +43 -43
- package/apps/charts/site_files/js/chart-animated.js +2 -2
- package/apps/charts/site_files/json/PieChart.json +41 -41
- package/apps/charts/site_files/json/PieChart2.json +23 -23
- package/apps/charts/site_files/json/XYChart.json +74 -74
- package/apps/charts/site_files/json/bar-chart.json +99 -99
- package/apps/charts/site_files/json/column-chart.json +80 -80
- package/apps/charts/site_files/json/gauge.json +36 -36
- package/apps/charts/site_files/json/line-graph.json +1867 -1867
- package/apps/charts/site_files/json/pie-chart-rounded-corners.json +42 -42
- package/apps/charts/site_files/json/simple-3D-pie-chart.json +50 -50
- package/apps/client-side/package-lock.json +5 -5
- package/apps/client-side/package.json +21 -21
- package/apps/client-side/site_files/css/bootstrap3.css +5 -5
- package/apps/client-side/site_files/css/bootstrap4.css +6 -6
- package/apps/client-side/site_files/css/bootstrap5.css +6 -6
- package/apps/client-side/site_files/css/checkbox.css +125 -125
- package/apps/client-side/site_files/css/font-awesome.css +4616 -4616
- package/apps/client-side/site_files/css/font-awesome.min.css +4 -4
- package/apps/client-side/site_files/css/fonts.css +85 -85
- package/apps/client-side/site_files/css/help.css +51 -51
- package/apps/client-side/site_files/css/main-menu.css +66 -66
- package/apps/client-side/site_files/css/print.css +144 -144
- package/apps/client-side/site_files/css/prism.css +139 -139
- package/apps/client-side/site_files/css/progress.css +7 -7
- package/apps/client-side/site_files/css/radio.css +103 -103
- package/apps/client-side/site_files/css/scrollbar.css +13 -13
- package/apps/client-side/site_files/css/semantic.css +363 -363
- package/apps/client-side/site_files/css/table.css +87 -87
- package/apps/client-side/site_files/css/treeview.css +84 -84
- package/apps/client-side/site_files/css/ui.css +28 -28
- package/apps/client-side/site_files/css/video-js.min.css +1 -0
- package/apps/client-side/site_files/fonts/fontawesome-webfont.svg +2671 -2671
- package/apps/client-side/site_files/fonts/glyphicons-halflings-regular.svg +287 -287
- package/apps/client-side/site_files/fonts/icons.svg +684 -684
- package/apps/client-side/site_files/js/Youtube.min.js +1 -0
- package/apps/client-side/site_files/js/angular-animate.js +4179 -4179
- package/apps/client-side/site_files/js/angular.js +36599 -36599
- package/apps/client-side/site_files/js/angular.min.js +351 -351
- package/apps/client-side/site_files/js/angular.min.js.map +8 -8
- package/apps/client-side/site_files/js/barcode.js +1 -1
- package/apps/client-side/site_files/js/base64.js +319 -319
- package/apps/client-side/site_files/js/bootstrap-5-directive.js +1456 -1456
- package/apps/client-side/site_files/js/bootstrap3.js +6 -6
- package/apps/client-side/site_files/js/bootstrap4.js +6 -6
- package/apps/client-side/site_files/js/bootstrap5.js +6 -6
- package/apps/client-side/site_files/js/custom.js +149 -149
- package/apps/client-side/site_files/js/directive.min.js +1 -1
- package/apps/client-side/site_files/js/hijri.js +965 -965
- package/apps/client-side/site_files/js/jquery.js +2 -2
- package/apps/client-side/site_files/js/moment.js +4511 -4511
- package/apps/client-side/site_files/js/prism.js +6 -6
- package/apps/client-side/site_files/js/qrcode.js +1398 -1398
- package/apps/client-side/site_files/js/semantic.js +10 -10
- package/apps/client-side/site_files/js/video.min.js +53 -0
- package/apps/client-side/site_files/js/xlsx.js +23 -23
- package/apps/client-side/site_files/semantic-themes/default/assets/fonts/brand-icons.svg +1008 -1008
- package/apps/client-side/site_files/semantic-themes/default/assets/fonts/icons.svg +1518 -1518
- package/apps/client-side/site_files/semantic-themes/default/assets/fonts/outline-icons.svg +366 -366
- package/apps/client-side/site_files/webfonts/fa-brands-400.svg +3717 -3717
- package/apps/client-side/site_files/webfonts/fa-regular-400.svg +801 -801
- package/apps/client-side/site_files/webfonts/fa-solid-900.svg +5034 -5034
- package/apps/security/README.md +12 -12
- package/apps/security/app.js +288 -288
- package/apps/security/libs/notifications.js +89 -89
- package/apps/security/site_files/html/add_modal.html +36 -36
- package/apps/security/site_files/html/content.html +36 -36
- package/apps/security/site_files/html/delete_modal.html +31 -31
- package/apps/security/site_files/html/head.html +7 -7
- package/apps/security/site_files/html/index.html +80 -80
- package/apps/security/site_files/html/login_modal.html +24 -24
- package/apps/security/site_files/html/logout_modal.html +21 -21
- package/apps/security/site_files/html/navbar.html +8 -8
- package/apps/security/site_files/html/register_modal.html +32 -32
- package/apps/security/site_files/html/update_modal.html +28 -28
- package/apps/security/site_files/html/view.html +74 -74
- package/apps/security/site_files/html/view_modal.html +32 -32
- package/apps/security/site_files/js/app.js +1 -1
- package/apps/security/site_files/js/index.js +278 -278
- package/apps/security/site_files/js/login.js +35 -35
- package/apps/security/site_files/js/logout.js +22 -22
- package/apps/security/site_files/js/navbar.js +26 -26
- package/apps/security/site_files/js/register.js +30 -30
- package/apps/security/site_files/json/permissions.json +7 -7
- package/apps/security/site_files/json/roles.json +33 -33
- package/apps/security/site_files/json/words.json +28 -28
- package/gulpfile.js +17 -17
- package/isite.postman_collection.json +7 -7
- package/isite_files/css/bootstrap.css +5 -5
- package/isite_files/css/font-awesome.css +4 -4
- package/isite_files/css/prism.css +139 -139
- package/isite_files/fonts/fontawesome-webfont.svg +2671 -2671
- package/isite_files/fonts/glyphicons-halflings-regular.svg +287 -287
- package/isite_files/html/files.html +9 -9
- package/isite_files/html/head.html +12 -12
- package/isite_files/html/index.html +30 -30
- package/isite_files/html/installing.html +27 -27
- package/isite_files/html/navbar.html +51 -51
- package/isite_files/html/routes.html +13 -13
- package/isite_files/html/sessions.html +13 -13
- package/isite_files/html/vars.html +9 -9
- package/isite_files/js/angular.js +334 -334
- package/isite_files/js/bootstrap.js +6 -6
- package/isite_files/js/custom.js +149 -149
- package/isite_files/js/jquery.js +4 -4
- package/isite_files/js/prism.js +6 -6
- package/lib/README.md +1 -1
- package/lib/collection.js +92 -41
- package/lib/cookie.js +81 -81
- package/lib/dashboard.js +189 -189
- package/lib/mongodb.js +819 -756
- package/lib/parser.js +910 -910
- package/lib/security.js +48 -57
- package/lib/session.js +153 -153
- package/object-options/index.js +3 -3
- package/object-options/lib/isite.code-workspace +10 -10
- package/package.json +58 -58
- package/ssl/create_ssl.sh +3 -3
package/lib/security.js
CHANGED
|
@@ -9,20 +9,13 @@ module.exports = function init(____0) {
|
|
|
9
9
|
db: ____0.options.security.db,
|
|
10
10
|
});
|
|
11
11
|
|
|
12
|
-
/** Email Must Not Duplicate */
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
},
|
|
17
|
-
(
|
|
18
|
-
|
|
19
|
-
{
|
|
20
|
-
email: 1,
|
|
21
|
-
},
|
|
22
|
-
() => {}
|
|
23
|
-
);
|
|
24
|
-
}
|
|
25
|
-
);
|
|
12
|
+
/** Email Must Not Duplicate but can be null */
|
|
13
|
+
|
|
14
|
+
____0.$users.dropIndexes(() => {
|
|
15
|
+
____0.$users.createIndex({ email: 1 }, { unique: true, partialFilterExpression: { email: { $exists: true } } }, () => {});
|
|
16
|
+
____0.$users.createIndex({ username: 1 }, { unique: true, partialFilterExpression: { username: { $exists: true } } }, () => {});
|
|
17
|
+
____0.$users.createIndex({ mobile: 1 }, { unique: true, partialFilterExpression: { mobile: { $exists: true } } }, () => {});
|
|
18
|
+
});
|
|
26
19
|
|
|
27
20
|
____0.$roles.deleteDuplicate(
|
|
28
21
|
{
|
|
@@ -393,39 +386,37 @@ module.exports = function init(____0) {
|
|
|
393
386
|
});
|
|
394
387
|
};
|
|
395
388
|
|
|
396
|
-
security.getUser = function (
|
|
389
|
+
security.getUser = function (_user, callback) {
|
|
397
390
|
callback = callback || function () {};
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
(
|
|
403
|
-
(!user.key &&
|
|
404
|
-
(
|
|
405
|
-
(
|
|
406
|
-
(user.key && userArgs.key && user.key === userArgs.key) ||
|
|
407
|
-
(user.key && userArgs.email && user.key === ____0.x0md50x(userArgs.email.trim().toLowerCase()))
|
|
408
|
-
) {
|
|
409
|
-
user.$memory = !0;
|
|
410
|
-
user = security.handleUser(user);
|
|
411
|
-
callback(null, user);
|
|
412
|
-
return;
|
|
413
|
-
}
|
|
414
|
-
}
|
|
415
|
-
|
|
416
|
-
____0.$users.findOne(
|
|
417
|
-
{
|
|
418
|
-
where: userArgs,
|
|
419
|
-
select: {},
|
|
420
|
-
},
|
|
421
|
-
function (err, doc) {
|
|
422
|
-
if (doc && (userArgs.id || userArgs.email)) {
|
|
423
|
-
doc = security.handleUser(doc);
|
|
424
|
-
security.users.push(doc);
|
|
425
|
-
}
|
|
426
|
-
callback(err, doc);
|
|
427
|
-
}
|
|
391
|
+
let index = security.users.findIndex(
|
|
392
|
+
(user) =>
|
|
393
|
+
(_user.id && user.id === _user.id) ||
|
|
394
|
+
(!user.key && _user.email && user.email === _user.email.trim().toLowerCase()) ||
|
|
395
|
+
(!user.key && _user.username && user.username === _user.username.trim().toLowerCase()) ||
|
|
396
|
+
(!user.key && _user.mobile && user.mobile === _user.mobile.trim().toLowerCase()) ||
|
|
397
|
+
(user.key && _user.key && user.key === _user.key) ||
|
|
398
|
+
(user.key && _user.email && user.key === ____0.x0md50x(_user.email.trim().toLowerCase()))
|
|
428
399
|
);
|
|
400
|
+
if (index !== -1) {
|
|
401
|
+
security.users[index].$memory = !0;
|
|
402
|
+
security.users[index] = security.handleUser(security.users[index]);
|
|
403
|
+
callback(null, security.users[index]);
|
|
404
|
+
return;
|
|
405
|
+
} else {
|
|
406
|
+
____0.$users.findOne(
|
|
407
|
+
{
|
|
408
|
+
where: _user,
|
|
409
|
+
select: {},
|
|
410
|
+
},
|
|
411
|
+
function (err, doc) {
|
|
412
|
+
if (!err && doc) {
|
|
413
|
+
doc = security.handleUser(doc);
|
|
414
|
+
security.users.push(doc);
|
|
415
|
+
}
|
|
416
|
+
callback(err, doc);
|
|
417
|
+
}
|
|
418
|
+
);
|
|
419
|
+
}
|
|
429
420
|
};
|
|
430
421
|
|
|
431
422
|
security.isUserExists = function (user, callback) {
|
|
@@ -480,8 +471,8 @@ module.exports = function init(____0) {
|
|
|
480
471
|
user.email = user.email.trim().toLowerCase();
|
|
481
472
|
} else if (user && user.mobile && user.password) {
|
|
482
473
|
user.mobile = user.mobile.trim().toLowerCase();
|
|
483
|
-
} else if (user && user.
|
|
484
|
-
user.
|
|
474
|
+
} else if (user && user.username && user.password) {
|
|
475
|
+
user.username = user.username.trim().toLowerCase();
|
|
485
476
|
} else {
|
|
486
477
|
callback({
|
|
487
478
|
message: 'User Info Not Correct',
|
|
@@ -494,7 +485,7 @@ module.exports = function init(____0) {
|
|
|
494
485
|
if (
|
|
495
486
|
(!_user.key && user.email && _user.email === user.email && _user.password === user.password) ||
|
|
496
487
|
(!_user.key && user.mobile && _user.mobile === user.mobile && _user.password === user.password) ||
|
|
497
|
-
(!_user.key && user.
|
|
488
|
+
(!_user.key && user.username && _user.username === user.username && _user.password === user.password) ||
|
|
498
489
|
(_user.key && user.key && _user.key === user.key) ||
|
|
499
490
|
(_user.key && user.email && user.password && _user.key === ____0.x0md50x(user.email + user.password))
|
|
500
491
|
) {
|
|
@@ -523,8 +514,8 @@ module.exports = function init(____0) {
|
|
|
523
514
|
where.email = user.email;
|
|
524
515
|
} else if (user.mobile) {
|
|
525
516
|
where.mobile = user.mobile;
|
|
526
|
-
} else if (user.
|
|
527
|
-
where.
|
|
517
|
+
} else if (user.username) {
|
|
518
|
+
where.username = user.username;
|
|
528
519
|
} else {
|
|
529
520
|
callback({
|
|
530
521
|
message: 'User Info Not Correct',
|
|
@@ -585,8 +576,8 @@ module.exports = function init(____0) {
|
|
|
585
576
|
user.email = user.email.trim().toLowerCase();
|
|
586
577
|
} else if (user && user.mobile && user.password) {
|
|
587
578
|
user.mobile = user.mobile.trim().toLowerCase();
|
|
588
|
-
} else if (user && user.
|
|
589
|
-
user.
|
|
579
|
+
} else if (user && user.username && user.password) {
|
|
580
|
+
user.username = user.username.trim().toLowerCase();
|
|
590
581
|
} else {
|
|
591
582
|
callback({
|
|
592
583
|
message: 'User Info Not Correct',
|
|
@@ -672,8 +663,8 @@ module.exports = function init(____0) {
|
|
|
672
663
|
user.email = user.email.trim().toLowerCase();
|
|
673
664
|
} else if (user && user.mobile && user.password) {
|
|
674
665
|
user.mobile = user.mobile.trim().toLowerCase();
|
|
675
|
-
} else if (user && user.
|
|
676
|
-
user.
|
|
666
|
+
} else if (user && user.username && user.password) {
|
|
667
|
+
user.username = user.username.trim().toLowerCase();
|
|
677
668
|
} else {
|
|
678
669
|
callback({
|
|
679
670
|
message: 'User Info Not Correct',
|
|
@@ -682,7 +673,7 @@ module.exports = function init(____0) {
|
|
|
682
673
|
}
|
|
683
674
|
|
|
684
675
|
if (!user.email) {
|
|
685
|
-
user.email = user.
|
|
676
|
+
user.email = user.username || user.mobile || 'Not Set';
|
|
686
677
|
}
|
|
687
678
|
|
|
688
679
|
security.isUserExists(user, function (err, u) {
|
|
@@ -741,8 +732,8 @@ module.exports = function init(____0) {
|
|
|
741
732
|
where.email = user.email.trim().toLowerCase();
|
|
742
733
|
} else if (user.mobile) {
|
|
743
734
|
where.mobile = user.mobile.trim().toLowerCase();
|
|
744
|
-
} else if (user.
|
|
745
|
-
where.
|
|
735
|
+
} else if (user.username) {
|
|
736
|
+
where.username = user.username.trim().toLowerCase();
|
|
746
737
|
} else {
|
|
747
738
|
callback({
|
|
748
739
|
message: 'User Info Not Correct',
|
package/lib/session.js
CHANGED
|
@@ -1,153 +1,153 @@
|
|
|
1
|
-
module.exports = function init(req, res, ____0, callback) {
|
|
2
|
-
____0.getSession({ accessToken: req.headers['Access-Token'] || req.headers['access-token'] || req.query['access-token'] || req.cookie('access_token') }, (session) => {
|
|
3
|
-
if (!session.accessToken) {
|
|
4
|
-
session.accessToken = req.host + new Date().getTime().toString() + '_' + Math.random();
|
|
5
|
-
session.accessToken = ____0.x0md50x(session.accessToken);
|
|
6
|
-
res.cookie('access_token', session.accessToken);
|
|
7
|
-
res.set('Access-Token', session.accessToken);
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
session.ip = req.ip;
|
|
11
|
-
session.modifiedTime = new Date().getTime();
|
|
12
|
-
____0.saveSession(session);
|
|
13
|
-
|
|
14
|
-
function AssignFeatures() {
|
|
15
|
-
____0.options.defaults.features.forEach((f) => {
|
|
16
|
-
req.features.push(f);
|
|
17
|
-
});
|
|
18
|
-
____0.features.forEach((f) => {
|
|
19
|
-
req.features.push(f.name);
|
|
20
|
-
});
|
|
21
|
-
if (____0.options.dynamic) {
|
|
22
|
-
req.features.push('site.dynamic');
|
|
23
|
-
}
|
|
24
|
-
req.features.push('ip.' + req.ip);
|
|
25
|
-
|
|
26
|
-
if (req.host) {
|
|
27
|
-
req.features.push('host.' + req.host);
|
|
28
|
-
req.hostArray = req.host.split(':')[0].split('.').reverse();
|
|
29
|
-
if (req.hostArray[0] == 'localhost') {
|
|
30
|
-
req.domain = req.hostArray[0];
|
|
31
|
-
req.features.push('host.' + req.hostArray[0]);
|
|
32
|
-
if (req.hostArray.length == 2) {
|
|
33
|
-
req.domain2 = req.hostArray[1];
|
|
34
|
-
req.features.push('host.' + req.hostArray[1]);
|
|
35
|
-
} else if (req.hostArray.length == 3) {
|
|
36
|
-
req.domain2 = req.hostArray[1];
|
|
37
|
-
req.domain3 = req.hostArray[2];
|
|
38
|
-
req.features.push('host.' + req.domain2);
|
|
39
|
-
req.features.push('host.' + req.domain3);
|
|
40
|
-
}
|
|
41
|
-
} else {
|
|
42
|
-
if (req.hostArray.length == 2) {
|
|
43
|
-
req.domain = req.hostArray[1] + '.' + req.hostArray[0];
|
|
44
|
-
req.features.push('host.' + req.domain);
|
|
45
|
-
req.features.push('host.' + req.hostArray[0]);
|
|
46
|
-
req.features.push('host.' + req.hostArray[1]);
|
|
47
|
-
} else if (req.hostArray.length == 3) {
|
|
48
|
-
req.domain = req.hostArray[1] + '.' + req.hostArray[0];
|
|
49
|
-
req.domain2 = req.hostArray[2];
|
|
50
|
-
req.features.push('host.' + req.domain);
|
|
51
|
-
req.features.push('host.' + req.hostArray[0]);
|
|
52
|
-
req.features.push('host.' + req.hostArray[1]);
|
|
53
|
-
req.features.push('host.' + req.hostArray[2]);
|
|
54
|
-
} else if (req.hostArray.length == 4) {
|
|
55
|
-
req.domain = req.hostArray[1] + '.' + req.hostArray[0];
|
|
56
|
-
req.domain2 = req.hostArray[2];
|
|
57
|
-
req.domain3 = req.hostArray[3];
|
|
58
|
-
req.features.push('host.' + req.domain);
|
|
59
|
-
req.features.push('host.' + req.hostArray[0]);
|
|
60
|
-
req.features.push('host.' + req.hostArray[1]);
|
|
61
|
-
req.features.push('host.' + req.hostArray[2]);
|
|
62
|
-
req.features.push('host.' + req.hostArray[3]);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
if (req.cookies.obj && req.cookies.obj['_ga'] && req.cookies.obj['_ga'].contains('sb')) {
|
|
68
|
-
req.features.push('browser.social');
|
|
69
|
-
req.features.push('browser.social.app');
|
|
70
|
-
}
|
|
71
|
-
if (req.cookies.obj && req.cookies.obj['_gab'] && req.cookies.obj['_gab'].contains('sb')) {
|
|
72
|
-
req.features.push('browser.social');
|
|
73
|
-
req.features.push('browser.social.app');
|
|
74
|
-
}
|
|
75
|
-
if (req.headers['x-browser'] && req.headers['x-browser'].contains('social-browser')) {
|
|
76
|
-
req.features.push('browser.social');
|
|
77
|
-
req.features.push('browser.social.app');
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
if (req.headers['user-agent']) {
|
|
81
|
-
req.userAgent = req.headers['user-agent'].toLowerCase();
|
|
82
|
-
req.features.push('user-agent.' + req.userAgent);
|
|
83
|
-
if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(req.userAgent)) {
|
|
84
|
-
req.features.push('os.mobile');
|
|
85
|
-
} else {
|
|
86
|
-
req.features.push('os.desktop');
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
if (req.userAgent.contains('windows')) {
|
|
90
|
-
req.features.push('os.windows');
|
|
91
|
-
if (req.userAgent.contains('windows nt 5.1')) {
|
|
92
|
-
req.features.push('os.windowsxp');
|
|
93
|
-
} else if (req.userAgent.contains('windows nt 6.1')) {
|
|
94
|
-
req.features.push('os.windows7');
|
|
95
|
-
} else if (req.userAgent.contains('windows nt 6.2') || req.userAgent.contains('windows nt 6.3')) {
|
|
96
|
-
req.features.push('os.windows8');
|
|
97
|
-
} else if (req.userAgent.contains('windows nt 6.4') || req.userAgent.contains('windows nt 10')) {
|
|
98
|
-
req.features.push('os.windows10');
|
|
99
|
-
} else {
|
|
100
|
-
}
|
|
101
|
-
} else if (req.userAgent.contains('linux')) {
|
|
102
|
-
req.features.push('os.linux');
|
|
103
|
-
} else if (req.userAgent.contains('macintosh')) {
|
|
104
|
-
req.features.push('os.mac');
|
|
105
|
-
} else if (req.userAgent.contains('android')) {
|
|
106
|
-
req.features.push('os.android');
|
|
107
|
-
} else {
|
|
108
|
-
req.features.push('os.unknown');
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
if (req.userAgent.contains('edge')) {
|
|
112
|
-
req.features.push('browser.edge');
|
|
113
|
-
} else if (req.userAgent.contains('firefox')) {
|
|
114
|
-
req.features.push('browser.firefox');
|
|
115
|
-
} else if (req.userAgent.contains('opr')) {
|
|
116
|
-
req.features.push('browser.opera');
|
|
117
|
-
} else if (req.userAgent.contains('ucbrowser')) {
|
|
118
|
-
req.features.push('browser.ucbrowser');
|
|
119
|
-
} else if (req.userAgent.contains('bdbrowser') || req.userAgent.contains('baidu') || req.userAgent.contains('baidubrowser')) {
|
|
120
|
-
req.features.push('browser.baidu');
|
|
121
|
-
} else if (req.userAgent.contains('chromium')) {
|
|
122
|
-
req.features.push('browser.chromium');
|
|
123
|
-
} else if (req.userAgent.contains('chrome')) {
|
|
124
|
-
req.features.push('browser.chrome');
|
|
125
|
-
} else {
|
|
126
|
-
req.features.push('browser.unknown');
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
AssignFeatures();
|
|
132
|
-
|
|
133
|
-
if (____0.security && session.user_id) {
|
|
134
|
-
____0.security.getUser(
|
|
135
|
-
{
|
|
136
|
-
id: session.user_id,
|
|
137
|
-
},
|
|
138
|
-
function (err, user) {
|
|
139
|
-
if (!err && user) {
|
|
140
|
-
session.user = user;
|
|
141
|
-
if (session.user) {
|
|
142
|
-
req.features.push('login');
|
|
143
|
-
}
|
|
144
|
-
____0.saveSession(session);
|
|
145
|
-
callback(session);
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
);
|
|
149
|
-
} else {
|
|
150
|
-
callback(session);
|
|
151
|
-
}
|
|
152
|
-
});
|
|
153
|
-
};
|
|
1
|
+
module.exports = function init(req, res, ____0, callback) {
|
|
2
|
+
____0.getSession({ accessToken: req.headers['Access-Token'] || req.headers['access-token'] || req.query['access-token'] || req.cookie('access_token') }, (session) => {
|
|
3
|
+
if (!session.accessToken) {
|
|
4
|
+
session.accessToken = req.host + new Date().getTime().toString() + '_' + Math.random();
|
|
5
|
+
session.accessToken = ____0.x0md50x(session.accessToken);
|
|
6
|
+
res.cookie('access_token', session.accessToken);
|
|
7
|
+
res.set('Access-Token', session.accessToken);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
session.ip = req.ip;
|
|
11
|
+
session.modifiedTime = new Date().getTime();
|
|
12
|
+
____0.saveSession(session);
|
|
13
|
+
|
|
14
|
+
function AssignFeatures() {
|
|
15
|
+
____0.options.defaults.features.forEach((f) => {
|
|
16
|
+
req.features.push(f);
|
|
17
|
+
});
|
|
18
|
+
____0.features.forEach((f) => {
|
|
19
|
+
req.features.push(f.name);
|
|
20
|
+
});
|
|
21
|
+
if (____0.options.dynamic) {
|
|
22
|
+
req.features.push('site.dynamic');
|
|
23
|
+
}
|
|
24
|
+
req.features.push('ip.' + req.ip);
|
|
25
|
+
|
|
26
|
+
if (req.host) {
|
|
27
|
+
req.features.push('host.' + req.host);
|
|
28
|
+
req.hostArray = req.host.split(':')[0].split('.').reverse();
|
|
29
|
+
if (req.hostArray[0] == 'localhost') {
|
|
30
|
+
req.domain = req.hostArray[0];
|
|
31
|
+
req.features.push('host.' + req.hostArray[0]);
|
|
32
|
+
if (req.hostArray.length == 2) {
|
|
33
|
+
req.domain2 = req.hostArray[1];
|
|
34
|
+
req.features.push('host.' + req.hostArray[1]);
|
|
35
|
+
} else if (req.hostArray.length == 3) {
|
|
36
|
+
req.domain2 = req.hostArray[1];
|
|
37
|
+
req.domain3 = req.hostArray[2];
|
|
38
|
+
req.features.push('host.' + req.domain2);
|
|
39
|
+
req.features.push('host.' + req.domain3);
|
|
40
|
+
}
|
|
41
|
+
} else {
|
|
42
|
+
if (req.hostArray.length == 2) {
|
|
43
|
+
req.domain = req.hostArray[1] + '.' + req.hostArray[0];
|
|
44
|
+
req.features.push('host.' + req.domain);
|
|
45
|
+
req.features.push('host.' + req.hostArray[0]);
|
|
46
|
+
req.features.push('host.' + req.hostArray[1]);
|
|
47
|
+
} else if (req.hostArray.length == 3) {
|
|
48
|
+
req.domain = req.hostArray[1] + '.' + req.hostArray[0];
|
|
49
|
+
req.domain2 = req.hostArray[2];
|
|
50
|
+
req.features.push('host.' + req.domain);
|
|
51
|
+
req.features.push('host.' + req.hostArray[0]);
|
|
52
|
+
req.features.push('host.' + req.hostArray[1]);
|
|
53
|
+
req.features.push('host.' + req.hostArray[2]);
|
|
54
|
+
} else if (req.hostArray.length == 4) {
|
|
55
|
+
req.domain = req.hostArray[1] + '.' + req.hostArray[0];
|
|
56
|
+
req.domain2 = req.hostArray[2];
|
|
57
|
+
req.domain3 = req.hostArray[3];
|
|
58
|
+
req.features.push('host.' + req.domain);
|
|
59
|
+
req.features.push('host.' + req.hostArray[0]);
|
|
60
|
+
req.features.push('host.' + req.hostArray[1]);
|
|
61
|
+
req.features.push('host.' + req.hostArray[2]);
|
|
62
|
+
req.features.push('host.' + req.hostArray[3]);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if (req.cookies.obj && req.cookies.obj['_ga'] && req.cookies.obj['_ga'].contains('sb')) {
|
|
68
|
+
req.features.push('browser.social');
|
|
69
|
+
req.features.push('browser.social.app');
|
|
70
|
+
}
|
|
71
|
+
if (req.cookies.obj && req.cookies.obj['_gab'] && req.cookies.obj['_gab'].contains('sb')) {
|
|
72
|
+
req.features.push('browser.social');
|
|
73
|
+
req.features.push('browser.social.app');
|
|
74
|
+
}
|
|
75
|
+
if (req.headers['x-browser'] && req.headers['x-browser'].contains('social-browser')) {
|
|
76
|
+
req.features.push('browser.social');
|
|
77
|
+
req.features.push('browser.social.app');
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
if (req.headers['user-agent']) {
|
|
81
|
+
req.userAgent = req.headers['user-agent'].toLowerCase();
|
|
82
|
+
req.features.push('user-agent.' + req.userAgent);
|
|
83
|
+
if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(req.userAgent)) {
|
|
84
|
+
req.features.push('os.mobile');
|
|
85
|
+
} else {
|
|
86
|
+
req.features.push('os.desktop');
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
if (req.userAgent.contains('windows')) {
|
|
90
|
+
req.features.push('os.windows');
|
|
91
|
+
if (req.userAgent.contains('windows nt 5.1')) {
|
|
92
|
+
req.features.push('os.windowsxp');
|
|
93
|
+
} else if (req.userAgent.contains('windows nt 6.1')) {
|
|
94
|
+
req.features.push('os.windows7');
|
|
95
|
+
} else if (req.userAgent.contains('windows nt 6.2') || req.userAgent.contains('windows nt 6.3')) {
|
|
96
|
+
req.features.push('os.windows8');
|
|
97
|
+
} else if (req.userAgent.contains('windows nt 6.4') || req.userAgent.contains('windows nt 10')) {
|
|
98
|
+
req.features.push('os.windows10');
|
|
99
|
+
} else {
|
|
100
|
+
}
|
|
101
|
+
} else if (req.userAgent.contains('linux')) {
|
|
102
|
+
req.features.push('os.linux');
|
|
103
|
+
} else if (req.userAgent.contains('macintosh')) {
|
|
104
|
+
req.features.push('os.mac');
|
|
105
|
+
} else if (req.userAgent.contains('android')) {
|
|
106
|
+
req.features.push('os.android');
|
|
107
|
+
} else {
|
|
108
|
+
req.features.push('os.unknown');
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
if (req.userAgent.contains('edge')) {
|
|
112
|
+
req.features.push('browser.edge');
|
|
113
|
+
} else if (req.userAgent.contains('firefox')) {
|
|
114
|
+
req.features.push('browser.firefox');
|
|
115
|
+
} else if (req.userAgent.contains('opr')) {
|
|
116
|
+
req.features.push('browser.opera');
|
|
117
|
+
} else if (req.userAgent.contains('ucbrowser')) {
|
|
118
|
+
req.features.push('browser.ucbrowser');
|
|
119
|
+
} else if (req.userAgent.contains('bdbrowser') || req.userAgent.contains('baidu') || req.userAgent.contains('baidubrowser')) {
|
|
120
|
+
req.features.push('browser.baidu');
|
|
121
|
+
} else if (req.userAgent.contains('chromium')) {
|
|
122
|
+
req.features.push('browser.chromium');
|
|
123
|
+
} else if (req.userAgent.contains('chrome')) {
|
|
124
|
+
req.features.push('browser.chrome');
|
|
125
|
+
} else {
|
|
126
|
+
req.features.push('browser.unknown');
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
AssignFeatures();
|
|
132
|
+
|
|
133
|
+
if (____0.security && session.user_id) {
|
|
134
|
+
____0.security.getUser(
|
|
135
|
+
{
|
|
136
|
+
id: session.user_id,
|
|
137
|
+
},
|
|
138
|
+
function (err, user) {
|
|
139
|
+
if (!err && user) {
|
|
140
|
+
session.user = user;
|
|
141
|
+
if (session.user) {
|
|
142
|
+
req.features.push('login');
|
|
143
|
+
}
|
|
144
|
+
____0.saveSession(session);
|
|
145
|
+
callback(session);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
);
|
|
149
|
+
} else {
|
|
150
|
+
callback(session);
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
};
|
package/object-options/index.js
CHANGED
|
@@ -71,7 +71,7 @@ function setOptions(_options, ____0) {
|
|
|
71
71
|
protocal: 'mongodb://',
|
|
72
72
|
host: '127.0.0.1',
|
|
73
73
|
port: '27017',
|
|
74
|
-
|
|
74
|
+
username: null,
|
|
75
75
|
password: null,
|
|
76
76
|
db: 'db_' + name,
|
|
77
77
|
collection: 'default_collection',
|
|
@@ -207,7 +207,7 @@ function setOptions(_options, ____0) {
|
|
|
207
207
|
_x0oo.mongodb.protocal = _x0oo.mongodb.protocal || template.mongodb.protocal;
|
|
208
208
|
_x0oo.mongodb.host = _x0oo.mongodb.host || template.mongodb.host;
|
|
209
209
|
_x0oo.mongodb.port = _x0oo.mongodb.port || template.mongodb.port;
|
|
210
|
-
_x0oo.mongodb.
|
|
210
|
+
_x0oo.mongodb.username = _x0oo.mongodb.username || template.mongodb.username;
|
|
211
211
|
_x0oo.mongodb.password = _x0oo.mongodb.password || template.mongodb.password;
|
|
212
212
|
_x0oo.mongodb.db = _0xddxo ? 'smart_db_' + name : _x0oo.mongodb.db || template.mongodb.db;
|
|
213
213
|
_x0oo.mongodb.collection = _x0oo.mongodb.collection || template.mongodb.collection;
|
|
@@ -229,7 +229,7 @@ function setOptions(_options, ____0) {
|
|
|
229
229
|
_x0oo.mongodb.protocal = userOptions.mongodb.protocal || _x0oo.mongodb.protocal;
|
|
230
230
|
_x0oo.mongodb.host = userOptions.mongodb.host || _x0oo.mongodb.host;
|
|
231
231
|
_x0oo.mongodb.port = userOptions.mongodb.port || _x0oo.mongodb.port;
|
|
232
|
-
_x0oo.mongodb.
|
|
232
|
+
_x0oo.mongodb.username = userOptions.mongodb.username || _x0oo.mongodb.username;
|
|
233
233
|
_x0oo.mongodb.password = userOptions.mongodb.password || _x0oo.mongodb.password;
|
|
234
234
|
_x0oo.mongodb.db = userOptions.mongodb.db || _x0oo.mongodb.db;
|
|
235
235
|
_x0oo.mongodb.collection = userOptions.mongodb.collection || _x0oo.mongodb.collection;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
{
|
|
2
|
-
"folders": [
|
|
3
|
-
{
|
|
4
|
-
"path": "F:\\nodes\\isite"
|
|
5
|
-
},
|
|
6
|
-
{
|
|
7
|
-
"path": "F:\\nodes\\object-options"
|
|
8
|
-
}
|
|
9
|
-
],
|
|
10
|
-
"settings": {}
|
|
1
|
+
{
|
|
2
|
+
"folders": [
|
|
3
|
+
{
|
|
4
|
+
"path": "F:\\nodes\\isite"
|
|
5
|
+
},
|
|
6
|
+
{
|
|
7
|
+
"path": "F:\\nodes\\object-options"
|
|
8
|
+
}
|
|
9
|
+
],
|
|
10
|
+
"settings": {}
|
|
11
11
|
}
|
package/package.json
CHANGED
|
@@ -1,58 +1,58 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "isite",
|
|
3
|
-
"version": "2024.08.
|
|
4
|
-
"description": "Create High Level Multi-Language Web Site [Fast and Easy] ",
|
|
5
|
-
"main": "index.js",
|
|
6
|
-
"repository": {
|
|
7
|
-
"type": "git",
|
|
8
|
-
"url": "git://github.com/absunstar/isite"
|
|
9
|
-
},
|
|
10
|
-
"keywords": [
|
|
11
|
-
"http",
|
|
12
|
-
"route",
|
|
13
|
-
"cookie",
|
|
14
|
-
"session",
|
|
15
|
-
"security",
|
|
16
|
-
"upload",
|
|
17
|
-
"download",
|
|
18
|
-
"master page",
|
|
19
|
-
"cache",
|
|
20
|
-
"memory",
|
|
21
|
-
"file",
|
|
22
|
-
"api",
|
|
23
|
-
"restful",
|
|
24
|
-
"framework",
|
|
25
|
-
"charts",
|
|
26
|
-
"fonts",
|
|
27
|
-
"arabic",
|
|
28
|
-
"mongodb"
|
|
29
|
-
],
|
|
30
|
-
"scripts": {
|
|
31
|
-
"test": "echo \"Error: no test specified\" && exit 1"
|
|
32
|
-
},
|
|
33
|
-
"author": {
|
|
34
|
-
"name": "Amr Barakat",
|
|
35
|
-
"email": "Absunstar@gmail.com"
|
|
36
|
-
},
|
|
37
|
-
"license": "UNLICENSED",
|
|
38
|
-
"dependencies": {
|
|
39
|
-
"@pdf-lib/fontkit": "^1.1.1",
|
|
40
|
-
"archiver": "^5.0.2",
|
|
41
|
-
"cheerio": "^1.0.0-rc.12",
|
|
42
|
-
"eval": "^0.1.8",
|
|
43
|
-
"formidable": "^2.0.1",
|
|
44
|
-
"md5": "^2.3.0",
|
|
45
|
-
"mongodb": "^6.8.0",
|
|
46
|
-
"mv": "^2.1.1",
|
|
47
|
-
"node-fetch": "^3.3.2",
|
|
48
|
-
"nodemailer": "^6.9.14",
|
|
49
|
-
"pdf-lib": "^1.17.1",
|
|
50
|
-
"utf8": "^3.0.0",
|
|
51
|
-
"webp-converter": "^2.3.3",
|
|
52
|
-
"ws": "^8.18.0",
|
|
53
|
-
"xlsx": "^0.17.5"
|
|
54
|
-
},
|
|
55
|
-
"optionalDependencies": {
|
|
56
|
-
"bufferutil": "^4.0.8"
|
|
57
|
-
}
|
|
58
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "isite",
|
|
3
|
+
"version": "2024.08.06",
|
|
4
|
+
"description": "Create High Level Multi-Language Web Site [Fast and Easy] ",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git://github.com/absunstar/isite"
|
|
9
|
+
},
|
|
10
|
+
"keywords": [
|
|
11
|
+
"http",
|
|
12
|
+
"route",
|
|
13
|
+
"cookie",
|
|
14
|
+
"session",
|
|
15
|
+
"security",
|
|
16
|
+
"upload",
|
|
17
|
+
"download",
|
|
18
|
+
"master page",
|
|
19
|
+
"cache",
|
|
20
|
+
"memory",
|
|
21
|
+
"file",
|
|
22
|
+
"api",
|
|
23
|
+
"restful",
|
|
24
|
+
"framework",
|
|
25
|
+
"charts",
|
|
26
|
+
"fonts",
|
|
27
|
+
"arabic",
|
|
28
|
+
"mongodb"
|
|
29
|
+
],
|
|
30
|
+
"scripts": {
|
|
31
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
32
|
+
},
|
|
33
|
+
"author": {
|
|
34
|
+
"name": "Amr Barakat",
|
|
35
|
+
"email": "Absunstar@gmail.com"
|
|
36
|
+
},
|
|
37
|
+
"license": "UNLICENSED",
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"@pdf-lib/fontkit": "^1.1.1",
|
|
40
|
+
"archiver": "^5.0.2",
|
|
41
|
+
"cheerio": "^1.0.0-rc.12",
|
|
42
|
+
"eval": "^0.1.8",
|
|
43
|
+
"formidable": "^2.0.1",
|
|
44
|
+
"md5": "^2.3.0",
|
|
45
|
+
"mongodb": "^6.8.0",
|
|
46
|
+
"mv": "^2.1.1",
|
|
47
|
+
"node-fetch": "^3.3.2",
|
|
48
|
+
"nodemailer": "^6.9.14",
|
|
49
|
+
"pdf-lib": "^1.17.1",
|
|
50
|
+
"utf8": "^3.0.0",
|
|
51
|
+
"webp-converter": "^2.3.3",
|
|
52
|
+
"ws": "^8.18.0",
|
|
53
|
+
"xlsx": "^0.17.5"
|
|
54
|
+
},
|
|
55
|
+
"optionalDependencies": {
|
|
56
|
+
"bufferutil": "^4.0.8"
|
|
57
|
+
}
|
|
58
|
+
}
|
package/ssl/create_ssl.sh
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
openssl genrsa -out key.pem
|
|
2
|
-
openssl req -new -key key.pem -out csr.pem
|
|
3
|
-
openssl x509 -req -days 9999 -in csr.pem -signkey key.pem -out cert.pem
|
|
1
|
+
openssl genrsa -out key.pem
|
|
2
|
+
openssl req -new -key key.pem -out csr.pem
|
|
3
|
+
openssl x509 -req -days 9999 -in csr.pem -signkey key.pem -out cert.pem
|
|
4
4
|
rm csr.pem
|