Merge pull request 'Mosquitto MQTT broker' (#127) from feature_94_mqtt into master
Reviewed-on: #127
This commit is contained in:
commit
211e912cbf
|
@ -58,6 +58,7 @@ Not every stack is tested to fully work.
|
||||||
| magneticod | ✅ | `boramalper/magneticod` | DHT indexing daemon. | [Website](https://www.boramalper.org/labs/magnetico/), [Github](https://github.com/boramalper/magnetico) |
|
| magneticod | ✅ | `boramalper/magneticod` | DHT indexing daemon. | [Website](https://www.boramalper.org/labs/magnetico/), [Github](https://github.com/boramalper/magnetico) |
|
||||||
| Matrix Telegram Bridge | ✅ | `dock.mau.dev/mautrix/telegram` | Telegram bridge for Matrix server | [Gitlab](https://mau.dev/mautrix/telegram/) |
|
| Matrix Telegram Bridge | ✅ | `dock.mau.dev/mautrix/telegram` | Telegram bridge for Matrix server | [Gitlab](https://mau.dev/mautrix/telegram/) |
|
||||||
| Metube | ✅ | `alexta69/metube` | Web GUI for yt-dlp. | [Github](https://github.com/alexta69/metube) |
|
| Metube | ✅ | `alexta69/metube` | Web GUI for yt-dlp. | [Github](https://github.com/alexta69/metube) |
|
||||||
|
| Mosquitto | ✅ | `iegomez/mosquitto-go-auth` | Simple and fast MQTT server with Go Auth plugin. | [Plugin Github](https://github.com/iegomez/mosquitto-go-auth), [Mosquitto website](https://mosquitto.org) |
|
||||||
| Murmur (Mumble server) | ✅ | `registry.gitlab.com/skobkin/docker-murmur` | Mumble VoIP server (custom build) | [Website](https://www.mumble.info), [Github](https://github.com/mumble-voip/mumble) |
|
| Murmur (Mumble server) | ✅ | `registry.gitlab.com/skobkin/docker-murmur` | Mumble VoIP server (custom build) | [Website](https://www.mumble.info), [Github](https://github.com/mumble-voip/mumble) |
|
||||||
| Ollama | ✅ | `ollama/ollama` | Toolkit for easily running LLM's locally. | [Website](https://ollama.com), [Github](https://github.com/ollama/ollama) |
|
| Ollama | ✅ | `ollama/ollama` | Toolkit for easily running LLM's locally. | [Website](https://ollama.com), [Github](https://github.com/ollama/ollama) |
|
||||||
| Open Streaming Platform | ✅ | `deamos/openstreamingplatform` | Live streaming platform. | [Website](https://openstreamingplatform.com), [Gitlab](https://gitlab.com/osp-group/flask-nginx-rtmp-manager) |
|
| Open Streaming Platform | ✅ | `deamos/openstreamingplatform` | Live streaming platform. | [Website](https://openstreamingplatform.com), [Gitlab](https://gitlab.com/osp-group/flask-nginx-rtmp-manager) |
|
||||||
|
|
16
mosquitto/.env.dist
Normal file
16
mosquitto/.env.dist
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
# Image version for Mosquitto with Go auth plugin
|
||||||
|
IMAGE_VERSION=latest
|
||||||
|
|
||||||
|
# External address binding for Mosquitto ports
|
||||||
|
BIND_ADDR=127.0.0.1
|
||||||
|
BIND_PORT_MQTT=1883
|
||||||
|
BIND_PORT_WS=1884
|
||||||
|
|
||||||
|
# Paths for configuration and data persistence
|
||||||
|
CONFIG_DIR=./config
|
||||||
|
DATA_DIR=./data
|
||||||
|
LOG_DIR=./logs
|
||||||
|
|
||||||
|
# Logging options
|
||||||
|
LOG_MAX_SIZE=5m
|
||||||
|
LOG_MAX_FILE=5
|
26
mosquitto/README.md
Normal file
26
mosquitto/README.md
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
# Usage
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
|
||||||
|
```shell
|
||||||
|
cp config/files/acls.dist config/files/acls
|
||||||
|
cp config/files/passwords.dist config/files/passwords
|
||||||
|
cp config/files/passwords.dist config/files/passwords
|
||||||
|
cp config/mosquitto.conf.dist config/mosquitto.conf
|
||||||
|
```
|
||||||
|
|
||||||
|
Edit configuration to suit your needs.
|
||||||
|
|
||||||
|
## Passwords
|
||||||
|
|
||||||
|
To generate password hashes, you can use `pw` tool located at the `/mosquitto/pw` inside the container.
|
||||||
|
|
||||||
|
```shell
|
||||||
|
docker compose exec mosquitto sh
|
||||||
|
/mosquitto/pw --help
|
||||||
|
/mosquitto/pw -p MyPasswordString
|
||||||
|
```
|
||||||
|
|
||||||
|
## ACL's
|
||||||
|
|
||||||
|
Refer to the [documentation](https://github.com/iegomez/mosquitto-go-auth?tab=readme-ov-file#acl-file).
|
3
mosquitto/config/.gitignore
vendored
Normal file
3
mosquitto/config/.gitignore
vendored
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
mosquitto.conf
|
||||||
|
files/passwords
|
||||||
|
files/acls
|
19
mosquitto/config/conf.d/go-auth.conf
Normal file
19
mosquitto/config/conf.d/go-auth.conf
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
# Path to the Go auth plugin shared object
|
||||||
|
auth_plugin /mosquitto/go-auth.so
|
||||||
|
|
||||||
|
# Configure the authentication backends (adjust as needed)
|
||||||
|
auth_opt_backends files
|
||||||
|
|
||||||
|
# Specify the paths for passwords and ACLs
|
||||||
|
# https://github.com/iegomez/mosquitto-go-auth?tab=readme-ov-file#files
|
||||||
|
# Hashes may be generated using the `/mosquitto/pw` utility
|
||||||
|
auth_opt_files_password_path /etc/mosquitto/files/passwords
|
||||||
|
auth_opt_files_acl_path /etc/mosquitto/files/acls
|
||||||
|
|
||||||
|
# Plugin-specific options (examples)
|
||||||
|
# https://github.com/iegomez/mosquitto-go-auth?tab=readme-ov-file#configuration
|
||||||
|
# auth_opt_postgres_host=db
|
||||||
|
# auth_opt_postgres_port=5432
|
||||||
|
# auth_opt_postgres_user=user
|
||||||
|
# auth_opt_postgres_password=password
|
||||||
|
# auth_opt_postgres_dbname=mqtt
|
12
mosquitto/config/files/acls.dist
Normal file
12
mosquitto/config/files/acls.dist
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
user test1
|
||||||
|
topic write test/topic/1
|
||||||
|
topic read test/topic/2
|
||||||
|
|
||||||
|
user test2
|
||||||
|
topic read test/topic/+
|
||||||
|
|
||||||
|
user test3
|
||||||
|
topic read test/#
|
||||||
|
|
||||||
|
pattern read test/%u
|
||||||
|
pattern read test/%c
|
2
mosquitto/config/files/passwords.dist
Normal file
2
mosquitto/config/files/passwords.dist
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
test1:PBKDF2$sha512$100000$2WQHK5rjNN+oOT+TZAsWAw==$TDf4Y6J+9BdnjucFQ0ZUWlTwzncTjOOeE00W4Qm8lfPQyPCZACCjgfdK353jdGFwJjAf6vPAYaba9+z4GWK7Gg==
|
||||||
|
test2:PBKDF2$sha512$100000$o513B9FfaKTL6xalU+UUwA==$mAUtjVg1aHkDpudOnLKUQs8ddGtKKyu+xi07tftd5umPKQKnJeXf1X7RpoL/Gj/ZRdpuBu5GWZ+NZ2rYyAsi1g==
|
18
mosquitto/config/mosquitto.conf.dist
Normal file
18
mosquitto/config/mosquitto.conf.dist
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
# Mosquitto configuration
|
||||||
|
persistence true
|
||||||
|
persistence_location /data/
|
||||||
|
log_dest file /logs/mosquitto.log
|
||||||
|
|
||||||
|
# Default listener for unencrypted connections
|
||||||
|
listener 1883
|
||||||
|
allow_anonymous false
|
||||||
|
|
||||||
|
# Optional TLS listener
|
||||||
|
listener 1884
|
||||||
|
# Uncomment and configure the following for TLS
|
||||||
|
# cafile /etc/mosquitto/ca_certificates/ca.crt
|
||||||
|
# certfile /etc/mosquitto/certs/server.crt
|
||||||
|
# keyfile /etc/mosquitto/certs/server.key
|
||||||
|
|
||||||
|
# Include directory for additional configuration files
|
||||||
|
include_dir /etc/mosquitto/conf.d
|
2
mosquitto/data/.gitignore
vendored
Normal file
2
mosquitto/data/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
/*
|
||||||
|
!/.gitignore
|
19
mosquitto/docker-compose.yml
Normal file
19
mosquitto/docker-compose.yml
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
services:
|
||||||
|
mosquitto:
|
||||||
|
image: "iegomez/mosquitto-go-auth:${IMAGE_VERSION:-latest}"
|
||||||
|
container_name: mosquitto
|
||||||
|
hostname: mosquitto
|
||||||
|
volumes:
|
||||||
|
- "${CONFIG_DIR:-./config}:/etc/mosquitto"
|
||||||
|
- "${DATA_DIR:-./data}:/data"
|
||||||
|
- "${LOG_DIR:-./logs}:/logs"
|
||||||
|
ports:
|
||||||
|
- "${BIND_ADDR:-127.0.0.1}:${BIND_PORT_MQTT:-1883}:1883"
|
||||||
|
- "${BIND_ADDR:-127.0.0.1}:${BIND_PORT_WS:-1884}:1884"
|
||||||
|
env_file: .env
|
||||||
|
restart: unless-stopped
|
||||||
|
logging:
|
||||||
|
driver: "json-file"
|
||||||
|
options:
|
||||||
|
max-size: "${LOG_MAX_SIZE:-5m}"
|
||||||
|
max-file: "${LOG_MAX_FILE:-5}"
|
2
mosquitto/logs/.gitignore
vendored
Normal file
2
mosquitto/logs/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
/*
|
||||||
|
!/.gitignore
|
Loading…
Reference in a new issue