Skip to content

Commit

Permalink
upgrade Mosquitto with web-based MQTT-Explorer
Browse files Browse the repository at this point in the history
  • Loading branch information
madejackson committed Sep 17, 2024
1 parent b88d8af commit f572458
Showing 1 changed file with 69 additions and 0 deletions.
69 changes: 69 additions & 0 deletions servapps/mosquitto/cosmos-compose.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,29 @@
{
"cosmos-installer": {
"form": [
{
"name": "installWebClient",
"label": "Do you want to install a web-based MQTT-Explorer?",
"initialValue": true,
"type": "checkbox"
}
{if Context.installWebClient}
, {
"name": "adminOnly",
"label": "Do you want to make this service admin only?",
"initialValue": true,
"type": "checkbox"
}
{/if}
],
"translation": {
"de": {
"form.installWebClient.label": "Möchten Sie einen webbasierten MQTT-Explorer mit dazu installieren?",
"form.adminOnly.label": "Möchten Sie den MQTT-Explorer nur für Administratoren zugänglich machen?"
}
}
},
"minVersion": "0.8.0",
"services": {
"{ServiceName}": {
"image": "eclipse-mosquitto:latest",
Expand Down Expand Up @@ -42,5 +65,51 @@
"printf \"listener 1883\\nallow_anonymous true\" > /mosquitto/config/mosquitto.conf"
]
}
{if Context.installWebClient}
, "MQTT-Explorer": {
"container_name": "MQTT-Explorer",
"image": "smeagolworms4/mqtt-explorer",
"environment": [
"HTTP_PORT=80",
"CONFIG_PATH=/mqtt-explorer/config",
"INITIAL_CONFIG={\"ConnectionManager_connections\":{\"mosquitto\":{\"configVersion\":1,\"certValidation\":false,\"clientId\":\"mqtt-explorer-387011e3\",\"id\":\"mosquitto\",\"name\":\"Mosquitto\",\"encryption\":false,\"subscriptions\":[{\"topic\":\"#\",\"qos\":0},{\"topic\":\"$SYS/#\",\"qos\":0}],\"type\":\"mqtt\",\"host\":\"Mosquitto\",\"port\":1883,\"protocol\":\"mqtt\"}}}"
],
"labels": {
"cosmos-force-network-secured": "true",
"cosmos-auto-update": "true",
"cosmos-icon": "https://aseracorp.github.io/resiSTORE/servapps/mosquitto/icon.png"
},
"volumes": [
{
"type": "volume",
"source": "MQTT-Explorer-config",
"target": "/mqtt-explorer/config"
}
],
"links": [
"Mosquitto"
],
"routes": [
{
"name": "MQTT-Explorer",
"description": "Expose MQTT-Explorer to the web",
"useHost": true,
"target": "http://MQTT-Explorer:80",
"mode": "SERVAPP",
"Timeout": 14400000,
"ThrottlePerMinute": 12000,
"BlockCommonBots": true,
"SmartShield": {
"Enabled": true
},
"AuthEnabled": true
{if Context.adminOnly}
, "AuthAdmin": true
{/if}
}
],
"restart": "unless-stopped"
}
{/if}
}
}

0 comments on commit f572458

Please sign in to comment.