Skip to content
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

Update mosquitto image to latest versions #3850

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

DerDreschner
Copy link

@DerDreschner DerDreschner commented Dec 2, 2024

The mosquitto image is quite outdated. This PR changes this by updating the following components:

  • Use latest Debian Bookworm as base image
  • Update mosquitto from v2.0.18 to v2.0.20 (which includes a few security fixes from version 2.0.19)
  • Update mosquitto-go-auth to v2.1.0
  • Update libwebsocket to v4.3.3

To achive this, it was necessary to include the DLWS_WITHOUT_TESTAPPS switch when building the libwebsocket library. This is being discussed here and will be fixed in the next version of libwebsocket. I've added a little comment in the Dockerfile to make it clear it can be removed in the future.

Additionally, I've normalized the version strings in the build.yaml by moving the prefix into the the Dockerfile (like it's being handled in i.e. the ssh addon).

Summary by CodeRabbit

Release Notes for Mosquitto Version 6.5.0

  • New Features

    • Updated to Mosquitto version 2.0.20 and included enhancements from mosquitto-go-auth version 2.1.0.
    • Base image updated to Debian 12 (bookworm) for improved compatibility and security.
  • Bug Fixes

    • Adjusted build configuration to resolve issues related to libwebsockets, enhancing stability.
  • Documentation

    • Changelog updated to reflect new version entry and detailed changes for version 6.5.0.

Copy link

@home-assistant home-assistant bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @DerDreschner

It seems you haven't yet signed a CLA. Please do so here.

Once you do that we will be able to review and accept this pull request.

Thanks!

@home-assistant
Copy link

home-assistant bot commented Dec 2, 2024

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

@home-assistant home-assistant bot marked this pull request as draft December 2, 2024 21:25
@DerDreschner DerDreschner marked this pull request as ready for review December 2, 2024 21:26
Copy link
Contributor

coderabbitai bot commented Dec 2, 2024

📝 Walkthrough

Walkthrough

The changes in this pull request include updates to the Mosquitto project's changelog, Dockerfile, build configuration, and broker configuration. The changelog has a new version entry for 6.5.0, documenting various updates including dependency versions and base image changes. The Dockerfile modifications focus on versioning format adjustments and a new build configuration option for libwebsockets. The build.yaml file updates the base images and dependency versions from "bullseye" to "bookworm" and reflects the latest versions of the dependencies. Lastly, the config.yaml file updates the broker version number to 6.5.0.

Changes

File Change Summary
mosquitto/CHANGELOG.md Added new version entry for 6.5.0, updated base image to Debian 12, and updated versions for Mosquitto (2.0.20), mosquitto-go-auth (2.1.0), and libwebsockets (4.3.3).
mosquitto/Dockerfile Changed versioning format for LIBWEBSOCKET_VERSION and MOSQUITTO_VERSION to hardcoded strings, added -DLWS_WITHOUT_TESTAPPS=ON to the cmake command.
mosquitto/build.yaml Updated base images from "bullseye" to "bookworm" for multiple architectures, and updated versions for LIBWEBSOCKET_VERSION (4.3.3), MOSQUITTO_VERSION (2.0.20), and MOSQUITTO_AUTH_VERSION (2.1.0).
mosquitto/config.yaml Updated broker version from 6.4.1 to 6.5.0.

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 5d9cb42 and db95ec3.

📒 Files selected for processing (4)
  • mosquitto/CHANGELOG.md (1 hunks)
  • mosquitto/Dockerfile (1 hunks)
  • mosquitto/build.yaml (1 hunks)
  • mosquitto/config.yaml (1 hunks)
✅ Files skipped from review due to trivial changes (2)
  • mosquitto/config.yaml
  • mosquitto/CHANGELOG.md
🧰 Additional context used
📓 Path-based instructions (2)
mosquitto/Dockerfile (6)

Pattern */**(html|markdown|md): - For instructional content in documentation, use a direct and authoritative tone. Avoid expressions of politeness such as 'may' or 'please', and ensure the goal of the instruction is fronted.

  • Apply the Microsoft Style Guide to ensure documentation maintains clarity and conciseness.
  • In step-by-step instructions, front the location phrase in the instructional sentence.
  • In step-by-step instructions, front the 'goal' in the instructional sentence.
  • In step-by-step instructions, if in doubt what to front, front the 'goal' before the location phrase in the instructional sentence.
  • do not hyphenate terms like 'top-right' or 'bottom-left' with 'corner'

Pattern */**(html|markdown|md): - Use bold to mark UI strings.

  • If "" are used to mark UI strings, replace them by bold.

Pattern */**(html|markdown|md): - Be brief in your replies and don't add fluff like "thank you for..." and "Please let me know if"


Pattern */**(html|markdown|md): - Use sentence-style capitalization also in headings.


