Allow devuser (UID 1000) to run framework in autonomous Claude mode

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
root
2025-12-19 07:50:02 +00:00
parent 83096ff62b
commit 5a1ab414f1

View File

@@ -60,9 +60,11 @@ if (str_contains($base_path, ' ')) {
if ($app_env !== 'production' && $app_env !== 'prod') {
// Check if we're not in the expected Docker environment
// Check if running as root
// Allow root OR devuser (UID 1000) when /docker exists (autonomous Claude mode)
/** @phpstan-ignore-next-line */
$is_docker = ($base_path === '/var/www/html' || $base_path === '/var/www/html/system') && (posix_getuid() === 0 || posix_geteuid() === 0);
$is_root = posix_getuid() === 0 || posix_geteuid() === 0;
$is_devuser = posix_getuid() === 1000 && trim(shell_exec('whoami') ?? '') === 'devuser' && is_dir('/docker');
$is_docker = ($base_path === '/var/www/html' || $base_path === '/var/www/html/system') && ($is_root || $is_devuser);
if (!$is_docker) {
// Determine if this is a CLI or web request