Skip to content
This repository has been archived by the owner on Jul 16, 2021. It is now read-only.

Commit

Permalink
Fix premission issues when 'allow_anonymous' is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
ludeeus committed May 12, 2019
1 parent b63bc9c commit 3c6d596
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions mqtt/rootfs/etc/cont-init.d/mosquitto.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,24 @@ bashio::log.info 'Adding configuration for MQTT Server...'
echo "log_type websockets";
echo "persistence true";
echo "persistence_location $PERSISTENCE_LOCATION";
echo "acl_file $ACL_FILE";
echo "password_file $PWFILE";
echo "listener 1883"
echo "protocol mqtt"
echo "listener 1884";
echo "protocol websockets";
echo "socket_domain ipv4";
} > "$CONFIG"

# Allow anonymous auth?
if bashio::config.true 'allow_anonymous'; then
echo "allow_anonymous true" >> "$CONFIG"
else
{
echo "allow_anonymous false";
echo "acl_file $ACL_FILE";
echo "password_file $PWFILE";
} >> "$CONFIG"
fi

# Set SSL configurtations
if bashio::config.true 'ssl'; then
{
Expand All @@ -65,13 +74,6 @@ if bashio::config.true 'ssl'; then
} >> "$CONFIG"
fi

# Allow anonymous auth?
if bashio::config.true 'allow_anonymous'; then
echo "allow_anonymous true" >> "$CONFIG"
else
echo "allow_anonymous false" >> "$CONFIG"
fi

# Set username and password for the broker
for user in $(bashio::config 'mqttusers|keys'); do
bashio::config.require.username "mqttusers[${user}].username"
Expand Down

0 comments on commit 3c6d596

Please sign in to comment.