penguins-eggs 10.0.27 → 10.0.28

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.
Files changed (324) hide show
  1. package/.oclif.manifest.json +2 -1463
  2. package/README.md +3 -741
  3. package/manpages/doc/man/eggs.1.gz +0 -0
  4. package/manpages/doc/man/eggs.html +4 -4
  5. package/package.json +3 -3
  6. package/scripts/love +2 -2
  7. package/dist/classes/bleach.d.ts +0 -32
  8. package/dist/classes/bleach.js +0 -136
  9. package/dist/classes/cfs.d.ts +0 -17
  10. package/dist/classes/cfs.js +0 -39
  11. package/dist/classes/cli-autologin.d.ts +0 -52
  12. package/dist/classes/cli-autologin.js +0 -230
  13. package/dist/classes/compressors.d.ts +0 -54
  14. package/dist/classes/compressors.js +0 -109
  15. package/dist/classes/daddy.d.ts +0 -26
  16. package/dist/classes/daddy.js +0 -161
  17. package/dist/classes/distro.d.ts +0 -36
  18. package/dist/classes/distro.js +0 -346
  19. package/dist/classes/families/alpine.d.ts +0 -55
  20. package/dist/classes/families/alpine.js +0 -108
  21. package/dist/classes/families/archlinux.d.ts +0 -61
  22. package/dist/classes/families/archlinux.js +0 -140
  23. package/dist/classes/families/debian.d.ts +0 -65
  24. package/dist/classes/families/debian.js +0 -138
  25. package/dist/classes/families/fedora.d.ts +0 -52
  26. package/dist/classes/families/fedora.js +0 -100
  27. package/dist/classes/families/mockup.d.ts +0 -60
  28. package/dist/classes/families/mockup.js +0 -79
  29. package/dist/classes/families/opensuse.d.ts +0 -52
  30. package/dist/classes/families/opensuse.js +0 -104
  31. package/dist/classes/incubation/branding.d.ts +0 -17
  32. package/dist/classes/incubation/branding.js +0 -89
  33. package/dist/classes/incubation/distros/bionic.d.ts +0 -32
  34. package/dist/classes/incubation/distros/bionic.js +0 -83
  35. package/dist/classes/incubation/distros/buster.d.ts +0 -32
  36. package/dist/classes/incubation/distros/buster.js +0 -85
  37. package/dist/classes/incubation/distros/jessie.d.ts +0 -31
  38. package/dist/classes/incubation/distros/jessie.js +0 -44
  39. package/dist/classes/incubation/distros/noble.d.ts +0 -32
  40. package/dist/classes/incubation/distros/noble.js +0 -85
  41. package/dist/classes/incubation/distros/rolling.d.ts +0 -32
  42. package/dist/classes/incubation/distros/rolling.js +0 -82
  43. package/dist/classes/incubation/fisherman-helper/displaymanager.d.ts +0 -11
  44. package/dist/classes/incubation/fisherman-helper/displaymanager.js +0 -39
  45. package/dist/classes/incubation/fisherman-helper/packages.d.ts +0 -20
  46. package/dist/classes/incubation/fisherman-helper/packages.js +0 -72
  47. package/dist/classes/incubation/fisherman-helper/settings.d.ts +0 -15
  48. package/dist/classes/incubation/fisherman-helper/settings.js +0 -83
  49. package/dist/classes/incubation/fisherman.d.ts +0 -77
  50. package/dist/classes/incubation/fisherman.js +0 -251
  51. package/dist/classes/incubation/incubator.d.ts +0 -40
  52. package/dist/classes/incubation/incubator.js +0 -328
  53. package/dist/classes/incubation/installer.d.ts +0 -13
  54. package/dist/classes/incubation/installer.js +0 -64
  55. package/dist/classes/keyboards.d.ts +0 -50
  56. package/dist/classes/keyboards.js +0 -217
  57. package/dist/classes/locales.d.ts +0 -21
  58. package/dist/classes/locales.js +0 -80
  59. package/dist/classes/n8.d.ts +0 -18
  60. package/dist/classes/n8.js +0 -36
  61. package/dist/classes/network.d.ts +0 -37
  62. package/dist/classes/network.js +0 -98
  63. package/dist/classes/ovary.d.ts +0 -214
  64. package/dist/classes/ovary.js +0 -1879
  65. package/dist/classes/pacman.d.ts +0 -149
  66. package/dist/classes/pacman.js +0 -701
  67. package/dist/classes/pve-live.d.ts +0 -17
  68. package/dist/classes/pve-live.js +0 -52
  69. package/dist/classes/pxe.d.ts +0 -74
  70. package/dist/classes/pxe.js +0 -410
  71. package/dist/classes/settings.d.ts +0 -53
  72. package/dist/classes/settings.js +0 -185
  73. package/dist/classes/sources_list.d.ts +0 -28
  74. package/dist/classes/sources_list.js +0 -89
  75. package/dist/classes/systemctl.d.ts +0 -47
  76. package/dist/classes/systemctl.js +0 -86
  77. package/dist/classes/tailor.d.ts +0 -46
  78. package/dist/classes/tailor.js +0 -539
  79. package/dist/classes/tools.d.ts +0 -30
  80. package/dist/classes/tools.js +0 -54
  81. package/dist/classes/users.d.ts +0 -28
  82. package/dist/classes/users.js +0 -143
  83. package/dist/classes/utils.d.ts +0 -323
  84. package/dist/classes/utils.js +0 -946
  85. package/dist/classes/xdg.d.ts +0 -45
  86. package/dist/classes/xdg.js +0 -329
  87. package/dist/classes/yolk.d.ts +0 -33
  88. package/dist/classes/yolk.js +0 -114
  89. package/dist/commands/adapt.d.ts +0 -17
  90. package/dist/commands/adapt.js +0 -33
  91. package/dist/commands/analyze.d.ts +0 -26
  92. package/dist/commands/analyze.js +0 -95
  93. package/dist/commands/calamares.d.ts +0 -29
  94. package/dist/commands/calamares.js +0 -110
  95. package/dist/commands/config.d.ts +0 -35
  96. package/dist/commands/config.js +0 -192
  97. package/dist/commands/cuckoo.d.ts +0 -16
  98. package/dist/commands/cuckoo.js +0 -62
  99. package/dist/commands/dad.d.ts +0 -20
  100. package/dist/commands/dad.js +0 -46
  101. package/dist/commands/export/deb.d.ts +0 -19
  102. package/dist/commands/export/deb.js +0 -51
  103. package/dist/commands/export/iso.d.ts +0 -19
  104. package/dist/commands/export/iso.js +0 -55
  105. package/dist/commands/install.d.ts +0 -37
  106. package/dist/commands/install.js +0 -92
  107. package/dist/commands/kill.d.ts +0 -24
  108. package/dist/commands/kill.js +0 -50
  109. package/dist/commands/mom.d.ts +0 -16
  110. package/dist/commands/mom.js +0 -30
  111. package/dist/commands/produce.d.ts +0 -34
  112. package/dist/commands/produce.js +0 -199
  113. package/dist/commands/status.d.ts +0 -23
  114. package/dist/commands/status.js +0 -31
  115. package/dist/commands/syncfrom.d.ts +0 -45
  116. package/dist/commands/syncfrom.js +0 -152
  117. package/dist/commands/syncto.d.ts +0 -40
  118. package/dist/commands/syncto.js +0 -175
  119. package/dist/commands/tools/clean.d.ts +0 -18
  120. package/dist/commands/tools/clean.js +0 -37
  121. package/dist/commands/tools/ppa.d.ts +0 -26
  122. package/dist/commands/tools/ppa.js +0 -138
  123. package/dist/commands/tools/skel.d.ts +0 -18
  124. package/dist/commands/tools/skel.js +0 -44
  125. package/dist/commands/tools/stat.d.ts +0 -31
  126. package/dist/commands/tools/stat.js +0 -70
  127. package/dist/commands/tools/yolk.d.ts +0 -24
  128. package/dist/commands/tools/yolk.js +0 -45
  129. package/dist/commands/update.d.ts +0 -47
  130. package/dist/commands/update.js +0 -140
  131. package/dist/commands/wardrobe/get.d.ts +0 -23
  132. package/dist/commands/wardrobe/get.js +0 -52
  133. package/dist/commands/wardrobe/list.d.ts +0 -24
  134. package/dist/commands/wardrobe/list.js +0 -125
  135. package/dist/commands/wardrobe/show.d.ts +0 -25
  136. package/dist/commands/wardrobe/show.js +0 -97
  137. package/dist/commands/wardrobe/wear.d.ts +0 -26
  138. package/dist/commands/wardrobe/wear.js +0 -81
  139. package/dist/components/finished.d.ts +0 -15
  140. package/dist/components/finished.js +0 -55
  141. package/dist/components/information.d.ts +0 -8
  142. package/dist/components/information.js +0 -153
  143. package/dist/components/install.d.ts +0 -15
  144. package/dist/components/install.js +0 -56
  145. package/dist/components/keyboard.d.ts +0 -16
  146. package/dist/components/keyboard.js +0 -54
  147. package/dist/components/location.d.ts +0 -16
  148. package/dist/components/location.js +0 -59
  149. package/dist/components/network.d.ts +0 -19
  150. package/dist/components/network.js +0 -65
  151. package/dist/components/partitions.d.ts +0 -16
  152. package/dist/components/partitions.js +0 -73
  153. package/dist/components/steps.d.ts +0 -13
  154. package/dist/components/steps.js +0 -148
  155. package/dist/components/summary.d.ts +0 -24
  156. package/dist/components/summary.js +0 -82
  157. package/dist/components/title.d.ts +0 -11
  158. package/dist/components/title.js +0 -35
  159. package/dist/components/users.d.ts +0 -24
  160. package/dist/components/users.js +0 -80
  161. package/dist/components/welcome.d.ts +0 -13
  162. package/dist/components/welcome.js +0 -63
  163. package/dist/index.d.ts +0 -8
  164. package/dist/index.js +0 -8
  165. package/dist/interfaces/i-addons.d.ts +0 -13
  166. package/dist/interfaces/i-addons.js +0 -8
  167. package/dist/interfaces/i-analyze.d.ts +0 -17
  168. package/dist/interfaces/i-analyze.js +0 -17
  169. package/dist/interfaces/i-app.d.ts +0 -14
  170. package/dist/interfaces/i-app.js +0 -8
  171. package/dist/interfaces/i-branding.d.ts +0 -36
  172. package/dist/interfaces/i-branding.js +0 -8
  173. package/dist/interfaces/i-calamares-partition.d.ts +0 -18
  174. package/dist/interfaces/i-calamares-partition.js +0 -8
  175. package/dist/interfaces/i-config-tools.d.ts +0 -18
  176. package/dist/interfaces/i-config-tools.js +0 -8
  177. package/dist/interfaces/i-devices.d.ts +0 -20
  178. package/dist/interfaces/i-devices.js +0 -8
  179. package/dist/interfaces/i-distro.d.ts +0 -27
  180. package/dist/interfaces/i-distro.js +0 -8
  181. package/dist/interfaces/i-drive-list.d.ts +0 -33
  182. package/dist/interfaces/i-drive-list.js +0 -8
  183. package/dist/interfaces/i-eggs-config.d.ts +0 -32
  184. package/dist/interfaces/i-eggs-config.js +0 -8
  185. package/dist/interfaces/i-excludes.d.ts +0 -14
  186. package/dist/interfaces/i-excludes.js +0 -8
  187. package/dist/interfaces/i-exec.d.ts +0 -11
  188. package/dist/interfaces/i-exec.js +0 -8
  189. package/dist/interfaces/i-initrd.d.ts +0 -13
  190. package/dist/interfaces/i-initrd.js +0 -8
  191. package/dist/interfaces/i-install.d.ts +0 -16
  192. package/dist/interfaces/i-install.js +0 -8
  193. package/dist/interfaces/i-installer.d.ts +0 -17
  194. package/dist/interfaces/i-installer.js +0 -8
  195. package/dist/interfaces/i-krill-config.d.ts +0 -33
  196. package/dist/interfaces/i-krill-config.js +0 -8
  197. package/dist/interfaces/i-krill.d.ts +0 -42
  198. package/dist/interfaces/i-krill.js +0 -8
  199. package/dist/interfaces/i-materia.d.ts +0 -41
  200. package/dist/interfaces/i-materia.js +0 -8
  201. package/dist/interfaces/i-net.d.ts +0 -16
  202. package/dist/interfaces/i-net.js +0 -8
  203. package/dist/interfaces/i-packages.d.ts +0 -16
  204. package/dist/interfaces/i-packages.js +0 -8
  205. package/dist/interfaces/i-partitions.d.ts +0 -16
  206. package/dist/interfaces/i-partitions.js +0 -8
  207. package/dist/interfaces/i-pxe.d.ts +0 -45
  208. package/dist/interfaces/i-pxe.js +0 -1
  209. package/dist/interfaces/i-remix.d.ts +0 -21
  210. package/dist/interfaces/i-remix.js +0 -8
  211. package/dist/interfaces/i-settings.d.ts +0 -33
  212. package/dist/interfaces/i-settings.js +0 -8
  213. package/dist/interfaces/i-user.d.ts +0 -14
  214. package/dist/interfaces/i-user.js +0 -8
  215. package/dist/interfaces/i-workdir.d.ts +0 -14
  216. package/dist/interfaces/i-workdir.js +0 -8
  217. package/dist/interfaces/i-xkb-model.d.ts +0 -24
  218. package/dist/interfaces/i-xkb-model.js +0 -8
  219. package/dist/interfaces/index.d.ts +0 -25
  220. package/dist/interfaces/index.js +0 -8
  221. package/dist/krill/modules/add-user.d.ts +0 -20
  222. package/dist/krill/modules/add-user.js +0 -50
  223. package/dist/krill/modules/bootloader-config-arch.d.ts +0 -14
  224. package/dist/krill/modules/bootloader-config-arch.js +0 -37
  225. package/dist/krill/modules/bootloader-config-debian.d.ts +0 -10
  226. package/dist/krill/modules/bootloader-config-debian.js +0 -50
  227. package/dist/krill/modules/bootloader-config.d.ts +0 -10
  228. package/dist/krill/modules/bootloader-config.js +0 -16
  229. package/dist/krill/modules/bootloader.d.ts +0 -14
  230. package/dist/krill/modules/bootloader.js +0 -30
  231. package/dist/krill/modules/change-password.d.ts +0 -15
  232. package/dist/krill/modules/change-password.js +0 -18
  233. package/dist/krill/modules/del-live-user.d.ts +0 -14
  234. package/dist/krill/modules/del-live-user.js +0 -38
  235. package/dist/krill/modules/fstab.d.ts +0 -14
  236. package/dist/krill/modules/fstab.js +0 -121
  237. package/dist/krill/modules/grubcfg.d.ts +0 -17
  238. package/dist/krill/modules/grubcfg.js +0 -29
  239. package/dist/krill/modules/hostname.d.ts +0 -13
  240. package/dist/krill/modules/hostname.js +0 -50
  241. package/dist/krill/modules/initramfs-cfg.d.ts +0 -14
  242. package/dist/krill/modules/initramfs-cfg.js +0 -25
  243. package/dist/krill/modules/initramfs.d.ts +0 -13
  244. package/dist/krill/modules/initramfs.js +0 -48
  245. package/dist/krill/modules/locale-cfg.d.ts +0 -10
  246. package/dist/krill/modules/locale-cfg.js +0 -61
  247. package/dist/krill/modules/locale.d.ts +0 -13
  248. package/dist/krill/modules/locale.js +0 -48
  249. package/dist/krill/modules/m-keyboard.d.ts +0 -14
  250. package/dist/krill/modules/m-keyboard.js +0 -79
  251. package/dist/krill/modules/m-timezone.d.ts +0 -14
  252. package/dist/krill/modules/m-timezone.js +0 -22
  253. package/dist/krill/modules/machine-id.d.ts +0 -15
  254. package/dist/krill/modules/machine-id.js +0 -30
  255. package/dist/krill/modules/mkfs.d.ts +0 -13
  256. package/dist/krill/modules/mkfs.js +0 -48
  257. package/dist/krill/modules/mount-fs.d.ts +0 -17
  258. package/dist/krill/modules/mount-fs.js +0 -60
  259. package/dist/krill/modules/mount-vfs.d.ts +0 -17
  260. package/dist/krill/modules/mount-vfs.js +0 -40
  261. package/dist/krill/modules/network-cfg.d.ts +0 -19
  262. package/dist/krill/modules/network-cfg.js +0 -64
  263. package/dist/krill/modules/packages.d.ts +0 -14
  264. package/dist/krill/modules/packages.js +0 -105
  265. package/dist/krill/modules/partition.d.ts +0 -20
  266. package/dist/krill/modules/partition.js +0 -324
  267. package/dist/krill/modules/remove-installer-link.d.ts +0 -13
  268. package/dist/krill/modules/remove-installer-link.js +0 -35
  269. package/dist/krill/modules/umount.d.ts +0 -14
  270. package/dist/krill/modules/umount.js +0 -27
  271. package/dist/krill/modules/unpackfs.d.ts +0 -13
  272. package/dist/krill/modules/unpackfs.js +0 -19
  273. package/dist/krill/prepare.d.ts +0 -78
  274. package/dist/krill/prepare.js +0 -626
  275. package/dist/krill/sequence.d.ts +0 -157
  276. package/dist/krill/sequence.js +0 -665
  277. package/dist/lib/get_address.d.ts +0 -8
  278. package/dist/lib/get_address.js +0 -23
  279. package/dist/lib/get_dns.d.ts +0 -8
  280. package/dist/lib/get_dns.js +0 -23
  281. package/dist/lib/get_domain.d.ts +0 -8
  282. package/dist/lib/get_domain.js +0 -23
  283. package/dist/lib/get_gateway.d.ts +0 -8
  284. package/dist/lib/get_gateway.js +0 -23
  285. package/dist/lib/get_hostname.d.ts +0 -8
  286. package/dist/lib/get_hostname.js +0 -23
  287. package/dist/lib/get_netmask.d.ts +0 -8
  288. package/dist/lib/get_netmask.js +0 -23
  289. package/dist/lib/get_password.d.ts +0 -8
  290. package/dist/lib/get_password.js +0 -36
  291. package/dist/lib/get_userfullname.d.ts +0 -8
  292. package/dist/lib/get_userfullname.js +0 -23
  293. package/dist/lib/get_username.d.ts +0 -8
  294. package/dist/lib/get_username.js +0 -23
  295. package/dist/lib/kill_me_softly.d.ts +0 -11
  296. package/dist/lib/kill_me_softly.js +0 -61
  297. package/dist/lib/select_address_type.d.ts +0 -8
  298. package/dist/lib/select_address_type.js +0 -24
  299. package/dist/lib/select_filesystem_type.d.ts +0 -8
  300. package/dist/lib/select_filesystem_type.js +0 -45
  301. package/dist/lib/select_installation_device.d.ts +0 -8
  302. package/dist/lib/select_installation_device.js +0 -30
  303. package/dist/lib/select_installation_mode.d.ts +0 -8
  304. package/dist/lib/select_installation_mode.js +0 -24
  305. package/dist/lib/select_interface.d.ts +0 -8
  306. package/dist/lib/select_interface.js +0 -24
  307. package/dist/lib/select_keyboard_layout.d.ts +0 -11
  308. package/dist/lib/select_keyboard_layout.js +0 -36
  309. package/dist/lib/select_keyboard_model.d.ts +0 -11
  310. package/dist/lib/select_keyboard_model.js +0 -34
  311. package/dist/lib/select_keyboard_option.d.ts +0 -11
  312. package/dist/lib/select_keyboard_option.js +0 -34
  313. package/dist/lib/select_keyboard_variant.d.ts +0 -11
  314. package/dist/lib/select_keyboard_variant.js +0 -35
  315. package/dist/lib/select_languages.d.ts +0 -8
  316. package/dist/lib/select_languages.js +0 -28
  317. package/dist/lib/select_regions.d.ts +0 -8
  318. package/dist/lib/select_regions.js +0 -24
  319. package/dist/lib/select_user_swap_choice.d.ts +0 -8
  320. package/dist/lib/select_user_swap_choice.js +0 -34
  321. package/dist/lib/select_zones.d.ts +0 -8
  322. package/dist/lib/select_zones.js +0 -518
  323. package/dist/lib/utils.d.ts +0 -34
  324. package/dist/lib/utils.js +0 -79
