fix: use --user root for docker exec when applying volume ownership

Ensures chown/chmod commands run as root inside containers even when
the container runs as a non-root user by default.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Andras Bacsai
2025-12-12 14:53:36 +01:00
co-authored by Claude Opus 4.5
parent aa4c6f1dc7
commit 253dcab3a5
+2 -2
View File
@@ -3322,14 +3322,14 @@ COPY ./nginx.conf /etc/nginx/conf.d/default.conf");
if ($storage->chown) {
$escapedChown = escapeshellarg($storage->chown);
$this->execute_remote_command(
["docker exec {$containerName} chown {$recursiveFlag}{$escapedChown} {$mountPath}", 'hidden' => true],
["docker exec --user root {$containerName} chown {$recursiveFlag}{$escapedChown} {$mountPath}", 'hidden' => true],
);
}
if ($storage->chmod) {
$escapedChmod = escapeshellarg($storage->chmod);
$this->execute_remote_command(
["docker exec {$containerName} chmod {$recursiveFlag}{$escapedChmod} {$mountPath}", 'hidden' => true],
["docker exec --user root {$containerName} chmod {$recursiveFlag}{$escapedChmod} {$mountPath}", 'hidden' => true],
);
}