greybel-mock-environment 1.4.0 → 1.4.2
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/dist/environment.js +1 -1
- package/dist/types/device.js +20 -20
- package/dist/types/permission.js +3 -3
- package/package.json +1 -1
package/dist/environment.js
CHANGED
|
@@ -106,7 +106,7 @@ var MockEnvironment = /** @class */ (function () {
|
|
|
106
106
|
var currentPath = computer.getHome(user);
|
|
107
107
|
var programPath = new types_1.File({
|
|
108
108
|
name: 'myprogramm',
|
|
109
|
-
permissions: '
|
|
109
|
+
permissions: '---------',
|
|
110
110
|
owner: 'root',
|
|
111
111
|
isProtected: true,
|
|
112
112
|
type: types_1.FileType.Binary
|
package/dist/types/device.js
CHANGED
|
@@ -179,7 +179,7 @@ var Device = /** @class */ (function () {
|
|
|
179
179
|
if (etcFolder instanceof file_system_1.Folder) {
|
|
180
180
|
var file = new file_system_1.File({
|
|
181
181
|
name: 'passwd',
|
|
182
|
-
permissions: '
|
|
182
|
+
permissions: 'rw-r-----',
|
|
183
183
|
owner: 'root',
|
|
184
184
|
content: Array.from(this.users.values())
|
|
185
185
|
.map(function (v) { return "".concat(v.username, ":").concat(v.passwordHashed); })
|
|
@@ -388,7 +388,7 @@ var Device = /** @class */ (function () {
|
|
|
388
388
|
var configFolder = homeFolder.folders.get('Config');
|
|
389
389
|
var bankFile = new file_system_1.File({
|
|
390
390
|
name: 'Bank.txt',
|
|
391
|
-
permissions: '
|
|
391
|
+
permissions: 'rw-r--r--',
|
|
392
392
|
owner: user.username,
|
|
393
393
|
content: "".concat(user.bankAccount.id, ":").concat(user.bankAccount.passwordHashed),
|
|
394
394
|
type: file_system_1.FileType.Source
|
|
@@ -407,7 +407,7 @@ var Device = /** @class */ (function () {
|
|
|
407
407
|
var configFolder = homeFolder.folders.get('Config');
|
|
408
408
|
var emailFile = new file_system_1.File({
|
|
409
409
|
name: 'Mail.txt',
|
|
410
|
-
permissions: '
|
|
410
|
+
permissions: 'rw-r--r--',
|
|
411
411
|
owner: user.username,
|
|
412
412
|
content: "".concat(user.email.email, ":").concat(user.email.passwordHashed),
|
|
413
413
|
type: file_system_1.FileType.Source
|
|
@@ -484,7 +484,7 @@ var Device = /** @class */ (function () {
|
|
|
484
484
|
if (libFolder instanceof file_system_1.Folder) {
|
|
485
485
|
libFile = new file_system_1.File({
|
|
486
486
|
name: 'libssh.so',
|
|
487
|
-
permissions: '
|
|
487
|
+
permissions: 'rw-r--r--',
|
|
488
488
|
owner: 'root',
|
|
489
489
|
type: file_system_1.FileType.SSH,
|
|
490
490
|
version: libManager.getLatestVersion(library_1.Library.SSH).toString()
|
|
@@ -497,7 +497,7 @@ var Device = /** @class */ (function () {
|
|
|
497
497
|
if (configFolder instanceof file_system_1.Folder) {
|
|
498
498
|
configFile = new file_system_1.File({
|
|
499
499
|
name: 'sshd.conf',
|
|
500
|
-
permissions: '
|
|
500
|
+
permissions: 'rw-r--r--',
|
|
501
501
|
owner: 'root',
|
|
502
502
|
content: JSON.stringify({
|
|
503
503
|
encryption_enabled: false,
|
|
@@ -525,7 +525,7 @@ var Device = /** @class */ (function () {
|
|
|
525
525
|
if (libFolder instanceof file_system_1.Folder) {
|
|
526
526
|
libFile = new file_system_1.File({
|
|
527
527
|
name: 'libftp.so',
|
|
528
|
-
permissions: '
|
|
528
|
+
permissions: 'rw-r--r--',
|
|
529
529
|
owner: 'root',
|
|
530
530
|
type: file_system_1.FileType.FTP,
|
|
531
531
|
version: libManager.getLatestVersion(library_1.Library.FTP).toString()
|
|
@@ -538,7 +538,7 @@ var Device = /** @class */ (function () {
|
|
|
538
538
|
if (configFolder instanceof file_system_1.Folder) {
|
|
539
539
|
configFile = new file_system_1.File({
|
|
540
540
|
name: 'ftpd.conf',
|
|
541
|
-
permissions: '
|
|
541
|
+
permissions: 'rw-r--r--',
|
|
542
542
|
owner: 'root',
|
|
543
543
|
type: file_system_1.FileType.Source
|
|
544
544
|
});
|
|
@@ -561,7 +561,7 @@ var Device = /** @class */ (function () {
|
|
|
561
561
|
if (libFolder instanceof file_system_1.Folder) {
|
|
562
562
|
libFile = new file_system_1.File({
|
|
563
563
|
name: 'libhttp.so',
|
|
564
|
-
permissions: '
|
|
564
|
+
permissions: 'rw-r--r--',
|
|
565
565
|
owner: 'root',
|
|
566
566
|
type: file_system_1.FileType.HTTP,
|
|
567
567
|
version: libManager.getLatestVersion(library_1.Library.HTTP).toString()
|
|
@@ -574,7 +574,7 @@ var Device = /** @class */ (function () {
|
|
|
574
574
|
if (configFolder instanceof file_system_1.Folder) {
|
|
575
575
|
configFile = new file_system_1.File({
|
|
576
576
|
name: 'httpd.conf',
|
|
577
|
-
permissions: '
|
|
577
|
+
permissions: 'rw-r--r--',
|
|
578
578
|
owner: 'root',
|
|
579
579
|
type: file_system_1.FileType.Source
|
|
580
580
|
});
|
|
@@ -585,7 +585,7 @@ var Device = /** @class */ (function () {
|
|
|
585
585
|
if (!publicFolder) {
|
|
586
586
|
publicFolder = new file_system_1.Folder({
|
|
587
587
|
name: 'Public',
|
|
588
|
-
permissions: '
|
|
588
|
+
permissions: 'rw-r--r--',
|
|
589
589
|
owner: 'root'
|
|
590
590
|
});
|
|
591
591
|
}
|
|
@@ -594,7 +594,7 @@ var Device = /** @class */ (function () {
|
|
|
594
594
|
if (!dlFolder) {
|
|
595
595
|
dlFolder = new file_system_1.Folder({
|
|
596
596
|
name: 'Downloads',
|
|
597
|
-
permissions: '
|
|
597
|
+
permissions: 'rw-r--r--',
|
|
598
598
|
owner: 'root'
|
|
599
599
|
});
|
|
600
600
|
publicFolder.putEntity(dlFolder);
|
|
@@ -604,7 +604,7 @@ var Device = /** @class */ (function () {
|
|
|
604
604
|
if (!htDocsFolder) {
|
|
605
605
|
htDocsFolder = new file_system_1.Folder({
|
|
606
606
|
name: 'htdocs',
|
|
607
|
-
permissions: '
|
|
607
|
+
permissions: 'rw-r--r--',
|
|
608
608
|
owner: 'root'
|
|
609
609
|
});
|
|
610
610
|
publicFolder.putEntity(htDocsFolder);
|
|
@@ -614,7 +614,7 @@ var Device = /** @class */ (function () {
|
|
|
614
614
|
if (!htDocsDownloadFolder) {
|
|
615
615
|
htDocsDownloadFolder = new file_system_1.Folder({
|
|
616
616
|
name: 'downloads',
|
|
617
|
-
permissions: '
|
|
617
|
+
permissions: 'rw-r--r--',
|
|
618
618
|
owner: 'root'
|
|
619
619
|
});
|
|
620
620
|
htDocsFolder.putEntity(htDocsDownloadFolder);
|
|
@@ -628,7 +628,7 @@ var Device = /** @class */ (function () {
|
|
|
628
628
|
if (!htDocsWebsiteFile) {
|
|
629
629
|
htDocsWebsiteFile = new file_system_1.File({
|
|
630
630
|
name: 'website.html',
|
|
631
|
-
permissions: '
|
|
631
|
+
permissions: 'rw-r--r--',
|
|
632
632
|
owner: 'root',
|
|
633
633
|
content: "<!doctype html>\n <title>Site Maintenance</title>\n <style>\n body { text-align: center; padding: 25px; }\n h1 { font-size: 50px; }\n body { font: 20px Helvetica, sans-serif; color: #333; }\n article { display: block; text-align: left; width: 650px; margin: 0 auto; }\n html{\n background-color: whitesmoke;\n height:100%;\n }\n </style>\n <article>\n <h1>We will be back soon!</h1>\n <div>\n <p>Sorry for the inconvenience but we are performing some maintenance at the moment. We will be back online shortly!</p>\n <p>The Team</p>\n </div>\n </article>",
|
|
634
634
|
type: file_system_1.FileType.Source
|
|
@@ -652,7 +652,7 @@ var Device = /** @class */ (function () {
|
|
|
652
652
|
if (libFolder instanceof file_system_1.Folder) {
|
|
653
653
|
libFile = new file_system_1.File({
|
|
654
654
|
name: 'librshell.so',
|
|
655
|
-
permissions: '
|
|
655
|
+
permissions: 'rw-r--r--',
|
|
656
656
|
owner: 'root',
|
|
657
657
|
type: file_system_1.FileType.RShell,
|
|
658
658
|
version: libManager.getLatestVersion(library_1.Library.RSHELL).toString()
|
|
@@ -665,7 +665,7 @@ var Device = /** @class */ (function () {
|
|
|
665
665
|
if (configFolder instanceof file_system_1.Folder) {
|
|
666
666
|
configFile = new file_system_1.File({
|
|
667
667
|
name: 'rshelld.conf',
|
|
668
|
-
permissions: '
|
|
668
|
+
permissions: 'rw-r--r--',
|
|
669
669
|
owner: 'root',
|
|
670
670
|
type: file_system_1.FileType.Source
|
|
671
671
|
});
|
|
@@ -687,7 +687,7 @@ var Device = /** @class */ (function () {
|
|
|
687
687
|
if (libFolder instanceof file_system_1.Folder) {
|
|
688
688
|
libFile = new file_system_1.File({
|
|
689
689
|
name: 'libchat.so',
|
|
690
|
-
permissions: '
|
|
690
|
+
permissions: 'rw-r--r--',
|
|
691
691
|
owner: 'root',
|
|
692
692
|
type: file_system_1.FileType.Chat,
|
|
693
693
|
version: libManager.getLatestVersion(library_1.Library.CHAT).toString()
|
|
@@ -700,7 +700,7 @@ var Device = /** @class */ (function () {
|
|
|
700
700
|
if (configFolder instanceof file_system_1.Folder) {
|
|
701
701
|
configFile = new file_system_1.File({
|
|
702
702
|
name: 'chatd.conf',
|
|
703
|
-
permissions: '
|
|
703
|
+
permissions: 'rw-r--r--',
|
|
704
704
|
owner: 'root',
|
|
705
705
|
type: file_system_1.FileType.Source
|
|
706
706
|
});
|
|
@@ -722,7 +722,7 @@ var Device = /** @class */ (function () {
|
|
|
722
722
|
if (libFolder instanceof file_system_1.Folder) {
|
|
723
723
|
libFile = new file_system_1.File({
|
|
724
724
|
name: 'librepository.so',
|
|
725
|
-
permissions: '
|
|
725
|
+
permissions: 'rw-r--r--',
|
|
726
726
|
owner: 'root',
|
|
727
727
|
type: file_system_1.FileType.Repository,
|
|
728
728
|
version: libManager.getLatestVersion(library_1.Library.REPOSITORY).toString()
|
|
@@ -735,7 +735,7 @@ var Device = /** @class */ (function () {
|
|
|
735
735
|
if (configFolder instanceof file_system_1.Folder) {
|
|
736
736
|
configFile = new file_system_1.File({
|
|
737
737
|
name: 'repod.conf',
|
|
738
|
-
permissions: '
|
|
738
|
+
permissions: 'rw-r--r--',
|
|
739
739
|
owner: 'root',
|
|
740
740
|
type: file_system_1.FileType.Source,
|
|
741
741
|
content: JSON.stringify({
|
package/dist/types/permission.js
CHANGED
|
@@ -105,9 +105,9 @@ var Permissions = /** @class */ (function () {
|
|
|
105
105
|
if (!/^([r-][w-][x-]){3}$/.test(permission)) {
|
|
106
106
|
throw new Error('Invalid permission.');
|
|
107
107
|
}
|
|
108
|
-
var u = permission.slice(
|
|
109
|
-
var g = permission.slice(
|
|
110
|
-
var o = permission.slice(
|
|
108
|
+
var u = permission.slice(0, 3);
|
|
109
|
+
var g = permission.slice(3, 6);
|
|
110
|
+
var o = permission.slice(6, 9);
|
|
111
111
|
this.u = new PermissionSegment({ segment: u, userType: 'u' });
|
|
112
112
|
this.g = new PermissionSegment({ segment: g, userType: 'g' });
|
|
113
113
|
this.o = new PermissionSegment({ segment: o, userType: 'o' });
|