penguins-eggs 9.0.31 → 9.1.10
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 +488 -28
- package/assets/leaves.svg +1 -0
- package/assets/live-installer/com.github.pieroproietti.penguins-eggs.policy +25 -0
- package/assets/live-installer/filesystem.packages-remove +49 -0
- package/assets/penguins-live-installer.desktop +27 -0
- package/conf/distros/buster/calamares/modules/bootloader.yml +3 -1
- package/conf/eggs.yaml +9 -2
- package/lib/classes/bleach.js +2 -2
- package/lib/classes/compressors.js +1 -1
- package/lib/classes/daddy.js +30 -30
- package/lib/classes/distro.d.ts +5 -3
- package/lib/classes/distro.js +78 -80
- package/lib/classes/family/archlinux.js +4 -4
- package/lib/classes/family/debian.d.ts +4 -0
- package/lib/classes/family/debian.js +13 -6
- package/lib/classes/family/fedora.js +4 -4
- package/lib/classes/family/suse.js +4 -4
- package/lib/classes/i18n.d.ts +28 -4
- package/lib/classes/i18n.js +112 -84
- package/lib/classes/incubation/branding.js +13 -7
- package/lib/classes/incubation/distros/bionic.js +1 -1
- package/lib/classes/incubation/distros/buster.js +1 -1
- package/lib/classes/incubation/distros/focal.js +1 -1
- package/lib/classes/incubation/distros/jessie.js +1 -1
- package/lib/classes/incubation/distros/rolling.js +1 -1
- package/lib/classes/incubation/fisherman-helper/displaymanager.js +1 -1
- package/lib/classes/incubation/fisherman-helper/packages.js +2 -2
- package/lib/classes/incubation/fisherman.js +5 -5
- package/lib/classes/incubation/incubator.js +5 -5
- package/lib/classes/incubation/installer.d.ts +1 -1
- package/lib/classes/incubation/installer.js +4 -4
- package/lib/classes/initrd.js +2 -2
- package/lib/classes/keyboards.d.ts +45 -0
- package/lib/classes/keyboards.js +196 -0
- package/lib/classes/krill_install.d.ts +5 -0
- package/lib/classes/krill_install.js +46 -14
- package/lib/classes/krill_prepare.d.ts +4 -0
- package/lib/classes/krill_prepare.js +56 -77
- package/lib/classes/locales.d.ts +14 -0
- package/lib/classes/locales.js +54 -0
- package/lib/classes/n8.js +1 -1
- package/lib/classes/ovary.d.ts +6 -1
- package/lib/classes/ovary.js +77 -60
- package/lib/classes/pacman.d.ts +1 -1
- package/lib/classes/pacman.js +40 -40
- package/lib/classes/pve-live.js +12 -16
- package/lib/classes/settings.d.ts +6 -0
- package/lib/classes/settings.js +13 -16
- package/lib/classes/sources_list.d.ts +27 -0
- package/lib/classes/sources_list.js +103 -0
- package/lib/classes/systemctl.js +1 -1
- package/lib/classes/tailor.d.ts +41 -0
- package/lib/classes/tailor.js +356 -0
- package/lib/classes/tools.js +4 -4
- package/lib/classes/users.js +1 -1
- package/lib/classes/utils.d.ts +16 -3
- package/lib/classes/utils.js +74 -36
- package/lib/classes/xdg.d.ts +2 -1
- package/lib/classes/xdg.js +56 -131
- package/lib/classes/yolk.d.ts +8 -7
- package/lib/classes/yolk.js +35 -38
- package/lib/commands/adapt.js +1 -1
- package/lib/commands/analyze.js +2 -2
- package/lib/commands/bro.js +2 -2
- package/lib/commands/calamares.js +4 -4
- package/lib/commands/config.js +8 -6
- package/lib/commands/dad.js +2 -2
- package/lib/commands/export/deb.js +2 -2
- package/lib/commands/export/docs.js +2 -2
- package/lib/commands/export/iso.js +2 -2
- package/lib/commands/info.js +2 -2
- package/lib/commands/install.js +5 -5
- package/lib/commands/kill.js +2 -2
- package/lib/commands/mom.js +2 -2
- package/lib/commands/produce.js +9 -9
- package/lib/commands/remove.js +2 -2
- package/lib/commands/syncfrom.d.ts +9 -3
- package/lib/commands/syncfrom.js +39 -32
- package/lib/commands/syncto.d.ts +26 -6
- package/lib/commands/syncto.js +73 -50
- package/lib/commands/tools/clean.js +2 -2
- package/lib/commands/tools/locales.js +9 -4
- package/lib/commands/tools/skel.js +2 -2
- package/lib/commands/tools/stat.js +3 -3
- package/lib/commands/tools/yolk.js +4 -4
- package/lib/commands/update.d.ts +0 -2
- package/lib/commands/update.js +7 -56
- package/lib/commands/wardrobe/get.d.ts +17 -0
- package/lib/commands/wardrobe/get.js +43 -0
- package/lib/commands/wardrobe/ironing.d.ts +15 -0
- package/lib/commands/wardrobe/ironing.js +125 -0
- package/lib/commands/wardrobe/list.d.ts +17 -0
- package/lib/commands/wardrobe/list.js +81 -0
- package/lib/commands/wardrobe/show.d.ts +19 -0
- package/lib/commands/wardrobe/show.js +71 -0
- package/lib/commands/wardrobe/wear.d.ts +20 -0
- package/lib/commands/wardrobe/wear.js +79 -0
- package/lib/components/elements/information.js +41 -34
- package/lib/components/elements/steps.js +1 -1
- package/lib/components/elements/title.js +5 -4
- package/lib/components/finished.js +6 -5
- package/lib/components/install.js +5 -5
- package/lib/components/keyboard.js +5 -8
- package/lib/components/location.js +5 -5
- package/lib/components/network.js +6 -5
- package/lib/components/partitions.js +5 -5
- package/lib/components/summary.js +5 -5
- package/lib/components/users.js +5 -5
- package/lib/components/welcome.js +7 -7
- package/lib/interfaces/i-costume.d.ts +27 -0
- package/lib/interfaces/i-costume.js +2 -0
- package/lib/interfaces/i-distro.d.ts +4 -2
- package/lib/interfaces/i-installer.d.ts +1 -1
- package/lib/interfaces/i-krill.d.ts +1 -0
- package/lib/interfaces/i-materia.d.ts +32 -0
- package/lib/interfaces/i-materia.js +2 -0
- package/lib/interfaces/i-packages.d.ts +13 -0
- package/lib/interfaces/i-packages.js +2 -0
- package/lib/interfaces/i-xkb-model.d.ts +17 -0
- package/lib/interfaces/i-xkb-model.js +2 -0
- package/lib/interfaces/index.d.ts +2 -0
- package/lib/lib/cli-autologin.js +3 -3
- package/lib/lib/select_address_type.js +1 -1
- package/lib/lib/select_filesystem_type.js +2 -2
- package/lib/lib/select_installation_device.js +1 -1
- package/lib/lib/select_interface.js +1 -1
- package/lib/lib/select_keyboard_layout.d.ts +1 -28
- package/lib/lib/select_keyboard_layout.js +18 -33
- package/lib/lib/select_keyboard_model.d.ts +4 -0
- package/lib/lib/select_keyboard_model.js +36 -0
- package/lib/lib/select_keyboard_option.d.ts +4 -0
- package/lib/lib/select_keyboard_option.js +36 -0
- package/lib/lib/select_keyboard_variant.d.ts +1 -5
- package/lib/lib/select_keyboard_variant.js +32 -5
- package/lib/lib/select_languages.d.ts +1 -1
- package/lib/lib/select_languages.js +8 -7
- package/lib/lib/select_regions.d.ts +1 -1
- package/lib/lib/select_regions.js +2 -2
- package/lib/lib/select_user_swap_choice.js +2 -2
- package/oclif.manifest.json +1 -1
- package/package.json +19 -20
- package/scripts/_eggs +53 -8
- package/scripts/eggs.bash +9 -4
- package/scripts/mom-cli.sh +66 -0
- package/scripts/resy.sh +8 -0
- package/scripts/userexist.sh +6 -0
- package/assets/penguins-clinstaller.desktop +0 -24
- package/assets/penguins-minstall.desktop +0 -95
- package/conf/distros/buster/locales/locale.gen.template +0 -10
- package/conf/distros/buster/locales/locale.template +0 -11
- package/conf/distros/focal/locale.gen.template +0 -8
- package/lib/classes/basket.d.ts +0 -22
- package/lib/classes/basket.js +0 -114
package/lib/commands/syncto.js
CHANGED
|
@@ -1,24 +1,45 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
2
|
/**
|
|
5
3
|
* penguins-eggs-v9
|
|
6
4
|
* author: Piero Proietti
|
|
7
5
|
* email: piero.proietti@gmail.com
|
|
8
6
|
* license: MIT
|
|
9
7
|
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
const tslib_1 = require("tslib");
|
|
10
|
+
/**
|
|
11
|
+
*
|
|
12
|
+
* syncfrom (restore)
|
|
13
|
+
* --include-from file.list // if only include is provided everything from the list if used to update the system.
|
|
14
|
+
* --exclude-from file-list // it just updates the system
|
|
15
|
+
* --delete
|
|
16
|
+
*
|
|
17
|
+
* If both options are provided then it works as a combination as provided in the link above.
|
|
18
|
+
* https://stackoverflow.com/questions/19296190/rsync-include-from-vs-exclude-from-what-is-the-actual-difference
|
|
19
|
+
*
|
|
20
|
+
* The same logic is applied for the syncto also.
|
|
21
|
+
*
|
|
22
|
+
* On top of all of this the --delete option
|
|
23
|
+
* if needed to be passed so that everything else is removed, but this
|
|
24
|
+
* this should not be available by default
|
|
25
|
+
*/
|
|
10
26
|
const core_1 = require("@oclif/core");
|
|
11
27
|
const fs = require("fs");
|
|
12
28
|
const path = require("path");
|
|
13
|
-
const utils_1 =
|
|
29
|
+
const utils_1 = tslib_1.__importDefault(require("../classes/utils"));
|
|
14
30
|
const utils_2 = require("../lib/utils");
|
|
15
31
|
// backup
|
|
16
32
|
const promises_1 = require("fs/promises");
|
|
17
33
|
const fs_1 = require("fs");
|
|
18
|
-
const users_1 =
|
|
34
|
+
const users_1 = tslib_1.__importDefault(require("../classes/users"));
|
|
35
|
+
/**
|
|
36
|
+
*
|
|
37
|
+
*/
|
|
19
38
|
class Syncto extends core_1.Command {
|
|
20
39
|
constructor() {
|
|
21
40
|
super(...arguments);
|
|
41
|
+
this.verbose = false;
|
|
42
|
+
this.echo = {};
|
|
22
43
|
this.luksName = 'luks-eggs-backup';
|
|
23
44
|
this.luksFile = `/run/live/medium/live/${this.luksName}`;
|
|
24
45
|
this.luksDevice = `/dev/mapper/${this.luksName}`;
|
|
@@ -29,15 +50,18 @@ class Syncto extends core_1.Command {
|
|
|
29
50
|
*/
|
|
30
51
|
async run() {
|
|
31
52
|
const { flags } = await this.parse(Syncto);
|
|
32
|
-
let verbose = false;
|
|
33
53
|
if (flags.verbose) {
|
|
34
|
-
verbose = true;
|
|
54
|
+
this.verbose = true;
|
|
35
55
|
}
|
|
56
|
+
this.echo = utils_1.default.setEcho(this.verbose);
|
|
36
57
|
let fileVolume = '';
|
|
37
58
|
if (flags.file) {
|
|
38
59
|
fileVolume = flags.file;
|
|
39
60
|
}
|
|
40
|
-
|
|
61
|
+
let destDelete = false;
|
|
62
|
+
if (flags.delete) {
|
|
63
|
+
destDelete = true;
|
|
64
|
+
}
|
|
41
65
|
if (utils_1.default.isRoot(this.id)) {
|
|
42
66
|
/**
|
|
43
67
|
* restore con file
|
|
@@ -50,44 +74,47 @@ class Syncto extends core_1.Command {
|
|
|
50
74
|
this.luksDevice = `/dev/mapper/${this.luksName}`;
|
|
51
75
|
this.luksMountpoint = '/tmp/eggs-backup';
|
|
52
76
|
if (!fs.existsSync(fileVolume)) {
|
|
53
|
-
await this.luksCreate(
|
|
77
|
+
await this.luksCreate();
|
|
54
78
|
}
|
|
55
79
|
else {
|
|
56
80
|
utils_1.default.warning(`LUKS volume: ${this.luksFile} exist, don't need create`);
|
|
57
81
|
}
|
|
58
82
|
if (fs.existsSync(fileVolume)) {
|
|
59
|
-
await this.luksOpen(
|
|
60
|
-
await this.backup(
|
|
61
|
-
await this.luksClose(
|
|
83
|
+
await this.luksOpen();
|
|
84
|
+
await this.backup(destDelete);
|
|
85
|
+
await this.luksClose();
|
|
62
86
|
}
|
|
63
87
|
}
|
|
64
88
|
}
|
|
65
89
|
/**
|
|
66
90
|
*
|
|
67
|
-
* @param verbose
|
|
68
91
|
*/
|
|
69
|
-
async backup(
|
|
70
|
-
|
|
71
|
-
if (verbose) {
|
|
92
|
+
async backup(destDelete = false) {
|
|
93
|
+
if (this.verbose) {
|
|
72
94
|
utils_1.default.warning('backup');
|
|
73
95
|
}
|
|
96
|
+
utils_1.default.warning(`Coping users and services data on ${this.luksFile}`);
|
|
74
97
|
const usersArray = await this.usersFill();
|
|
75
98
|
const cmds = [];
|
|
76
99
|
for (let i = 0; i < usersArray.length; i++) {
|
|
77
100
|
if (usersArray[i].saveIt) {
|
|
78
101
|
if (fs.existsSync(usersArray[i].home)) {
|
|
79
|
-
await (0, utils_2.exec)(`mkdir -p ${this.luksMountpoint}/ROOT${usersArray[i].home}`, echo);
|
|
102
|
+
await (0, utils_2.exec)(`mkdir -p ${this.luksMountpoint}/ROOT${usersArray[i].home}`, this.echo);
|
|
80
103
|
const source = usersArray[i].home;
|
|
81
104
|
let dest = this.luksMountpoint + '/ROOT' + usersArray[i].home;
|
|
82
105
|
dest = dest.substring(0, dest.lastIndexOf('/'));
|
|
83
|
-
|
|
106
|
+
let cmd = `rsync --archive ${source} ${dest}`;
|
|
107
|
+
if (destDelete) {
|
|
108
|
+
cmd = `rsync --archive --delete ${source} ${dest}`;
|
|
109
|
+
}
|
|
110
|
+
await (0, utils_2.exec)(cmd, this.echo);
|
|
84
111
|
}
|
|
85
112
|
}
|
|
86
113
|
}
|
|
87
|
-
await (0, utils_2.exec)(`mkdir -p ${this.luksMountpoint}/etc`, echo);
|
|
88
|
-
await (0, utils_2.exec)(`cp /etc/passwd ${this.luksMountpoint}/etc`, echo);
|
|
89
|
-
await (0, utils_2.exec)(`cp /etc/shadow ${this.luksMountpoint}/etc`, echo);
|
|
90
|
-
await (0, utils_2.exec)(`cp /etc/group ${this.luksMountpoint}/etc`, echo);
|
|
114
|
+
await (0, utils_2.exec)(`mkdir -p ${this.luksMountpoint}/etc`, this.echo);
|
|
115
|
+
await (0, utils_2.exec)(`cp /etc/passwd ${this.luksMountpoint}/etc`, this.echo);
|
|
116
|
+
await (0, utils_2.exec)(`cp /etc/shadow ${this.luksMountpoint}/etc`, this.echo);
|
|
117
|
+
await (0, utils_2.exec)(`cp /etc/group ${this.luksMountpoint}/etc`, this.echo);
|
|
91
118
|
}
|
|
92
119
|
/**
|
|
93
120
|
* usersFill
|
|
@@ -109,9 +136,7 @@ class Syncto extends core_1.Command {
|
|
|
109
136
|
/**
|
|
110
137
|
*
|
|
111
138
|
*/
|
|
112
|
-
async luksCreate(
|
|
113
|
-
const echo = utils_1.default.setEcho(verbose);
|
|
114
|
-
const echoYes = utils_1.default.setEcho(true);
|
|
139
|
+
async luksCreate() {
|
|
115
140
|
utils_1.default.warning(`Creating LUKS Volume on ${this.luksFile}`);
|
|
116
141
|
let totalSize = 0;
|
|
117
142
|
console.log(`I will extimate volume size from your private data:`);
|
|
@@ -119,12 +144,16 @@ class Syncto extends core_1.Command {
|
|
|
119
144
|
for (let i = 0; i < users.length; i++) {
|
|
120
145
|
if (users[i].login !== 'root') {
|
|
121
146
|
if (users[i].saveIt) {
|
|
122
|
-
|
|
147
|
+
let utype = 'user ';
|
|
148
|
+
if (parseInt(users[i].uid) < 1000) {
|
|
149
|
+
utype = 'service';
|
|
150
|
+
}
|
|
151
|
+
console.log(`- ${utype}: ${users[i].login.padEnd(16)} \thome: ${users[i].home} \tsize: ${utils_1.default.formatBytes(users[i].size)} \tBytes: ${users[i].size} `);
|
|
123
152
|
totalSize += users[i].size;
|
|
124
153
|
}
|
|
125
154
|
}
|
|
126
155
|
}
|
|
127
|
-
console.log(`Total\t\t\t\t\
|
|
156
|
+
console.log(`Total\t\t\t\t\t\t\tsize: ${utils_1.default.formatBytes(totalSize)} \tBytes: ${totalSize}`);
|
|
128
157
|
/**
|
|
129
158
|
* after we get size, we can start building luks-volume
|
|
130
159
|
*/
|
|
@@ -141,53 +170,48 @@ class Syncto extends core_1.Command {
|
|
|
141
170
|
blocks = Math.ceil(minimunSize / blockSize);
|
|
142
171
|
}
|
|
143
172
|
utils_1.default.warning(`Creating an encrypted file ${this.luksFile} blocks=${blocks}, block size: ${blockSize}, size: ${utils_1.default.formatBytes(blocks * blockSize)}`);
|
|
144
|
-
await (0, utils_2.exec)(`dd if=/dev/zero of=${this.luksFile} bs=${blockSize} count=${blocks}`, echo);
|
|
173
|
+
await (0, utils_2.exec)(`dd if=/dev/zero of=${this.luksFile} bs=${blockSize} count=${blocks}`, this.echo);
|
|
145
174
|
// find first unused device
|
|
146
|
-
let findFirstUnusedDevice = await (0, utils_2.exec)(`losetup -f`, { echo: verbose, ignore: false, capture: true });
|
|
175
|
+
let findFirstUnusedDevice = await (0, utils_2.exec)(`losetup -f`, { echo: this.verbose, ignore: false, capture: true });
|
|
147
176
|
let firstUnusedDevice = '';
|
|
148
177
|
if (findFirstUnusedDevice.code !== 0) {
|
|
149
|
-
utils_1.default.
|
|
150
|
-
process.exit(1);
|
|
178
|
+
utils_1.default.pressKeyToExit(`Error: ${findFirstUnusedDevice.code} ${findFirstUnusedDevice.data}`);
|
|
151
179
|
}
|
|
152
180
|
else {
|
|
153
181
|
firstUnusedDevice = findFirstUnusedDevice.data.trim();
|
|
154
182
|
}
|
|
155
|
-
await (0, utils_2.exec)(`losetup ${firstUnusedDevice} ${this.luksFile}`, echo);
|
|
183
|
+
await (0, utils_2.exec)(`losetup ${firstUnusedDevice} ${this.luksFile}`, this.echo);
|
|
156
184
|
utils_1.default.warning('Enter a large string of random text below to setup the pre-encryption');
|
|
157
|
-
await (0, utils_2.exec)(`cryptsetup -y -v --type luks2 luksFormat ${this.luksFile}`,
|
|
185
|
+
await (0, utils_2.exec)(`cryptsetup -y -v --type luks2 luksFormat ${this.luksFile}`, utils_1.default.setEcho(true));
|
|
158
186
|
utils_1.default.warning(`Enter the desired passphrase for the encrypted ${this.luksName} below`);
|
|
159
|
-
let crytoSetup = await (0, utils_2.exec)(`cryptsetup luksOpen --type luks2 ${this.luksFile} ${this.luksName}`,
|
|
187
|
+
let crytoSetup = await (0, utils_2.exec)(`cryptsetup luksOpen --type luks2 ${this.luksFile} ${this.luksName}`, utils_1.default.setEcho(true));
|
|
160
188
|
if (crytoSetup.code !== 0) {
|
|
161
|
-
utils_1.default.
|
|
162
|
-
process.exit(1);
|
|
189
|
+
utils_1.default.pressKeyToExit(`Error: ${crytoSetup.code} ${crytoSetup.data}`);
|
|
163
190
|
}
|
|
164
191
|
utils_1.default.warning(`Formatting ${this.luksDevice} to ext2`);
|
|
165
|
-
let formatting = await (0, utils_2.exec)(`sudo mkfs.ext2 ${this.luksDevice}`, echo);
|
|
192
|
+
let formatting = await (0, utils_2.exec)(`sudo mkfs.ext2 ${this.luksDevice}`, this.echo);
|
|
166
193
|
if (formatting.code !== 0) {
|
|
167
|
-
utils_1.default.
|
|
168
|
-
process.exit(1);
|
|
194
|
+
utils_1.default.pressKeyToExit(`Error: ${formatting.code} ${formatting.data}`);
|
|
169
195
|
}
|
|
170
196
|
// this.luksClose()
|
|
171
197
|
}
|
|
172
198
|
/**
|
|
173
199
|
*
|
|
174
200
|
*/
|
|
175
|
-
async luksOpen(
|
|
176
|
-
const echo = utils_1.default.setEcho(verbose);
|
|
177
|
-
const echoYes = utils_1.default.setEcho(true); // echoYes serve solo per cryptsetup luksOpen
|
|
201
|
+
async luksOpen() {
|
|
178
202
|
if (!fs.existsSync(this.luksDevice)) {
|
|
179
203
|
utils_1.default.warning(`LUKS open volume: ${this.luksName}`);
|
|
180
|
-
await (0, utils_2.exec)(`cryptsetup luksOpen --type luks2 ${this.luksFile} ${this.luksName}`,
|
|
204
|
+
await (0, utils_2.exec)(`cryptsetup luksOpen --type luks2 ${this.luksFile} ${this.luksName}`, utils_1.default.setEcho(true));
|
|
181
205
|
}
|
|
182
206
|
else {
|
|
183
207
|
utils_1.default.warning(`LUKS volume: ${this.luksName} already open`);
|
|
184
208
|
}
|
|
185
209
|
if (!fs.existsSync(this.luksMountpoint)) {
|
|
186
|
-
await (0, utils_2.exec)(`mkdir -p ${this.luksMountpoint}`, echo);
|
|
210
|
+
await (0, utils_2.exec)(`mkdir -p ${this.luksMountpoint}`, this.echo);
|
|
187
211
|
}
|
|
188
212
|
if (!utils_1.default.isMountpoint(this.luksMountpoint)) {
|
|
189
213
|
utils_1.default.warning(`mount volume: ${this.luksDevice} on ${this.luksMountpoint}`);
|
|
190
|
-
await (0, utils_2.exec)(`mount ${this.luksDevice} ${this.luksMountpoint}`, echo);
|
|
214
|
+
await (0, utils_2.exec)(`mount ${this.luksDevice} ${this.luksMountpoint}`, this.echo);
|
|
191
215
|
}
|
|
192
216
|
else {
|
|
193
217
|
utils_1.default.warning(`mount volume: ${this.luksDevice} already mounted on ${this.luksMountpoint}`);
|
|
@@ -196,24 +220,23 @@ class Syncto extends core_1.Command {
|
|
|
196
220
|
/**
|
|
197
221
|
*
|
|
198
222
|
*/
|
|
199
|
-
async luksClose(
|
|
200
|
-
const echo = utils_1.default.setEcho(verbose);
|
|
223
|
+
async luksClose() {
|
|
201
224
|
if (utils_1.default.isMountpoint(this.luksMountpoint)) {
|
|
202
|
-
await (0, utils_2.exec)(`umount ${this.luksMountpoint}`, echo);
|
|
225
|
+
await (0, utils_2.exec)(`umount ${this.luksMountpoint}`, this.echo);
|
|
203
226
|
}
|
|
204
227
|
if (fs.existsSync(this.luksDevice)) {
|
|
205
228
|
utils_1.default.warning(`LUKS close volume: ${this.luksName}`);
|
|
206
|
-
await (0, utils_2.exec)(`cryptsetup luksClose ${this.luksName}`, echo);
|
|
229
|
+
await (0, utils_2.exec)(`cryptsetup luksClose ${this.luksName}`, this.echo);
|
|
207
230
|
}
|
|
208
231
|
}
|
|
209
232
|
}
|
|
210
233
|
exports.default = Syncto;
|
|
211
234
|
Syncto.description = 'Backup users, server and datas to luks-eggs-backup';
|
|
212
235
|
Syncto.flags = {
|
|
213
|
-
|
|
236
|
+
delete: core_1.Flags.string({ description: 'rsync --delete delete extraneous files from dest dirs' }),
|
|
214
237
|
file: core_1.Flags.string({ char: 'f', description: "file LUKS volume encrypted" }),
|
|
215
238
|
help: core_1.Flags.help({ char: 'h' }),
|
|
216
239
|
verbose: core_1.Flags.boolean({ char: 'v', description: 'verbose' })
|
|
217
240
|
};
|
|
218
241
|
Syncto.aliases = ['backup'];
|
|
219
|
-
Syncto.examples = ['$ sudo eggs
|
|
242
|
+
Syncto.examples = ['$ sudo eggs syncto'];
|
|
@@ -8,8 +8,8 @@ const tslib_1 = require("tslib");
|
|
|
8
8
|
* license: MIT
|
|
9
9
|
*/
|
|
10
10
|
const core_1 = require("@oclif/core");
|
|
11
|
-
const utils_1 =
|
|
12
|
-
const bleach_1 =
|
|
11
|
+
const utils_1 = tslib_1.__importDefault(require("../../classes/utils"));
|
|
12
|
+
const bleach_1 = tslib_1.__importDefault(require("../../classes/bleach"));
|
|
13
13
|
class Clean extends core_1.Command {
|
|
14
14
|
async run() {
|
|
15
15
|
const { flags } = await this.parse(Clean);
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const core_1 = require("@oclif/core");
|
|
5
|
-
const utils_1 =
|
|
6
|
-
const i18n_1 =
|
|
5
|
+
const utils_1 = tslib_1.__importDefault(require("../../classes/utils"));
|
|
6
|
+
const i18n_1 = tslib_1.__importDefault(require("../../classes/i18n"));
|
|
7
7
|
/**
|
|
8
8
|
*
|
|
9
9
|
*/
|
|
@@ -21,8 +21,13 @@ class Locales extends core_1.Command {
|
|
|
21
21
|
}
|
|
22
22
|
const echo = utils_1.default.setEcho(verbose);
|
|
23
23
|
if (utils_1.default.isRoot()) {
|
|
24
|
-
const i18n = new i18n_1.default(verbose);
|
|
25
|
-
|
|
24
|
+
const i18n = new i18n_1.default('/', verbose);
|
|
25
|
+
if (reinstall) {
|
|
26
|
+
await i18n.reinstall();
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
await i18n.generate(true);
|
|
30
|
+
}
|
|
26
31
|
}
|
|
27
32
|
}
|
|
28
33
|
}
|
|
@@ -8,9 +8,9 @@ const tslib_1 = require("tslib");
|
|
|
8
8
|
* license: MIT
|
|
9
9
|
*/
|
|
10
10
|
const core_1 = require("@oclif/core");
|
|
11
|
-
const utils_1 =
|
|
11
|
+
const utils_1 = tslib_1.__importDefault(require("../../classes/utils"));
|
|
12
12
|
const fs = require("fs");
|
|
13
|
-
const xdg_1 =
|
|
13
|
+
const xdg_1 = tslib_1.__importDefault(require("../../classes/xdg"));
|
|
14
14
|
class Skel extends core_1.Command {
|
|
15
15
|
async run() {
|
|
16
16
|
utils_1.default.titles(this.id + ' ' + this.argv);
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const core_1 = require("@oclif/core");
|
|
5
|
-
const utils_1 =
|
|
6
|
-
const axios_1 =
|
|
7
|
-
const node_https_1 =
|
|
5
|
+
const utils_1 = tslib_1.__importDefault(require("../../classes/utils"));
|
|
6
|
+
const axios_1 = tslib_1.__importDefault(require("axios"));
|
|
7
|
+
const node_https_1 = tslib_1.__importDefault(require("node:https"));
|
|
8
8
|
const agent = new node_https_1.default.Agent({
|
|
9
9
|
rejectUnauthorized: false
|
|
10
10
|
});
|
|
@@ -8,10 +8,10 @@ const tslib_1 = require("tslib");
|
|
|
8
8
|
* license: MIT
|
|
9
9
|
*/
|
|
10
10
|
const core_1 = require("@oclif/core");
|
|
11
|
-
const shelljs_1 =
|
|
12
|
-
const node_fs_1 =
|
|
13
|
-
const utils_1 =
|
|
14
|
-
const yolk_1 =
|
|
11
|
+
const shelljs_1 = tslib_1.__importDefault(require("shelljs"));
|
|
12
|
+
const node_fs_1 = tslib_1.__importDefault(require("node:fs"));
|
|
13
|
+
const utils_1 = tslib_1.__importDefault(require("../../classes/utils"));
|
|
14
|
+
const yolk_1 = tslib_1.__importDefault(require("../../classes/yolk"));
|
|
15
15
|
/**
|
|
16
16
|
*
|
|
17
17
|
*/
|
package/lib/commands/update.d.ts
CHANGED
|
@@ -13,8 +13,6 @@ export default class Update extends Command {
|
|
|
13
13
|
static examples: string[];
|
|
14
14
|
static flags: {
|
|
15
15
|
help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
|
|
16
|
-
apt: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
17
|
-
basket: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
18
16
|
verbose: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
19
17
|
};
|
|
20
18
|
run(): Promise<void>;
|
package/lib/commands/update.js
CHANGED
|
@@ -8,12 +8,11 @@ const tslib_1 = require("tslib");
|
|
|
8
8
|
* license: MIT
|
|
9
9
|
*/
|
|
10
10
|
const core_1 = require("@oclif/core");
|
|
11
|
-
const utils_1 =
|
|
12
|
-
const tools_1 =
|
|
13
|
-
const pacman_1 =
|
|
14
|
-
const basket_1 = (0, tslib_1.__importDefault)(require("../classes/basket"));
|
|
11
|
+
const utils_1 = tslib_1.__importDefault(require("../classes/utils"));
|
|
12
|
+
const tools_1 = tslib_1.__importDefault(require("../classes/tools"));
|
|
13
|
+
const pacman_1 = tslib_1.__importDefault(require("../classes/pacman"));
|
|
15
14
|
const utils_2 = require("../lib/utils");
|
|
16
|
-
const inquirer_1 =
|
|
15
|
+
const inquirer_1 = tslib_1.__importDefault(require("inquirer"));
|
|
17
16
|
/**
|
|
18
17
|
*
|
|
19
18
|
*/
|
|
@@ -29,40 +28,7 @@ class Update extends core_1.Command {
|
|
|
29
28
|
else if (utils_1.default.isDebPackage()) {
|
|
30
29
|
utils_1.default.warning(`You are on eggs-${utils_1.default.getPackageVersion()} installed as package .deb`);
|
|
31
30
|
}
|
|
32
|
-
|
|
33
|
-
let aptVersion = '';
|
|
34
|
-
if (await pacman_1.default.packageAptAvailable('eggs')) {
|
|
35
|
-
apt = true;
|
|
36
|
-
aptVersion = await pacman_1.default.packageAptLast('eggs');
|
|
37
|
-
utils_1.default.warning('eggs-' + aptVersion + ' is available via apt');
|
|
38
|
-
}
|
|
39
|
-
else {
|
|
40
|
-
utils_1.default.warning('eggs is not available your repositories');
|
|
41
|
-
}
|
|
42
|
-
const basket = new basket_1.default();
|
|
43
|
-
const basketVersion = await basket.last();
|
|
44
|
-
if (basketVersion !== '') {
|
|
45
|
-
utils_1.default.warning('eggs-' + basketVersion + '-1.deb available in basket');
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Se è specificato il metodo di aggiornamento
|
|
49
|
-
* e, questo corrisponde al tipo di pacchetto
|
|
50
|
-
* installato
|
|
51
|
-
*/
|
|
52
|
-
if (flags.apt || flags.basket) {
|
|
53
|
-
if (utils_1.default.isDebPackage() && flags.apt) {
|
|
54
|
-
await this.getDebFromApt();
|
|
55
|
-
}
|
|
56
|
-
else if (utils_1.default.isDebPackage() && flags.basket) {
|
|
57
|
-
await basket.get();
|
|
58
|
-
}
|
|
59
|
-
else {
|
|
60
|
-
await this.chooseUpdate();
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
else {
|
|
64
|
-
await this.chooseUpdate();
|
|
65
|
-
}
|
|
31
|
+
await this.chooseUpdate();
|
|
66
32
|
}
|
|
67
33
|
}
|
|
68
34
|
/**
|
|
@@ -71,7 +37,6 @@ class Update extends core_1.Command {
|
|
|
71
37
|
* indipendentemente dal flag
|
|
72
38
|
*/
|
|
73
39
|
async chooseUpdate() {
|
|
74
|
-
const basket = new basket_1.default();
|
|
75
40
|
console.log();
|
|
76
41
|
const choose = await this.chosenDeb();
|
|
77
42
|
utils_1.default.titles(`updating via ${choose}`);
|
|
@@ -80,10 +45,6 @@ class Update extends core_1.Command {
|
|
|
80
45
|
await this.getDebFromApt();
|
|
81
46
|
break;
|
|
82
47
|
}
|
|
83
|
-
case 'basket': {
|
|
84
|
-
await basket.get();
|
|
85
|
-
break;
|
|
86
|
-
}
|
|
87
48
|
case 'lan': {
|
|
88
49
|
await this.getDebFromLan();
|
|
89
50
|
break;
|
|
@@ -104,14 +65,7 @@ class Update extends core_1.Command {
|
|
|
104
65
|
*/
|
|
105
66
|
async chosenDeb() {
|
|
106
67
|
const choices = ['abort'];
|
|
107
|
-
choices.push('
|
|
108
|
-
/*
|
|
109
|
-
choices.push(new inquirer.Separator('exit from update'), 'basket')
|
|
110
|
-
choices.push(new inquirer.Separator('select, download and update from basket'), 'lan')
|
|
111
|
-
choices.push(new inquirer.Separator('automatic import and update from lan'), 'manual')
|
|
112
|
-
choices.push(new inquirer.Separator('manual download from sourceforge.net and update with dpkg'), 'sources')
|
|
113
|
-
choices.push(new inquirer.Separator('download sources from github.com'))
|
|
114
|
-
*/
|
|
68
|
+
choices.push('apt', 'lan', 'manual', 'sources');
|
|
115
69
|
const questions = [
|
|
116
70
|
{
|
|
117
71
|
type: 'list',
|
|
@@ -149,8 +103,7 @@ class Update extends core_1.Command {
|
|
|
149
103
|
async getDebFromManual() {
|
|
150
104
|
console.log('Download package from: \n\nhttps://sourceforge.net/projects/penguins-eggs/files/packages-deb/');
|
|
151
105
|
console.log('\nand install it with:');
|
|
152
|
-
|
|
153
|
-
console.log('\nsudo dpkg -i eggs_' + (await basket.last()) + '-1.deb');
|
|
106
|
+
console.log('\nsudo dpkg -i eggs_x.x.x-1.deb');
|
|
154
107
|
}
|
|
155
108
|
/**
|
|
156
109
|
* download da LAN
|
|
@@ -183,7 +136,5 @@ Update.description = "update the penguin's eggs tool";
|
|
|
183
136
|
Update.examples = ["$ eggs update\nupdate/upgrade the penguin's eggs tool"];
|
|
184
137
|
Update.flags = {
|
|
185
138
|
help: core_1.Flags.help({ char: 'h' }),
|
|
186
|
-
apt: core_1.Flags.boolean({ char: 'a', description: 'if eggs package is .deb, update from distro repositories' }),
|
|
187
|
-
basket: core_1.Flags.boolean({ char: 'b', description: 'if eggs package is .deb, update from eggs basket' }),
|
|
188
139
|
verbose: core_1.Flags.boolean({ char: 'v', description: 'verbose' })
|
|
189
140
|
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
*/
|
|
5
|
+
export default class Get extends Command {
|
|
6
|
+
static description: string;
|
|
7
|
+
static args: {
|
|
8
|
+
name: string;
|
|
9
|
+
description: string;
|
|
10
|
+
required: boolean;
|
|
11
|
+
}[];
|
|
12
|
+
static flags: {
|
|
13
|
+
verbose: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
14
|
+
help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
|
|
15
|
+
};
|
|
16
|
+
run(): Promise<void>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const core_1 = require("@oclif/core");
|
|
5
|
+
const utils_1 = tslib_1.__importDefault(require("../../classes/utils"));
|
|
6
|
+
// libraries
|
|
7
|
+
const utils_2 = require("../../lib/utils");
|
|
8
|
+
const path_1 = require("path");
|
|
9
|
+
/**
|
|
10
|
+
*
|
|
11
|
+
*/
|
|
12
|
+
class Get extends core_1.Command {
|
|
13
|
+
async run() {
|
|
14
|
+
const { args, flags } = await this.parse(Get);
|
|
15
|
+
let verbose = false;
|
|
16
|
+
if (flags.verbose) {
|
|
17
|
+
verbose = true;
|
|
18
|
+
}
|
|
19
|
+
const echo = utils_1.default.setEcho(verbose);
|
|
20
|
+
utils_1.default.titles(this.id + ' ' + this.argv);
|
|
21
|
+
let repo = 'https://github.com/pieroproietti/penguins-wardrobe';
|
|
22
|
+
if (this.argv['0'] !== undefined) {
|
|
23
|
+
repo = this.argv['0'];
|
|
24
|
+
}
|
|
25
|
+
// No sudo for get
|
|
26
|
+
if (process.getuid && process.getuid() === 0) {
|
|
27
|
+
utils_1.default.warning(`You must run: eggs wardrobe get without sudo`);
|
|
28
|
+
process.exit(0);
|
|
29
|
+
}
|
|
30
|
+
let wardrobe = (0, path_1.basename)(repo); // ~/.eggs-wardrobe
|
|
31
|
+
const result = await (0, utils_2.exec)(`git clone --depth 1 ${repo} ${await utils_1.default.wardrobe()}`);
|
|
32
|
+
if (result.code === 0) {
|
|
33
|
+
utils_1.default.warning(`you get new wardrobe from repo: ${repo} in ${await utils_1.default.wardrobe()}`);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
exports.default = Get;
|
|
38
|
+
Get.description = 'get warorobe';
|
|
39
|
+
Get.args = [{ name: 'repo', description: 'repository to get', required: false }];
|
|
40
|
+
Get.flags = {
|
|
41
|
+
verbose: core_1.Flags.boolean({ char: 'v' }),
|
|
42
|
+
help: core_1.Flags.help({ char: 'h' })
|
|
43
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
export declare class Ironing extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static args: {
|
|
5
|
+
name: string;
|
|
6
|
+
description: string;
|
|
7
|
+
required: boolean;
|
|
8
|
+
}[];
|
|
9
|
+
static flags: {
|
|
10
|
+
wardrobe: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
11
|
+
verbose: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
12
|
+
help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
|
|
13
|
+
};
|
|
14
|
+
run(): Promise<void>;
|
|
15
|
+
}
|