Pattern */**(html|markdown|md): do not comment on HTML used for icons


Pattern */**(html|markdown|md): Avoid flagging inline HTML for embedding videos in future reviews for this repository.

mosquitto/build.yaml (6)

Pattern */**(html|markdown|md): - For instructional content in documentation, use a direct and authoritative tone. Avoid expressions of politeness such as 'may' or 'please', and ensure the goal of the instruction is fronted.

  • Apply the Microsoft Style Guide to ensure documentation maintains clarity and conciseness.
  • In step-by-step instructions, front the location phrase in the instructional sentence.
  • In step-by-step instructions, front the 'goal' in the instructional sentence.
  • In step-by-step instructions, if in doubt what to front, front the 'goal' before the location phrase in the instructional sentence.
  • do not hyphenate terms like 'top-right' or 'bottom-left' with 'corner'

Pattern */**(html|markdown|md): - Use bold to mark UI strings.

  • If "" are used to mark UI strings, replace them by bold.

Pattern */**(html|markdown|md): - Be brief in your replies and don't add fluff like "thank you for..." and "Please let me know if"


Pattern */**(html|markdown|md): - Use sentence-style capitalization also in headings.


Pattern */**(html|markdown|md): do not comment on HTML used for icons


Pattern */**(html|markdown|md): Avoid flagging inline HTML for embedding videos in future reviews for this repository.

🔇 Additional comments (5)
mosquitto/build.yaml (3)

14-14: Verify breaking changes in mosquitto-go-auth 2.1.0

The update from 1.8.2 to 2.1.0 is a major version change that might include breaking changes.

✅ Verification successful

Let me check the changelog of mosquitto addon for any related information about this version upgrade.


Let me check the repository for any configuration files that might be affected by the auth plugin version change.


Let me check the template file and Dockerfile to see how the auth plugin is configured and used.


Based on the gathered information, I can now provide the final response:

Update to mosquitto-go-auth 2.1.0 appears safe to proceed

The version update from 1.8.2 to 2.1.0 appears to be safe as:

  • Release notes show no breaking changes, only adding binary releases for different architectures
  • The auth plugin configuration in the template file uses stable features (files/http backends, caching, etc.)
  • The integration method in Dockerfile remains unchanged
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check release notes for breaking changes
curl -s https://api.github.com/repos/iegomez/mosquitto-go-auth/releases/tags/2.1.0 | jq -r '.body'

# Search for migration guides or upgrade notes
rg -l "upgrade|migration|breaking.?changes" --glob "*.md"

Length of output: 440


Script:

#!/bin/bash
# Check mosquitto changelog for any mentions of auth plugin version changes
cat mosquitto/CHANGELOG.md

Length of output: 2328


Script:

#!/bin/bash
# Search for mosquitto-go-auth related configuration
rg -l "mosquitto-go-auth|auth_opt_" mosquitto/

Length of output: 141


Script:

#!/bin/bash
# Check the template and Dockerfile content
cat mosquitto/rootfs/usr/share/tempio/mosquitto.gtpl
echo "---"
cat mosquitto/Dockerfile

Length of output: 4180


12-13: Verify security fixes in Mosquitto and libwebsockets updates

The version updates include security fixes from Mosquitto v2.0.19. Let's verify the changes:

✅ Verification successful

Security fixes confirmed in Mosquitto 2.0.19-2.0.20 update

The changelog reveals important security fixes in Mosquitto 2.0.19:

  • Fixed mismatched subscribe/unsubscribe vulnerability with normal/shared topics
  • Fixed crash vulnerability in bridge using remapped topic when sent crafted packets

For libwebsockets, let's try an alternative source for the changelog:


Let's try one more time to find libwebsockets security information from a different source:


Version updates include confirmed security improvements

The Mosquitto update to 2.0.19-2.0.20 includes critical security fixes:

  • Protection against mismatched subscribe/unsubscribe vulnerabilities
  • Prevention of crash exploits in bridge remapped topics

While specific security notes for libwebsockets 4.3.3 couldn't be found in our searches, the version update appears to be a maintenance release with general improvements.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check Mosquitto changelog for security fixes
curl -s https://raw.githubusercontent.com/eclipse/mosquitto/v2.0.20/ChangeLog.txt | grep -A 10 "2.0.19\|2.0.20"

# Check libwebsockets release notes for security improvements
curl -s https://api.github.com/repos/warmcat/libwebsockets/releases/tags/v4.3.3 | jq -r '.body'

Length of output: 886


Script:

#!/bin/bash
# Try alternative method to get libwebsockets changelog
curl -s https://raw.githubusercontent.com/warmcat/libwebsockets/v4.3.3/changelog | head -n 20

Length of output: 836


Script:

