diff --git a/bootstrap/app.php b/bootstrap/app.php index ae168af14..d134837b0 100755 --- a/bootstrap/app.php +++ b/bootstrap/app.php @@ -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