Skip to content

Commit

Permalink
feat(containers): set mqtt bind address to make broker accessible fro…
Browse files Browse the repository at this point in the history
…m containers
  • Loading branch information
reubenmiller committed Feb 12, 2024
1 parent 04d0cb9 commit ac27c4d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
5 changes: 5 additions & 0 deletions layers/containers.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,15 @@ parent = "tedge-rugpi-core/tedge"
recipes = [
"tedge-rugpi-core/defaults",
"tedge-rugpi-core/docker",
"tedge-config",
]

[parameters."core/apt-cleanup"]
autoremove = true

[parameters."core/rugpi-ctrl"]
rugpi_admin = true # Enable Rugpi Admin.

[parameters."tedge-config"]
# Allow containers to reach the MQTT broker on the host
mqtt_bind_address = "0.0.0.0"
6 changes: 6 additions & 0 deletions recipes/tedge-config/recipe.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
description = "thin-edge.io custom configuration"
priority = 10_000
dependencies = ["tedge-rugpi-core/defaults"]

[parameters]
mqtt_bind_address = { default = "" }
7 changes: 7 additions & 0 deletions recipes/tedge-config/steps/00-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
set -e

if [ -n "$RECIPE_PARAM_MQTT_BIND_ADDRESS" ]; then
echo "Setting mqtt.bind.address to $RECIPE_PARAM_MQTT_BIND_ADDRESS" >&2
tedge config set mqtt.bind.address "$RECIPE_PARAM_MQTT_BIND_ADDRESS"
fi

0 comments on commit ac27c4d

Please sign in to comment.