1
0
forked from jchomaz/Vulture

Lancement en mode network plutot que pod

This commit is contained in:
2025-11-30 10:34:02 +01:00
parent 516ca23c5e
commit 6633ecbe70
7 changed files with 31 additions and 26 deletions

View File

@@ -18,11 +18,11 @@ mqtt {
}
listeners.tcp {
bind = "127.0.0.1:1883"
bind = "0.0.0.0:1883"
}
listeners.ws {
bind = "127.0.0.1:9001"
bind = "0.0.0.0:9001"
}
http_server {

View File

@@ -4,21 +4,28 @@ set -e
# Move to repository root
cd "$(dirname "$0")/.."
echo "Creating Pod vulture..."
# Check if pod exists to avoid error
if podman pod exists vulture; then
echo "Pod vulture already exists."
NETWORK_NAME="vulture-net"
echo "Creating network $NETWORK_NAME..."
if podman network exists $NETWORK_NAME; then
echo "Network $NETWORK_NAME already exists."
else
podman pod create --name vulture -p 8080:80 -p 1883:1883 -p 8081:8081 -p 8083:8083 -p 8883:8883 -p 9001:9001
podman network create $NETWORK_NAME
fi
echo "Starting NanoMQ..."
podman run -dt --rm --pod vulture --name nanomq -v ./VContainers/MQTT/config/nanomq.conf:/etc/nanomq.conf docker.io/emqx/nanomq:latest --conf /etc/nanomq.conf
# NanoMQ needs to expose ports for external access (e.g. VApp frontend) and be on the network for VNode
podman run -dt --rm --network $NETWORK_NAME --name nanomq \
-p 1883:1883 -p 9001:9001 -p 8081:8081 -p 8083:8083 -p 8883:8883 \
-v ./VContainers/MQTT/config/nanomq.conf:/etc/nanomq.conf \
docker.io/emqx/nanomq:latest --conf /etc/nanomq.conf
echo "Starting VNode..."
podman run -dt --rm --pod vulture --name vnode vnode:latest
# VNode connects to nanomq via the network, no ports needed on host unless for debugging
podman run -dt --rm --network $NETWORK_NAME --name vnode vnode:latest
echo "Starting VApp..."
podman run -dt --rm --pod vulture --name vapp vapp:latest
# VApp (nginx) needs port 80 exposed
podman run -dt --rm --network $NETWORK_NAME --name vapp -p 8080:80 vapp:latest
echo "All containers started."
echo "All containers started on network $NETWORK_NAME."

View File

@@ -5,7 +5,7 @@ podman stop vapp || echo "vapp not running"
podman stop vnode || echo "vnode not running"
podman stop nanomq || echo "nanomq not running"
echo "Removing pod..."
podman pod rm vulture || echo "Pod vulture not found"
echo "Removing network..."
podman network rm vulture-net || echo "Network vulture-net not found"
echo "Cleanup complete."

View File

@@ -2,7 +2,7 @@
const mqtt = require('mqtt');
// MQTT broker configuration
const brokerUrl = 'mqtt://localhost'; // Broker URL (change if needed)
const brokerUrl = 'mqtt://nanomq'; // Broker URL (change if needed)
const clientId = 'buzzer_manager';
const options = {
clientId,

View File

@@ -1,18 +1,17 @@
{
"services": {
"mqttHost": "mqtt://localhost",
"score":{
"MQTTconfig":{
"mqttHost": "mqtt://nanomq",
"score": {
"MQTTconfig": {
"mqttScoreTopic": "game/score",
"mqttScoreChangeTopic": "game/score/update"
}
},
"quizzcollector":{
"MQTTconfig":{
"quizzcollector": {
"MQTTconfig": {
"mqttQuizzCollectorListTopic": "game/quizz-collector/list",
"mqttQuizzCollectorCmdTopic": "game/quizz-collector/cmd"
}
}
}
}

View File

@@ -1,17 +1,16 @@
{
"hosts": {
"buzzers":{
"IP":{
"buzzers": {
"IP": {
"redBuzzerIP": "8.8.8.6",
"blueBuzzerIP": "8.8.8.8",
"greenBuzzerIP": "8.8.8.8",
"yellowBuzzerIP": "8.8.8.8"
},
"MQTTconfig":{
"mqttHost": "mqtt://localhost",
"MQTTconfig": {
"mqttHost": "mqtt://nanomq",
"mqttTopic": "buzzer/watcher"
}
}
}
}

View File

@@ -2,7 +2,7 @@
const mqtt = require('mqtt');
// Configuration du broker MQTT et de WLED
const brokerUrl = 'mqtt://localhost'; // Change ce lien si nécessaire
const brokerUrl = 'mqtt://nanomq'; // Change ce lien si nécessaire
const clientId = 'light_manager_wled';
const wledTopicBase = 'wled/all'; // Le topic de base pour ton ruban WLED
const options = {