penguins-eggs 9.3.29 → 9.4.0
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/.oclif.manifest.json +1 -1
- package/README.md +42 -42
- package/addons/README.md +3 -3
- package/addons/eggs/ichoice/bin/eggs-ichoice.sh +1 -1
- package/addons/eggs/theme/calamares/branding/show.qml +8 -8
- package/addons/eggs/theme/livecd/grub.theme.cfg +1 -1
- package/addons/eggs/theme/livecd/isolinux.theme.cfg +1 -1
- package/addons/templates/isolinux.template +0 -1
- package/assets/penguins-eggs.desktop +15 -15
- package/conf/README.md +1 -1
- package/conf/derivatives.yaml +1 -1
- package/conf/eggs.yaml +1 -1
- package/conf/krill.yaml +1 -1
- package/conf/tools.yaml +1 -1
- package/dist/classes/bleach.js +22 -22
- package/dist/classes/daddy.js +25 -25
- package/dist/classes/family/archlinux.js +16 -16
- package/dist/classes/family/debian.js +23 -23
- package/dist/classes/family/fedora.js +14 -14
- package/dist/classes/family/suse.js +14 -14
- package/dist/classes/incubation/distros/bionic.js +5 -4
- package/dist/classes/incubation/distros/buster.js +5 -4
- package/dist/classes/incubation/distros/focal.js +5 -4
- package/dist/classes/incubation/distros/jessie.js +2 -2
- package/dist/classes/incubation/distros/rolling.js +6 -4
- package/dist/classes/incubation/fisherman-helper/displaymanager.js +2 -2
- package/dist/classes/incubation/fisherman-helper/packages.js +6 -6
- package/dist/classes/incubation/fisherman.js +13 -17
- package/dist/classes/incubation/incubator.js +26 -25
- package/dist/classes/incubation/installer.js +5 -5
- package/dist/classes/keyboards.js +5 -5
- package/dist/classes/locales.js +6 -6
- package/dist/classes/n8.js +1 -1
- package/dist/classes/network.js +6 -0
- package/dist/classes/ovary.js +203 -205
- package/dist/classes/pacman.js +121 -121
- package/dist/classes/pve-live.js +2 -2
- package/dist/classes/pxe.js +32 -32
- package/dist/classes/settings.js +24 -24
- package/dist/classes/sources_list.js +8 -8
- package/dist/classes/systemctl.js +11 -11
- package/dist/classes/tailor.js +57 -57
- package/dist/classes/tools.js +2 -2
- package/dist/classes/users.js +2 -2
- package/dist/classes/utils.js +12 -12
- package/dist/classes/xdg.js +38 -38
- package/dist/classes/yolk.js +27 -27
- package/dist/commands/adapt.js +9 -9
- package/dist/commands/analyze.js +10 -10
- package/dist/commands/calamares.js +19 -19
- package/dist/commands/config.js +67 -67
- package/dist/commands/cuckoo.js +8 -8
- package/dist/commands/dad.js +8 -8
- package/dist/commands/export/deb.js +9 -9
- package/dist/commands/export/iso.js +8 -8
- package/dist/commands/install.js +8 -8
- package/dist/commands/kill.js +11 -11
- package/dist/commands/mom.js +5 -5
- package/dist/commands/produce.js +15 -15
- package/dist/commands/status.js +2 -2
- package/dist/commands/syncfrom.js +34 -34
- package/dist/commands/syncto.js +42 -42
- package/dist/commands/tools/clean.js +7 -7
- package/dist/commands/tools/ppa.js +17 -17
- package/dist/commands/tools/skel.js +11 -11
- package/dist/commands/tools/stat.js +2 -2
- package/dist/commands/tools/yolk.js +6 -6
- package/dist/commands/update.js +22 -22
- package/dist/commands/wardrobe/get.js +7 -7
- package/dist/commands/wardrobe/list.js +5 -5
- package/dist/commands/wardrobe/show.js +6 -6
- package/dist/commands/wardrobe/wear.js +10 -10
- package/dist/components/elements/information.js +16 -16
- package/dist/components/finished.js +4 -4
- package/dist/components/install.js +4 -4
- package/dist/components/keyboard.js +4 -4
- package/dist/components/location.js +4 -4
- package/dist/components/network.js +4 -4
- package/dist/components/partitions.js +4 -4
- package/dist/components/summary.js +4 -4
- package/dist/components/users.js +4 -4
- package/dist/components/welcome.js +4 -4
- package/dist/krill/krill-prepare.js +84 -84
- package/dist/krill/krill-sequence.js +140 -140
- package/dist/krill/modules/add-user.js +6 -6
- package/dist/krill/modules/bootloader-config-ubuntu.js +21 -21
- package/dist/krill/modules/bootloader.js +6 -6
- package/dist/krill/modules/change-password.js +2 -2
- package/dist/krill/modules/del-live-user.js +5 -5
- package/dist/krill/modules/fstab.js +10 -10
- package/dist/krill/modules/grubcfg.js +3 -3
- package/dist/krill/modules/initramfs-cfg.js +3 -3
- package/dist/krill/modules/initramfs.js +9 -9
- package/dist/krill/modules/locale.js +4 -4
- package/dist/krill/modules/m-keyboard.js +9 -9
- package/dist/krill/modules/m-timezone.js +3 -3
- package/dist/krill/modules/machine-id.js +3 -3
- package/dist/krill/modules/mkfs.js +6 -6
- package/dist/krill/modules/mount-fs.js +13 -13
- package/dist/krill/modules/mount-vfs.js +12 -12
- package/dist/krill/modules/network-cfg.js +5 -5
- package/dist/krill/modules/packages.js +10 -10
- package/dist/krill/modules/partition.js +69 -69
- package/dist/krill/modules/umount.js +6 -6
- package/dist/krill/modules/unpackfs.js +4 -4
- package/dist/lib/cli-autologin.js +13 -13
- package/dist/lib/select_keyboard_layout.js +2 -2
- package/dist/lib/select_keyboard_model.js +2 -2
- package/dist/lib/select_keyboard_option.js +2 -2
- package/dist/lib/select_keyboard_variant.js +2 -2
- package/dist/lib/select_languages.js +2 -2
- package/manpages/doc/man/eggs.html +3 -3
- package/package.json +1 -1
- package/scripts/_eggs +1 -1
|
@@ -12,8 +12,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
const core_1 = require("@oclif/core");
|
|
13
13
|
const fs_1 = __importDefault(require("fs"));
|
|
14
14
|
const path_1 = __importDefault(require("path"));
|
|
15
|
-
const
|
|
16
|
-
const
|
|
15
|
+
const utils_1 = __importDefault(require("../classes/utils"));
|
|
16
|
+
const utils_2 = require("../lib/utils");
|
|
17
17
|
/**
|
|
18
18
|
*
|
|
19
19
|
*/
|
|
@@ -33,7 +33,7 @@ class Syncfrom extends core_1.Command {
|
|
|
33
33
|
if (flags.verbose) {
|
|
34
34
|
this.verbose = true;
|
|
35
35
|
}
|
|
36
|
-
this.echo =
|
|
36
|
+
this.echo = utils_1.default.setEcho(this.verbose);
|
|
37
37
|
let fileVolume = '';
|
|
38
38
|
if (flags.file) {
|
|
39
39
|
fileVolume = flags.file;
|
|
@@ -42,19 +42,19 @@ class Syncfrom extends core_1.Command {
|
|
|
42
42
|
if (flags.delete) {
|
|
43
43
|
destDelete = true;
|
|
44
44
|
}
|
|
45
|
-
if (
|
|
45
|
+
if (utils_1.default.isLive()) {
|
|
46
46
|
if (flags.rootdir) {
|
|
47
47
|
this.rootDir = flags.rootdir;
|
|
48
48
|
}
|
|
49
49
|
else {
|
|
50
|
-
|
|
50
|
+
utils_1.default.pressKeyToExit('Argument --rootdir is mandatory, when running live! Process will terminate');
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
|
-
if (
|
|
53
|
+
if (utils_1.default.isRoot()) {
|
|
54
54
|
if (fileVolume === '') {
|
|
55
55
|
fileVolume = '/run/live/medium/live/luks-eggs-dada';
|
|
56
56
|
}
|
|
57
|
-
if (!
|
|
57
|
+
if (!utils_1.default.isLive()) {
|
|
58
58
|
/**
|
|
59
59
|
* WORKING FROM INSTALLED
|
|
60
60
|
*/
|
|
@@ -64,12 +64,12 @@ class Syncfrom extends core_1.Command {
|
|
|
64
64
|
this.luksDevice = `/dev/mapper/${this.luksName}`;
|
|
65
65
|
this.luksMountpoint = '/tmp/eggs-data';
|
|
66
66
|
await this.restorePrivateData();
|
|
67
|
-
if (await
|
|
68
|
-
await (0,
|
|
67
|
+
if (await utils_1.default.customConfirm('Your system was updated! Press a key to reboot')) {
|
|
68
|
+
await (0, utils_2.exec)('reboot');
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
else {
|
|
72
|
-
|
|
72
|
+
utils_1.default.pressKeyToExit(`Can't find ${this.luksFile}`);
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
else {
|
|
@@ -84,7 +84,7 @@ class Syncfrom extends core_1.Command {
|
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
else {
|
|
87
|
-
|
|
87
|
+
utils_1.default.useRoot(this.id);
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
/**
|
|
@@ -93,27 +93,27 @@ class Syncfrom extends core_1.Command {
|
|
|
93
93
|
*/
|
|
94
94
|
async restorePrivateData(destDelete = false) {
|
|
95
95
|
if (!fs_1.default.existsSync(this.luksMountpoint)) {
|
|
96
|
-
await (0,
|
|
96
|
+
await (0, utils_2.exec)(`mkdir ${this.luksMountpoint}`, this.echo);
|
|
97
97
|
}
|
|
98
98
|
await this.luksOpen();
|
|
99
99
|
/**
|
|
100
100
|
* ONLY FROM LIVE
|
|
101
101
|
* rm home, subst /etc/passwd, /etc/shadow, /etc/groups
|
|
102
102
|
*/
|
|
103
|
-
if (
|
|
104
|
-
|
|
105
|
-
await (0,
|
|
106
|
-
|
|
107
|
-
await (0,
|
|
108
|
-
await (0,
|
|
109
|
-
await (0,
|
|
110
|
-
}
|
|
111
|
-
|
|
103
|
+
if (utils_1.default.isLive() && this.rootDir !== '/') {
|
|
104
|
+
utils_1.default.warning('Removing live user on destination system');
|
|
105
|
+
await (0, utils_2.exec)(`rm -rf ${this.rootDir}/home/*`, this.echo);
|
|
106
|
+
utils_1.default.warning('Restoring accounts');
|
|
107
|
+
await (0, utils_2.exec)(`cp ${this.luksMountpoint}/etc/passwd ${this.rootDir}/etc/`, this.echo);
|
|
108
|
+
await (0, utils_2.exec)(`cp ${this.luksMountpoint}/etc/shadow ${this.rootDir}/etc/`, this.echo);
|
|
109
|
+
await (0, utils_2.exec)(`cp ${this.luksMountpoint}/etc/group ${this.rootDir}/etc/`, this.echo);
|
|
110
|
+
}
|
|
111
|
+
utils_1.default.warning('Restoring crypted data');
|
|
112
112
|
let cmd = `rsync -a ${this.luksMountpoint}/ROOT/ ${this.rootDir}/`;
|
|
113
113
|
if (destDelete) {
|
|
114
114
|
cmd = `rsync --archive --delete ${this.luksMountpoint}/ROOT/ ${this.rootDir}/`;
|
|
115
115
|
}
|
|
116
|
-
await (0,
|
|
116
|
+
await (0, utils_2.exec)(cmd, this.echo);
|
|
117
117
|
await this.luksClose();
|
|
118
118
|
}
|
|
119
119
|
/**
|
|
@@ -121,33 +121,33 @@ class Syncfrom extends core_1.Command {
|
|
|
121
121
|
*/
|
|
122
122
|
async luksOpen() {
|
|
123
123
|
if (!fs_1.default.existsSync(this.luksDevice)) {
|
|
124
|
-
|
|
125
|
-
await (0,
|
|
124
|
+
utils_1.default.warning(`LUKS open volume: ${this.luksName}`);
|
|
125
|
+
await (0, utils_2.exec)(`cryptsetup luksOpen --type luks2 ${this.luksFile} ${this.luksName}`, utils_1.default.setEcho(true));
|
|
126
126
|
}
|
|
127
127
|
else {
|
|
128
|
-
|
|
128
|
+
utils_1.default.warning(`LUKS volume: ${this.luksName} already open`);
|
|
129
129
|
}
|
|
130
130
|
if (!fs_1.default.existsSync(this.luksMountpoint)) {
|
|
131
|
-
await (0,
|
|
131
|
+
await (0, utils_2.exec)(`mkdir -p ${this.luksMountpoint}`, this.echo);
|
|
132
132
|
}
|
|
133
|
-
if (!
|
|
134
|
-
|
|
135
|
-
await (0,
|
|
133
|
+
if (!utils_1.default.isMountpoint(this.luksMountpoint)) {
|
|
134
|
+
utils_1.default.warning(`mount volume: ${this.luksDevice} on ${this.luksMountpoint}`);
|
|
135
|
+
await (0, utils_2.exec)(`mount ${this.luksDevice} ${this.luksMountpoint}`, this.echo);
|
|
136
136
|
}
|
|
137
137
|
else {
|
|
138
|
-
|
|
138
|
+
utils_1.default.warning(`mount volume: ${this.luksDevice} already mounted on ${this.luksMountpoint}`);
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
141
|
/**
|
|
142
142
|
*
|
|
143
143
|
*/
|
|
144
144
|
async luksClose() {
|
|
145
|
-
if (
|
|
146
|
-
await (0,
|
|
145
|
+
if (utils_1.default.isMountpoint(this.luksMountpoint)) {
|
|
146
|
+
await (0, utils_2.exec)(`umount ${this.luksMountpoint}`, this.echo);
|
|
147
147
|
}
|
|
148
148
|
if (fs_1.default.existsSync(this.luksDevice)) {
|
|
149
|
-
|
|
150
|
-
await (0,
|
|
149
|
+
utils_1.default.warning(`LUKS close volume: ${this.luksName}`);
|
|
150
|
+
await (0, utils_2.exec)(`cryptsetup luksClose ${this.luksName}`, this.echo);
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
153
|
}
|
package/dist/commands/syncto.js
CHANGED
|
@@ -28,12 +28,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
28
28
|
const core_1 = require("@oclif/core");
|
|
29
29
|
const fs_1 = __importDefault(require("fs"));
|
|
30
30
|
const path_1 = __importDefault(require("path"));
|
|
31
|
-
const
|
|
32
|
-
const
|
|
31
|
+
const utils_1 = __importDefault(require("../classes/utils"));
|
|
32
|
+
const utils_2 = require("../lib/utils");
|
|
33
33
|
// backup
|
|
34
34
|
const promises_1 = require("fs/promises");
|
|
35
35
|
const fs_2 = require("fs");
|
|
36
|
-
const
|
|
36
|
+
const users_1 = __importDefault(require("../classes/users"));
|
|
37
37
|
/**
|
|
38
38
|
*
|
|
39
39
|
*/
|
|
@@ -55,7 +55,7 @@ class Syncto extends core_1.Command {
|
|
|
55
55
|
if (flags.verbose) {
|
|
56
56
|
this.verbose = true;
|
|
57
57
|
}
|
|
58
|
-
this.echo =
|
|
58
|
+
this.echo = utils_1.default.setEcho(this.verbose);
|
|
59
59
|
let fileVolume = '';
|
|
60
60
|
if (flags.file) {
|
|
61
61
|
fileVolume = flags.file;
|
|
@@ -64,7 +64,7 @@ class Syncto extends core_1.Command {
|
|
|
64
64
|
if (flags.delete) {
|
|
65
65
|
destDelete = true;
|
|
66
66
|
}
|
|
67
|
-
if (
|
|
67
|
+
if (utils_1.default.isRoot()) {
|
|
68
68
|
/**
|
|
69
69
|
* restore con file
|
|
70
70
|
*/
|
|
@@ -79,7 +79,7 @@ class Syncto extends core_1.Command {
|
|
|
79
79
|
await this.luksCreate();
|
|
80
80
|
}
|
|
81
81
|
else {
|
|
82
|
-
|
|
82
|
+
utils_1.default.warning(`LUKS volume: ${this.luksFile} exist, don't need create`);
|
|
83
83
|
}
|
|
84
84
|
if (fs_1.default.existsSync(fileVolume)) {
|
|
85
85
|
await this.luksOpen();
|
|
@@ -88,7 +88,7 @@ class Syncto extends core_1.Command {
|
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
else {
|
|
91
|
-
|
|
91
|
+
utils_1.default.useRoot(this.id);
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
94
|
/**
|
|
@@ -96,13 +96,13 @@ class Syncto extends core_1.Command {
|
|
|
96
96
|
*/
|
|
97
97
|
async backup(destDelete = false) {
|
|
98
98
|
if (this.verbose) {
|
|
99
|
-
|
|
99
|
+
utils_1.default.warning('backup');
|
|
100
100
|
}
|
|
101
|
-
|
|
101
|
+
utils_1.default.warning(`Saving users' data on ${this.luksFile}`);
|
|
102
102
|
const usersArray = await this.usersFill();
|
|
103
103
|
for (const element of usersArray) {
|
|
104
104
|
if (element.saveIt && fs_1.default.existsSync(element.home)) {
|
|
105
|
-
await (0,
|
|
105
|
+
await (0, utils_2.exec)(`mkdir -p ${this.luksMountpoint}/ROOT${element.home}`, this.echo);
|
|
106
106
|
const source = element.home;
|
|
107
107
|
let dest = this.luksMountpoint + '/ROOT' + element.home;
|
|
108
108
|
dest = dest.slice(0, Math.max(0, dest.lastIndexOf('/')));
|
|
@@ -110,14 +110,14 @@ class Syncto extends core_1.Command {
|
|
|
110
110
|
if (destDelete) {
|
|
111
111
|
cmd = `rsync --archive --delete ${source} ${dest}`;
|
|
112
112
|
}
|
|
113
|
-
await (0,
|
|
113
|
+
await (0, utils_2.exec)(cmd, this.echo);
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
|
-
|
|
117
|
-
await (0,
|
|
118
|
-
await (0,
|
|
119
|
-
await (0,
|
|
120
|
-
await (0,
|
|
116
|
+
utils_1.default.warning(`Saving users' accounts on ${this.luksFile}`);
|
|
117
|
+
await (0, utils_2.exec)(`mkdir -p ${this.luksMountpoint}/etc`, this.echo);
|
|
118
|
+
await (0, utils_2.exec)(`cp /etc/passwd ${this.luksMountpoint}/etc`, this.echo);
|
|
119
|
+
await (0, utils_2.exec)(`cp /etc/shadow ${this.luksMountpoint}/etc`, this.echo);
|
|
120
|
+
await (0, utils_2.exec)(`cp /etc/group ${this.luksMountpoint}/etc`, this.echo);
|
|
121
121
|
}
|
|
122
122
|
/**
|
|
123
123
|
* usersFill
|
|
@@ -128,7 +128,7 @@ class Syncto extends core_1.Command {
|
|
|
128
128
|
const passwd = fs_1.default.readFileSync('/etc/passwd', 'utf-8').split('\n');
|
|
129
129
|
for (const element of passwd) {
|
|
130
130
|
const line = element.split(':');
|
|
131
|
-
const users = new
|
|
131
|
+
const users = new users_1.default(line[0], line[1], line[2], line[3], line[4], line[5], line[6]);
|
|
132
132
|
await users.getValues();
|
|
133
133
|
if (users.password !== undefined) {
|
|
134
134
|
usersArray.push(users);
|
|
@@ -140,7 +140,7 @@ class Syncto extends core_1.Command {
|
|
|
140
140
|
*
|
|
141
141
|
*/
|
|
142
142
|
async luksCreate() {
|
|
143
|
-
|
|
143
|
+
utils_1.default.warning(`Creating LUKS Volume on ${this.luksFile}`);
|
|
144
144
|
let totalSize = 0;
|
|
145
145
|
console.log('I will extimate volume size from your private data:');
|
|
146
146
|
const users = await this.usersFill();
|
|
@@ -150,11 +150,11 @@ class Syncto extends core_1.Command {
|
|
|
150
150
|
if (Number.parseInt(user.uid) < 1000) {
|
|
151
151
|
utype = 'service';
|
|
152
152
|
}
|
|
153
|
-
console.log(`- ${utype}: ${user.login.padEnd(16)} \thome: ${user.home} \tsize: ${
|
|
153
|
+
console.log(`- ${utype}: ${user.login.padEnd(16)} \thome: ${user.home} \tsize: ${utils_1.default.formatBytes(user.size)} \tBytes: ${user.size} `);
|
|
154
154
|
totalSize += user.size;
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
|
-
console.log(`Total\t\t\t\t\t\t\tsize: ${
|
|
157
|
+
console.log(`Total\t\t\t\t\t\t\tsize: ${utils_1.default.formatBytes(totalSize)} \tBytes: ${totalSize}`);
|
|
158
158
|
/**
|
|
159
159
|
* after we get size, we can start building luks-volume
|
|
160
160
|
*/
|
|
@@ -169,29 +169,29 @@ class Syncto extends core_1.Command {
|
|
|
169
169
|
if (blocks * blockSize < minimunSize) {
|
|
170
170
|
blocks = Math.ceil(minimunSize / blockSize);
|
|
171
171
|
}
|
|
172
|
-
|
|
173
|
-
await (0,
|
|
172
|
+
utils_1.default.warning(`Creating an encrypted file ${this.luksFile} blocks=${blocks}, block size: ${blockSize}, size: ${utils_1.default.formatBytes(blocks * blockSize)}`);
|
|
173
|
+
await (0, utils_2.exec)(`dd if=/dev/zero of=${this.luksFile} bs=${blockSize} count=${blocks}`, this.echo);
|
|
174
174
|
// find first unused device
|
|
175
|
-
const findFirstUnusedDevice = await (0,
|
|
175
|
+
const findFirstUnusedDevice = await (0, utils_2.exec)('losetup -f', { echo: this.verbose, ignore: false, capture: true });
|
|
176
176
|
let firstUnusedDevice = '';
|
|
177
177
|
if (findFirstUnusedDevice.code !== 0) {
|
|
178
|
-
|
|
178
|
+
utils_1.default.pressKeyToExit(`Error: ${findFirstUnusedDevice.code} ${findFirstUnusedDevice.data}`);
|
|
179
179
|
}
|
|
180
180
|
else {
|
|
181
181
|
firstUnusedDevice = findFirstUnusedDevice.data.trim();
|
|
182
182
|
}
|
|
183
|
-
await (0,
|
|
183
|
+
await (0, utils_2.exec)(`losetup ${firstUnusedDevice} ${this.luksFile}`, this.echo);
|
|
184
184
|
// Utils.warning('Enter a large string of random text below to setup the pre-encryption')
|
|
185
|
-
await (0,
|
|
185
|
+
await (0, utils_2.exec)(`cryptsetup -y -v --type luks2 luksFormat ${this.luksFile}`, utils_1.default.setEcho(true));
|
|
186
186
|
// Utils.warning(`Enter the desired passphrase for the encrypted ${this.luksName} below`)
|
|
187
|
-
const crytoSetup = await (0,
|
|
187
|
+
const crytoSetup = await (0, utils_2.exec)(`cryptsetup luksOpen --type luks2 ${this.luksFile} ${this.luksName}`, utils_1.default.setEcho(true));
|
|
188
188
|
if (crytoSetup.code !== 0) {
|
|
189
|
-
|
|
189
|
+
utils_1.default.pressKeyToExit(`Error: ${crytoSetup.code} ${crytoSetup.data}`);
|
|
190
190
|
}
|
|
191
|
-
|
|
192
|
-
const formatting = await (0,
|
|
191
|
+
utils_1.default.warning(`Formatting ${this.luksDevice} to ext2`);
|
|
192
|
+
const formatting = await (0, utils_2.exec)(`sudo mkfs.ext2 ${this.luksDevice}`, this.echo);
|
|
193
193
|
if (formatting.code !== 0) {
|
|
194
|
-
|
|
194
|
+
utils_1.default.pressKeyToExit(`Error: ${formatting.code} ${formatting.data}`);
|
|
195
195
|
}
|
|
196
196
|
// this.luksClose()
|
|
197
197
|
}
|
|
@@ -201,32 +201,32 @@ class Syncto extends core_1.Command {
|
|
|
201
201
|
async luksOpen() {
|
|
202
202
|
if (!fs_1.default.existsSync(this.luksDevice)) {
|
|
203
203
|
// Utils.warning(`LUKS open volume: ${this.luksName}`)
|
|
204
|
-
await (0,
|
|
204
|
+
await (0, utils_2.exec)(`cryptsetup luksOpen --type luks2 ${this.luksFile} ${this.luksName}`, utils_1.default.setEcho(true));
|
|
205
205
|
}
|
|
206
206
|
else {
|
|
207
|
-
|
|
207
|
+
utils_1.default.warning(`LUKS volume: ${this.luksName} already open`);
|
|
208
208
|
}
|
|
209
209
|
if (!fs_1.default.existsSync(this.luksMountpoint)) {
|
|
210
|
-
await (0,
|
|
210
|
+
await (0, utils_2.exec)(`mkdir -p ${this.luksMountpoint}`, this.echo);
|
|
211
211
|
}
|
|
212
|
-
if (!
|
|
213
|
-
|
|
214
|
-
await (0,
|
|
212
|
+
if (!utils_1.default.isMountpoint(this.luksMountpoint)) {
|
|
213
|
+
utils_1.default.warning(`mount volume: ${this.luksDevice} on ${this.luksMountpoint}`);
|
|
214
|
+
await (0, utils_2.exec)(`mount ${this.luksDevice} ${this.luksMountpoint}`, this.echo);
|
|
215
215
|
}
|
|
216
216
|
else {
|
|
217
|
-
|
|
217
|
+
utils_1.default.warning(`mount volume: ${this.luksDevice} already mounted on ${this.luksMountpoint}`);
|
|
218
218
|
}
|
|
219
219
|
}
|
|
220
220
|
/**
|
|
221
221
|
*
|
|
222
222
|
*/
|
|
223
223
|
async luksClose() {
|
|
224
|
-
if (
|
|
225
|
-
await (0,
|
|
224
|
+
if (utils_1.default.isMountpoint(this.luksMountpoint)) {
|
|
225
|
+
await (0, utils_2.exec)(`umount ${this.luksMountpoint}`, this.echo);
|
|
226
226
|
}
|
|
227
227
|
if (fs_1.default.existsSync(this.luksDevice)) {
|
|
228
|
-
|
|
229
|
-
await (0,
|
|
228
|
+
utils_1.default.warning(`LUKS close volume: ${this.luksName}`);
|
|
229
|
+
await (0, utils_2.exec)(`cryptsetup luksClose ${this.luksName}`, this.echo);
|
|
230
230
|
}
|
|
231
231
|
}
|
|
232
232
|
}
|
|
@@ -10,25 +10,25 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
10
10
|
* license: MIT
|
|
11
11
|
*/
|
|
12
12
|
const core_1 = require("@oclif/core");
|
|
13
|
-
const
|
|
14
|
-
const
|
|
13
|
+
const utils_1 = __importDefault(require("../../classes/utils"));
|
|
14
|
+
const bleach_1 = __importDefault(require("../../classes/bleach"));
|
|
15
15
|
class Clean extends core_1.Command {
|
|
16
16
|
async run() {
|
|
17
17
|
const { flags } = await this.parse(Clean);
|
|
18
|
-
|
|
18
|
+
utils_1.default.titles(this.id + ' ' + this.argv);
|
|
19
19
|
let verbose = false;
|
|
20
20
|
if (flags.verbose) {
|
|
21
21
|
verbose = true;
|
|
22
22
|
}
|
|
23
23
|
const nointeractive = flags.nointeractive;
|
|
24
|
-
if (
|
|
25
|
-
if (nointeractive || await
|
|
26
|
-
const bleach = new
|
|
24
|
+
if (utils_1.default.isRoot()) {
|
|
25
|
+
if (nointeractive || await utils_1.default.customConfirm('Select yes to continue...')) {
|
|
26
|
+
const bleach = new bleach_1.default();
|
|
27
27
|
bleach.clean(verbose);
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
else {
|
|
31
|
-
|
|
31
|
+
utils_1.default.useRoot(this.id);
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
}
|
|
@@ -10,9 +10,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
10
10
|
* license: MIT
|
|
11
11
|
*/
|
|
12
12
|
const core_1 = require("@oclif/core");
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
13
|
+
const distro_1 = __importDefault(require("../../classes/distro"));
|
|
14
|
+
const utils_1 = __importDefault(require("../../classes/utils"));
|
|
15
|
+
const utils_2 = require("../../lib/utils");
|
|
16
16
|
const fs_1 = __importDefault(require("fs"));
|
|
17
17
|
const fkey = '/etc/apt/trusted.gpg.d/penguins-eggs-key.gpg';
|
|
18
18
|
const flist = '/etc/apt/sources.list.d/penguins-eggs-ppa.list';
|
|
@@ -22,24 +22,24 @@ const flist = '/etc/apt/sources.list.d/penguins-eggs-ppa.list';
|
|
|
22
22
|
class Ppa extends core_1.Command {
|
|
23
23
|
async run() {
|
|
24
24
|
const { flags } = await this.parse(Ppa);
|
|
25
|
-
|
|
25
|
+
utils_1.default.titles(this.id + ' ' + this.argv);
|
|
26
26
|
let verbose = false;
|
|
27
27
|
if (flags.verbose) {
|
|
28
28
|
verbose = true;
|
|
29
29
|
}
|
|
30
30
|
const nointeractive = flags.nointeractive;
|
|
31
|
-
const distro = new
|
|
31
|
+
const distro = new distro_1.default();
|
|
32
32
|
if (distro.familyId === 'debian') {
|
|
33
|
-
if (
|
|
33
|
+
if (utils_1.default.isRoot()) {
|
|
34
34
|
if (flags.remove) {
|
|
35
|
-
|
|
36
|
-
if (nointeractive || await
|
|
35
|
+
utils_1.default.warning(`Are you sure to remove ${flist} to your repositories?`);
|
|
36
|
+
if (nointeractive || await utils_1.default.customConfirm('Select yes to continue...')) {
|
|
37
37
|
await remove();
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
if (flags.add) {
|
|
41
|
-
|
|
42
|
-
if (nointeractive || await
|
|
41
|
+
utils_1.default.warning(`Are you sure to add ${flist} to your repositories?`);
|
|
42
|
+
if (nointeractive || await utils_1.default.customConfirm('Select yes to continue...')) {
|
|
43
43
|
await clean();
|
|
44
44
|
await add();
|
|
45
45
|
}
|
|
@@ -47,7 +47,7 @@ class Ppa extends core_1.Command {
|
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
else {
|
|
50
|
-
|
|
50
|
+
utils_1.default.warning('you can use ppa only for debian family');
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
}
|
|
@@ -68,23 +68,23 @@ Ppa.examples = [
|
|
|
68
68
|
* add ppa
|
|
69
69
|
*/
|
|
70
70
|
async function add() {
|
|
71
|
-
await (0,
|
|
71
|
+
await (0, utils_2.exec)(`curl -sS https://pieroproietti.github.io/penguins-eggs-ppa/KEY.gpg| gpg --dearmor | sudo tee ${fkey} > /dev/null`);
|
|
72
72
|
const content = `deb [signed-by=${fkey}] https://pieroproietti.github.io/penguins-eggs-ppa ./\n`;
|
|
73
73
|
fs_1.default.writeFileSync(flist, content);
|
|
74
|
-
await (0,
|
|
74
|
+
await (0, utils_2.exec)('apt-get update');
|
|
75
75
|
}
|
|
76
76
|
/**
|
|
77
77
|
* remove ppa
|
|
78
78
|
*/
|
|
79
79
|
async function remove() {
|
|
80
80
|
await clean();
|
|
81
|
-
await (0,
|
|
81
|
+
await (0, utils_2.exec)('apt-get update');
|
|
82
82
|
}
|
|
83
83
|
/**
|
|
84
84
|
*
|
|
85
85
|
*/
|
|
86
86
|
async function clean() {
|
|
87
|
-
await (0,
|
|
88
|
-
await (0,
|
|
89
|
-
await (0,
|
|
87
|
+
await (0, utils_2.exec)('rm -f /etc/apt/trusted.gpg.d/penguins-eggs*');
|
|
88
|
+
await (0, utils_2.exec)('rm -f /etc/apt/sources.list.d/penguins-eggs*');
|
|
89
|
+
await (0, utils_2.exec)('rm -f /usr/share/keyrings/penguins-eggs*');
|
|
90
90
|
}
|
|
@@ -10,32 +10,32 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
10
10
|
* license: MIT
|
|
11
11
|
*/
|
|
12
12
|
const core_1 = require("@oclif/core");
|
|
13
|
-
const
|
|
13
|
+
const utils_1 = __importDefault(require("../../classes/utils"));
|
|
14
14
|
const fs_1 = __importDefault(require("fs"));
|
|
15
|
-
const
|
|
15
|
+
const xdg_1 = __importDefault(require("../../classes/xdg"));
|
|
16
16
|
class Skel extends core_1.Command {
|
|
17
17
|
async run() {
|
|
18
|
-
|
|
18
|
+
utils_1.default.titles(this.id + ' ' + this.argv);
|
|
19
19
|
const { flags } = await this.parse(Skel);
|
|
20
20
|
let verbose = false;
|
|
21
21
|
if (flags.verbose) {
|
|
22
22
|
verbose = true;
|
|
23
23
|
}
|
|
24
24
|
let user = '';
|
|
25
|
-
user = flags.user ? flags.user : await
|
|
26
|
-
|
|
25
|
+
user = flags.user ? flags.user : await utils_1.default.getPrimaryUser();
|
|
26
|
+
utils_1.default.warning(`user: ${user}`);
|
|
27
27
|
const homeSource = `/home/${user}`;
|
|
28
28
|
if (!fs_1.default.existsSync(homeSource)) {
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
utils_1.default.error(`User ${user} not exist or not exist a proper home`);
|
|
30
|
+
utils_1.default.warning('terminate');
|
|
31
31
|
process.exit(0);
|
|
32
32
|
}
|
|
33
|
-
if (
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
if (utils_1.default.isRoot()) {
|
|
34
|
+
utils_1.default.titles('skel');
|
|
35
|
+
xdg_1.default.skel(user, verbose);
|
|
36
36
|
}
|
|
37
37
|
else {
|
|
38
|
-
|
|
38
|
+
utils_1.default.useRoot(this.id);
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
}
|
|
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const core_1 = require("@oclif/core");
|
|
7
|
-
const
|
|
7
|
+
const utils_1 = __importDefault(require("../../classes/utils"));
|
|
8
8
|
const axios_1 = __importDefault(require("axios"));
|
|
9
9
|
const node_https_1 = __importDefault(require("node:https"));
|
|
10
10
|
const agent = new node_https_1.default.Agent({
|
|
@@ -19,7 +19,7 @@ class ToolsStat extends core_1.Command {
|
|
|
19
19
|
*/
|
|
20
20
|
async run() {
|
|
21
21
|
const { args, flags } = await this.parse(ToolsStat);
|
|
22
|
-
|
|
22
|
+
utils_1.default.titles(this.id + ' ' + this.argv);
|
|
23
23
|
const yesterday = new Date();
|
|
24
24
|
yesterday.setDate(yesterday.getDate() - 1);
|
|
25
25
|
// current date
|
|
@@ -12,8 +12,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
const core_1 = require("@oclif/core");
|
|
13
13
|
const shelljs_1 = __importDefault(require("shelljs"));
|
|
14
14
|
const node_fs_1 = __importDefault(require("node:fs"));
|
|
15
|
-
const
|
|
16
|
-
const
|
|
15
|
+
const utils_1 = __importDefault(require("../../classes/utils"));
|
|
16
|
+
const yolk_1 = __importDefault(require("../../classes/yolk"));
|
|
17
17
|
/**
|
|
18
18
|
*
|
|
19
19
|
*/
|
|
@@ -22,21 +22,21 @@ class DevYolk extends core_1.Command {
|
|
|
22
22
|
*
|
|
23
23
|
*/
|
|
24
24
|
async run() {
|
|
25
|
-
|
|
25
|
+
utils_1.default.titles(this.id + ' ' + this.argv);
|
|
26
26
|
const { flags } = await this.parse(DevYolk);
|
|
27
27
|
let verbose = false;
|
|
28
28
|
if (flags.verbose) {
|
|
29
29
|
verbose = true;
|
|
30
30
|
}
|
|
31
|
-
if (
|
|
31
|
+
if (utils_1.default.isRoot()) {
|
|
32
32
|
if (node_fs_1.default.existsSync(DevYolk.dir)) {
|
|
33
33
|
shelljs_1.default.exec(`rm ${DevYolk.dir} -rf `);
|
|
34
34
|
}
|
|
35
|
-
const yolk = new
|
|
35
|
+
const yolk = new yolk_1.default();
|
|
36
36
|
await yolk.create(verbose);
|
|
37
37
|
}
|
|
38
38
|
else {
|
|
39
|
-
|
|
39
|
+
utils_1.default.useRoot(this.id);
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
}
|