feat(update): mode container -> menu Update tampil dgn pesan rebuild image (bukan disembunyikan)
This commit is contained in:
1 parent
fed81ed5f9
commit
d02c9baf7b
3 files changed
+21
-6
No files matched your search
@@ -384,7 +384,9 @@ function getUpdateInfo(repoRoot) {
|
||||
|
||||
const inside = runCmd('git', ['rev-parse', '--is-inside-work-tree'], repoRoot);
|
||||
if (!inside.ok) {
|
||||
info.error = 'Folder ini belum menjadi git repository.';
|
||||
// Tanpa .git (Docker/container): update dilakukan via rebuild image (bukan git)
|
||||
info.container = true;
|
||||
info.containerMessage = 'Instalasi ini berjalan sebagai kontainer/gambar (tanpa .git). Pembaruan dilakukan dengan membangun ulang image dari repo terbaru.';
|
||||
return info;
|
||||
}
|
||||
|
||||
@@ -4554,6 +4556,10 @@ router.get('/update', requireAdminSession, requireSidebarMenuAccess('update'), r
|
||||
|
||||
router.post('/update/run', requireAdminSession, restrictToAdmin, (req, res) => {
|
||||
const repoRoot = path.resolve(__dirname, '..');
|
||||
if (!runCmd('git', ['rev-parse', '--is-inside-work-tree'], repoRoot).ok) {
|
||||
req.session._msg = { type: 'error', text: 'Instalasi kontainer (tanpa .git): pembaruan dilakukan dengan rebuild image, bukan lewat git.' };
|
||||
return res.redirect('/admin/update');
|
||||
}
|
||||
const log = [];
|
||||
const pushCmd = (label, r) => {
|
||||
log.push(`$ ${label}`.trim());
|
||||
|
||||
Reference in new issue
Block a user