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.
- package/bin/cli.js +180 -0
- package/client/assets/index-C4GZ_uMC.js +104 -0
- package/client/assets/index-Dq-W19hL.css +2 -0
- package/client/assets/poppins-devanagari-400-normal-CJDn6rn8.woff2 +0 -0
- package/client/assets/poppins-devanagari-400-normal-CqVvlrh5.woff +0 -0
- package/client/assets/poppins-latin-400-normal-BOb3E3N0.woff +0 -0
- package/client/assets/poppins-latin-400-normal-cpxAROuN.woff2 +0 -0
- package/client/assets/poppins-latin-ext-400-normal-DaBSavcJ.woff +0 -0
- package/client/assets/poppins-latin-ext-400-normal-by3JarPu.woff2 +0 -0
- package/client/favicon.svg +1 -0
- package/client/icons.svg +24 -0
- package/client/index.html +14 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.js +143 -0
- package/dist/routes/async-route.d.ts +3 -0
- package/dist/routes/async-route.js +9 -0
- package/dist/routes/auth.d.ts +5 -0
- package/dist/routes/auth.js +101 -0
- package/dist/routes/database.d.ts +2 -0
- package/dist/routes/database.js +192 -0
- package/dist/routes/deploy.d.ts +2 -0
- package/dist/routes/deploy.js +161 -0
- package/dist/routes/domain.d.ts +2 -0
- package/dist/routes/domain.js +54 -0
- package/dist/routes/firewall.d.ts +2 -0
- package/dist/routes/firewall.js +63 -0
- package/dist/routes/instances.d.ts +2 -0
- package/dist/routes/instances.js +77 -0
- package/dist/routes/logs.d.ts +2 -0
- package/dist/routes/logs.js +67 -0
- package/dist/routes/system.d.ts +2 -0
- package/dist/routes/system.js +83 -0
- package/dist/services/auth.d.ts +25 -0
- package/dist/services/auth.js +128 -0
- package/dist/services/backup-config.d.ts +16 -0
- package/dist/services/backup-config.js +51 -0
- package/dist/services/backup-scheduler.d.ts +2 -0
- package/dist/services/backup-scheduler.js +104 -0
- package/dist/services/daemon.d.ts +28 -0
- package/dist/services/daemon.js +180 -0
- package/dist/services/database.d.ts +60 -0
- package/dist/services/database.js +540 -0
- package/dist/services/deploy.d.ts +102 -0
- package/dist/services/deploy.js +540 -0
- package/dist/services/domain.d.ts +26 -0
- package/dist/services/domain.js +170 -0
- package/dist/services/firewall.d.ts +24 -0
- package/dist/services/firewall.js +64 -0
- package/dist/services/instances.d.ts +17 -0
- package/dist/services/instances.js +67 -0
- package/dist/services/logs.d.ts +8 -0
- package/dist/services/logs.js +61 -0
- package/dist/services/metrics-history.d.ts +13 -0
- package/dist/services/metrics-history.js +36 -0
- package/dist/services/packages.d.ts +22 -0
- package/dist/services/packages.js +124 -0
- package/dist/services/s3.d.ts +17 -0
- package/dist/services/s3.js +93 -0
- package/dist/services/ssh.d.ts +78 -0
- package/dist/services/ssh.js +309 -0
- package/dist/services/system.d.ts +74 -0
- package/dist/services/system.js +286 -0
- package/package.json +55 -0
- package/scripts/dev.js +88 -0
- package/scripts/postinstall.js +123 -0
- package/scripts/preuninstall.js +21 -0
- package/scripts/try-install.sh +65 -0
- 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
|
+
}
|