@@ -1,95 +0,0 @@
1
- /**
2
- * ./src/commands/analyze.ts
3
- * penguins-eggs v.10.0.0 / ecmascript 2020
4
- * author: Piero Proietti
5
- * email: piero.proietti@gmail.com
6
- * license: MIT
7
- */
8
- import { Command, Flags } from '@oclif/core';
9
- import fs, { constants } from 'node:fs';
10
- import { access } from 'node:fs/promises';
11
- import si from 'systeminformation';
12
- import Users from '../classes/users.js';
13
- import Utils from '../classes/utils.js';
14
- export default class Analyze extends Command {
15
- static description = 'analyze for syncto';
16
- static examples = ['sudo eggs analyze'];
17
- static flags = {
18
- help: Flags.help({ char: 'h' }),
19
- verbose: Flags.boolean({ char: 'v', description: 'verbose' })
20
- };
21
- config_file = '/etc/penguins-eggs.d/eggs.yaml';
22
- snapshot_dir = '';
23
- work_dir = {};
24
- /**
25
- * fill
26
- */
27
- async fill() {
28
- try {
29
- const usersArray = [];
30
- await access('/etc/passwd', constants.R_OK | constants.W_OK);
31
- const passwd = fs.readFileSync('/etc/passwd', 'utf8').split('\n');
32
- for (const element of passwd) {
33
- const line = element.split(':');
34
- const users = new Users(line[0], line[1], line[2], line[3], line[4], line[5], line[6]);
35
- await users.getValues();
36
- if (users.password !== undefined) {
37
- usersArray.push(users);
38
- }
39
- }
40
- return usersArray;
41
- }
42
- catch {
43
- console.error("can't read /etc/passwd");
44
- process.exit(1);
45
- }
46
- }
47
- async run() {
48
- Utils.titles(this.id + ' ' + this.argv);
49
- const { flags } = await this.parse(Analyze);
50
- let verbose = false;
51
- if (flags.verbose) {
52
- verbose = true;
53
- }
54
- Utils.warning('eggs will analyze your system, and get users data');
55
- const echo = Utils.setEcho(verbose);
56
- let totalSize = 0;
57
- if (Utils.isRoot(this.id)) {
58
- const audio = await si.audio();
59
- const bios = await si.bios();
60
- const blockDevices = await si.blockDevices();
61
- const chassis = await si.chassis();
62
- const cpu = await si.cpu();
63
- const diskLayout = await si.diskLayout();
64
- const mem = await si.mem();
65
- const usb = await si.usb();
66
- console.log(`chassis: ${chassis.manufacturer} model: ${chassis.manufacturer}`);
67
- console.log(`bios vendor: ${bios.vendor} version: ${bios.version} revision: ${bios.revision}`);
68
- console.log(`processor: ${cpu.brand} core: ${cpu.cores} `);
69
- if (diskLayout[0].device !== undefined) {
70
- console.log(`disk0: ${diskLayout[0].device}`);
71
- }
72
- if (diskLayout[1] !== undefined) {
73
- console.log(`disk1: ${diskLayout[1].device}`);
74
- }
75
- if (diskLayout[2] !== undefined) {
76
- console.log(`disk1: ${diskLayout[2].device}`);
77
- }
78
- // console.log(`name: ${blockDevices[0].name} fs: ${blockDevices[0].fsType}`)
79
- // console.log(`name: ${blockDevices[1].name} fs: ${blockDevices[1].fsType}`)
80
- // console.log(`name: ${blockDevices[2].name} fs: ${blockDevices[2].fsType}`)
81
- // console.log(`name: ${blockDevices[3].name} fs: ${blockDevices[3].fsType}`)
82
- // console.log(`usb: ${usb[0].name}`)
83
- const users = await this.fill();
84
- for (let i = 0; i < users.length; i++)
85
- if (users[i].saveIt) {
86
- console.log(`user: ${users[i].login} \thome: ${users[i].home.padEnd(16)} \tsize: ${Utils.formatBytes(users[i].size)} \tBytes: ${users[i].size} `);
87
- totalSize += users[i].size;
88
- }
89
- console.log(`Total\t\t\t\t\tSize: ${Utils.formatBytes(totalSize)} \tBytes: ${totalSize}`);
90
- }
91
- else {
92
- Utils.useRoot(this.id);
93
- }
94
- }
95
- }
@@ -1,29 +0,0 @@
1
- /**
2
- * ./src/commands/calamares.ts
3
- * penguins-eggs v.10.0.0 / ecmascript 2020
4
- * author: Piero Proietti
5
- * email: piero.proietti@gmail.com
6
- * license: MIT
7
- */
8
- import { Command } from '@oclif/core';
9
- import Incubator from '../classes/incubation/incubator.js';
10
- import Settings from '../classes/settings.js';
11
- import { IRemix } from '../interfaces/index.js';
12
- export default class Calamares extends Command {
13
- static description: string;
14
- static examples: string[];
15
- static flags: {
16
- help: import("@oclif/core/interfaces").BooleanFlag<void>;
17
- install: import("@oclif/core/interfaces").BooleanFlag<boolean>;
18
- nointeractive: import("@oclif/core/interfaces").BooleanFlag<boolean>;
19
- policies: import("@oclif/core/interfaces").BooleanFlag<boolean>;
20
- release: import("@oclif/core/interfaces").BooleanFlag<boolean>;
21
- remove: import("@oclif/core/interfaces").BooleanFlag<boolean>;
22
- theme: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
23
- verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
24
- };
25
- incubator: Incubator;
26
- remix: IRemix;
27
- settings: Settings;
28
- run(): Promise<void>;
29
- }
@@ -1,110 +0,0 @@
1
- /**
2
- * ./src/commands/calamares.ts
3
- * penguins-eggs v.10.0.0 / ecmascript 2020
4
- * author: Piero Proietti
5
- * email: piero.proietti@gmail.com
6
- * license: MIT
7
- */
8
- import { Command, Flags } from '@oclif/core';
9
- import fs from 'node:fs';
10
- import path from 'node:path';
11
- import Incubator from '../classes/incubation/incubator.js';
12
- import Pacman from '../classes/pacman.js';
13
- import Settings from '../classes/settings.js';
14
- import Utils from '../classes/utils.js';
15
- export default class Calamares extends Command {
16
- static description = 'configure calamares or install or configure it';
17
- static examples = ['sudo eggs calamares', 'sudo eggs calamares --install', 'sudo eggs calamares --install --theme=/path/to/theme', 'sudo eggs calamares --remove'];
18
- static flags = {
19
- help: Flags.help({ char: 'h' }),
20
- install: Flags.boolean({ char: 'i', description: 'install calamares and its dependencies' }),
21
- nointeractive: Flags.boolean({ char: 'n', description: 'no user interaction' }),
22
- policies: Flags.boolean({ char: 'p', description: 'configure calamares policies' }),
23
- release: Flags.boolean({ char: 'r', description: 'release: remove calamares and all its dependencies after the installation' }),
24
- remove: Flags.boolean({ description: 'remove calamares and its dependencies' }),
25
- theme: Flags.string({ description: 'theme/branding for eggs and calamares' }),
26
- verbose: Flags.boolean({ char: 'v' })
27
- };
28
- incubator = {};
29
- remix = {};
30
- settings = {};
31
- async run() {
32
- Utils.titles(this.id + ' ' + this.argv);
33
- this.settings = new Settings();
34
- const { flags } = await this.parse(Calamares);
35
- const { verbose } = flags;
36
- const { remove } = flags;
37
- const { install } = flags;
38
- const { release } = flags;
39
- let theme = 'eggs';
40
- if (flags.theme !== undefined) {
41
- theme = flags.theme;
42
- if (theme.includes('/')) {
43
- if (theme.endsWith('/')) {
44
- theme = theme.slice(0, Math.max(0, theme.length - 1));
45
- }
46
- }
47
- else {
48
- const wpath = `/home/${await Utils.getPrimaryUser()}/.wardrobe/vendors/`;
49
- theme = wpath + flags.theme;
50
- }
51
- theme = path.resolve(theme);
52
- if (!fs.existsSync(theme + '/theme')) {
53
- console.log('Cannot find theme: ' + theme);
54
- process.exit();
55
- }
56
- }
57
- console.log(`theme: ${theme}`);
58
- let { policies } = flags;
59
- const { nointeractive } = flags;
60
- if (Utils.isRoot(this.id)) {
61
- let installer = 'krill';
62
- if (Pacman.isInstalledGui()) {
63
- installer = 'calamares';
64
- }
65
- if (installer === 'calamares') {
66
- if (!nointeractive || (await Utils.customConfirm('Select yes to continue...'))) {
67
- if (remove) {
68
- if (Pacman.calamaresExists()) {
69
- await Pacman.calamaresRemove();
70
- if (await this.settings.load()) {
71
- this.settings.config.force_installer = false;
72
- this.settings.save(this.settings.config);
73
- }
74
- }
75
- process.exit();
76
- }
77
- /**
78
- * Install
79
- */
80
- if (install) {
81
- Utils.warning('Installing calamares');
82
- await Pacman.calamaresInstall();
83
- if (await this.settings.load()) {
84
- this.settings.config.force_installer = true;
85
- this.settings.save(this.settings.config);
86
- policies = true;
87
- }
88
- }
89
- }
90
- /**
91
- * Configure
92
- */
93
- if (await this.settings.load()) {
94
- Utils.warning(`Configuring ${installer}`);
95
- await this.settings.loadRemix(theme);
96
- const isClone = false;
97
- this.incubator = new Incubator(this.settings.remix, this.settings.distro, this.settings.config.user_opt, theme, isClone, verbose);
98
- await this.incubator.config(release);
99
- /**
100
- * policies
101
- */
102
- if (policies) {
103
- Utils.warning('Configuring policies');
104
- await Pacman.calamaresPolicies();
105
- }
106
- }
107
- }
108
- }
109
- }
110
- }
@@ -1,35 +0,0 @@
1
- /**
2
- * ./src/commands/config.ts
3
- * penguins-eggs v.10.0.0 / ecmascript 2020
4
- * author: Piero Proietti
5
- * email: piero.proietti@gmail.com
6
- * license: MIT
7
- */
8
- import { Command } from '@oclif/core';
9
- import { IInstall } from '../interfaces/index.js';
10
- /**
11
- *
12
- */
13
- export default class Config extends Command {
14
- static description: string;
15
- static examples: string[];
16
- static flags: {
17
- clean: import("@oclif/core/interfaces").BooleanFlag<boolean>;
18
- help: import("@oclif/core/interfaces").BooleanFlag<void>;
19
- nointeractive: import("@oclif/core/interfaces").BooleanFlag<boolean>;
20
- verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
21
- };
22
- /**
23
- *
24
- * @param i
25
- * @param verbose
26
- */
27
- static install(i: IInstall, nointeractive?: boolean, verbose?: boolean): Promise<void>;
28
- /**
29
- *
30
- *
31
- * @param verbose
32
- */
33
- static thatWeNeed(nointeractive?: boolean, verbose?: boolean, cryptedclone?: boolean): Promise<IInstall>;
34
- run(): Promise<void>;
35
- }
@@ -1,192 +0,0 @@
1
- /**
2
- * ./src/commands/config.ts
3
- * penguins-eggs v.10.0.0 / ecmascript 2020
4
- * author: Piero Proietti
5
- * email: piero.proietti@gmail.com
6
- * license: MIT
7
- */
8
- import { Command, Flags } from '@oclif/core';
9
- import chalk from 'chalk';
10
- import Bleach from '../classes/bleach.js';
11
- import Pacman from '../classes/pacman.js';
12
- import Utils from '../classes/utils.js';
13
- import { exec } from '../lib/utils.js';
14
- /**
15
- *
16
- */
17
- export default class Config extends Command {
18
- static description = 'Configure eggs to run it';
19
- static examples = ['sudo eggs config', 'sudo eggs config --clean', 'sudo eggs config --clean --nointeractive'];
20
- static flags = {
21
- clean: Flags.boolean({ char: 'c', description: 'remove old configuration before to create new one' }),
22
- help: Flags.help({ char: 'h' }),
23
- nointeractive: Flags.boolean({ char: 'n', description: 'no user interaction' }),
24
- verbose: Flags.boolean({ char: 'v', description: 'verbose' })
25
- };
26
- /**
27
- *
28
- * @param i
29
- * @param verbose
30
- */
31
- static async install(i, nointeractive = false, verbose = false) {
32
- const echo = Utils.setEcho(verbose);
33
- Utils.warning('config: so, we install');
34
- if (i.configurationInstall) {
35
- Utils.warning('creating configuration...');
36
- await Pacman.configurationInstall(verbose);
37
- }
38
- if (i.configurationRefresh) {
39
- Utils.warning('refreshing configuration for new machine...');
40
- await Pacman.configurationMachineNew(verbose);
41
- }
42
- if (i.distroTemplate) {
43
- Utils.warning('copying distro templates...');
44
- await Pacman.distroTemplateInstall(verbose);
45
- }
46
- if (i.needApt && !nointeractive && !nointeractive && Pacman.distro().familyId === 'debian') {
47
- Utils.warning('updating system...');
48
- await exec('apt-get update --yes', echo);
49
- }
50
- if (i.efi) {
51
- if (nointeractive) {
52
- Utils.error('config: you are on a system UEFI');
53
- Utils.warning('I suggest You to install grub-efi-' + Utils.uefiArch() + '-bin before to produce your ISO.\nJust write:\n sudo apt install grub-efi-' + Utils.uefiArch());
54
- }
55
- else if (Pacman.distro().familyId === 'debian') {
56
- Utils.warning('Installing uefi support...');
57
- await exec('apt-get install grub-efi-' + Utils.uefiArch() + '-bin --yes', echo);
58
- }
59
- }
60
- if (i.calamares && Pacman.isCalamaresAvailable()) {
61
- if (nointeractive) {
62
- Utils.warning('I suggest You to install calamares GUI installer before to produce your ISO.\nJust write:\n sudo eggs calamares --install');
63
- }
64
- else {
65
- Utils.warning('Installing calamares...');
66
- await Pacman.calamaresInstall(verbose);
67
- await Pacman.calamaresPolicies();
68
- }
69
- }
70
- if (i.needApt && !nointeractive) {
71
- Utils.warning('cleaning the system...');
72
- if (Pacman.distro().familyId === 'debian') {
73
- const bleach = new Bleach();
74
- await bleach.clean(verbose);
75
- }
76
- }
77
- }
78
- /**
79
- *
80
- *
81
- * @param verbose
82
- */
83
- static async thatWeNeed(nointeractive = false, verbose = false, cryptedclone = false) {
84
- const i = {};
85
- i.distroTemplate = !Pacman.distroTemplateCheck();
86
- if (Utils.uefiArch() !== 'i386') {
87
- i.efi = !Pacman.isUefi();
88
- }
89
- if (!cryptedclone && !Pacman.calamaresExists() && Pacman.isInstalledGui() && Pacman.isCalamaresAvailable() && !Pacman.packageIsInstalled('live-installer')) {
90
- Utils.warning('Config: you are on a graphic system, I suggest to install the GUI installer calamares');
91
- i.calamares = nointeractive ? false : await Utils.customConfirm('Want You install calamares?');
92
- }
93
- i.configurationInstall = !Pacman.configurationCheck();
94
- if (!i.configurationInstall) {
95
- i.configurationRefresh = !Pacman.configurationMachineNew();
96
- }
97
- if (i.efi || i.calamares) {
98
- i.needApt = true;
99
- }
100
- /**
101
- * Visualizza cosa c'è da fare
102
- */
103
- if (!nointeractive) {
104
- if (i.needApt) {
105
- console.log('- update the system');
106
- if (Pacman.distro().familyId === 'debian') {
107
- console.log(chalk.yellow(' apt-get update --yes\n'));
108
- }
109
- }
110
- if (i.efi && Pacman.distro().familyId === 'debian' && Utils.uefiArch() !== 'i386') {
111
- console.log('- install efi packages');
112
- console.log(chalk.yellow(' apt install -y grub-efi-' + Utils.uefiArch() + '-bin\n'));
113
- }
114
- if (i.configurationInstall) {
115
- console.log("- creating configuration's files...");
116
- Pacman.configurationInstall(verbose);
117
- }
118
- if (i.configurationRefresh) {
119
- console.log("- refreshing configuration's files...");
120
- Pacman.configurationFresh();
121
- }
122
- if (i.distroTemplate) {
123
- console.log('- copy distro template\n');
124
- }
125
- if (i.calamares) {
126
- console.log('- install calamares');
127
- if (Pacman.distro().familyId === 'debian') {
128
- const packages = Pacman.debs4calamares;
129
- console.log(chalk.yellow(' will install: ' + packages.join(' ') + '\n'));
130
- }
131
- }
132
- if (i.needApt) {
133
- console.log('- cleaning packages\n');
134
- }
135
- if (i.configurationInstall) {
136
- console.log('- creating/updating configuration');
137
- console.log(' files: ' + chalk.yellow('/etc/penguins-eggs.d/eggs.yaml'));
138
- }
139
- else if (i.configurationRefresh) {
140
- console.log('- refreshing configuration for new machine');
141
- }
142
- if (i.needApt) {
143
- Utils.warning("Be sure! It's just a series of apt install from your repo.\nYou can follows them using flag --verbose");
144
- }
145
- }
146
- return i;
147
- }
148
- async run() {
149
- const { flags } = await this.parse(Config);
150
- const { nointeractive } = flags;
151
- const { verbose } = flags;
152
- if (!nointeractive) {
153
- Utils.titles(this.id + ' ' + this.argv);
154
- if (Utils.isDebPackage()) {
155
- Utils.warning('running as package .deb');
156
- }
157
- else if (Utils.isSources()) {
158
- Utils.warning('running as sources');
159
- }
160
- }
161
- if (Utils.isRoot(this.id)) {
162
- if (flags.clean) {
163
- Utils.warning('removing old configurations');
164
- await exec('rm /etc/penguins-eggs.d -rf');
165
- }
166
- /**
167
- * Se stiamo utilizzando eggs da sorgenti
168
- * Aggiungo autocomplete e manPage
169
- */
170
- if (Utils.isSources()) {
171
- Utils.warning('creating autocomplete...');
172
- await Pacman.autocompleteInstall(verbose);
173
- Utils.warning('creating eggs man page...');
174
- await Pacman.manPageInstall(verbose);
175
- }
176
- // Vediamo che cosa c'è da fare...
177
- Utils.warning('what we need?');
178
- const i = await Config.thatWeNeed(nointeractive, verbose);
179
- if (i.needApt || i.configurationInstall || i.configurationRefresh || i.distroTemplate) {
180
- if (nointeractive) {
181
- await Config.install(i, nointeractive, verbose);
182
- }
183
- else if (await Utils.customConfirm()) {
184
- await Config.install(i, nointeractive, verbose);
185
- }
186
- }
187
- }
188
- else {
189
- Utils.useRoot(this.id);
190
- }
191
- }
192
- }
@@ -1,16 +0,0 @@
1
- /**
2
- * ./src/commands/cuckoo.ts
3
- * penguins-eggs v.10.0.0 / ecmascript 2020
4
- * author: Piero Proietti
5
- * email: piero.proietti@gmail.com
6
- * license: MIT
7
- */
8
- import { Command } from '@oclif/core';
9
- export default class Cuckoo extends Command {
10
- static description: string;
11
- static examples: string[];
12
- static flags: {
13
- help: import("@oclif/core/interfaces").BooleanFlag<void>;
14
- };
15
- run(): Promise<void>;
16
- }
@@ -1,62 +0,0 @@
1
- /**
2
- * ./src/commands/cuckoo.ts
3
- * penguins-eggs v.10.0.0 / ecmascript 2020
4
- * author: Piero Proietti
5
- * email: piero.proietti@gmail.com
6
- * license: MIT
7
- */
8
- import { Command, Flags } from '@oclif/core';
9
- import network from '../classes/network.js';
10
- import Pxe from '../classes/pxe.js';
11
- import Settings from '../classes/settings.js';
12
- import Utils from '../classes/utils.js';
13
- export default class Cuckoo extends Command {
14
- static description = 'PXE start with proxy-dhcp';
15
- static examples = ['sudo eggs cuckoo'];
16
- static flags = {
17
- help: Flags.help({ char: 'h' })
18
- };
19
- async run() {
20
- const { args, flags } = await this.parse(Cuckoo);
21
- Utils.titles(this.id + ' ' + this.argv);
22
- if (Utils.isRoot()) {
23
- const settings = new Settings();
24
- settings.load();
25
- const nest = settings.config.snapshot_mnt;
26
- const pxeRoot = nest + 'pxe';
27
- const pxe = new Pxe(nest, pxeRoot);
28
- await pxe.fertilization();
29
- await pxe.build();
30
- const n = new network();
31
- /**
32
- * service proxy-dhcp
33
- */
34
- const dhcpOptions = {
35
- bios_filename: 'lpxelinux.0',
36
- efi32_filename: 'ipxe32.efi',
37
- efi64_filename: 'ipxe.efi',
38
- host: n.address,
39
- subnet: n.cidr,
40
- tftpserver: n.address
41
- };
42
- pxe.dhcpStart(dhcpOptions);
43
- /**
44
- * service tftp
45
- */
46
- const tftpOptions = {
47
- denyPUT: true,
48
- host: n.address,
49
- port: 69,
50
- root: pxeRoot
51
- };
52
- await pxe.tftpStart(tftpOptions);
53
- /**
54
- * service http
55
- */
56
- await pxe.httpStart();
57
- }
58
- else {
59
- Utils.useRoot(this.id);
60
- }
61
- }
62
- }
@@ -1,20 +0,0 @@
1
- /**
2
- * ./src/commands/dad.ts
3
- * penguins-eggs v.10.0.0 / ecmascript 2020
4
- * author: Piero Proietti
5
- * email: piero.proietti@gmail.com
6
- * license: MIT
7
- */
8
- import { Command } from '@oclif/core';
9
- export default class Dad extends Command {
10
- static description: string;
11
- static examples: string[];
12
- static flags: {
13
- clean: import("@oclif/core/interfaces").BooleanFlag<boolean>;
14
- default: import("@oclif/core/interfaces").BooleanFlag<boolean>;
15
- file: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
16
- help: import("@oclif/core/interfaces").BooleanFlag<void>;
17
- verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
18
- };
19
- run(): Promise<void>;
20
- }
@@ -1,46 +0,0 @@
1
- /**
2
- * ./src/commands/dad.ts
3
- * penguins-eggs v.10.0.0 / ecmascript 2020
4
- * author: Piero Proietti
5
- * email: piero.proietti@gmail.com
6
- * license: MIT
7
- */
8
- import { Command, Flags } from '@oclif/core';
9
- import chalk from 'chalk';
10
- import fs from 'node:fs';
11
- import Daddy from '../classes/daddy.js';
12
- import Utils from '../classes/utils.js';
13
- import { exec } from '../lib/utils.js';
14
- export default class Dad extends Command {
15
- static description = 'ask help from daddy - TUI configuration helper';
16
- static examples = ['sudo dad', 'sudo dad --clean', 'sudo dad --default'];
17
- static flags = {
18
- clean: Flags.boolean({ char: 'c', description: 'remove old configuration before to create' }),
19
- default: Flags.boolean({ char: 'd', description: 'reset to default values' }),
20
- file: Flags.string({ char: 'f', description: 'use a file configuration custom' }),
21
- help: Flags.help({ char: 'h' }),
22
- verbose: Flags.boolean({ char: 'v' })
23
- };
24
- async run() {
25
- Utils.titles(this.id + ' ' + this.argv);
26
- console.log(chalk.cyan('Daddy, what else did you leave for me?'));
27
- const { flags } = await this.parse(Dad);
28
- const fileCustom = flags.file;
29
- const isCustom = fileCustom !== undefined && fileCustom !== '';
30
- const reset = flags.default;
31
- if (Utils.isRoot(this.id)) {
32
- if (flags.clean || flags.default || flags.mine) {
33
- await exec('rm /etc/penguins-eggs.d -rf');
34
- }
35
- if (isCustom && !fs.existsSync(fileCustom)) {
36
- console.log(chalk.red(`Custom configuration file: ${flags.custom} not found!`));
37
- process.exit(1);
38
- }
39
- const daddy = new Daddy();
40
- daddy.helpMe(reset, isCustom, fileCustom, flags.verbose);
41
- }
42
- else {
43
- Utils.useRoot(this.id);
44
- }
45
- }
46
- }
@@ -1,19 +0,0 @@
1
- /**
2
- * ./src/commands/export/deb.ts
3
- * penguins-eggs v.10.0.0 / ecmascript 2020
4
- * author: Piero Proietti
5
- * email: piero.proietti@gmail.com
6
- * license: MIT
7
- */
8
- import { Command } from '@oclif/core';
9
- export default class ExportDeb extends Command {
10
- static description: string;
11
- static examples: string[];
12
- static flags: {
13
- all: import("@oclif/core/interfaces").BooleanFlag<boolean>;
14
- clean: import("@oclif/core/interfaces").BooleanFlag<boolean>;
15
- help: import("@oclif/core/interfaces").BooleanFlag<void>;
16
- verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
17
- };
18
- run(): Promise<void>;
19
- }