Jump to content

[Support] cmccambridge - mosquitto-unraid


Recommended Posts

eclipse-mosquitto.png

 

Application: mosquitto-unraid

Overview: Container for eclipse-mosquitto with Unraid ease-of-use tweaks

Docker: https://quay.io/repository/cmccambridge/mosquitto-unraid 

Application GitHub: https://github.com/cmccambridge/mosquitto-unraid 

 

This container is a minimal port of the official Eclipse Mosquitto Docker container with minor tweaks to work more conveniently in Unraid.

 

Breaking Change Announcement (2021-01-20): Starting with Version 2.0.0, this container requires manual configuration to run! See more details below: 

 

 

For details on how to configure the container, please see the README on GitHub! You can configure:

  • Persistent Data
  • Logging
  • Authentication
  • TLS
  • Websockets

 

Questions?

Post any other questions or issues relating to this Docker container on Unraid in this thread, or by opening an issue on GitHub.

Edited by cmccambridge
2.0.0 Breaking change
Link to comment
  • 9 months later...

Stupid question @cmccambridge....

 

The community apps version of the container is 1.5.8... But I see the current version on your github is 1.6.x.

 

EDIT: Never mind. It looks like when it installed originally the repository was listed as "cmccambridge/mosquitto-unraid:1.5.8". I changed it to "cmccambridge/mosquitto-unraid:latest" and all is good.

Edited by JasonJoel
Link to comment

Ugh, great catch. Thanks for letting me know @JasonJoel!

 

This bug has been there since I migrated from quay.io in April 2019 and I never noticed, because I made the same edit locally that you've just done...

 

Good news is your fix is exactly correct. I've committed the same to the template repository, so other new installs and folks accidentally pinned at 1.5.8 should receive the update soon as well. Fixed with this PR.

Edited by cmccambridge
link PR
  • Like 1
Link to comment
  • 1 year later...

Hello all,

 

BREAKING CHANGE ANNOUNCEMENT!

If you have never customized your Mosquitto container, you MUST take action after the next container update!

 

Starting with Mosquitto 2.0.0, the Eclipse project requires explicit configuration to enable listening on non-loopback network interfaces and to allow anonymous (unauthenticated) connections to the MQTT server. This change was made by the Eclipse project to harden their security posture, and is documented in the 2.0.0 release announcement and the official Eclipse migration guide.

 

The unRAID container is taking this breaking change as well, though I'm trying to make it as painless as possible... Three options for you to consider, in order of increasing difficulty:

  1. Set the RUN_INSECURE_MQTT_SERVER variable to return to the old default/insecure 1.x settings: A MQTT server on port 1883 that allows anonymous connections. If you have never customized Mosquitto configuration files, this will be your easiest option!
    1. In Docker Manager, click "Check for Updates" and wait for it to complete.
    2. Edit your Mosquitto-unraid container configuration
    3. You should see a new variable field, "Run Insecure MQTT Server". Change the value from 0 to 1.
    4. Save your changes.
    5. If available, run the Mosquitto container update.
  2. Edit the mosquitto-unraid-default.conf file in the configuration directory. If you would like more hands-on customization of this new security posture, give this a try.
    1. Run the Mosquitto container update.
    2. You will find a generated file mosquitto-unraid-default.conf in your "Config" path, e.g. /mnt/user/appdata/mosquitto/mosquitto-unraid-default.conf
    3. Read the file, select an option to enable, and save your changes.
    4. Restart the Mosquitto container.
  3. Configure the Mosquitto container to your liking (or update your existing configuration), including at least one listener. For advanced users.
    1. Refer to the mosquitto-unraid documentation or the official Mosquitto configuration docs.
    2. Restart the Mosquitto container after making your changes.

Let me know if you have any questions, and apologies for the disruption!

 

I debated a long time about whether I could somehow work around this breaking change, and in the end concluded that I cannot... without knowing how you may have customized Mosquitto, any automatic change I might attempt could be even more disruptive than this change, so I have erred on the side of caution in propagating the breaking change. Hopefully the pre-generated configuration options in mosquitto-unraid-default.conf or the override RUN_INSECURE_MQTT_SERVER option will provide you a quick way to resume previous functionality!

Link to comment
  • 1 year later...

hi i have trouble understanding all this stuff..  and i try to run nano  in the console terminal for the mosquitto    but doesnt work

 

i want  to do is send  home assistant a command to turn on a switch.. but want to run from a user script

i have

"test"   as the topic

"turn_on"   as a message to turn on

"turn_off"  as a message to turn off

 

i hjave no idea what i doing...  i tried to read the documenations..    is there any docs for a noob 

so i can run like

 

"mosquitto test/turn_on"    something like that .

Link to comment
  • 4 months later...

Hi, I have installed this container and seem to be getting some errors in the Log.  what can this be?

 

