-
Notifications
You must be signed in to change notification settings - Fork 1.8k
packaging: add -L flag to curl for redirect support #11137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
packaging: add -L flag to curl for redirect support #11137
Conversation
…ntbit.io infrastructure now uses 302 redirects to S3, causing curl to return empty responses without -L flag. This breaks GPG key import on Debian/Ubuntu systems. Fixes: 'gpg: no valid OpenPGP data found' error Signed-off-by: Saksham Srivastava <134858442+sakshitposting-irl@users.noreply.github.com>
WalkthroughThe install script's curl command for fetching the release key now includes the Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
install.sh (1)
139-139: Optional: Consider adding--max-redirsfor defense-in-depth.For added safety against redirect loops or chains, consider capping the number of redirects:
-curl -L $RELEASE_KEY | gpg --dearmor > /usr/share/keyrings/fluentbit-keyring.gpg +curl -L --max-redirs 5 $RELEASE_KEY | gpg --dearmor > /usr/share/keyrings/fluentbit-keyring.gpgThis prevents edge cases where a misconfigured redirect target might lead to unexpected behavior. Not required for this fix, but a reasonable defensive measure.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
install.sh(1 hunks)
🔇 Additional comments (1)
install.sh (1)
139-139: ✓ Fix is correct and well-targeted.Adding
-Lto curl follows HTTP redirects, which directly addresses the 302 redirect from packages.fluentbit.io to S3 that was causing the key import to fail. The change is minimal, focused, and has been tested successfully on Ubuntu 24.04. This is the only place in the script where an explicitcurlinvocation fetches a URL (RPM-based systems userpm --importwhich handles redirects internally).
|
We should backport to 4.1 and 4.0 for people consuming that way although docs do just reference master. |
|
This can be a security issue. Not using -L guarantees that the gpg key has to be found in the address defined in the client repo. Another important issue with redirects in repository addresses is that they break all systems using a proxy to allow the access to the repository from internal infrastructures. |
Problem
The official install.sh script fails on Debian/Ubuntu with:
This occurs because
packages.fluentbit.io/fluentbit.keynow returns a 302 redirect to S3. Without the-Lflag, curl stops at the redirect and returns an empty response, breaking GPG key import.Solution
Added
-Lflag to curl command in the Ubuntu/Debian installation section to follow HTTP redirects.Fixes the installation failure on Debian/Ubuntu platforms.
Testing
Example configuration file for the change
Debug log output from testing the change
Attached Valgrind output
Run local packaging test
Set
ok-package-testlabelDocumentation
-LflagBackporting
Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.
Summary by CodeRabbit