diff --git a/admin/templates/pages/update.php b/admin/templates/pages/update.php index e1438c0..a5eb847 100644 --- a/admin/templates/pages/update.php +++ b/admin/templates/pages/update.php @@ -1,5 +1,16 @@

Systeem Update

+ +
+ + Schrijfrechten vereist voor Git: De PHP-webserver heeft geen schrijfrechten op de .git/objects map op de server. +

+ Voer op de live server eenmalig uit in de terminal (als root): +
chown -R www-data:www-data /var/www/CodePress
+ (Vervang www-data door jouw webserver gebruiker, bijvoorbeeld www of nginx, als dat anders is). +
+ +
diff --git a/public/admin.php b/public/admin.php index 6e1c2a5..bebc459 100644 --- a/public/admin.php +++ b/public/admin.php @@ -1600,8 +1600,12 @@ function handleUpdate(AdminAuth $auth, array $config): void $cmsVersion = is_array($verData) ? ($verData['version'] ?? '1.7.1') : '1.7.1'; } - // Get git branch + // Get git branch & check git permissions $gitBranch = 'main'; + $root = $config['codepress_root']; + $gitDir = $root . '/.git'; + $isGitWritable = is_dir($gitDir) && (is_writable($gitDir) && (!is_dir($gitDir . '/objects') || is_writable($gitDir . '/objects'))); + if (function_exists('exec')) { @exec('git rev-parse --abbrev-ref HEAD 2>&1', $branchOutput); if (!empty($branchOutput[0]) && strpos($branchOutput[0], 'fatal') === false) {