1659882243: Error: Permission denied.
1659884044: Error: Permission denied.
1659885845: Error: Permission denied.
1659887646: Error: Permission denied.
1659889447: Error: Permission denied.
1659891248: Error: Permission denied.
1659893049: Error: Permission denied.
1659894850: Error: Permission denied.
1659896651: Error: Permission denied.
1659898452: Error: Permission denied.
1659900253: Error: Permission denied.
1659902054: Error: Permission denied.
1659903855: Error: Permission denied.
1659905656: Error: Permission denied.
1659907457: Error: Permission denied.
1659909258: Error: Permission denied.
1659911059: Error: Permission denied.
1659912860: Error: Permission denied.
1659914661: Error: Permission denied.
1659916462: Error: Permission denied.
1659918263: Error: Permission denied.
1659920064: Error: Permission denied.
1659921865: Error: Permission denied.
1659923666: Error: Permission denied.
1659925467: Error: Permission denied.
1659927268: Error: Permission denied.
1659929069: Error: Permission denied.
1659930870: Error: Permission denied.
1659932671: Error: Permission denied.
1659934472: Error: Permission denied.
1659936273: Error: Permission denied.
1659938074: Error: Permission denied.
1659939875: Error: Permission denied.
1659941676: Error: Permission denied.
1659943477: Error: Permission denied.
1659945278: Error: Permission denied.
1659947079: Error: Permission denied.
1659948880: Error: Permission denied.
1659950681: Error: Permission denied.
1659952482: Error: Permission denied.
1659954283: Error: Permission denied.
1659956084: Error: Permission denied.
1659957885: Error: Permission denied.
1659959686: Error: Permission denied.
1659961487: Error: Permission denied.
1659963288: Error: Permission denied.
1659965089: Error: Permission denied.
1659966890: Error: Permission denied.
1659968691: Error: Permission denied.
1659970492: Error: Permission denied.
1659972293: Error: Permission denied.
1659974094: Error: Permission denied.
1659975895: Error: Permission denied.
1659977696: Error: Permission denied.
1659979497: Error: Permission denied.
1659981298: Error: Permission denied.
1659983099: Error: Permission denied.
1659984900: Error: Permission denied.
1659986701: Error: Permission denied.
1659988502: Error: Permission denied.
1659990303: Error: Permission denied.
1659992104: Error: Permission denied.
1659993905: Error: Permission denied.
1659995706: Error: Permission denied.
1659997507: Error: Permission denied.
1659999308: Error: Permission denied.
1660001109: Error: Permission denied.
1660002910: Error: Permission denied.
1660004711: Error: Permission denied.
1660006512: Error: Permission denied.
1660008313: Error: Permission denied.
1660010114: Error: Permission denied.
1660011915: Error: Permission denied.
1660013716: Error: Permission denied.
1660015517: Error: Permission denied.
1660017318: Error: Permission denied.
1660019119: Error: Permission denied.
1660020920: Error: Permission denied.
1660022721: Error: Permission denied.
1660024522: Error: Permission denied.
1660026323: Error: Permission denied.
1660028124: Error: Permission denied.
1660029925: Error: Permission denied.
1660031726: Error: Permission denied.
1660033527: Error: Permission denied.
1660035328: Error: Permission denied.
1660037129: Error: Permission denied.
1660038930: Error: Permission denied.
1660040731: Error: Permission denied.
1660042532: Error: Permission denied.

Link to comment
  • 2 years later...

sorry if my question is stupid but am trying to install the container and can't follow the steps.

 

i would like to run it with option 2 since 1 seems the least secure and 3 is not for me since i'm fairly new with unraid docker etc.

 

My Problem with option 2 is that the container i followed the steps and edit my mosquitto-unraid-default.conf file in the lines 28-30 and deleted the # so it looks like this:

 

listener 1883
protocol mqtt
password_file /mosquitto/config/passwd

 

now i start the container and it stops again. The logs show:

 

1726144166: Loading config file /mosquitto/config/mosquitto-unraid-default.conf
1726144166: mosquitto version 2.0.18 starting
1726144166: Config loaded from /mosquitto-unraid/include_dir.conf.
1726144166: Error: Unable to open pwfile "/mosquitto/config/passwd".
1726144166: Error opening password file "/mosquitto/config/passwd".
!! ATTENTION: MANUAL CONFIGURATION IS REQUIRED !!

Due to security hardening in Mosquitto 2.0, you MUST TAKE MANUAL ACTION to
reenable MQTT in this container!

OPTION 1: Set RUN_INSECURE_MQTT_SERVER to 1 in this container's settings

OPTION 2: Edit the file "mosquitto-unraid-default.conf" in your configuration
path for more details (Usually /mnt/user/appdata/mosquitto)

OPTION 3: Update your customized Mosquitto configuration to configure at
least one listener. See https://mosquitto.org/documentation/migrating-to-2-0/

 

https://github.com/cmccambridge/mosquitto-unraid#authentication

tells me to run (i assume in the unraid console since the container wont even start)

docker exec -it mosquitto touch /mosquitto/config/passwd

 

but the console shows me

Error response from daemon: Container b5dfb6360ea02ebf58e744cc1c166ff04e2e0496f46bb4cb778e0c2a4506698f is not running

if i do. which makes sense since the container is not running but it autostops every time i tell it to start.

 

any ideas whats wrong? i did not change anything else. screenshot of the containersetup is attached.

 

 

 

mosquitto settings 1.png

Edited by Icarium
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...