easy-devops 1.2.0 → 1.3.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 (132) hide show
  1. package/README.md +97 -6
  2. package/dist/ui/assets/index-B6zdwEnG.css +1 -0
  3. package/dist/ui/assets/index-Cy0oNmul.js +442 -0
  4. package/dist/ui/assets/socket-DwLPrgsr.js +1 -0
  5. package/dist/ui/assets/socket-K5ttLD2q.js +65 -0
  6. package/dist/ui/brand/apple-touch-icon.png +0 -0
  7. package/dist/ui/brand/favicon-16.png +0 -0
  8. package/dist/ui/brand/favicon-32.png +0 -0
  9. package/dist/ui/brand/favicon-light-16.png +0 -0
  10. package/dist/ui/brand/favicon-light-32.png +0 -0
  11. package/dist/ui/brand/favicon.ico +0 -0
  12. package/dist/ui/brand/icon-192.png +0 -0
  13. package/dist/ui/brand/icon-48.png +0 -0
  14. package/dist/ui/brand/icon-512.png +0 -0
  15. package/dist/ui/brand/icon-64-light.png +0 -0
  16. package/dist/ui/brand/icon-64.png +0 -0
  17. package/dist/ui/brand/logo-dark.png +0 -0
  18. package/dist/ui/brand/logo-light.png +0 -0
  19. package/dist/ui/brand/mark-dark.png +0 -0
  20. package/dist/ui/brand/mark-light.png +0 -0
  21. package/dist/ui/index.html +71 -0
  22. package/install.ps1 +188 -1
  23. package/install.sh +254 -29
  24. package/package.json +17 -5
  25. package/src/cli/dash.js +110 -0
  26. package/src/cli/index.js +237 -106
  27. package/src/cli/managers/domain-manager.js +60 -40
  28. package/src/cli/managers/ssl-manager.js +47 -330
  29. package/src/cli/menu.js +156 -0
  30. package/src/cli/menus/cleanup.js +205 -0
  31. package/src/cli/menus/dashboard.js +93 -2
  32. package/src/cli/menus/runtime.js +236 -0
  33. package/src/cli/menus/service.js +764 -0
  34. package/src/cli/menus/settings.js +176 -8
  35. package/src/cli/menus/uninstall.js +167 -0
  36. package/src/cli/menus/update.js +221 -65
  37. package/src/core/acme-challenge.js +273 -0
  38. package/src/core/cert-operations.js +189 -0
  39. package/src/{dashboard/lib → core}/cert-reader.js +2 -2
  40. package/src/core/cert-renewal.js +494 -0
  41. package/src/core/channels/discord.js +77 -0
  42. package/src/core/channels/telegram.js +120 -0
  43. package/src/core/cleanup.js +600 -0
  44. package/src/core/config.js +169 -2
  45. package/src/core/daemon/ipc.js +292 -0
  46. package/src/core/daemon/lock.js +294 -0
  47. package/src/core/daemon/run.js +241 -0
  48. package/src/core/daemon/stopRequest.js +162 -0
  49. package/src/core/db.js +44 -8
  50. package/src/core/deploy/apps.js +491 -0
  51. package/src/core/deploy/domainLink.js +200 -0
  52. package/src/core/deploy/engine.js +973 -0
  53. package/src/core/deploy/ezfile.js +361 -0
  54. package/src/core/deploy/github.js +239 -0
  55. package/src/core/deploy/githubApi.js +261 -0
  56. package/src/core/deploy/hookServer.js +325 -0
  57. package/src/core/deploy/hubCommands.js +267 -0
  58. package/src/core/deploy/launcher.js +57 -0
  59. package/src/core/deploy/status.js +91 -0
  60. package/src/core/deploy/store.js +398 -0
  61. package/src/core/domainNotifier.js +364 -0
  62. package/src/core/domains-db.js +234 -0
  63. package/src/core/events.js +222 -0
  64. package/src/core/hub/agent.js +842 -0
  65. package/src/core/hubLink.js +306 -0
  66. package/src/core/hubPermissions.js +430 -0
  67. package/src/core/installSource.js +162 -0
  68. package/src/core/jobs/bus.js +120 -0
  69. package/src/core/jobs/index.js +371 -0
  70. package/src/core/jobs/monitors.js +368 -0
  71. package/src/core/jobs/owner.js +217 -0
  72. package/src/core/jobs/revisionWatcher.js +106 -0
  73. package/src/core/nginx-apply.js +213 -0
  74. package/src/core/nginx-conf-generator.js +253 -17
  75. package/src/{dashboard/lib → core}/nginx-service.js +18 -9
  76. package/src/core/notifications/claim.js +214 -0
  77. package/src/core/notifications/dispatch.js +154 -0
  78. package/src/core/notifier.js +103 -0
  79. package/src/core/passwords.js +172 -0
  80. package/src/core/permissions.js +8 -4
  81. package/src/core/platform.js +709 -2
  82. package/src/core/probeCache.js +258 -0
  83. package/src/core/purge.js +372 -0
  84. package/src/core/runner.js +488 -0
  85. package/src/core/service/acl.js +226 -0
  86. package/src/core/service/dataDir.js +345 -0
  87. package/src/core/service/index.js +1128 -0
  88. package/src/core/service/legacy.js +218 -0
  89. package/src/core/service/runtime.js +446 -0
  90. package/src/core/service/runtimeUpdate.js +800 -0
  91. package/src/core/service/systemd.js +458 -0
  92. package/src/core/service/windowsPersonal.js +530 -0
  93. package/src/core/service/windowsService.js +576 -0
  94. package/src/core/service/winsw.js +260 -0
  95. package/src/core/setupCode.js +331 -0
  96. package/src/core/shell.js +128 -13
  97. package/src/core/ssl-issuer.js +627 -0
  98. package/src/core/updater.js +295 -0
  99. package/src/core/validators.js +99 -0
  100. package/src/dashboard/controllers/authController.js +316 -0
  101. package/src/dashboard/controllers/deploymentsController.js +479 -0
  102. package/src/dashboard/controllers/domainsController.js +403 -0
  103. package/src/dashboard/controllers/hubController.js +135 -0
  104. package/src/dashboard/controllers/nginxController.js +146 -0
  105. package/src/dashboard/controllers/processesController.js +368 -0
  106. package/src/dashboard/controllers/settingsController.js +503 -0
  107. package/src/dashboard/controllers/sslController.js +452 -0
  108. package/src/dashboard/lib/daemonBridge.js +163 -0
  109. package/src/dashboard/lib/localRequest.js +235 -0
  110. package/src/dashboard/lib/loginRateLimit.js +119 -0
  111. package/src/dashboard/lib/requireAuth.js +80 -0
  112. package/src/dashboard/public/img/icon.png +0 -0
  113. package/src/dashboard/public/img/icon_b.png +0 -0
  114. package/src/dashboard/public/js/app.js +595 -19
  115. package/src/dashboard/routes/auth.js +14 -33
  116. package/src/dashboard/routes/deployments.js +46 -0
  117. package/src/dashboard/routes/domains.js +20 -363
  118. package/src/dashboard/routes/hub.js +22 -0
  119. package/src/dashboard/routes/nginx.js +22 -146
  120. package/src/dashboard/routes/processes.js +29 -0
  121. package/src/dashboard/routes/settings.js +25 -232
  122. package/src/dashboard/routes/ssl.js +18 -276
  123. package/src/dashboard/server.js +279 -165
  124. package/src/dashboard/socketManager.js +246 -0
  125. package/src/dashboard/views/index.ejs +1 -0
  126. package/src/dashboard/views/partials/domain-form.ejs +64 -1
  127. package/src/dashboard/views/partials/login.ejs +69 -8
  128. package/src/dashboard/views/partials/processes-panel.ejs +261 -0
  129. package/src/dashboard/views/partials/settings-panel.ejs +549 -118
  130. package/src/dashboard/views/partials/sidebar.ejs +3 -1
  131. package/src/dashboard/lib/domains-db.js +0 -51
  132. /package/src/{dashboard/routes → core/channels}/.gitkeep +0 -0
