From 8226b7bf81938b96ea80f0c436949b089a88f3b8 Mon Sep 17 00:00:00 2001 From: ZasX Date: Tue, 19 Jul 2022 07:50:20 +0200 Subject: [PATCH] feat(mosquitto): Create setup-guide.md (#3212) * Create setup-guide.md * linting Co-authored-by: Stavros Kois <47820033+stavros-k@users.noreply.github.com> --- charts/stable/mosquitto/docs/setup-guide.md | 36 +++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 charts/stable/mosquitto/docs/setup-guide.md diff --git a/charts/stable/mosquitto/docs/setup-guide.md b/charts/stable/mosquitto/docs/setup-guide.md new file mode 100644 index 00000000000..a45f1202b49 --- /dev/null +++ b/charts/stable/mosquitto/docs/setup-guide.md @@ -0,0 +1,36 @@ +# Configure password authentication + +## Edit chart config + +Change the chart's config to disable `allow_anonymous` by setting authentication to `enabled`. + +```yaml title="values.yaml" +auth: + # -- By enabling this, `allow_anonymous` gets set to `false` in the mosquitto config. + # highlight-next-line + enabled: true +``` + +## Create password and config files + +Open the Mosquitto container shell and execute the following commands, *one by one*, in order: + +```sh +cd /mosquitto/configinc +mosquitto_passwd -c passwordfile username +echo "password_file /mosquitto/configinc/passwordfile" > passwordconfig.conf +``` + +:::info These commands explained + +- Navigate to `/mosquitto/configinc`, the persistent storage location inside the container where the password files go +- Create a password file. This is interactive. Change `username` to your username. It will ask you to input the password twice +- Create a config file that points to the password file + +::: + +:::caution Restart chart + +Restart the chart so Mosquitto loads the new configuration file. + +:::