Skip to content

Commit 3449637

Browse files
committed
Remove extraneous tab characters throughout
1 parent dbb6217 commit 3449637

File tree

1 file changed

+29
-29
lines changed

1 file changed

+29
-29
lines changed

docs/Containers/Mosquitto.md

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,9 @@ Using `mosquitto.conf` as the example, assume you wish to use your existing file
179179
$ cd ~/IOTstack
180180
$ sudo mv ./services/mosquitto/mosquitto.conf ./volumes/mosquitto/config/mosquitto.conf
181181
```
182-
182+
183183
> The move overwrites the default. At this point, the moved file will probably be owned by user "pi" but that does not matter.
184-
184+
185185
2. Mosquitto will always enforce correct ownership (1883:1883) on any restart but it will not overwrite permissions. If in doubt, use mode 644 as your default for permissions:
186186

187187
```bash
@@ -193,7 +193,7 @@ Using `mosquitto.conf` as the example, assume you wish to use your existing file
193193
```bash
194194
$ docker-compose restart mosquitto
195195
```
196-
196+
197197
4. Check your work:
198198

199199
```bash
@@ -279,7 +279,7 @@ A common problem with the previous version of Mosquitto for IOTstack occurred wh
279279
The Mosquitto container performs self-repair each time the container is brought up or restarts. If `pwfile` is missing, an empty file is created as a placeholder. This prevents the restart loop. What happens next depends on `allow_anonymous`:
280280

281281
* If `true` then:
282-
282+
283283
- Any MQTT request *without* credentials will be permitted;
284284
- Any MQTT request *with* credentials will be rejected (because `pwfile` is empty so there is nothing to match on).
285285

@@ -292,17 +292,17 @@ To create a username and password, use the following as a template.
292292
```
293293
$ docker exec mosquitto mosquitto_passwd -b /mosquitto/pwfile/pwfile «username» «password»
294294
```
295-
295+
296296
Replace «username» and «password» with appropriate values, then execute the command. For example, to create the username "hello" with password "world":
297-
297+
298298
```
299299
$ docker exec mosquitto mosquitto_passwd -b /mosquitto/pwfile/pwfile hello world
300300
```
301301

302302
Note:
303303

304304
* See also [customising health-check](#healthCheckCustom). If you are creating usernames and passwords, you may also want to create credentials for the health-check agent.
305-
305+
306306
#### <a name="checkPasswordFile"> check password file </a>
307307

308308
There are two ways to verify that the password file exists and has the expected content:
@@ -312,7 +312,7 @@ There are two ways to verify that the password file exists and has the expected
312312
```bash
313313
$ sudo cat ~/IOTstack/volumes/mosquitto/pwfile/pwfile
314314
```
315-
315+
316316
> `sudo` is needed because the file is neither owned nor readable by `pi`.
317317

318318
2. View the file using its **internal** path:
@@ -346,24 +346,24 @@ There are several ways to reset the password file. Your options are:
346346
$ sudo rm ./volumes/mosquitto/pwfile/pwfile
347347
$ docker-compose restart mosquitto
348348
```
349-
349+
350350
The result is an empty password file.
351-
351+
352352
2. Clear all existing passwords while adding a new password:
353353

354354
```bash
355355
$ docker exec mosquitto mosquitto_passwd -c -b /mosquitto/pwfile/pwfile «username» «password»
356356
```
357-
357+
358358
The result is a password file with a single entry.
359-
359+
360360
3. Clear all existing passwords in favour of a single dummy password which is then removed:
361361

362362
```bash
363363
$ docker exec mosquitto mosquitto_passwd -c -b /mosquitto/pwfile/pwfile dummy dummy
364364
$ docker exec mosquitto mosquitto_passwd -D /mosquitto/pwfile/pwfile dummy
365365
```
366-
366+
367367
The result is an empty password file.
368368

369369
### <a name="activateSecurity"> Activate Mosquitto security </a>
@@ -379,7 +379,7 @@ There are several ways to reset the password file. Your options are:
379379
```
380380
#password_file /mosquitto/pwfile/pwfile
381381
```
382-
382+
383383
so that it becomes:
384384

