coolify/tests
Andras Bacsai c1c234da5f fix(server): wrap complex piped commands in bash -c for sudo execution
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
2025-11-13 14:39:55 +01:00
..
Browser feat(core): You can validate compose files with docker compose config 2025-02-27 11:29:04 +01:00
Feature fix(CleanupRedisTest): update mock return values for hgetall to reflect job processing state 2025-11-11 23:17:25 +01:00
Traits test: setup database for upcoming tests 2024-12-04 12:43:52 +01:00
Unit fix(server): wrap complex piped commands in bash -c for sudo execution 2025-11-13 14:39:55 +01:00
CreatesApplication.php Fix styling 2024-06-10 20:43:34 +00:00
DuskTestCase.php Refactor DuskTestCase.php to use a hardcoded base URL 2024-10-17 21:26:06 +02:00
Pest.php feat(core): You can validate compose files with docker compose config 2025-02-27 11:29:04 +01:00
TestCase.php init of v4 🌮 2023-03-17 15:33:48 +01:00