@@ -0,0 +1,261 @@
1
+ <!-- Processes: the PM2 apps on this server, plus the Easy DevOps service -->
2
+ <div v-show="page === 'processes'" class="space-y-6">
3
+
4
+ <!-- ── Background service ───────────────────────────────────────────── -->
5
+ <div class="stat-card overflow-hidden relative">
6
+ <div class="absolute top-0 left-0 w-full h-1"
7
+ :class="svc.status && svc.status.running ? 'bg-green-500/40' : 'bg-yellow-500/40'"></div>
8
+
9
+ <div class="p-6 border-b border-border/50 bg-black/5 dark:bg-white/5 flex items-start justify-between gap-4 flex-wrap">
10
+ <div>
11
+ <h3 class="form-label !mb-0 font-bold">Background service</h3>
12
+ <p class="text-[11px] text-muted mt-1 font-bold tracking-wide uppercase opacity-70">
13
+ Keeps the dashboard running and brings it back after a reboot
14
+ </p>
15
+ </div>
16
+ <button @click="loadProcessesPage" :disabled="svc.loading || processes.loading"
17
+ class="btn btn-secondary text-xs">
18
+ {{ (svc.loading || processes.loading) ? 'Refreshing…' : 'Refresh' }}
19
+ </button>
20
+ </div>
21
+
22
+ <div class="p-6 bg-background space-y-5">
23
+ <div v-if="svc.loading && !svc.status" class="text-sm text-muted">Checking…</div>
24
+
25
+ <template v-else-if="svc.status">
26
+ <!-- PM2 missing: the one thing that blocks everything else here -->
27
+ <div v-if="!svc.status.pm2.installed"
28
+ class="px-4 py-3 rounded-[10px] text-[13px] border bg-yellow-500/10 border-yellow-500/20 text-yellow-600 dark:text-yellow-500">
29
+ PM2 is not installed on this server. Run
30
+ <code class="font-mono">ezz service install</code> in a terminal — it asks before
31
+ installing anything.
32
+ </div>
33
+
34
+ <template v-else>
35
+ <!-- Status grid -->
36
+ <div class="grid grid-cols-2 md:grid-cols-4 gap-4">
37
+ <div>
38
+ <p class="text-[10px] uppercase tracking-widest text-muted font-bold">Installed</p>
39
+ <p class="text-sm font-semibold mt-1"
40
+ :class="svc.status.installed ? 'text-green-500' : 'text-yellow-500'">
41
+ {{ svc.status.installed ? 'Yes' : 'No' }}
42
+ </p>
43
+ </div>
44
+ <div>
45
+ <p class="text-[10px] uppercase tracking-widest text-muted font-bold">Running</p>
46
+ <p class="text-sm font-semibold mt-1"
47
+ :class="svc.status.running ? 'text-green-500' : 'text-yellow-500'">
48
+ {{ svc.status.running ? 'Yes' : (svc.status.status || 'No') }}
49
+ </p>
50
+ </div>
51
+ <div>
52
+ <p class="text-[10px] uppercase tracking-widest text-muted font-bold">Start on boot</p>
53
+ <p class="text-sm font-semibold mt-1"
54
+ :class="svc.status.enabledOnBoot ? 'text-green-500' : 'text-yellow-500'">
55
+ {{ describeBoot(svc.status) }}
56
+ </p>
57
+ </div>
58
+ <div>
59
+ <p class="text-[10px] uppercase tracking-widest text-muted font-bold">PM2</p>
60
+ <p class="text-sm font-semibold mt-1 text-foreground">
61
+ {{ svc.status.pm2.version || 'installed' }}
62
+ </p>
63
+ </div>
64
+ </div>
65
+
66
+ <!-- App name and data directory, so a dev instance is obvious -->
67
+ <div class="flex flex-wrap gap-x-6 gap-y-2 text-[11px] text-muted">
68
+ <span>App <code class="font-mono text-foreground">{{ svc.status.appName }}</code></span>
69
+ <span v-if="svc.status.dev"
70
+ class="px-1.5 py-0.5 rounded bg-yellow-500/15 text-yellow-600 dark:text-yellow-500 font-bold uppercase tracking-wide">
71
+ dev data dir
72
+ </span>
73
+ <span>Data <code class="font-mono break-all">{{ svc.status.dataDir }}</code></span>
74
+ </div>
75
+
76
+ <!-- PM2 keeps one process list per OS user -->
77
+ <div v-if="!svc.status.sameUser"
78
+ class="px-4 py-3 rounded-[10px] text-[13px] border bg-yellow-500/10 border-yellow-500/20 text-yellow-600 dark:text-yellow-500">
79
+ The service belongs to OS user <strong>{{ svc.status.appUser }}</strong>, but this
80
+ dashboard runs as <strong>{{ svc.status.currentUser }}</strong>. PM2 keeps a separate
81
+ process list per user, so it cannot be controlled from here.
82
+ </div>
83
+
84
+ <!-- Not installed, or not enabled on boot -->
85
+ <div v-if="!svc.status.installed || !svc.status.enabledOnBoot"
86
+ class="px-4 py-3 rounded-[10px] text-[13px] border bg-surface border-border/60 text-muted space-y-1">
87
+ <p v-if="!svc.status.installed">
88
+ Easy DevOps is not running as a service, so it stops when you close the terminal.
89
+ </p>
90
+ <p v-else>
91
+ The service will not start on boot, so it will not come back after a reboot.
92
+ </p>
93
+ <p class="text-foreground">
94
+ Run <code class="font-mono">{{ svc.status.cliHint }}</code>
95
+ </p>
96
+ <!--
97
+ Installing is CLI-only on Windows: the at-boot task needs
98
+ administrator rights AND an interactive console, because Windows
99
+ itself prompts for the account password. A dashboard request has
100
+ no terminal to prompt on.
101
+ -->
102
+ <p v-if="!svc.status.canInstallFromDashboard" class="text-[11px] opacity-80">
103
+ This cannot be done from the dashboard on Windows — the at-boot task needs an
104
+ elevated terminal, and Windows must ask you for the account password itself.
105
+ </p>
106
+ </div>
107
+
108
+ <!-- Restarting an installed service needs no elevation or prompt -->
109
+ <div v-if="svc.status.installed && svc.status.sameUser" class="flex items-center gap-3 flex-wrap">
110
+ <button @click="restartService" :disabled="svc.restarting" class="btn btn-secondary text-xs">
111
+ {{ svc.restarting ? 'Restarting…' : 'Restart service' }}
112
+ </button>
113
+ <span class="text-[11px] text-muted">
114
+ The dashboard will be briefly unavailable while it restarts.
115
+ </span>
116
+ </div>
117
+
118
+ <div v-if="svc.message"
119
+ class="px-4 py-3 rounded-[10px] text-[13px] border"
120
+ :class="svc.error ? 'bg-red-500/10 border-red-500/20 text-red-500'
121
+ : 'bg-green-500/10 border-green-500/20 text-green-600 dark:text-green-500'">
122
+ {{ svc.message }}
123
+ </div>
124
+ </template>
125
+ </template>
126
+ </div>
127
+ </div>
128
+
129
+ <!-- ── PM2 processes ────────────────────────────────────────────────── -->
130
+ <div class="stat-card overflow-hidden">
131
+ <div class="p-6 border-b border-border/50 bg-black/5 dark:bg-white/5">
132
+ <h3 class="form-label !mb-0 font-bold">
133
+ PM2 processes
134
+ <span v-if="processes.apps.length" class="text-xs text-muted font-normal ml-1">
135
+ {{ processes.apps.length }} total
136
+ </span>
137
+ </h3>
138
+ <p class="text-[11px] text-muted mt-1 font-bold tracking-wide uppercase opacity-70">
139
+ Everything PM2 is supervising for this user
140
+ </p>
141
+ </div>
142
+
143
+ <div class="bg-background">
144
+ <div v-if="processes.loading && !processes.apps.length" class="p-8 text-sm text-muted">Loading…</div>
145
+
146
+ <div v-else-if="!processes.pm2Installed" class="p-8 text-center">
147
+ <p class="text-sm text-muted">PM2 is not installed.</p>
148
+ </div>
149
+
150
+ <div v-else-if="!processes.apps.length" class="p-8 text-center">
151
+ <p class="text-sm text-muted">PM2 is not supervising anything yet.</p>
152
+ </div>
153
+
154
+ <!-- Tables may scroll sideways; the page body must not -->
155
+ <div v-else class="overflow-x-auto">
156
+ <table class="w-full min-w-[46rem] text-left text-sm">
157
+ <thead>
158
+ <tr class="border-b border-border text-[10px] uppercase tracking-widest text-muted">
159
+ <th scope="col" class="px-5 py-3 font-bold">Name</th>
160
+ <th scope="col" class="px-5 py-3 font-bold">Status</th>
161
+ <th scope="col" class="px-5 py-3 font-bold tabular-nums">CPU</th>
162
+ <th scope="col" class="px-5 py-3 font-bold tabular-nums">Memory</th>
163
+ <th scope="col" class="px-5 py-3 font-bold tabular-nums">Uptime</th>
164
+ <th scope="col" class="px-5 py-3 font-bold tabular-nums">Restarts</th>
165
+ <th scope="col" class="px-5 py-3 font-bold text-right">Actions</th>
166
+ </tr>
167
+ </thead>
168
+ <tbody>
169
+ <tr v-for="app in processes.apps" :key="app.name + '-' + app.pmId"
170
+ class="border-b border-border/50 last:border-0">
171
+ <td class="px-5 py-3">
172
+ <span class="font-semibold text-foreground">{{ app.name }}</span>
173
+ <!--
174
+ Apps Easy DevOps created are labelled. Everything else is
175
+ listed but only ever acted on by an explicit click, and asks
176
+ for confirmation first.
177
+ -->
178
+ <span v-if="app.managed"
179
+ class="ml-2 px-1.5 py-0.5 rounded bg-primary/10 text-primary text-[10px] font-bold uppercase tracking-wide">
180
+ Easy DevOps
181
+ </span>
182
+ <span v-if="app.user && app.user !== processes.currentUser"
183
+ class="ml-2 px-1.5 py-0.5 rounded bg-yellow-500/15 text-yellow-600 dark:text-yellow-500 text-[10px] font-bold uppercase tracking-wide">
184
+ {{ app.user }}
185
+ </span>
186
+ </td>
187
+ <td class="px-5 py-3">
188
+ <span :class="app.status === 'online' ? 'text-green-500' : 'text-muted'">
189
+ {{ app.status }}
190
+ </span>
191
+ </td>
192
+ <td class="px-5 py-3 tabular-nums text-muted">{{ app.cpu === null ? '—' : app.cpu + '%' }}</td>
193
+ <td class="px-5 py-3 tabular-nums text-muted">{{ formatBytes(app.memoryBytes) }}</td>
194
+ <td class="px-5 py-3 tabular-nums text-muted">{{ formatDuration(app.uptimeMs) }}</td>
195
+ <td class="px-5 py-3 tabular-nums text-muted">{{ app.restarts }}</td>
196
+ <td class="px-5 py-3">
197
+ <div class="flex items-center justify-end gap-1.5 flex-wrap">
198
+ <button v-if="app.status !== 'online'" @click="processAction(app, 'start')"
199
+ :disabled="processes.busy === app.name" class="btn btn-secondary !px-2 !py-1 text-[11px]">
200
+ Start
201
+ </button>
202
+ <button v-else @click="processAction(app, 'stop')"
203
+ :disabled="processes.busy === app.name" class="btn btn-secondary !px-2 !py-1 text-[11px]">
204
+ Stop
205
+ </button>
206
+ <button @click="processAction(app, 'restart')"
207
+ :disabled="processes.busy === app.name" class="btn btn-secondary !px-2 !py-1 text-[11px]">
208
+ Restart
209
+ </button>
210
+ <button @click="showProcessLogs(app)"
211
+ :disabled="processes.busy === app.name" class="btn btn-secondary !px-2 !py-1 text-[11px]">
212
+ Logs
213
+ </button>
214
+ </div>
215
+ </td>
216
+ </tr>
217
+ </tbody>
218
+ </table>
219
+ </div>
220
+
221
+ <div v-if="processes.message" class="px-5 py-3 border-t border-border/50 text-[13px]"
222
+ :class="processes.error ? 'text-red-500' : 'text-green-600 dark:text-green-500'">
223
+ {{ processes.message }}
224
+ </div>
225
+ </div>
226
+ </div>
227
+
228
+ <!-- ── Logs for one process ─────────────────────────────────────────── -->
229
+ <div v-if="processes.logsFor" class="stat-card overflow-hidden">
230
+ <div class="p-6 border-b border-border/50 bg-black/5 dark:bg-white/5 flex items-center justify-between gap-4">
231
+ <h3 class="form-label !mb-0 font-bold">Logs — {{ processes.logsFor }}</h3>
232
+ <button @click="processes.logsFor = null; processes.logLines = []"
233
+ class="btn btn-secondary text-xs">Close</button>
234
+ </div>
235
+ <pre class="bg-background p-5 text-[12px] font-mono text-muted overflow-x-auto max-h-96 overflow-y-auto whitespace-pre-wrap">{{ processes.logLines.join('\n') || '(no output)' }}</pre>
236
+ </div>
237
+
238
+ <!-- ── Confirm acting on a process ez did not create ─────────────────── -->
239
+ <div v-if="processes.confirm"
240
+ class="fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/50"
241
+ @click.self="processes.confirm = null">
242
+ <div class="stat-card max-w-md w-full overflow-hidden">
243
+ <div class="p-6 border-b border-border/50 bg-black/5 dark:bg-white/5">
244
+ <h3 class="form-label !mb-0 font-bold">Not an Easy DevOps process</h3>
245
+ </div>
246
+ <div class="p-6 bg-background space-y-4">
247
+ <p class="text-sm text-muted">
248
+ <code class="font-mono text-foreground">{{ processes.confirm.name }}</code> was not created
249
+ by Easy DevOps. {{ processes.confirm.action === 'stop' ? 'Stopping' : 'Restarting' }} it
250
+ affects whatever else relies on it.
251
+ </p>
252
+ <div class="flex gap-3 justify-end">
253
+ <button @click="processes.confirm = null" class="btn btn-secondary text-xs">Cancel</button>
254
+ <button @click="runConfirmedProcessAction" class="btn btn-primary text-xs">
255
+ {{ processes.confirm.action }} anyway
256
+ </button>
257
+ </div>
258
+ </div>
259
+ </div>
260
+ </div>
261
+ </div>