385385
```
@@ -391,14 +391,14 @@ There are several ways to reset the password file. Your options are:
391391
```
392392
allow_anonymous true
393393
```
394-
394+
395395
If `true` then:
396-
396+
397397
* Any MQTT request without credentials will be permitted;
398398
* The validity of credentials supplied with any MQTT request will be enforced.
399399

400400
If `false` then:
401-
401+
402402
* Any MQTT request without credentials will be rejected;
403403
* The validity of credentials supplied with any MQTT request will be enforced.
404404

@@ -462,7 +462,7 @@ $ mosquitto_sub -v -h 127.0.0.1 -p 1883 -t "/password/test" -F "%I %t %p" -u hel
462462
```
463463

464464
Repeat the earlier test:
465-
465+
466466
```
467467
$ mosquitto_pub -h 127.0.0.1 -p 1883 -t "/password/test" -m "up up and away" -u hello -P world
468468
2021-02-16T14:40:51+1100 /password/test up up and away
@@ -471,7 +471,7 @@ $ mosquitto_pub -h 127.0.0.1 -p 1883 -t "/password/test" -m "up up and away" -u
471471
Note:
472472

473473
* the second line above is coming from the `mosquitto_sub` running in the background.
474-
474+
475475
When you have finished testing you can kill the background process (press return twice after you enter the `kill` command):
476476

477477
```
@@ -493,7 +493,7 @@ The agent is invoked 30 seconds after the container starts, and every 30 seconds
493493
```
494494
iotstack/mosquitto/healthcheck
495495
```
496-
496+
497497
* Subscribes to the same broker for the same topic for a single message event.
498498
* Compares the payload sent with the payload received. If the payloads (ie time-stamps) match, the agent concludes that the Mosquitto broker (the process running inside the same container) is functioning properly for round-trip messaging.
499499

@@ -529,7 +529,7 @@ Possible reply patterns are:
529529
NAMES STATUS
530530
mosquitto Up About a minute (unhealthy)
531531
```
532-
532+
533533
You can also subscribe to the same topic that the health-check agent is using to view the retained messages as they are published:
534534

535535
```bash
@@ -553,16 +553,16 @@ You can customise the operation of the health-check agent by editing the `mosqui
553553
environment:
554554
- HEALTHCHECK_PORT=12345
555555
```
556-
556+
557557
2. If the default topic string used by the health-check agent causes a name-space collision, you can override it. For example, you could use a Universally-Unique Identifier (UUID):
558558

559559
```yaml
560560
environment:
561561
- HEALTHCHECK_TOPIC=4DAA361F-288C-45D5-9540-F1275BDCAF02
562562
```
563-
563+
564564
Note:
565-
565+
566566
* You will also need to use the same topic string in the `mosquitto_sub` command shown at [monitoring health-check](#healthCheckMonitor).
567567

568568
3. If you have enabled authentication for your Mosquitto broker service, you will need to provide appropriate credentials for your health-check agent:
@@ -581,15 +581,15 @@ You can customise the operation of the health-check agent by editing the `mosqui
581581
```
582582

583583
Notes:
584-
584+
585585
* The directives to disable health-checking are independent of the environment variables. If you want to disable health-checking temporarily, there is no need to remove any `HEALTHCHECK_` environment variables that may already be in place.
586-
* Conversely, the mere presence of a `healthcheck:` clause in the `mosquitto` service definition overrides the supplied agent. In other words, the following can't be used to re-enable the supplied agent:
586+
* Conversely, the mere presence of a `healthcheck:` clause in the `mosquitto` service definition overrides the supplied agent. In other words, the following can't be used to re-enable the supplied agent:
587587

588588
```yaml
589589
healthcheck:
590590
disable: false
591591
```
592-
592+
593593
You must remove the entire `healthcheck:` clause.
594594

595595
## <a name="upgradingMosquitto"> Upgrading Mosquitto </a>
@@ -665,7 +665,7 @@ If you need to pin Mosquitto to a particular version:
665665
```
666666

667667
The new *local image* is built, then the new container is instantiated based on that image. The `prune` deletes the old *local image*.
668-
668+
669669
Note:
670670

671671
* As well as preventing Docker from updating the *base image*, pinning will also block incoming updates to the *Dockerfile* from a `git pull`. Nothing will change until you decide to remove the pin.
@@ -701,7 +701,7 @@ If you have a use-case that needs port 9001, you can re-enable support by:
701701
listener 1883
702702
listener 9001
703703
```
704-
704+
705705
You need **both** lines. If you omit 1883 then Mosquitto will stop listening to port 1883 and will only listen to port 9001.
706706

707707
3. Restarting the container:

0 commit comments

Comments
 (0)