diff --git a/.env b/.env index 56e98ff..3ff6859 100644 --- a/.env +++ b/.env @@ -2,14 +2,14 @@ API_SECRET=nyEX8BZ44KqTXeV2 # DB configuration DEVELOPMENT -API_PORT=8111 -API_RELEASE="Desenvolvimento" -DB_HOST=177.153.50.98 -DB_DRIVER=postgres -DB_USER=pcastdev -DB_PASSWORD=@407Smc837 -DB_NAME=pcastdev -DB_PORT=5432 +#API_PORT=8111 +#API_RELEASE="Desenvolvimento" +#DB_HOST=177.153.50.98 +#DB_DRIVER=postgres +#DB_USER=pcastdev +#DB_PASSWORD=@407Smc837 +#DB_NAME=pcastdev +#DB_PORT=5432 # DB configuration HOMOLOGAÇÃO #API_PORT=8111 @@ -22,11 +22,11 @@ DB_PORT=5432 #DB_PORT=5432 # DB configuration PRODUÇÃO -#API_PORT=8112 -#API_RELEASE="" -#DB_HOST=177.153.50.98 -#DB_DRIVER=postgres -#DB_USER=pcast -#DB_PASSWORD=@407Smc837 -#DB_NAME=pcast -#DB_PORT=5432 \ No newline at end of file +API_PORT=8112 +API_RELEASE="" +DB_HOST=177.153.50.98 +DB_DRIVER=postgres +DB_USER=pcast +DB_PASSWORD=@407Smc837 +DB_NAME=pcast +DB_PORT=5432 \ No newline at end of file diff --git a/api.exe~ b/api.exe~ deleted file mode 100644 index 7d95bad..0000000 Binary files a/api.exe~ and /dev/null differ diff --git a/controllers/webhookController.go b/controllers/webhookController.go index ce0445c..c5c0c37 100644 --- a/controllers/webhookController.go +++ b/controllers/webhookController.go @@ -47,7 +47,7 @@ func OnUpdate(c *fiber.Ctx) error { func OnSubStart(c *fiber.Ctx) error { p := new(models.Update) if err := c.BodyParser(p); err != nil { - log.Printf("Error Update: %s\n", err) + log.Printf("Error SubStart: %s\n", err) return err } @@ -64,6 +64,9 @@ func OnSubStart(c *fiber.Ctx) error { } func OnPubStart(c *fiber.Ctx) error { + // ================================================================ + // Called when a publisher starts streaming - Start of Transmission + // ================================================================ p := new(models.Pub) if err := c.BodyParser(p); err != nil { return err @@ -73,6 +76,9 @@ func OnPubStart(c *fiber.Ctx) error { } func OnPubStop(c *fiber.Ctx) error { + // ============================================================= + // Called when a publisher stops streaming - End of Transmission + // ============================================================= p := new(models.Pub) if err := c.BodyParser(p); err != nil { return err diff --git a/globals/globals.go b/globals/globals.go index 8aa09e0..6eece97 100644 --- a/globals/globals.go +++ b/globals/globals.go @@ -1,6 +1,6 @@ package globals var ( - API_VERSION = "1.0.20" + API_VERSION = "1.0.21" API_RELEASE = "" ) diff --git a/infra/mqtt.service b/infra/mqtt.service new file mode 100644 index 0000000..855f3b3 --- /dev/null +++ b/infra/mqtt.service @@ -0,0 +1,12 @@ +[Unit] +Description=Mqtt Broker +After=multi-user.target + +[Service] +WorkingDirectory=/root/mqtt/cmd +ExecStart=/root/mqtt/cmd/mqtt +Type=simple + +[Install] +WantedBy=multi-user.target +