#!/bin/bash
# Try to find security fixes in libwebsockets release notes
curl -s https://raw.githubusercontent.com/warmcat/libwebsockets/v4.3.3/READMEs/README.security.md

# Also check git log for security-related commits
curl -s https://api.github.com/repos/warmcat/libwebsockets/commits\?path\=SECURITY.md\&since\=2023-01-01 | jq -r '.[].commit.message'

Length of output: 461


3-7: Verify compatibility with Debian Bookworm base image

The update from Debian Bullseye to Bookworm is a major version upgrade that could introduce breaking changes.

✅ Verification successful

Based on the analysis of the shell script results, I can now generate the final response:

Base image update to Debian Bookworm appears safe

The Dockerfile shows that Mosquitto is built from source with specific version tags (MOSQUITTO_VERSION, LIBWEBSOCKET_VERSION, MOSQUITTO_AUTH_VERSION) rather than using Debian packages. This means:

  • Dependencies are explicitly installed and version-controlled
  • Build process is isolated from system-wide package versions
  • Runtime dependencies are minimal and basic (openssl, libc-ares2, libcjson1)

The update to Bookworm base image should not impact the functionality since:

  • All critical components are compiled from source with pinned versions
  • System libraries used are standard and backward compatible
  • Build-time dependencies are removed after compilation
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check for any dependency version changes between Bullseye and Bookworm that might affect Mosquitto
curl -s https://packages.debian.org/bullseye/mosquitto | grep -o 'Version: .*' > /tmp/bullseye_ver
curl -s https://packages.debian.org/bookworm/mosquitto | grep -o 'Version: .*' > /tmp/bookworm_ver
diff /tmp/bullseye_ver /tmp/bookworm_ver

Length of output: 204


Script:

#!/bin/bash
# Let's check the repository for any version constraints or dependencies
rg -l "debian|bullseye|bookworm" --type yaml

Length of output: 270


Script:

#!/bin/bash
# Check if there are any build or runtime dependencies specified
cat mosquitto/Dockerfile

Length of output: 2370


Script:

#!/bin/bash
# Check for any configuration files that might need adjustment
fd -e conf -e cfg . mosquitto/

Length of output: 32


Script:

#!/bin/bash
# Look for any version-specific dependencies or configurations
rg -A 5 "version|Version" mosquitto/

Length of output: 790

mosquitto/Dockerfile (2)

27-36: Verify status of libwebsockets workaround

The -DLWS_WITHOUT_TESTAPPS=ON flag is added as a workaround. Let's verify if this is still needed:

✅ Verification successful

Workaround still needed for libwebsockets build

Based on the GitHub issue status check, the issue #2790 is still open as of May 2024, with recent activity confirming the workaround is still helping users resolve the problem. Keep the -DLWS_WITHOUT_TESTAPPS=ON flag in the build configuration.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if the issue is still open
gh api graphql -f query='
{
  repository(owner: "warmcat", name: "libwebsockets") {
    issue(number: 2790) {
      state
      comments(last: 1) {
        nodes {
          updatedAt
          body
        }
      }
    }
  }
}'

Length of output: 453


Script:

#!/bin/bash
# Check the libwebsockets repository for any recent changes related to test apps or build system
rg -i "testapps" -g "CMakeLists.txt" -A 5 -B 5

Length of output: 193


30-30: Verify existence of version tags with "v" prefix

The version strings now include a "v" prefix. Let's verify these tags exist:

Also applies to: 41-41

✅ Verification successful

Let me follow up on the mosquitto repository since we got a redirect response. I'll verify both repositories with a different approach.


Version tags with "v" prefix exist and are valid

The version tags v4.3.3 for libwebsockets and v2.0.20 for mosquitto exist in their respective repositories, confirming that the changes to add "v" prefix in the git clone commands are correct.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if the tags exist in both repositories
curl -s https://api.github.com/repos/warmcat/libwebsockets/git/refs/tags/v4.3.3
curl -s https://api.github.com/repos/eclipse/mosquitto/git/refs/tags/v2.0.20

Length of output: 779


Script:

#!/bin/bash
# Check tags using GitHub CLI which handles redirects automatically
gh api repos/warmcat/libwebsockets/git/refs/tags/v4.3.3
echo "---"
gh api repos/eclipse/mosquitto/git/refs/tags/v2.0.20

Length of output: 834


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai or @coderabbitai title anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@DerDreschner
Copy link
Author

DerDreschner commented Dec 20, 2024

@agners Just to make sure I didn't overlook something: Is there anything I still have to do so you guys can merge my PR?

@agners
Copy link
Member

agners commented Dec 23, 2024

@agners Just to make sure I didn't overlook something: Is there anything I still have to do so you guys can merge my PR?

Everything fine, I just didn't come around to take a closer look. I intend to do a local build and test before merging, just to be sure things indeed work as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants