fix(mqtt): ignored folders
This commit is contained in:
parent
1920b8b701
commit
745e7d6658
2
backend/services/mtp/mqtt/.gitignore
vendored
2
backend/services/mtp/mqtt/.gitignore
vendored
|
|
@ -1,4 +1,3 @@
|
||||||
cmd/mqtt
|
|
||||||
.DS_Store
|
.DS_Store
|
||||||
*.db
|
*.db
|
||||||
auth.prod.json
|
auth.prod.json
|
||||||
|
|
@ -8,3 +7,4 @@ mochi
|
||||||
*.crt
|
*.crt
|
||||||
*.key
|
*.key
|
||||||
*.local
|
*.local
|
||||||
|
./mqtt
|
||||||
54
backend/services/mtp/mqtt/cmd/mqtt/auth.json
Normal file
54
backend/services/mtp/mqtt/cmd/mqtt/auth.json
Normal 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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
35
backend/services/mtp/mqtt/cmd/mqtt/main.go
Normal file
35
backend/services/mtp/mqtt/cmd/mqtt/main.go
Normal 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...")
|
||||||
|
}
|
||||||
1
backend/services/mtp/mqtt/cmd/mqtt/run.sh
Normal file
1
backend/services/mtp/mqtt/cmd/mqtt/run.sh
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
go run . -path auth.json
|
||||||
Loading…
Reference in New Issue
Block a user