fix(mqtt): ignored folders

This commit is contained in:
leandrofars 2024-03-12 12:06:31 -03:00
parent 1920b8b701
commit 745e7d6658
4 changed files with 92 additions and 2 deletions

View File

@ -1,4 +1,3 @@
cmd/mqtt
.DS_Store
*.db
auth.prod.json
@ -8,3 +7,4 @@ mochi
*.crt
*.key
*.local
./mqtt

View File

@ -0,0 +1,54 @@
{
"auth": [
{
"username": "leandro",
"password": "leandro",
"allow": true
},
{
"username": "steve",
"password": "steve",
"allow": true
},
{
"username": "root",
"password": "root",
"allow": true
},
{
"remote": "*",
"allow": false
},
{
"remote": "*",
"allow": false
}
],
"acl": [
{
"remote": "*"
},
{
"username": "leandro",
"filters": {
"oktopus/+/agent/+": 1,
"oktopus/+/controller/+": 2,
"oktopus/+/get/+": 2
}
},
{
"username": "steve",
"filters": {
"oktopus/+/agent/+": 1,
"oktopus/+/controller/+": 2,
"oktopus/+/get/+": 2
}
},
{
"username": "root",
"filters": {
"#": 3
}
}
]
}

View File

@ -0,0 +1,35 @@
package main
import (
"broker/internal/config"
"broker/internal/listeners"
"log"
"os"
"os/signal"
"syscall"
)
func main() {
done := make(chan os.Signal, 1)
conf := config.NewConfig()
signal.Notify(done, syscall.SIGINT, syscall.SIGTERM)
go listeners.StartServers(conf)
if conf.WsEnable {
log.Printf("websocket is running at port %s", conf.WsPort)
}
if conf.HttpEnable {
log.Printf("http is running at port %s", conf.HttpPort)
}
log.Printf("mqtt is running at port %s", conf.MqttPort)
<-done
log.Println("server is shutting down...")
}

View File

@ -0,0 +1 @@
go run . -path auth.json