mirror of
https://github.com/tiennm99/coolify.git
synced 2026-04-18 01:20:31 +00:00
Fixes Docker installation failures on non-root servers by properly handling complex shell commands with pipes and operators. Previously, the sudo parser would insert sudo throughout command chains, breaking pipe structures like 'curl URL | sh || curl URL2 | sh'. The fix detects complex piped commands (containing '| sh', '| bash', or pipes combined with && or || operators) and wraps them in 'sudo bash -c' instead of inserting sudo mid-command. This preserves the command structure and prevents syntax errors. Changes: - Detect complex piped commands in parseCommandsByLineForSudo - Wrap complex commands in 'sudo bash -c' with proper quote escaping - Preserve original behavior for simple commands - Add 27 comprehensive unit tests covering all scenarios Fixes #7116
9.9 KiB
9.9 KiB