easy-vps 0.1.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.
Files changed (68) hide show
  1. package/bin/cli.js +180 -0
  2. package/client/assets/index-C4GZ_uMC.js +104 -0
  3. package/client/assets/index-Dq-W19hL.css +2 -0
  4. package/client/assets/poppins-devanagari-400-normal-CJDn6rn8.woff2 +0 -0
  5. package/client/assets/poppins-devanagari-400-normal-CqVvlrh5.woff +0 -0
  6. package/client/assets/poppins-latin-400-normal-BOb3E3N0.woff +0 -0
  7. package/client/assets/poppins-latin-400-normal-cpxAROuN.woff2 +0 -0
  8. package/client/assets/poppins-latin-ext-400-normal-DaBSavcJ.woff +0 -0
  9. package/client/assets/poppins-latin-ext-400-normal-by3JarPu.woff2 +0 -0
  10. package/client/favicon.svg +1 -0
  11. package/client/icons.svg +24 -0
  12. package/client/index.html +14 -0
  13. package/dist/index.d.ts +22 -0
  14. package/dist/index.js +143 -0
  15. package/dist/routes/async-route.d.ts +3 -0
  16. package/dist/routes/async-route.js +9 -0
  17. package/dist/routes/auth.d.ts +5 -0
  18. package/dist/routes/auth.js +101 -0
  19. package/dist/routes/database.d.ts +2 -0
  20. package/dist/routes/database.js +192 -0
  21. package/dist/routes/deploy.d.ts +2 -0
  22. package/dist/routes/deploy.js +161 -0
  23. package/dist/routes/domain.d.ts +2 -0
  24. package/dist/routes/domain.js +54 -0
  25. package/dist/routes/firewall.d.ts +2 -0
  26. package/dist/routes/firewall.js +63 -0
  27. package/dist/routes/instances.d.ts +2 -0
  28. package/dist/routes/instances.js +77 -0
  29. package/dist/routes/logs.d.ts +2 -0
  30. package/dist/routes/logs.js +67 -0
  31. package/dist/routes/system.d.ts +2 -0
  32. package/dist/routes/system.js +83 -0
  33. package/dist/services/auth.d.ts +25 -0
  34. package/dist/services/auth.js +128 -0
  35. package/dist/services/backup-config.d.ts +16 -0
  36. package/dist/services/backup-config.js +51 -0
  37. package/dist/services/backup-scheduler.d.ts +2 -0
  38. package/dist/services/backup-scheduler.js +104 -0
  39. package/dist/services/daemon.d.ts +28 -0
  40. package/dist/services/daemon.js +180 -0
  41. package/dist/services/database.d.ts +60 -0
  42. package/dist/services/database.js +540 -0
  43. package/dist/services/deploy.d.ts +102 -0
  44. package/dist/services/deploy.js +540 -0
  45. package/dist/services/domain.d.ts +26 -0
  46. package/dist/services/domain.js +170 -0
  47. package/dist/services/firewall.d.ts +24 -0
  48. package/dist/services/firewall.js +64 -0
  49. package/dist/services/instances.d.ts +17 -0
  50. package/dist/services/instances.js +67 -0
  51. package/dist/services/logs.d.ts +8 -0
  52. package/dist/services/logs.js +61 -0
  53. package/dist/services/metrics-history.d.ts +13 -0
  54. package/dist/services/metrics-history.js +36 -0
  55. package/dist/services/packages.d.ts +22 -0
  56. package/dist/services/packages.js +124 -0
  57. package/dist/services/s3.d.ts +17 -0
  58. package/dist/services/s3.js +93 -0
  59. package/dist/services/ssh.d.ts +78 -0
  60. package/dist/services/ssh.js +309 -0
  61. package/dist/services/system.d.ts +74 -0
  62. package/dist/services/system.js +286 -0
  63. package/package.json +55 -0
  64. package/scripts/dev.js +88 -0
  65. package/scripts/postinstall.js +123 -0
  66. package/scripts/preuninstall.js +21 -0
  67. package/scripts/try-install.sh +65 -0
  68. package/scripts/ui.js +54 -0
package/scripts/ui.js ADDED
@@ -0,0 +1,54 @@
1
+ 'use strict'
2
+
3
+ // Progress output for install/uninstall hooks.
4
+ //
5
+ // npm 7+ buffers and discards lifecycle-script stdout unless --foreground-scripts
6
+ // is passed, so write to the controlling terminal directly and fall back to
7
+ // stdout when there is no tty (CI, piped installs).
8
+ const fs = require('node:fs')
9
+
10
+ let tty = null
11
+ try {
12
+ tty = fs.openSync('/dev/tty', 'w')
13
+ } catch {
14
+ tty = null
15
+ }
16
+
17
+ const ESC = String.fromCharCode(27)
18
+ const isTTY = tty !== null
19
+ const color = isTTY && !process.env.NO_COLOR
20
+ const GREEN = color ? `${ESC}[32m` : ''
21
+ const YELLOW = color ? `${ESC}[33m` : ''
22
+ const DIM = color ? `${ESC}[2m` : ''
23
+ const BOLD = color ? `${ESC}[1m` : ''
24
+ const RESET = color ? `${ESC}[0m` : ''
25
+ const CLEAR_LINE = isTTY ? `\r${ESC}[K` : ''
26
+
27
+ function out(text) {
28
+ try {
29
+ if (tty !== null) fs.writeSync(tty, text)
30
+ else process.stdout.write(text)
31
+ } catch {
32
+ // terminal went away mid-install; nothing to do
33
+ }
34
+ }
35
+
36
+ module.exports = {
37
+ line: (text) => out(`${text}\n`),
38
+ blank: () => out('\n'),
39
+ /** Pending step; overwritten in place by done()/warn() on a tty. */
40
+ step: (text) => out(`${DIM}-${RESET} ${text}${isTTY ? '' : '\n'}`),
41
+ done: (text) => out(`${CLEAR_LINE}${GREEN}✔${RESET} ${text}\n`),
42
+ warn: (text) => out(`${CLEAR_LINE}${YELLOW}!${RESET} ${text}\n`),
43
+ bold: (text) => `${BOLD}${text}${RESET}`,
44
+ dim: (text) => `${DIM}${text}${RESET}`,
45
+ close: () => {
46
+ if (tty !== null) {
47
+ try {
48
+ fs.closeSync(tty)
49
+ } catch {
50
+ // ignore
51
+ }
52
+ }
53
+ },
54
+ }