Skip to content

Commit 0787164

Browse files
committed
fix: log audit entry on update/apply
Records who triggered a deploy in audit_log before executing the update script.
1 parent cf15920 commit 0787164

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎server/src/index.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ app.post('/api/update/apply', async (c) => {
136136
if (!user || user.role !== 'admin') {
137137
return c.json({ error: 'solo administradores pueden actualizar' }, 403)
138138
}
139+
audit(db, user.username, user.id, 'update.apply', '')
139140
const ok = await applyUpdate()
140141
if (!ok) return c.json({ error: 'el script de actualización falló' }, 500)
141142
// El script con SKIP_RESTART=1 deja el server vivo hasta aquí; se sale y

0 commit comments

Comments
 (0)