Skip to content

fix(proxy): preserve negation in non-root sudo conditions - #11088

Open
Arnaud-IFEA wants to merge 1 commit into
coollabsio:nextfrom
mindedtech:fix/non-root-sudo-negation
Open

fix(proxy): preserve negation in non-root sudo conditions#11088
Arnaud-IFEA wants to merge 1 commit into
coollabsio:nextfrom
mindedtech:fix/non-root-sudo-negation

Conversation

@Arnaud-IFEA

Copy link
Copy Markdown
Contributor

Changes

  • Fix sudo insertion for negated Bash if statements executed on remote servers through a non-root SSH user.
  • Preserve the ! operator before sudo, producing if ! sudo docker ... instead of the invalid if sudo ! docker ....
  • Add regression coverage for a simple negated condition and the proxy container removal pipeline.

Issues

Category

  • Bug fix
  • Improvement
  • New feature
  • Adding new one click service
  • Fixing or updating existing one click service

Preview

Before:

sudo: !: command not found
Waiting for container to be removed... (1/15)
...
Waiting for container to be removed... (15/15)

After:

Container removed successfully.
Proxy stopped successfully.
Container coolify-proxy Healthy
Successfully started coolify-proxy.

AI Assistance

  • AI was NOT used to create this PR
  • AI was used (please describe below)

If AI was used:

  • Tools used: OpenAI Codex
  • How extensively: Used to analyze the root cause, prepare the targeted code change, audit related sudo handling, and add regression tests. The behavior was manually reproduced and validated on a self-hosted Coolify instance.

Testing

  • vendor/bin/pint --dirty --format agent passed under PHP 8.5.8.
  • php artisan test --compact tests/Unit/ParseCommandsByLineForSudoTest.php passed: 51 tests, 109 assertions.
  • Manually reproduced on Coolify 4.1.2, Debian 13.6, using a non-root SSH user with sudo.
  • Confirmed that the proxy container is removed and restarted successfully after the fix.

Contributor Agreement

Important

  • I have read and understood the contributor guidelines. If I have failed to follow any guideline, I understand that this PR may be closed without review.
  • I have searched existing issues and pull requests (including closed ones) to ensure this isn't a duplicate.
  • I have tested all the changes thoroughly with a local development instance of Coolify and I am confident that they will work as expected when a maintainer tests them.

@Arnaud-IFEA
Arnaud-IFEA marked this pull request as ready for review July 29, 2026 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant