1
0
mirror of https://github.com/mainflux/mainflux.git synced 2025-04-24 13:48:49 +08:00

250 lines
9.1 KiB
Makefile
Raw Normal View History

# Copyright (c) Mainflux
# SPDX-License-Identifier: Apache-2.0
MF-571 - Elm UI (#632) * Initial commit Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Add user create form Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Add Makefile and README Signed-off-by: Ivan Milošević <iva@blokovi.com> Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Remove elm-stuff Signed-off-by: Ivan Milošević <iva@blokovi.com> Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Add url parsing Signed-off-by: Ivan Milošević <iva@blokovi.com> Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Add channels retrive and remove Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Refactor request f and add f annotations Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Add things provision Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Add thing retrieve and remove Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Rename Channel.elm methods Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Fix trailing slash and add url constants Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Add module User with separate model, view and update Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Modularize channels Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Modularize version and things Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Refactor module methods Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Modularize messaging Signed-off-by: Ivan Milošević <iva@blokovi.com> Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Add channel pagination Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Fix initial channel model Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Add access control (connect and disconnect things from channel) Signed-off-by: Ivan Milošević <iva@blokovi.com> Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Add pagination to Things Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Using Url.Builder in connection and messaging Rename Acces module to Connection Rename attribute in Bootstrap code Remove debug logging Signed-off-by: Ivan Milošević <iva@blokovi.com> Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Add login Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Add dynamic menu Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Fix empty name channel/thing bug Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Remove menu from login screen and add response helper Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Add version, channels, things direct display Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Add channels table Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Change var names and add refreshChannelList helper Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Add Things list Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Fix response behavior Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Remove version page button Signed-off-by: drasko <drasko.draskovic@gmail.com> Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Move everything to ui folder Signed-off-by: drasko <drasko.draskovic@gmail.com> Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Remove dashflux Signed-off-by: drasko <drasko.draskovic@gmail.com> Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * MF-571 Add things and channels lists to Connection module (#580) * Add thing and channel lists to Connection module Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Fix form reset bug & remember checkbox status in Connection module Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * MF-571 - Add batch things-channels connection modification (#588) * Add batch things-channels connection modification Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Remove unused token arg and reposition buttons Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * NOISSUE - messaging in UI (#578) * Add thing and channel lists to Connection module Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * init commit Signed-off-by: Ivan Milošević <iva@blokovi.com> * list channels and things Signed-off-by: Ivan Milošević <iva@blokovi.com> * list channels with radio buttons Signed-off-by: Ivan Milošević <iva@blokovi.com> * Listing channels for selected thing Signed-off-by: Ivan Milošević <iva@blokovi.com> * fix list channels for selected thing Signed-off-by: Ivan Milošević <iva@blokovi.com> * Use records instead of hardcode values Use genFormField from Helpers Remove dead comments Signed-off-by: Ivan Milošević <iva@blokovi.com> Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * NOISSUE - Add Docker build for UI (#582) * Add Docker build for UI Signed-off-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com> * Fix entrypoint and ports Signed-off-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com> * Add NginX server. Fix port. Signed-off-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com> Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * NOISSUE - Fix layout and add custom CSS (#593) * Fix layout and add custom CSS Signed-off-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com> * Remove comments, add copyright headers Signed-off-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com> * Add newline at the end of the css file Signed-off-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com> Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * NOISSUE -update message module (#599) * Update message module Sending message as selected thing to multiple channels Signed-off-by: Ivan Milošević <iva@blokovi.com> * Rename token to thingkey Signed-off-by: Ivan Milošević <iva@blokovi.com> * Reset model on send message and reset list of channels on selecting thing Signed-off-by: Ivan Milošević <iva@blokovi.com> Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Remove logout button and add logout header (#604) * Remove logout button and add logout header * Removed dead code. Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * MF-571 - Pagination (#606) * Add total # things to Thing model Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Add basic pagination for Thing Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Add pagination helper function & Channel pagination Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * NOISSUE - Add bootstrap cards in version view (#607) * Add total # things to Thing model Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Add basic pagination for Thing Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Add bootstrap cards in version view Signed-off-by: Ivan Milošević <iva@blokovi.com> * Add pagination helper function & Channel pagination Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * modify styling Signed-off-by: Ivan Milošević <iva@blokovi.com> * Styling Signed-off-by: Ivan Milošević <iva@blokovi.com> * Mainflux logo Signed-off-by: Ivan Milošević <iva@blokovi.com> Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Revert "NOISSUE - Add bootstrap cards in version view (#607)" This reverts commit a9a4dd7c730de453c45b64b51712c81e9befbeec. Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Pagination (#613) Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * MF-571 - Add dashboard (#614) * Add Dashboard module and simplify Main module Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Remove unused code and Version module Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Add helper funcs to Main.elm update method Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Improve Main and Message module organization Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Add dashboard Things and Channels buttons Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Add Modal to edit thing Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Add RemoveThing msg and AwesomeFont Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Unify provision and retrieve request Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Reorganize code by making funcs and code repositioning Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Add fon-awesome 5.* support Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Add metadata edit Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Remove table header add thing and removed dead code Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * MF-571 - UI modal buttons (#617) * Add Dashboard module and simplify Main module Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Remove unused code and Version module Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Add helper funcs to Main.elm update method Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Improve Main and Message module organization Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Add dashboard Things and Channels buttons Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Add Modal to edit thing Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Add RemoveThing msg and AwesomeFont Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Unify provision and retrieve request Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Reorganize code by making funcs and code repositioning Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Add fon-awesome 5.* support Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Add metadata edit Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Remove table header add thing and removed dead code Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Add complete Thing edit modal buttons Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Add card style to channels (#618) Add dropdown user menu Add font awesome to main menu Signed-off-by: Ivan Milošević <iva@blokovi.com> Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * MF-571 - UI Thing module with modals (#620) * Add Thing provision modal Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Add app/dev dropdown to Thing provision modal Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Refactor Thing to have separate Update and Provision msg handling Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Remove fontAwesome import and fix Dict import Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * MF-571 - UI channel modals (#621) * Add Thing provision modal Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Add app/dev dropdown to Thing provision modal Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Refactor Thing to have separate Update and Provision msg handling Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Remove fontAwesome import and fix Dict import Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Add provision and edit modals to Channel Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Add HttpMF http custom library Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Add ModalMF Bootstrap modal custom library Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Moved all http funcs to HttpMF Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Moved expect funcs from Connection and Message to HttpMF Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Add cards and change tables (#622) * Change type of tables Add tables to cards Colorize buttons Signed-off-by: Ivan Milošević <iva@blokovi.com> * remove comments Signed-off-by: Ivan Milošević <iva@blokovi.com> Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * MF-571 - Fix user login and refactor User (#623) * Fix user login and refactor User Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Remove redundant Grid.row nesting Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Fix links in README (#624) Signed-off-by: Ivan Milošević <iva@blokovi.com> Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Fix ui/Makefile and ui/README.md Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Add copyright header to .elm files Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Fix missing README.md after migration Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Fix typo Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Add install options to README.md Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com> * Rename Url to URL and Id to ID Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>
2019-03-06 16:21:09 +01:00
MF_DOCKER_IMAGE_NAME_PREFIX ?= mainflux
BUILD_DIR = build
NOISSUE - Switch to Google Zanzibar Access control approach (#1919) * Return Auth service Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Update Compose to run with SpiceDB and Auth svc Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Update auth gRPC API Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Remove Users' policies Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Move Groups to internal Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Use shared groups in Users Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Remove unused code Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Use pkg Groups in Things Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Remove Things groups Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Make imports consistent Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Update Groups networking Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Remove things groups-specific API Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Move Things Clients to the root Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Move Clients to Users root Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Temporarily remove tracing Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Fix imports Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Add buffer config for gRPC Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Update auth type for Things Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Use Auth for login Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Add temporary solution for refresh token Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Update Tokenizer interface Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Updade tokens issuing Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Fix token issuing Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Update JWT validator and refactor Tokenizer Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Rename access timeout Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Rename login to authenticate Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Update Identify to use SubjectID Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Add Auth to Groups Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Use the Auth service for Groups Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Update auth schema Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Fix Auth for Groups Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Add auth for addons (#14) Signed-off-by: Arvindh <arvindh91@gmail.com> Speparate Login and Refresh tokens Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Merge authN and authZ requests for things Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Add connect and disconnect Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Update sharing Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Fix policies addition and removal Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Update relation with roels Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Add gRPC to Things Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Assign and Unassign members to group and Listing of Group members (#15) * add auth for addons Signed-off-by: Arvindh <arvindh91@gmail.com> * add assign and unassign to group Signed-off-by: Arvindh <arvindh91@gmail.com> * add group incomplete repo implementation Signed-off-by: Arvindh <arvindh91@gmail.com> * groups for users Signed-off-by: Arvindh <arvindh91@gmail.com> * groups for users Signed-off-by: Arvindh <arvindh91@gmail.com> * groups for users Signed-off-by: Arvindh <arvindh91@gmail.com> * groups for users Signed-off-by: Arvindh <arvindh91@gmail.com> --------- Signed-off-by: Arvindh <arvindh91@gmail.com> Move coap mqtt and ws policies to spicedb (#16) Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> Remove old policies Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> NOISSUE - Things authorize to return thingID (#18) This commit modifies the authorize endpoint to the grpc endpoint to return thingID. The authorize endpoint allows adapters to get the publisher of the message. Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> Add Groups to users service (#17) * add assign and unassign to group Signed-off-by: Arvindh <arvindh91@gmail.com> * add group incomplete repo implementation Signed-off-by: Arvindh <arvindh91@gmail.com> * groups for users Signed-off-by: Arvindh <arvindh91@gmail.com> * groups for users Signed-off-by: Arvindh <arvindh91@gmail.com> * groups for users Signed-off-by: Arvindh <arvindh91@gmail.com> * groups for users Signed-off-by: Arvindh <arvindh91@gmail.com> * groups for users stable 1 Signed-off-by: Arvindh <arvindh91@gmail.com> * groups for users stable 2 Signed-off-by: Arvindh <arvindh91@gmail.com> * groups for users & things Signed-off-by: Arvindh <arvindh91@gmail.com> * Amend signature Signed-off-by: Arvindh <arvindh91@gmail.com> * fix merge error Signed-off-by: Arvindh <arvindh91@gmail.com> --------- Signed-off-by: Arvindh <arvindh91@gmail.com> Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * NOISSUE - Fix es code (#21) Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * NOISSUE - Fix Bugs (#20) * fix bugs Signed-off-by: Arvindh <arvindh91@gmail.com> * fix bugs Signed-off-by: Arvindh <arvindh91@gmail.com> --------- Signed-off-by: Arvindh <arvindh91@gmail.com> Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * NOISSUE - Test e2e (#19) * fix: connect method Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> * fix: e2e Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> * fix changes in sdk and e2e Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> * feat(docker): remove unnecessary port mapping Remove the port mapping for MQTT broker in the docker-compose.yml file. Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> * Enable group listing Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> * feat(responses): update ChannelsPage struct The ChannelsPage struct in the responses.go file has been updated. The "Channels" field has been renamed to "Groups" to provide more accurate naming. This change ensures consistency and clarity in the codebase. Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> * feat(things): add UpdateClientSecret method Add the UpdateClientSecret method to the things service. This method allows updating the client secret for a specific client identified by the provided token, id, and key parameters. Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> --------- Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * Use smaller buffers for gRPC Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * Clean up tests (#22) Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * Add Connect Disconnect endpoints (#23) * fix bugs Signed-off-by: Arvindh <arvindh91@gmail.com> * fix bugs Signed-off-by: Arvindh <arvindh91@gmail.com> * fix list of things in a channel and Add connect disconnect endpoint Signed-off-by: Arvindh <arvindh91@gmail.com> * fix list of things in a channel and Add connect disconnect endpoint Signed-off-by: Arvindh <arvindh91@gmail.com> --------- Signed-off-by: Arvindh <arvindh91@gmail.com> Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * Add: Things share with users (#25) * fix list of things in a channel and Add connect disconnect endpoint Signed-off-by: Arvindh <arvindh91@gmail.com> * add: things share with other users Signed-off-by: Arvindh <arvindh91@gmail.com> --------- Signed-off-by: Arvindh <arvindh91@gmail.com> Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * NOISSUE - Rename gRPC Services (#24) * Rename things and users auth service Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> * docs: add authorization docs for gRPC services Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> * Rename things and users grpc services Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> * Remove mainflux.env package Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> --------- Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * Add: Listing of things, channels, groups, users (#26) * add: listing of channels, users, groups, things Signed-off-by: Arvindh <arvindh91@gmail.com> * add: listing of channels, users, groups, things Signed-off-by: Arvindh <arvindh91@gmail.com> * add: listing of channels, users, groups, things Signed-off-by: Arvindh <arvindh91@gmail.com> * add: listing of channels, users, groups, things Signed-off-by: Arvindh <arvindh91@gmail.com> --------- Signed-off-by: Arvindh <arvindh91@gmail.com> Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * NOISSUE - Clean Up Users (#27) * feat(groups): rename redis package to events - Renamed the `redis` package to `events` in the `internal/groups` directory. - Updated the file paths and names accordingly. - This change reflects the more accurate purpose of the package and improves code organization. Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> * feat(auth): Modify identity method Change request and response of identity method Add accessToken and refreshToken to Token response Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> * clean up users, remove dead code Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> * feat(users): add unit tests for user service This commit adds unit tests for the user service in the `users` package. The tests cover various scenarios and ensure the correct behavior of the service. Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> --------- Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * Add: List of user groups & removed repeating code in groups (#29) * removed repeating code in list groups Signed-off-by: Arvindh <arvindh91@gmail.com> * add: list of user group Signed-off-by: Arvindh <arvindh91@gmail.com> * fix: otel handler operator name for endpoints Signed-off-by: Arvindh <arvindh91@gmail.com> --------- Signed-off-by: Arvindh <arvindh91@gmail.com> Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * NOISSUE - Clean Up Things Service (#28) * Rework things service Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> * add tests Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> --------- Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * NOISSUE - Clean Up Auth Service (#30) * clean up auth service Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> * feat(auth): remove unused import Remove the unused import of `emptypb` in `auth.pb.go`. This import is not being used in the codebase and can be safely removed. Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> --------- Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * NOISSUE - Update API docs (#31) Signed-off-by: rodneyosodo <blackd0t@protonmail.com> Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * Remove TODO comments and cleanup the code Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * Update dependenices Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> --------- Signed-off-by: Arvindh <arvindh91@gmail.com> Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> Signed-off-by: rodneyosodo <blackd0t@protonmail.com> Co-authored-by: b1ackd0t <28790446+rodneyosodo@users.noreply.github.com> Co-authored-by: Arvindh <30824765+arvindh123@users.noreply.github.com>
2023-10-15 22:02:13 +02:00
SERVICES = auth users things http coap ws lora influxdb-writer influxdb-reader mongodb-writer \
mongodb-reader cassandra-writer cassandra-reader postgres-writer postgres-reader timescale-writer timescale-reader cli \
MF-1506 - Group-based Access Control (#1716) * Move Things and Users to Clients Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Signed-off-by: rodneyosodo <blackd0t@protonmail.com> Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * NOISSUE - Update Add and Delete Policies (#1792) * Remove Policy Action Ranks Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Fix Rebase Issues Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Fix CI Test Errors Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Adding Check on Subject For Clients Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Remove Check Client Exists Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Check When Sharing Clients Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Only Add User to Group When Sharing Things Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Remove clientType Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Minor Fix on ShareClient and Fix Tests Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Fix Policies Tests Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Clean Up Things Authorization Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Fix Tests on RetrieveAll Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Test ShareThing Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Fix Merge Conflicts Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Remove Adding Policies. Only Use Ownership Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Check If Subject is same as Object Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Move Back To Union As Sometimes Policy is Empty and Fails to Evaluate on Ownership Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Fix Entity Type For Failing Tests Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Fix BUG in policy evaluation Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Fix Tests Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Add Comments Regarding checkAdmin Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Fix Tests On Rebase Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Combine Authorize For Things and Users Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Fix Tests On Rebase Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Error on Things SVC `unsupported protocol scheme` Signed-off-by: rodneyosodo <blackd0t@protonmail.com> --------- Signed-off-by: rodneyosodo <blackd0t@protonmail.com> Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * Fix Bug on Things Authorization Cache (#1810) Signed-off-by: rodneyosodo <blackd0t@protonmail.com> Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * Use Password instead of username in MQTT handler Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * Simplify MQTT authorization Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * Fix MQTT tests Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * NOISSUE - Add More Functions to SDK (#1811) * Add More Functions to SDK Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Add Examples to GoDoc Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Update Unassign Interface Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Pass Subject as ID and Not Token on List Channels By Thing Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Fix Bootstrap Errors For Element Check Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Add empty line Before Return Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Reorder URLS in things mux Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Fix Listing Things Policies Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Fix Share Thing Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Add Examples to CLI Docs Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Fix Update Identity To Update Another User Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Fix Identify an Update Policies on Things Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Fix Update Things Policies Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Fix GoDocs on Disconnect Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Fix Tests Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Change Authorize To Use AccessRequest Signed-off-by: rodneyosodo <blackd0t@protonmail.com> --------- Signed-off-by: rodneyosodo <blackd0t@protonmail.com> Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * For Evaluate Policy Use AccessRequest (#1814) Signed-off-by: rodneyosodo <blackd0t@protonmail.com> Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * NOISSUE - Add SDK Tests (#1812) * Add Things Tests Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Add Channel Tests Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Add Certs Tests Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Add Consumer Tests Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Enrich Group Tests Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Add Tests For Health Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Add Tests For Tokens Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Rename SDK for Tests Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Add Policies Tests Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Fix Linter Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Fix Tests Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Make Variable Defination Inline Signed-off-by: rodneyosodo <blackd0t@protonmail.com> --------- Signed-off-by: rodneyosodo <blackd0t@protonmail.com> Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * NOISSUE - Make Cache Key Duration Configurable (#1815) * Make Cache Key Duration Configurable Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Rename ENV Var Signed-off-by: rodneyosodo <blackd0t@protonmail.com> --------- Signed-off-by: rodneyosodo <blackd0t@protonmail.com> Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * NOISSUE - Update GoDocs (#1816) * Add GoDocs Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Add Missing GoDoc Files Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Enable godot Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Add License Information Signed-off-by: rodneyosodo <blackd0t@protonmail.com> --------- Signed-off-by: rodneyosodo <blackd0t@protonmail.com> Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * NOISSUE - Add Call Home Client to Mainflux services (#1751) * Move Things and Users to Clients Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Signed-off-by: rodneyosodo <blackd0t@protonmail.com> Signed-off-by: SammyOina <sammyoina@gmail.com> * collect and send data package Signed-off-by: SammyOina <sammyoina@gmail.com> * create telemetry migrations Signed-off-by: SammyOina <sammyoina@gmail.com> * add telemetry endpoints Signed-off-by: SammyOina <sammyoina@gmail.com> * add transport Signed-off-by: SammyOina <sammyoina@gmail.com> * create service Signed-off-by: SammyOina <sammyoina@gmail.com> * remove homing server Signed-off-by: SammyOina <sammyoina@gmail.com> * add call home to adapters Signed-off-by: SammyOina <sammyoina@gmail.com> * add last seen Signed-off-by: SammyOina <sammyoina@gmail.com> * rename logger Signed-off-by: SammyOina <sammyoina@gmail.com> * remove homing client Signed-off-by: SammyOina <sammyoina@gmail.com> * use unmerged repo Signed-off-by: SammyOina <sammyoina@gmail.com> * use renamed module Signed-off-by: SammyOina <sammyoina@gmail.com> * update call home version Signed-off-by: SammyOina <sammyoina@gmail.com> * edit documentation Signed-off-by: SammyOina <sammyoina@gmail.com> * align table Signed-off-by: SammyOina <sammyoina@gmail.com> * use alias for call home client Signed-off-by: SammyOina <sammyoina@gmail.com> * update callhome Signed-off-by: SammyOina <sammyoina@gmail.com> * update call home pkg Signed-off-by: SammyOina <sammyoina@gmail.com> * update call home Signed-off-by: SammyOina <sammyoina@gmail.com> * fix modules Signed-off-by: SammyOina <sammyoina@gmail.com> * use mf build version Signed-off-by: SammyOina <sammyoina@gmail.com> * use mf build version Signed-off-by: SammyOina <sammyoina@gmail.com> * restore default Signed-off-by: SammyOina <sammyoina@gmail.com> * add call home for users and things Signed-off-by: SammyOina <sammyoina@gmail.com> * enable opting on call home Signed-off-by: SammyOina <sammyoina@gmail.com> * remove full stops Signed-off-by: SammyOina <sammyoina@gmail.com> * update callhome client Signed-off-by: SammyOina <sammyoina@gmail.com> * add call home to all services Signed-off-by: SammyOina <sammyoina@gmail.com> * fix build Signed-off-by: SammyOina <sammyoina@gmail.com> * restore sdk tests Signed-off-by: SammyOina <sammyoina@gmail.com> * remove unnecessary changes Signed-off-by: SammyOina <sammyoina@gmail.com> * restore health_test.go Signed-off-by: SammyOina <sammyoina@gmail.com> --------- Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Signed-off-by: rodneyosodo <blackd0t@protonmail.com> Signed-off-by: SammyOina <sammyoina@gmail.com> Co-authored-by: b1ackd0t <blackd0t@protonmail.com> Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> --------- Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Signed-off-by: rodneyosodo <blackd0t@protonmail.com> Signed-off-by: SammyOina <sammyoina@gmail.com> Co-authored-by: b1ackd0t <blackd0t@protonmail.com> Co-authored-by: Sammy Kerata Oina <44265300+SammyOina@users.noreply.github.com>
2023-06-14 12:40:37 +02:00
bootstrap opcua twins mqtt provision certs smtp-notifier smpp-notifier
DOCKERS = $(addprefix docker_,$(SERVICES))
DOCKERS_DEV = $(addprefix docker_dev_,$(SERVICES))
CGO_ENABLED ?= 0
GOARCH ?= amd64
MF-1308 - Use IETF Health Check standard (#1541) * MF-1308 - Use IETF Health Check standard Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add nginx health endpoint Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rm github.com/nelkinda dependency Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Check error Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Replace Version by Health in the CLI and SDK Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix typo Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Use new build flag go:build Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Revert wrong renaming Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * sdk health test Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add /health endpoint to openapi doc Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Use const for description message Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add version and build time during build Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Time format Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add version and commit using git and build args Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add comments Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add tests Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add missing api properties Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix api Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Use ./schemas/HealthInfo.yml as Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix example Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Use content type application/health+json Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Set Makefile variables only if empty Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix typo Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2022-01-24 21:18:53 +01:00
VERSION ?= $(shell git describe --abbrev=0 --tags)
COMMIT ?= $(shell git rev-parse HEAD)
TIME ?= $(shell date +%F_%T)
USER_REPO ?= $(shell git remote get-url origin | sed -e 's/.*\/\([^/]*\)\/\([^/]*\).*/\1_\2/' )
BRANCH ?= $(shell git rev-parse --abbrev-ref HEAD 2>/dev/null || git describe --tags --abbrev=0 2>/dev/null )
empty:=
space:= $(empty) $(empty)
# Docker compose project name should follow this guidelines: https://docs.docker.com/compose/reference/#use--p-to-specify-a-project-name
DOCKER_PROJECT ?= $(shell echo $(subst $(space),,$(USER_REPO)_$(BRANCH)) | tr -c -s '[:alnum:][=-=]' '_' | tr '[:upper:]' '[:lower:]')
DOCKER_COMPOSE_COMMANDS_SUPPORTED := up down config
DEFAULT_DOCKER_COMPOSE_COMMAND := up
GRPC_MTLS_CERT_FILES_EXISTS = 0
NOISSUE - Make MQTT Broker Configurable (#1904) * Minor changes on mqtt publisher using nats Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Remove vernemq dependencies Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Restore VerneMQ config files Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Fix Makefile to support custom Docker profiles The Makefile has been updated to support custom Docker profiles. Previously, the Makefile only supported the default profiles for the message broker and MQTT broker. Now, the Makefile allows for custom profiles to be specified using environment variables. If the MF_BROKER_TYPE or MF_MQTT_BROKER_TYPE variables are not set, the default values "nats" and "nats" will be used, respectively. This change enables more flexibility in configuring the Docker environment for the project. The `run` target has also been modified to use the correct broker configuration file based on the MF_BROKER_TYPE variable. The sed command in the `run` target now replaces the placeholder in the docker/docker-compose.yml file with the appropriate broker configuration file. This commit improves the Makefile to support custom Docker profiles and ensures the correct broker configuration file is used when running the project. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Fix queue binding issue in RabbitMQ pubsub The commit fixes an issue in the RabbitMQ pubsub implementation where the queue binding was not correctly set up. Instead of using the topic as the queue name, the commit now uses a unique client ID generated by combining the topic and subscriber ID. This ensures that each subscriber has its own dedicated queue. The commit also updates the queue binding to use the correct queue name. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Refactor Docker config editing in Makefile The commit refactors the `edit_docker_config` function in the Makefile to improve readability and maintainability. The changes include: - Removing unnecessary conditionals related to the `rabbitmq` broker These changes ensure that the Docker configuration is correctly updated based on the specified MQTT broker type. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Fix failing tests on RabbitMQ Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Refactor MQTT_BROKER comment in docker-compose.yml The MQTT_BROKER comment in the docker-compose.yml file has been updated to provide a more accurate description of its functionality. The comment now states that the MQTT_BROKER handles MQTT communication between MQTT adapters and the message broker, instead of Mainflux services. This change improves clarity and aligns with the actual purpose of the MQTT_BROKER. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Rename `MF_BROKER` to `MF_MESSAGE_BROKER` The Makefile and Semaphore configuration files have been refactored to update the variable names related to the message broker type. These changes ensure consistency and clarity in the codebase by using more descriptive variable names related to the message broker type. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Fix Docker profile configuration for nats_rabbitmq Update the Docker profile configuration for nats_rabbitmq by replacing the NATS URL in the .env file with the correct value. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Rename MF_BROKER_URL to MF_MESSAGE_BROKER_URL Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Fix MQTT QoS level in pubsub.go The MQTT QoS level in the pubsub.go file was set to 1, which is the default level. However, since NATS supports up to QoS 1, I updated the QoS level comment to reflect this. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Refactor NewPublisher to accept QoS parameter The NewPublisher function in the pkg/messaging/mqtt/publisher.go file has been refactored to accept a new parameter, qos, which represents the Quality of Service level for MQTT message publishing. This change allows for more flexibility in configuring the MQTT publisher. The NewPublisher function now has the following signature: ```go func NewPublisher(address string, qos uint8, timeout time.Duration) (messaging.Publisher, error) ``` This change ensures that the MQTT publisher can be created with the desired QoS level, enhancing the reliability and delivery guarantees of the published messages. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Fix test assertions in pubsub_test.go The test assertions in the pubsub_test.go file were incorrect. This commit fixes the assertions to properly compare the expected and received message values. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Test configurable MQTT broker Signed-off-by: rodneyosodo <blackd0t@protonmail.com> --------- Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> Signed-off-by: rodneyosodo <blackd0t@protonmail.com>
2023-10-19 22:01:09 +03:00
DOCKER_PROFILE ?= $(MF_MQTT_BROKER_TYPE)_$(MF_MESSAGE_BROKER_TYPE)
ifneq ($(MF_MESSAGE_BROKER_TYPE),)
MF_MESSAGE_BROKER_TYPE := $(MF_MESSAGE_BROKER_TYPE)
NOISSUE - RabbitMQ build and deployment (#1570) * Initial commit of adding rabbitmq broker Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Initial commit of adding rabbitmq broker Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Initial commit for tests Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Bump up tests Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Add more tests Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Add go routines Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Initial commit of adding rabbitmq broker Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Initial commit of adding rabbitmq broker Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Initial commit for tests Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Bump up tests Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Add more tests Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Add go routines Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Fix tests Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Fix with wait groups Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * unsubscribe to stop delivering messages Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Remove exclusivity Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Implement cancel mechanisms Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Queuename as parameter Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Queuename as parameter Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Initial commit Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Remove broker type Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Configure broker with makefile Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Check if we have changed MESSAGE_BROKER_FILE~ Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Set nats automatically Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Catching null and invalid broker type Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Remove unused fmt Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Fix tests Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Nats Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * unexport constants Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Change routingkey Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Remove wait groups Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * protecting map Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Add publisher to pubsub Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Change proto library Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Fix typos Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Reduce pubsub tests based on implementation Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Remove channel cancel Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Export constant Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Embedding publisher into pubsub Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Naming publisher Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Update rabbitmq subscriber interface Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * using publisher composition Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Change contenttype Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * rename topic for publish and subscribe Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Change errors to lower case Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Change errors to lower case Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * export errors Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * queue per subscription Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * queue per subscription Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Merge branch 'master' into RabbitMQ-deployment Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * rename nats to broker Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Change routing method Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Direct method with one exchange to many queues, one consumer per queue Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * MF-1263 - Move repeating errors to the separate package (#1540) * MF-1263 - Mv duplicated errors to pkg/errors Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Revert test build flags Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix merge Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix comment Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * NOISSUE - Fix auth members list response (#1555) * NOISSUE - Fix auth members list response Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Move group type next to page details Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rm membersRes Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix typo Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * MF-1261 - Use StatusUnauthorized for authn and StatusForbidden for authz (#1538) * MF-1261 - Use StatusUnauthorized for authn and StatusForbidden for authz Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * ErrExternalKey typo Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rename ErrUnauthorizedAcces -> ErrAuthentication Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix bootstrap error Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix status code in openapi Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix test description Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix test description Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix test description Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add errors cases Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix status codes Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add gRPC stutus code Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix tests description Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix openapi and encodeError Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix grpc message Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix test descriptions Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Revert sdk error Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix typo Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * MF-1059 - Add TLS support for email (#1560) * Use gomail package for sending emails Signed-off-by: Ivan Milosevic <iva@blokovi.com> * remove print err Signed-off-by: Ivan Milosevic <iva@blokovi.com> * Add vendor Signed-off-by: Ivan Milosevic <iva@blokovi.com> * Rename email structure remove logger Signed-off-by: Ivan Milosevic <iva@blokovi.com> * typo in var name Signed-off-by: Ivan Milosevic <iva@blokovi.com> * rename var Signed-off-by: Ivan Milosevic <iva@blokovi.com> * remove MF_EMAIL_SECRET Signed-off-by: Ivan Milosevic <iva@blokovi.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * NOISSUE - Refactor MQTT subscriber (#1561) * correct suscriber interface validator + refactore token error handling Signed-off-by: tzzed <zerouali.t@gmail.com> * apply review suggestion Signed-off-by: tzzed <zerouali.t@gmail.com> Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * MF-1257 - Access messages from readers endpoint with user access token (#1470) * remove owner id Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add user auth for db reader Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * add user auth for db reader Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * enable mongodb reader for user token reading Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * use uuid check for auth switch between thing key and user tok Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * enable user token reading Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * revert to correct version Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * fix endpoint test, add additional tests Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * remove logs,dead code Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * fix logging messages Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * remove auth interface, add authorization header type Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * update api doc Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * remove unused package Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * some refactor of cases for authorization switch Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * correct description in openapi Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * fix endpoint test to match auth service change Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * some rename Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * initialize auth url Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * add env variables for auth service Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * fix spelling Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * Things prefix and no prefix for Thing authorization, Bearer for user Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * update readme file Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * fix default things grpc port Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * enable user reading for timescaledb Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * remove not used error Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * improve errors Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * refactor authorize Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * add chanID check Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * inline some error checking Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * fixing errors Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * fixing errors Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * improve test case description Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * remove test code Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * dont inline Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * refactor a bit encodeError Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * remove unused error Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * remove unused error Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * fix things auth grpc url Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * rename variables for header prefix Signed-off-by: mteodor <mirko.teodorovic@gmail.com> Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Initial commit of adding rabbitmq broker Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Initial commit of adding rabbitmq broker Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Initial commit for tests Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Bump up tests Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Add more tests Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Add go routines Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Initial commit of adding rabbitmq broker Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Initial commit for tests Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Bump up tests Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Add more tests Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Add go routines Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Fix tests Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Fix with wait groups Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * unsubscribe to stop delivering messages Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Remove exclusivity Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * MF-1551 - Fix Cobra usage commands and clean unnecessary struct types (#1558) * MF-1551 - Fix Cobra usage commands and clean unnecessary struct types Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Use linux syntax for cmd usage description Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix typo Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix cmd.Use Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * NOISSUE - Separate Keto hosts for read and write (#1563) * Separate keto hosts for read and write Signed-off-by: Ivan Milosevic <iva@blokovi.com> * update readme with new envars Signed-off-by: Ivan Milosevic <iva@blokovi.com> * rename read connection name Signed-off-by: Ivan Milosevic <iva@blokovi.com> Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> Co-authored-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Update dependencies (#1564) Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * MF-1240 - Return to service transport layer only service errors (#1559) * MF-1240 - Return to service transport layer only service errors Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Remove unecessary errors Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rm duplicated errors and fix transport Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Revert http endpoint_test Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix conflict Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Implement cancel mechanisms Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Queuename as parameter Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Queuename as parameter Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * MF-1469 - Indicate proper authentication scheme in Authorization header (#1523) * MF-1469 - Indicate proper authentication scheme in Authorization header Signed-off-by: Stefan Kovacevic <jen2tri@gmail.com> * Fixing the remarks on the last push Signed-off-by: Stefan Kovacevic <jen2tri@gmail.com> * Remove Bearer prefix in all services and fix tests Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix remarks Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> Co-authored-by: Manuel Imperiale <manuel.imperiale@gmail.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * NOISSUE - Add nats wrapper for COAP (#1569) * Add nats wrapper for COAP Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Pass pubsub as argument Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Defer close connection Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Defer close connection Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Rename endpoint to topic Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * MF-1348 - Add transport errors logging (#1544) * MF-1348 - Add go-kit transport level logging Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix merge Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix remark Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix go test flags Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Use httputil errors in things and http service Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix SDK tests Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Use httputil errors in certs and provision service Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Use httputil errors in consumers service Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * General renaming and add ErrMissingToken Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rename httputil -> apiutil and use errors in users servive Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Use apiutil errors in auth, bootstrap, readers, things and twins Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Replace errors.Contain by comparison Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix remarks Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Simplify validateID Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Simplify validateID Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Simplify and rename ExtractAuthToken -> ExtractBearerToken Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix readers Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix auth key test and remarks Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Improve comment Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Simplify validateUUID check Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix typo Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * MF-1567 - Use Bearer, Thing or Basic scheme in Authorization header (#1568) Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * MF-1565 - Document Bearer, Thing and Basic Authorization header (#1566) * MF-1565 - Document Bearer Authorization header Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix auth, bootstrap, http and readers openapi Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix openapi Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add enc key for bootstrap Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix typo Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Use global security Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix bearer formats Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Polish descriptions Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix boostrap and typo Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> Co-authored-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * MF-1575 Add 'Name' field to ListMembers response in things svc (#1576) Signed-off-by: Ivan Balboteo <ivan@submer.com> Co-authored-by: Ivan Balboteo <ivan@submer.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * MF-1580 - Influxdb Writer changes format of update-time to string (#1581) * - MF-1580 - Modified consumers/writers/influxdb/fields.go - influxdb-writer used to update data type of update-time to string - Commented line 12 of consumers/writers/influxdb/fields.go to resolve uneccessary data type conversion issue Signed-off-by: Hasan Tariq <hasantariqashraf@gmail.com> * - MF-1580 - Removed strconv package from consumers/writers/influxdb/fields.go since it is no longer needed - Removed line 12 from consumers/writers/influxdb/fields.go - Replaced retrun value of updateTime with msg.UpdateTime (line 16 in fields.go) Signed-off-by: Hasan Tariq <hasantariqashraf@gmail.com> * Fix InflxuDB readers Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Co-authored-by: Hasan Tariq <hasant@plcgroup.com> Co-authored-by: dusanb94 <dusan.borovcanin@mainflux.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * NOISSUE - Unify MF_INFLUX_READER_DB_HOST and MF_INFLUX_WRITER_DB_HOST envars (#1585) Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * NOISSUE - Fix CoAP adapter (#1572) * Revert "NOISSUE - Add nats wrapper for COAP (#1569)" This reverts commit cc5d5195ab27fa94270ada616487b7053fd9c7bd. Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * Fix CoAP adapter Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * Update CoAP observation cancel Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * Fix observe Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * Fix GET handling Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * Revert authorization Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * Use constants instead of magic numbers Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * Remove an empty line Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * Extract special observe value to constant Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * MF-1582 - Fix lora-adapter MQTT client (#1583) * MF-1582 - Fix lora-adapter MQTT clien Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add timeout config to the mqtt subscriber Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rm comment Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add sub timeout Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * NOISSUE - Update changelog and readme for release 0.13.0 (#1592) * Update release example Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * Update changelog and examples for 0.13.0 release Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Update VerneMQ release (#1593) Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * NOISSUE - Update changelog for release 0.13.0 (#1595) Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * unexport constants Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Change routingkey Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Remove wait groups Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * protecting map Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Add publisher to pubsub Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Change proto library Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Fix typos Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Reduce pubsub tests based on implementation Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Remove channel cancel Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Export constant Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * NOISSUE - Move invariant statements out of loop for cassandra-writer (#1596) Signed-off-by: fuzhy <fuzhy1997@outlook.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Embedding publisher into pubsub Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Naming publisher Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * NOISSUE - Fix Nginx entrypoint script (#1597) * Fix Nginx entrypoint script Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * Update dependencies Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * Fix NginX entrypoint Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * Revert Makefile changes Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * MF-1525 - Add graceful stop for HTTP and GRPC servers (#1548) * Add : errgroup to cmd/auth Signed-off-by: Arvindh <arvindh91@gmail.com> * Add : Handle graceful stop for auth service Remove : errgroups from auth service Signed-off-by: Arvindh <arvindh91@gmail.com> * Add : Wait till server shutdown Signed-off-by: Arvindh <arvindh91@gmail.com> * Change : instead of waitgroup changed to errgroups Signed-off-by: Arvindh <arvindh91@gmail.com> * change : KillSignalHandler return type to error Signed-off-by: Arvindh <arvindh91@gmail.com> * Empty Commit Signed-off-by: Arvindh <arvindh91@gmail.com> * Add : Context to http server shutdown Rename : varaible from proto to protocol Signed-off-by: Arvindh <arvindh91@gmail.com> * change : to default log level Signed-off-by: Arvindh <arvindh91@gmail.com> * Add : Sign-off Signed-off-by: Arvindh <arvindh91@gmail.com> * Add: graceful stop of http and grpc server Signed-off-by: Arvindh <arvindh91@gmail.com> * Fix: typos and caps Signed-off-by: Arvindh <arvindh91@gmail.com> * Add: Signed-off Signed-off-by: Arvindh <arvindh91@gmail.com> * Rename: Func KillSignalHandler to SignalHandler Add: SIGABRT Signed-off-by: Arvindh <arvindh91@gmail.com> * Fix: auth service Signed-off-by: Arvindh <arvindh91@gmail.com> * Add: timeout for grpc gracefulstop Fix: typos Signed-off-by: Arvindh <arvindh91@gmail.com> * Add: .vscode folder to git ignore Signed-off-by: Arvindh <arvindh91@gmail.com> * change: variable name to stopWaitTime Signed-off-by: Arvindh <arvindh91@gmail.com> * remove: .vscode folder Signed-off-by: Arvindh <arvindh91@gmail.com> * remove: .vscode from .gitignore Signed-off-by: Arvindh <arvindh91@gmail.com> * Add : logger to handlers Signed-off-by: Arvindh <arvindh91@gmail.com> * Add : New line at end of .gitignore file Signed-off-by: Arvindh <arvindh91@gmail.com> * Fix : variable naming Add : graceful stop for timescale Signed-off-by: Arvindh <arvindh91@gmail.com> * Remove : unsued NATS library from import Signed-off-by: Arvindh <arvindh91@gmail.com> * Move: "https" and "https" to moved to const var Signed-off-by: Arvindh <arvindh91@gmail.com> * Move: "http" and "https" to moved to const var Signed-off-by: Arvindh <arvindh91@gmail.com> * update: branch with master Signed-off-by: Arvindh <arvindh91@gmail.com> Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> Co-authored-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * MF-1588 - Update Subscriber interface (#1598) * Initial commit Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Update subscriber interface Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * Add tests Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Add tests Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * check subscription map Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Check topic id after topic Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * reword description Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Setup empty queue Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Change mqtt implementation Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Switch statements Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Simplify Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Change mqtt subscriber Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Protect subscription map Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Fix subscription Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Set client id Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Format Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Change delete method Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Update rabbitmq subscriber interface Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * using publisher composition Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Change contenttype Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * rename topic for publish and subscribe Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Change errors to lower case Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Change errors to lower case Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * export errors Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * MF - 1590 - Fix fetching list of users with a zero limit (#1594) * Add max and min limit size Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Format Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Format Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * NOISSUE - Retrieve client key on cert issuing (#1607) Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * fix bug (#1604) Signed-off-by: zhangchuanfeng <654300242@qq.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * queue per subscription Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * queue per subscription Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Change routing method Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Direct method with one exchange to many queues, one consumer per queue Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * :recycle: Not casting data Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * :pencil2: Fix typo Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * :recycle: remove passed queue name Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * :fire: removing echange kind Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Combine tests Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Refactor unsubscribe method Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Fix merge conflict Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * :white_check_mark: sub and unsub to dummy topic Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * generate client id from topic and ID Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Rename topicID to clientID Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * update tests Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * merge changes Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * :recycle: rename constant and variable declaration Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * rename to brokers Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * :recycle: Rename brokers Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Change mqtt implementation Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Rename broker to brokers Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * include nats port Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * move to build tags Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * move to build tags Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * add nats build tag to test Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * \n at the end of file Signed-off-by: GitHub <noreply@github.com> * Add init function Signed-off-by: GitHub <noreply@github.com> * Add init function Signed-off-by: GitHub <noreply@github.com> * broker url automatically Signed-off-by: GitHub <noreply@github.com> * make nats as the default broker Signed-off-by: GitHub <noreply@github.com> * Updated publisher and subscriber interface Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Add error to close Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Change image version and let user define URI Signed-off-by: GitHub <noreply@github.com> * make broker url configurable Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * add compile check Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * rabbitmq check Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * default broker to nats Signed-off-by: GitHub <noreply@github.com> * change broker url in docker compose Signed-off-by: GitHub <noreply@github.com> * Fix ci Signed-off-by: GitHub <noreply@github.com> * fix makefile Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Fix env var and ci Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Fix ci Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Fix consts Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> Co-authored-by: Manuel Imperiale <manuel.Imperiale@gmail.com> Co-authored-by: Ivan Milošević <iva@blokovi.com> Co-authored-by: __touk__ <zerouali.t@gmail.com> Co-authored-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> Co-authored-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com> Co-authored-by: stefankovacevic123 <jen2tri@gmail.com> Co-authored-by: ibalboteo <ivanbalboteo@gmail.com> Co-authored-by: Ivan Balboteo <ivan@submer.com> Co-authored-by: Hasan98-git <67228396+Hasan98-git@users.noreply.github.com> Co-authored-by: Hasan Tariq <hasant@plcgroup.com> Co-authored-by: fuzhy <fuzhy1997@outlook.com> Co-authored-by: Arvindh <30824765+arvindh123@users.noreply.github.com> Co-authored-by: 张传峰 <59160162+zhang-chuanfeng@users.noreply.github.com>
2022-06-21 18:40:20 +03:00
else
NOISSUE - Make MQTT Broker Configurable (#1904) * Minor changes on mqtt publisher using nats Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Remove vernemq dependencies Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Restore VerneMQ config files Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Fix Makefile to support custom Docker profiles The Makefile has been updated to support custom Docker profiles. Previously, the Makefile only supported the default profiles for the message broker and MQTT broker. Now, the Makefile allows for custom profiles to be specified using environment variables. If the MF_BROKER_TYPE or MF_MQTT_BROKER_TYPE variables are not set, the default values "nats" and "nats" will be used, respectively. This change enables more flexibility in configuring the Docker environment for the project. The `run` target has also been modified to use the correct broker configuration file based on the MF_BROKER_TYPE variable. The sed command in the `run` target now replaces the placeholder in the docker/docker-compose.yml file with the appropriate broker configuration file. This commit improves the Makefile to support custom Docker profiles and ensures the correct broker configuration file is used when running the project. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Fix queue binding issue in RabbitMQ pubsub The commit fixes an issue in the RabbitMQ pubsub implementation where the queue binding was not correctly set up. Instead of using the topic as the queue name, the commit now uses a unique client ID generated by combining the topic and subscriber ID. This ensures that each subscriber has its own dedicated queue. The commit also updates the queue binding to use the correct queue name. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Refactor Docker config editing in Makefile The commit refactors the `edit_docker_config` function in the Makefile to improve readability and maintainability. The changes include: - Removing unnecessary conditionals related to the `rabbitmq` broker These changes ensure that the Docker configuration is correctly updated based on the specified MQTT broker type. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Fix failing tests on RabbitMQ Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Refactor MQTT_BROKER comment in docker-compose.yml The MQTT_BROKER comment in the docker-compose.yml file has been updated to provide a more accurate description of its functionality. The comment now states that the MQTT_BROKER handles MQTT communication between MQTT adapters and the message broker, instead of Mainflux services. This change improves clarity and aligns with the actual purpose of the MQTT_BROKER. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Rename `MF_BROKER` to `MF_MESSAGE_BROKER` The Makefile and Semaphore configuration files have been refactored to update the variable names related to the message broker type. These changes ensure consistency and clarity in the codebase by using more descriptive variable names related to the message broker type. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Fix Docker profile configuration for nats_rabbitmq Update the Docker profile configuration for nats_rabbitmq by replacing the NATS URL in the .env file with the correct value. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Rename MF_BROKER_URL to MF_MESSAGE_BROKER_URL Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Fix MQTT QoS level in pubsub.go The MQTT QoS level in the pubsub.go file was set to 1, which is the default level. However, since NATS supports up to QoS 1, I updated the QoS level comment to reflect this. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Refactor NewPublisher to accept QoS parameter The NewPublisher function in the pkg/messaging/mqtt/publisher.go file has been refactored to accept a new parameter, qos, which represents the Quality of Service level for MQTT message publishing. This change allows for more flexibility in configuring the MQTT publisher. The NewPublisher function now has the following signature: ```go func NewPublisher(address string, qos uint8, timeout time.Duration) (messaging.Publisher, error) ``` This change ensures that the MQTT publisher can be created with the desired QoS level, enhancing the reliability and delivery guarantees of the published messages. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Fix test assertions in pubsub_test.go The test assertions in the pubsub_test.go file were incorrect. This commit fixes the assertions to properly compare the expected and received message values. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Test configurable MQTT broker Signed-off-by: rodneyosodo <blackd0t@protonmail.com> --------- Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> Signed-off-by: rodneyosodo <blackd0t@protonmail.com>
2023-10-19 22:01:09 +03:00
MF_MESSAGE_BROKER_TYPE=nats
NOISSUE - RabbitMQ build and deployment (#1570) * Initial commit of adding rabbitmq broker Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Initial commit of adding rabbitmq broker Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Initial commit for tests Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Bump up tests Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Add more tests Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Add go routines Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Initial commit of adding rabbitmq broker Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Initial commit of adding rabbitmq broker Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Initial commit for tests Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Bump up tests Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Add more tests Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Add go routines Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Fix tests Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Fix with wait groups Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * unsubscribe to stop delivering messages Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Remove exclusivity Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Implement cancel mechanisms Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Queuename as parameter Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Queuename as parameter Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Initial commit Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Remove broker type Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Configure broker with makefile Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Check if we have changed MESSAGE_BROKER_FILE~ Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Set nats automatically Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Catching null and invalid broker type Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Remove unused fmt Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Fix tests Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Nats Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * unexport constants Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Change routingkey Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Remove wait groups Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * protecting map Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Add publisher to pubsub Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Change proto library Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Fix typos Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Reduce pubsub tests based on implementation Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Remove channel cancel Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Export constant Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Embedding publisher into pubsub Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Naming publisher Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Update rabbitmq subscriber interface Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * using publisher composition Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Change contenttype Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * rename topic for publish and subscribe Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Change errors to lower case Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Change errors to lower case Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * export errors Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * queue per subscription Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * queue per subscription Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Merge branch 'master' into RabbitMQ-deployment Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * rename nats to broker Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Change routing method Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Direct method with one exchange to many queues, one consumer per queue Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * MF-1263 - Move repeating errors to the separate package (#1540) * MF-1263 - Mv duplicated errors to pkg/errors Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Revert test build flags Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix merge Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix comment Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * NOISSUE - Fix auth members list response (#1555) * NOISSUE - Fix auth members list response Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Move group type next to page details Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rm membersRes Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix typo Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * MF-1261 - Use StatusUnauthorized for authn and StatusForbidden for authz (#1538) * MF-1261 - Use StatusUnauthorized for authn and StatusForbidden for authz Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * ErrExternalKey typo Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rename ErrUnauthorizedAcces -> ErrAuthentication Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix bootstrap error Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix status code in openapi Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix test description Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix test description Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix test description Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add errors cases Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix status codes Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add gRPC stutus code Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix tests description Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix openapi and encodeError Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix grpc message Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix test descriptions Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Revert sdk error Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix typo Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * MF-1059 - Add TLS support for email (#1560) * Use gomail package for sending emails Signed-off-by: Ivan Milosevic <iva@blokovi.com> * remove print err Signed-off-by: Ivan Milosevic <iva@blokovi.com> * Add vendor Signed-off-by: Ivan Milosevic <iva@blokovi.com> * Rename email structure remove logger Signed-off-by: Ivan Milosevic <iva@blokovi.com> * typo in var name Signed-off-by: Ivan Milosevic <iva@blokovi.com> * rename var Signed-off-by: Ivan Milosevic <iva@blokovi.com> * remove MF_EMAIL_SECRET Signed-off-by: Ivan Milosevic <iva@blokovi.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * NOISSUE - Refactor MQTT subscriber (#1561) * correct suscriber interface validator + refactore token error handling Signed-off-by: tzzed <zerouali.t@gmail.com> * apply review suggestion Signed-off-by: tzzed <zerouali.t@gmail.com> Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * MF-1257 - Access messages from readers endpoint with user access token (#1470) * remove owner id Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add user auth for db reader Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * add user auth for db reader Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * enable mongodb reader for user token reading Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * use uuid check for auth switch between thing key and user tok Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * enable user token reading Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * revert to correct version Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * fix endpoint test, add additional tests Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * remove logs,dead code Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * fix logging messages Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * remove auth interface, add authorization header type Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * update api doc Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * remove unused package Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * some refactor of cases for authorization switch Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * correct description in openapi Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * fix endpoint test to match auth service change Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * some rename Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * initialize auth url Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * add env variables for auth service Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * fix spelling Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * Things prefix and no prefix for Thing authorization, Bearer for user Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * update readme file Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * fix default things grpc port Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * enable user reading for timescaledb Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * remove not used error Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * improve errors Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * refactor authorize Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * add chanID check Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * inline some error checking Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * fixing errors Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * fixing errors Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * improve test case description Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * remove test code Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * dont inline Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * refactor a bit encodeError Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * remove unused error Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * remove unused error Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * fix things auth grpc url Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * rename variables for header prefix Signed-off-by: mteodor <mirko.teodorovic@gmail.com> Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Initial commit of adding rabbitmq broker Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Initial commit of adding rabbitmq broker Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Initial commit for tests Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Bump up tests Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Add more tests Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Add go routines Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Initial commit of adding rabbitmq broker Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Initial commit for tests Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Bump up tests Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Add more tests Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Add go routines Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Fix tests Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Fix with wait groups Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * unsubscribe to stop delivering messages Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Remove exclusivity Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * MF-1551 - Fix Cobra usage commands and clean unnecessary struct types (#1558) * MF-1551 - Fix Cobra usage commands and clean unnecessary struct types Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Use linux syntax for cmd usage description Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix typo Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix cmd.Use Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * NOISSUE - Separate Keto hosts for read and write (#1563) * Separate keto hosts for read and write Signed-off-by: Ivan Milosevic <iva@blokovi.com> * update readme with new envars Signed-off-by: Ivan Milosevic <iva@blokovi.com> * rename read connection name Signed-off-by: Ivan Milosevic <iva@blokovi.com> Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> Co-authored-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Update dependencies (#1564) Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * MF-1240 - Return to service transport layer only service errors (#1559) * MF-1240 - Return to service transport layer only service errors Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Remove unecessary errors Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rm duplicated errors and fix transport Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Revert http endpoint_test Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix conflict Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Implement cancel mechanisms Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Queuename as parameter Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Queuename as parameter Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * MF-1469 - Indicate proper authentication scheme in Authorization header (#1523) * MF-1469 - Indicate proper authentication scheme in Authorization header Signed-off-by: Stefan Kovacevic <jen2tri@gmail.com> * Fixing the remarks on the last push Signed-off-by: Stefan Kovacevic <jen2tri@gmail.com> * Remove Bearer prefix in all services and fix tests Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix remarks Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> Co-authored-by: Manuel Imperiale <manuel.imperiale@gmail.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * NOISSUE - Add nats wrapper for COAP (#1569) * Add nats wrapper for COAP Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Pass pubsub as argument Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Defer close connection Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Defer close connection Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Rename endpoint to topic Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * MF-1348 - Add transport errors logging (#1544) * MF-1348 - Add go-kit transport level logging Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix merge Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix remark Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix go test flags Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Use httputil errors in things and http service Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix SDK tests Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Use httputil errors in certs and provision service Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Use httputil errors in consumers service Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * General renaming and add ErrMissingToken Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rename httputil -> apiutil and use errors in users servive Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Use apiutil errors in auth, bootstrap, readers, things and twins Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Replace errors.Contain by comparison Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix remarks Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Simplify validateID Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Simplify validateID Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Simplify and rename ExtractAuthToken -> ExtractBearerToken Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix readers Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix auth key test and remarks Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Improve comment Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Simplify validateUUID check Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix typo Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * MF-1567 - Use Bearer, Thing or Basic scheme in Authorization header (#1568) Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * MF-1565 - Document Bearer, Thing and Basic Authorization header (#1566) * MF-1565 - Document Bearer Authorization header Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix auth, bootstrap, http and readers openapi Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix openapi Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add enc key for bootstrap Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix typo Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Use global security Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix bearer formats Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Polish descriptions Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix boostrap and typo Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> Co-authored-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * MF-1575 Add 'Name' field to ListMembers response in things svc (#1576) Signed-off-by: Ivan Balboteo <ivan@submer.com> Co-authored-by: Ivan Balboteo <ivan@submer.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * MF-1580 - Influxdb Writer changes format of update-time to string (#1581) * - MF-1580 - Modified consumers/writers/influxdb/fields.go - influxdb-writer used to update data type of update-time to string - Commented line 12 of consumers/writers/influxdb/fields.go to resolve uneccessary data type conversion issue Signed-off-by: Hasan Tariq <hasantariqashraf@gmail.com> * - MF-1580 - Removed strconv package from consumers/writers/influxdb/fields.go since it is no longer needed - Removed line 12 from consumers/writers/influxdb/fields.go - Replaced retrun value of updateTime with msg.UpdateTime (line 16 in fields.go) Signed-off-by: Hasan Tariq <hasantariqashraf@gmail.com> * Fix InflxuDB readers Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Co-authored-by: Hasan Tariq <hasant@plcgroup.com> Co-authored-by: dusanb94 <dusan.borovcanin@mainflux.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * NOISSUE - Unify MF_INFLUX_READER_DB_HOST and MF_INFLUX_WRITER_DB_HOST envars (#1585) Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * NOISSUE - Fix CoAP adapter (#1572) * Revert "NOISSUE - Add nats wrapper for COAP (#1569)" This reverts commit cc5d5195ab27fa94270ada616487b7053fd9c7bd. Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * Fix CoAP adapter Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * Update CoAP observation cancel Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * Fix observe Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * Fix GET handling Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * Revert authorization Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * Use constants instead of magic numbers Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * Remove an empty line Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * Extract special observe value to constant Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * MF-1582 - Fix lora-adapter MQTT client (#1583) * MF-1582 - Fix lora-adapter MQTT clien Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add timeout config to the mqtt subscriber Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rm comment Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add sub timeout Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * NOISSUE - Update changelog and readme for release 0.13.0 (#1592) * Update release example Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * Update changelog and examples for 0.13.0 release Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Update VerneMQ release (#1593) Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * NOISSUE - Update changelog for release 0.13.0 (#1595) Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * unexport constants Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Change routingkey Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Remove wait groups Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * protecting map Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Add publisher to pubsub Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Change proto library Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Fix typos Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Reduce pubsub tests based on implementation Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Remove channel cancel Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Export constant Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * NOISSUE - Move invariant statements out of loop for cassandra-writer (#1596) Signed-off-by: fuzhy <fuzhy1997@outlook.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Embedding publisher into pubsub Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Naming publisher Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * NOISSUE - Fix Nginx entrypoint script (#1597) * Fix Nginx entrypoint script Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * Update dependencies Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * Fix NginX entrypoint Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * Revert Makefile changes Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * MF-1525 - Add graceful stop for HTTP and GRPC servers (#1548) * Add : errgroup to cmd/auth Signed-off-by: Arvindh <arvindh91@gmail.com> * Add : Handle graceful stop for auth service Remove : errgroups from auth service Signed-off-by: Arvindh <arvindh91@gmail.com> * Add : Wait till server shutdown Signed-off-by: Arvindh <arvindh91@gmail.com> * Change : instead of waitgroup changed to errgroups Signed-off-by: Arvindh <arvindh91@gmail.com> * change : KillSignalHandler return type to error Signed-off-by: Arvindh <arvindh91@gmail.com> * Empty Commit Signed-off-by: Arvindh <arvindh91@gmail.com> * Add : Context to http server shutdown Rename : varaible from proto to protocol Signed-off-by: Arvindh <arvindh91@gmail.com> * change : to default log level Signed-off-by: Arvindh <arvindh91@gmail.com> * Add : Sign-off Signed-off-by: Arvindh <arvindh91@gmail.com> * Add: graceful stop of http and grpc server Signed-off-by: Arvindh <arvindh91@gmail.com> * Fix: typos and caps Signed-off-by: Arvindh <arvindh91@gmail.com> * Add: Signed-off Signed-off-by: Arvindh <arvindh91@gmail.com> * Rename: Func KillSignalHandler to SignalHandler Add: SIGABRT Signed-off-by: Arvindh <arvindh91@gmail.com> * Fix: auth service Signed-off-by: Arvindh <arvindh91@gmail.com> * Add: timeout for grpc gracefulstop Fix: typos Signed-off-by: Arvindh <arvindh91@gmail.com> * Add: .vscode folder to git ignore Signed-off-by: Arvindh <arvindh91@gmail.com> * change: variable name to stopWaitTime Signed-off-by: Arvindh <arvindh91@gmail.com> * remove: .vscode folder Signed-off-by: Arvindh <arvindh91@gmail.com> * remove: .vscode from .gitignore Signed-off-by: Arvindh <arvindh91@gmail.com> * Add : logger to handlers Signed-off-by: Arvindh <arvindh91@gmail.com> * Add : New line at end of .gitignore file Signed-off-by: Arvindh <arvindh91@gmail.com> * Fix : variable naming Add : graceful stop for timescale Signed-off-by: Arvindh <arvindh91@gmail.com> * Remove : unsued NATS library from import Signed-off-by: Arvindh <arvindh91@gmail.com> * Move: "https" and "https" to moved to const var Signed-off-by: Arvindh <arvindh91@gmail.com> * Move: "http" and "https" to moved to const var Signed-off-by: Arvindh <arvindh91@gmail.com> * update: branch with master Signed-off-by: Arvindh <arvindh91@gmail.com> Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> Co-authored-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * MF-1588 - Update Subscriber interface (#1598) * Initial commit Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Update subscriber interface Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * Add tests Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Add tests Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * check subscription map Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Check topic id after topic Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * reword description Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Setup empty queue Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Change mqtt implementation Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Switch statements Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Simplify Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Change mqtt subscriber Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Protect subscription map Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Fix subscription Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Set client id Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Format Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Change delete method Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Update rabbitmq subscriber interface Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * using publisher composition Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Change contenttype Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * rename topic for publish and subscribe Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Change errors to lower case Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Change errors to lower case Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * export errors Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * MF - 1590 - Fix fetching list of users with a zero limit (#1594) * Add max and min limit size Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Format Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Format Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * NOISSUE - Retrieve client key on cert issuing (#1607) Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * fix bug (#1604) Signed-off-by: zhangchuanfeng <654300242@qq.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * queue per subscription Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * queue per subscription Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Change routing method Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Direct method with one exchange to many queues, one consumer per queue Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * :recycle: Not casting data Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * :pencil2: Fix typo Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * :recycle: remove passed queue name Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * :fire: removing echange kind Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Combine tests Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Refactor unsubscribe method Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Fix merge conflict Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * :white_check_mark: sub and unsub to dummy topic Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * generate client id from topic and ID Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Rename topicID to clientID Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * update tests Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * merge changes Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * :recycle: rename constant and variable declaration Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * rename to brokers Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * :recycle: Rename brokers Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Change mqtt implementation Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Rename broker to brokers Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * include nats port Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * move to build tags Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * move to build tags Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * add nats build tag to test Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * \n at the end of file Signed-off-by: GitHub <noreply@github.com> * Add init function Signed-off-by: GitHub <noreply@github.com> * Add init function Signed-off-by: GitHub <noreply@github.com> * broker url automatically Signed-off-by: GitHub <noreply@github.com> * make nats as the default broker Signed-off-by: GitHub <noreply@github.com> * Updated publisher and subscriber interface Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Add error to close Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Change image version and let user define URI Signed-off-by: GitHub <noreply@github.com> * make broker url configurable Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * add compile check Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * rabbitmq check Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * default broker to nats Signed-off-by: GitHub <noreply@github.com> * change broker url in docker compose Signed-off-by: GitHub <noreply@github.com> * Fix ci Signed-off-by: GitHub <noreply@github.com> * fix makefile Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Fix env var and ci Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Fix ci Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Fix consts Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> Co-authored-by: Manuel Imperiale <manuel.Imperiale@gmail.com> Co-authored-by: Ivan Milošević <iva@blokovi.com> Co-authored-by: __touk__ <zerouali.t@gmail.com> Co-authored-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> Co-authored-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com> Co-authored-by: stefankovacevic123 <jen2tri@gmail.com> Co-authored-by: ibalboteo <ivanbalboteo@gmail.com> Co-authored-by: Ivan Balboteo <ivan@submer.com> Co-authored-by: Hasan98-git <67228396+Hasan98-git@users.noreply.github.com> Co-authored-by: Hasan Tariq <hasant@plcgroup.com> Co-authored-by: fuzhy <fuzhy1997@outlook.com> Co-authored-by: Arvindh <30824765+arvindh123@users.noreply.github.com> Co-authored-by: 张传峰 <59160162+zhang-chuanfeng@users.noreply.github.com>
2022-06-21 18:40:20 +03:00
endif
NOISSUE - Make MQTT Broker Configurable (#1904) * Minor changes on mqtt publisher using nats Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Remove vernemq dependencies Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Restore VerneMQ config files Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Fix Makefile to support custom Docker profiles The Makefile has been updated to support custom Docker profiles. Previously, the Makefile only supported the default profiles for the message broker and MQTT broker. Now, the Makefile allows for custom profiles to be specified using environment variables. If the MF_BROKER_TYPE or MF_MQTT_BROKER_TYPE variables are not set, the default values "nats" and "nats" will be used, respectively. This change enables more flexibility in configuring the Docker environment for the project. The `run` target has also been modified to use the correct broker configuration file based on the MF_BROKER_TYPE variable. The sed command in the `run` target now replaces the placeholder in the docker/docker-compose.yml file with the appropriate broker configuration file. This commit improves the Makefile to support custom Docker profiles and ensures the correct broker configuration file is used when running the project. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Fix queue binding issue in RabbitMQ pubsub The commit fixes an issue in the RabbitMQ pubsub implementation where the queue binding was not correctly set up. Instead of using the topic as the queue name, the commit now uses a unique client ID generated by combining the topic and subscriber ID. This ensures that each subscriber has its own dedicated queue. The commit also updates the queue binding to use the correct queue name. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Refactor Docker config editing in Makefile The commit refactors the `edit_docker_config` function in the Makefile to improve readability and maintainability. The changes include: - Removing unnecessary conditionals related to the `rabbitmq` broker These changes ensure that the Docker configuration is correctly updated based on the specified MQTT broker type. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Fix failing tests on RabbitMQ Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Refactor MQTT_BROKER comment in docker-compose.yml The MQTT_BROKER comment in the docker-compose.yml file has been updated to provide a more accurate description of its functionality. The comment now states that the MQTT_BROKER handles MQTT communication between MQTT adapters and the message broker, instead of Mainflux services. This change improves clarity and aligns with the actual purpose of the MQTT_BROKER. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Rename `MF_BROKER` to `MF_MESSAGE_BROKER` The Makefile and Semaphore configuration files have been refactored to update the variable names related to the message broker type. These changes ensure consistency and clarity in the codebase by using more descriptive variable names related to the message broker type. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Fix Docker profile configuration for nats_rabbitmq Update the Docker profile configuration for nats_rabbitmq by replacing the NATS URL in the .env file with the correct value. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Rename MF_BROKER_URL to MF_MESSAGE_BROKER_URL Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Fix MQTT QoS level in pubsub.go The MQTT QoS level in the pubsub.go file was set to 1, which is the default level. However, since NATS supports up to QoS 1, I updated the QoS level comment to reflect this. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Refactor NewPublisher to accept QoS parameter The NewPublisher function in the pkg/messaging/mqtt/publisher.go file has been refactored to accept a new parameter, qos, which represents the Quality of Service level for MQTT message publishing. This change allows for more flexibility in configuring the MQTT publisher. The NewPublisher function now has the following signature: ```go func NewPublisher(address string, qos uint8, timeout time.Duration) (messaging.Publisher, error) ``` This change ensures that the MQTT publisher can be created with the desired QoS level, enhancing the reliability and delivery guarantees of the published messages. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Fix test assertions in pubsub_test.go The test assertions in the pubsub_test.go file were incorrect. This commit fixes the assertions to properly compare the expected and received message values. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Test configurable MQTT broker Signed-off-by: rodneyosodo <blackd0t@protonmail.com> --------- Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> Signed-off-by: rodneyosodo <blackd0t@protonmail.com>
2023-10-19 22:01:09 +03:00
ifneq ($(MF_MQTT_BROKER_TYPE),)
MF_MQTT_BROKER_TYPE := $(MF_MQTT_BROKER_TYPE)
else
MF_MQTT_BROKER_TYPE=nats
endif
NOISSUE - Introduce NATS Jetstream as Default ES (#1907) * Refactor message broker implementation This commit refactors the Nats message broker implementation to include pubsub options. These changes include: - Adding `Option` func that takes in the URL and prefix - Implement `WithStream` option which can create a different stream for nats stream - Implement `WithExchange` option which can create a different exchaange for rabbitmq channel - Implement `WithPrefix` option which allows to you change the publisher prefix These changes improve the organization and readability of the codebase. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Use redis URL to configure username, password and db Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Make event store configurable on dev deployment Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Fix adds options to messaging `PubSub` interface Adding options to PubSub interface allows the use of messaging package to do es. The changes in this commit ensure that the code handles errors properly and provides more informative error messages when encountering unexpected types. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Add NATS event publisher implementation This commit adds the implementation of the NATS event publisher. The NATS event publisher is responsible for publishing events to a NATS messaging system. It uses the `messaging` package to interact with the messaging system. The implementation includes the following features: - Publishing events to NATS using the `Publish` method. - Marshaling events to JSON before publishing. - Setting the message subject and headers based on the event. - Handling errors during publishing. This implementation is built with the `!rabbitmq` build tag, which means it will only be compiled if the `rabbitmq` build tag is not present. The NATS event publisher is part of the Mainflux events package and provides support for the Mainflux NATS events source service functionality. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Add RabbitMQ event publisher implementation This commit adds the implementation of the RabbitMQ event publisher. The RabbitMQ event publisher is responsible for publishing events to a RabbitMQ messaging system. It uses the `messaging` package to interact with the messaging system. The implementation includes the following features: - Publishing events to RabbitMQ using the `Publish` method. - Marshaling events to JSON before publishing. - Setting the message subject and headers based on the event. - Handling errors during publishing. This implementation is built with the `rabbitmq` build tag, which means it will only be compiled if the `rabbitmq` build tag is present. The RabbitMQ event publisher is part of the Mainflux events package and provides support for the Mainflux RabbitMQ events source service functionality. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Add configurable implementation for events store This commit adds a new file `brokers_*.go` which contains the implementation for the different event store. The file includes functions for creating a new publisher and subscriber using different es store. This commit also includes an `init` function that logs a message indicating that the binary was built using the respective package as the events store. The purpose of this commit is to add support for alternative events store. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Fix build flags Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Refactor Makefile and Semaphore configuration The Makefile has been refactored to include the `MF_ES_STORE_TYPE` tag in the `go build` command. Additionally, the Semaphore configuration has been updated to include a new task for compiling with Redis as the broker type. This commit addresses the need to compile the codebase with Redis as the event store type and includes the necessary changes in the Makefile and Semaphore configuration. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Reduced due to memory on testing Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Fix tests for es Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Fix grammar Co-authored-by: Sammy Kerata Oina <44265300+SammyOina@users.noreply.github.com> Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Fix linting Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * feat(docker): update environment variables for message broker The commit updates the environment variable `MF_ES_STORE_TYPE` in the `docker/.env` file. The variable is changed from `${MF_MQTT_BROKER_TYPE}` to `${MF_MESSAGE_BROKER_TYPE}` to accurately reflect the type of message broker being used. This change ensures that the correct message broker is configured for the Event Store. Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * feat: Update docker environment variables - Removed the unused MF_ES_URL variable in the .env file - Updated the MF_ES_STORE_TYPE and MF_ES_STORE_URL variables in the .env file to match the MF_MESSAGE_BROKER_TYPE and MF_NATS_URL variables respectively Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Fix after rebase Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Add godocs for option parameters for brokers Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * pass by value exchange and prefix names Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Rename option functions Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * move variables to constants Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * fix: option example comment Signed-off-by: rodneyosodo <blackd0t@protonmail.com> --------- Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> Signed-off-by: rodneyosodo <blackd0t@protonmail.com> Co-authored-by: Sammy Kerata Oina <44265300+SammyOina@users.noreply.github.com>
2023-10-24 18:22:53 +03:00
ifneq ($(MF_ES_STORE_TYPE),)
MF_ES_STORE_TYPE := $(MF_ES_STORE_TYPE)
else
MF_ES_STORE_TYPE=nats
endif
NOISSUE - Make MQTT Broker Configurable (#1904) * Minor changes on mqtt publisher using nats Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Remove vernemq dependencies Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Restore VerneMQ config files Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Fix Makefile to support custom Docker profiles The Makefile has been updated to support custom Docker profiles. Previously, the Makefile only supported the default profiles for the message broker and MQTT broker. Now, the Makefile allows for custom profiles to be specified using environment variables. If the MF_BROKER_TYPE or MF_MQTT_BROKER_TYPE variables are not set, the default values "nats" and "nats" will be used, respectively. This change enables more flexibility in configuring the Docker environment for the project. The `run` target has also been modified to use the correct broker configuration file based on the MF_BROKER_TYPE variable. The sed command in the `run` target now replaces the placeholder in the docker/docker-compose.yml file with the appropriate broker configuration file. This commit improves the Makefile to support custom Docker profiles and ensures the correct broker configuration file is used when running the project. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Fix queue binding issue in RabbitMQ pubsub The commit fixes an issue in the RabbitMQ pubsub implementation where the queue binding was not correctly set up. Instead of using the topic as the queue name, the commit now uses a unique client ID generated by combining the topic and subscriber ID. This ensures that each subscriber has its own dedicated queue. The commit also updates the queue binding to use the correct queue name. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Refactor Docker config editing in Makefile The commit refactors the `edit_docker_config` function in the Makefile to improve readability and maintainability. The changes include: - Removing unnecessary conditionals related to the `rabbitmq` broker These changes ensure that the Docker configuration is correctly updated based on the specified MQTT broker type. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Fix failing tests on RabbitMQ Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Refactor MQTT_BROKER comment in docker-compose.yml The MQTT_BROKER comment in the docker-compose.yml file has been updated to provide a more accurate description of its functionality. The comment now states that the MQTT_BROKER handles MQTT communication between MQTT adapters and the message broker, instead of Mainflux services. This change improves clarity and aligns with the actual purpose of the MQTT_BROKER. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Rename `MF_BROKER` to `MF_MESSAGE_BROKER` The Makefile and Semaphore configuration files have been refactored to update the variable names related to the message broker type. These changes ensure consistency and clarity in the codebase by using more descriptive variable names related to the message broker type. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Fix Docker profile configuration for nats_rabbitmq Update the Docker profile configuration for nats_rabbitmq by replacing the NATS URL in the .env file with the correct value. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Rename MF_BROKER_URL to MF_MESSAGE_BROKER_URL Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Fix MQTT QoS level in pubsub.go The MQTT QoS level in the pubsub.go file was set to 1, which is the default level. However, since NATS supports up to QoS 1, I updated the QoS level comment to reflect this. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Refactor NewPublisher to accept QoS parameter The NewPublisher function in the pkg/messaging/mqtt/publisher.go file has been refactored to accept a new parameter, qos, which represents the Quality of Service level for MQTT message publishing. This change allows for more flexibility in configuring the MQTT publisher. The NewPublisher function now has the following signature: ```go func NewPublisher(address string, qos uint8, timeout time.Duration) (messaging.Publisher, error) ``` This change ensures that the MQTT publisher can be created with the desired QoS level, enhancing the reliability and delivery guarantees of the published messages. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Fix test assertions in pubsub_test.go The test assertions in the pubsub_test.go file were incorrect. This commit fixes the assertions to properly compare the expected and received message values. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Test configurable MQTT broker Signed-off-by: rodneyosodo <blackd0t@protonmail.com> --------- Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> Signed-off-by: rodneyosodo <blackd0t@protonmail.com>
2023-10-19 22:01:09 +03:00
define compile_service
MF-1308 - Use IETF Health Check standard (#1541) * MF-1308 - Use IETF Health Check standard Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add nginx health endpoint Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rm github.com/nelkinda dependency Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Check error Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Replace Version by Health in the CLI and SDK Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix typo Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Use new build flag go:build Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Revert wrong renaming Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * sdk health test Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add /health endpoint to openapi doc Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Use const for description message Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add version and build time during build Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Time format Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add version and commit using git and build args Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add comments Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add tests Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add missing api properties Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix api Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Use ./schemas/HealthInfo.yml as Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix example Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Use content type application/health+json Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Set Makefile variables only if empty Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix typo Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2022-01-24 21:18:53 +01:00
CGO_ENABLED=$(CGO_ENABLED) GOOS=$(GOOS) GOARCH=$(GOARCH) GOARM=$(GOARM) \
NOISSUE - Introduce NATS Jetstream as Default ES (#1907) * Refactor message broker implementation This commit refactors the Nats message broker implementation to include pubsub options. These changes include: - Adding `Option` func that takes in the URL and prefix - Implement `WithStream` option which can create a different stream for nats stream - Implement `WithExchange` option which can create a different exchaange for rabbitmq channel - Implement `WithPrefix` option which allows to you change the publisher prefix These changes improve the organization and readability of the codebase. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Use redis URL to configure username, password and db Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Make event store configurable on dev deployment Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Fix adds options to messaging `PubSub` interface Adding options to PubSub interface allows the use of messaging package to do es. The changes in this commit ensure that the code handles errors properly and provides more informative error messages when encountering unexpected types. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Add NATS event publisher implementation This commit adds the implementation of the NATS event publisher. The NATS event publisher is responsible for publishing events to a NATS messaging system. It uses the `messaging` package to interact with the messaging system. The implementation includes the following features: - Publishing events to NATS using the `Publish` method. - Marshaling events to JSON before publishing. - Setting the message subject and headers based on the event. - Handling errors during publishing. This implementation is built with the `!rabbitmq` build tag, which means it will only be compiled if the `rabbitmq` build tag is not present. The NATS event publisher is part of the Mainflux events package and provides support for the Mainflux NATS events source service functionality. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Add RabbitMQ event publisher implementation This commit adds the implementation of the RabbitMQ event publisher. The RabbitMQ event publisher is responsible for publishing events to a RabbitMQ messaging system. It uses the `messaging` package to interact with the messaging system. The implementation includes the following features: - Publishing events to RabbitMQ using the `Publish` method. - Marshaling events to JSON before publishing. - Setting the message subject and headers based on the event. - Handling errors during publishing. This implementation is built with the `rabbitmq` build tag, which means it will only be compiled if the `rabbitmq` build tag is present. The RabbitMQ event publisher is part of the Mainflux events package and provides support for the Mainflux RabbitMQ events source service functionality. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Add configurable implementation for events store This commit adds a new file `brokers_*.go` which contains the implementation for the different event store. The file includes functions for creating a new publisher and subscriber using different es store. This commit also includes an `init` function that logs a message indicating that the binary was built using the respective package as the events store. The purpose of this commit is to add support for alternative events store. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Fix build flags Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Refactor Makefile and Semaphore configuration The Makefile has been refactored to include the `MF_ES_STORE_TYPE` tag in the `go build` command. Additionally, the Semaphore configuration has been updated to include a new task for compiling with Redis as the broker type. This commit addresses the need to compile the codebase with Redis as the event store type and includes the necessary changes in the Makefile and Semaphore configuration. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Reduced due to memory on testing Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Fix tests for es Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Fix grammar Co-authored-by: Sammy Kerata Oina <44265300+SammyOina@users.noreply.github.com> Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Fix linting Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * feat(docker): update environment variables for message broker The commit updates the environment variable `MF_ES_STORE_TYPE` in the `docker/.env` file. The variable is changed from `${MF_MQTT_BROKER_TYPE}` to `${MF_MESSAGE_BROKER_TYPE}` to accurately reflect the type of message broker being used. This change ensures that the correct message broker is configured for the Event Store. Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * feat: Update docker environment variables - Removed the unused MF_ES_URL variable in the .env file - Updated the MF_ES_STORE_TYPE and MF_ES_STORE_URL variables in the .env file to match the MF_MESSAGE_BROKER_TYPE and MF_NATS_URL variables respectively Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Fix after rebase Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Add godocs for option parameters for brokers Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * pass by value exchange and prefix names Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Rename option functions Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * move variables to constants Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * fix: option example comment Signed-off-by: rodneyosodo <blackd0t@protonmail.com> --------- Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> Signed-off-by: rodneyosodo <blackd0t@protonmail.com> Co-authored-by: Sammy Kerata Oina <44265300+SammyOina@users.noreply.github.com>
2023-10-24 18:22:53 +03:00
go build -mod=vendor -tags $(MF_MESSAGE_BROKER_TYPE) --tags $(MF_ES_STORE_TYPE) -ldflags "-s -w \
MF-1308 - Use IETF Health Check standard (#1541) * MF-1308 - Use IETF Health Check standard Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add nginx health endpoint Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rm github.com/nelkinda dependency Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Check error Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Replace Version by Health in the CLI and SDK Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix typo Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Use new build flag go:build Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Revert wrong renaming Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * sdk health test Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add /health endpoint to openapi doc Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Use const for description message Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add version and build time during build Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Time format Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add version and commit using git and build args Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add comments Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add tests Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add missing api properties Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix api Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Use ./schemas/HealthInfo.yml as Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix example Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Use content type application/health+json Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Set Makefile variables only if empty Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix typo Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2022-01-24 21:18:53 +01:00
-X 'github.com/mainflux/mainflux.BuildTime=$(TIME)' \
-X 'github.com/mainflux/mainflux.Version=$(VERSION)' \
-X 'github.com/mainflux/mainflux.Commit=$(COMMIT)'" \
-o ${BUILD_DIR}/mainflux-$(1) cmd/$(1)/main.go
endef
define make_docker
$(eval svc=$(subst docker_,,$(1)))
docker build \
--no-cache \
--build-arg SVC=$(svc) \
--build-arg GOARCH=$(GOARCH) \
--build-arg GOARM=$(GOARM) \
MF-1308 - Use IETF Health Check standard (#1541) * MF-1308 - Use IETF Health Check standard Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add nginx health endpoint Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rm github.com/nelkinda dependency Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Check error Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Replace Version by Health in the CLI and SDK Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix typo Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Use new build flag go:build Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Revert wrong renaming Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * sdk health test Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add /health endpoint to openapi doc Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Use const for description message Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add version and build time during build Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Time format Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add version and commit using git and build args Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add comments Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add tests Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add missing api properties Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix api Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Use ./schemas/HealthInfo.yml as Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix example Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Use content type application/health+json Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Set Makefile variables only if empty Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix typo Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2022-01-24 21:18:53 +01:00
--build-arg VERSION=$(VERSION) \
--build-arg COMMIT=$(COMMIT) \
--build-arg TIME=$(TIME) \
--tag=$(MF_DOCKER_IMAGE_NAME_PREFIX)/$(svc) \
-f docker/Dockerfile .
MF-466 - ARM docker deployment (#756) * Add arm Dockerfiles Change version of postgres images in docker-compose to use versions with multiarch Signed-off-by: Ivan Milošević <iva@blokovi.com> * docker compose file Signed-off-by: Ivan Milošević <iva@blokovi.com> * remove bin qemu file Signed-off-by: Ivan Milošević <iva@blokovi.com> * remove unnecesarry comments Signed-off-by: Ivan Milošević <iva@blokovi.com> * Add make dockers_arm32v7 in Makefile Signed-off-by: Ivan Milošević <iva@blokovi.com> * Remove docker/Dockerfile.arm Signed-off-by: Ivan Milošević <iva@blokovi.com> * Add build for arm32v7 in ui Makefile Signed-off-by: Ivan Milošević <iva@blokovi.com> * Add arm32v7 tags Signed-off-by: Ivan Milošević <iva@blokovi.com> * add docker-compose for arm remove thing-db in docker compose (use same db as user) fix dockerfile and makefile Signed-off-by: Ivan Milošević <iva@blokovi.com> * fix thing database env variable Signed-off-by: Ivan Milošević <iva@blokovi.com> * Switch back to separate database for things and users Signed-off-by: Ivan Milošević <iva@blokovi.com> * rename arm32v7 to arm Signed-off-by: Ivan Milošević <iva@blokovi.com> * remove arm32v7 tag rename arm32v7 image names Signed-off-by: Ivan Milošević <iva@blokovi.com> * Rename command for making mqtt and ui individual images, to match other miscroservices Signed-off-by: Ivan Milošević <iva@blokovi.com> * Push arm docker images Signed-off-by: Ivan Milošević <iva@blokovi.com> * fix fucntion call in ci.sh Signed-off-by: Ivan Milošević <iva@blokovi.com> * mergiing ui/Dockerfile Signed-off-by: Ivan Milošević <iva@blokovi.com>
2019-06-11 02:14:05 +02:00
endef
define make_docker_dev
$(eval svc=$(subst docker_dev_,,$(1)))
docker build \
--no-cache \
--build-arg SVC=$(svc) \
--tag=$(MF_DOCKER_IMAGE_NAME_PREFIX)/$(svc) \
-f docker/Dockerfile.dev ./build
endef
ADDON_SERVICES = bootstrap cassandra-reader cassandra-writer certs \
influxdb-reader influxdb-writer lora-adapter mongodb-reader mongodb-writer \
opcua-adapter postgres-reader postgres-writer provision smpp-notifier smtp-notifier \
timescale-reader timescale-writer twins
EXTERNAL_SERVICES = vault prometheus
ifneq ($(filter run%,$(firstword $(MAKECMDGOALS))),)
temp_args := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
DOCKER_COMPOSE_COMMAND := $(if $(filter $(DOCKER_COMPOSE_COMMANDS_SUPPORTED),$(temp_args)), $(filter $(DOCKER_COMPOSE_COMMANDS_SUPPORTED),$(temp_args)), $(DEFAULT_DOCKER_COMPOSE_COMMAND))
$(eval $(DOCKER_COMPOSE_COMMAND):;@)
endif
ifneq ($(filter run_addons%,$(firstword $(MAKECMDGOALS))),)
temp_args := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
RUN_ADDON_ARGS := $(if $(filter-out $(DOCKER_COMPOSE_COMMANDS_SUPPORTED),$(temp_args)), $(filter-out $(DOCKER_COMPOSE_COMMANDS_SUPPORTED),$(temp_args)),$(ADDON_SERVICES) $(EXTERNAL_SERVICES))
$(eval $(RUN_ADDON_ARGS):;@)
endif
ifneq ("$(wildcard docker/ssl/certs/*-grpc-*)","")
GRPC_MTLS_CERT_FILES_EXISTS = 1
else
GRPC_MTLS_CERT_FILES_EXISTS = 0
endif
FILTERED_SERVICES = $(filter-out $(RUN_ADDON_ARGS), $(SERVICES))
all: $(SERVICES)
.PHONY: all $(SERVICES) dockers dockers_dev latest release run run_addons grpc_mtls_certs check_mtls check_certs
clean:
rm -rf ${BUILD_DIR}
cleandocker:
# Stops containers and removes containers, networks, volumes, and images created by up
UV-267 - Update http messaging to mproxy (#1916) * update http messaging to mproxy Signed-off-by: SammyOina <sammyoina@gmail.com> * Fix import path for mproxy module The import path for the mproxy module has been updated to github.com/sammyoina/mproxy v0.0.0-20231005134356-c44220b46ea0. This change ensures that the correct version of the module is used. This commit fixes the import path for the mproxy module, updating it to github.com/sammyoina/mproxy v0.0.0-20231005134356-c44220b46ea0. Signed-off-by: SammyOina <sammyoina@gmail.com> * Fix inconsistent variable naming in streams_test.go The variable "defaultTimout" was misspelled and should be "defaultTimeout". Also, the unused variable "configList" was removed. - Fix variable name "defaultTimout" to "defaultTimeout" - Remove unused variable "configList" Signed-off-by: SammyOina <sammyoina@gmail.com> * update mproxy Signed-off-by: SammyOina <sammyoina@gmail.com> * update mproxy Signed-off-by: SammyOina <sammyoina@gmail.com> * use auth connect Signed-off-by: SammyOina <sammyoina@gmail.com> * Fix incorrect HTTP status code in endpoint_test.go The previous commit introduced a mistake in the HTTP status code used in the endpoint_test.go file. The status code http.StatusUnauthorized was changed to http.StatusBadGateway. This commit corrects the status code to http.StatusBadRequest. This commit also includes a minor change in the things.go file. It adds three lines of code to the Authorize function. These changes ensure that the test cases and authorization logic are aligned with the correct HTTP status codes. Signed-off-by: SammyOina <sammyoina@gmail.com> * fix errors Signed-off-by: SammyOina <sammyoina@gmail.com> * Fix import formatting in message_test.go The import statements in message_test.go were not properly formatted. This commit fixes the formatting by organizing the imports and removing unnecessary commented code. - Import statements were organized and grouped together. - Unnecessary commented code was removed. This commit resolves the import formatting issue in message_test.go, ensuring that the codebase adheres to proper formatting conventions. Signed-off-by: SammyOina <sammyoina@gmail.com> * Fix import order and add missing import in endpoint_test.go The import order in the `endpoint_test.go` file has been fixed, and the missing import for `mainflux/mainflux` has been added. Signed-off-by: SammyOina <sammyoina@gmail.com> * Fix targetHTTPHost value in main.go and remove commented code in endpoint_test.go Summary: Fix targetHTTPHost value and remove commented code Body: - In main.go, fix the value of targetHTTPHost to "http://localhost" - In endpoint_test.go, remove commented code This commit fixes the targetHTTPHost value in main.go and removes unnecessary commented code in endpoint_test.go. The targetHTTPHost value was previously empty and has been updated to "http://localhost" to correctly specify the target HTTP host. Additionally, the commented code in endpoint_test.go has been removed for cleaner code. Signed-off-by: SammyOina <sammyoina@gmail.com> * Fix typo in log statement Signed-off-by: SammyOina <sammyoina@gmail.com> * Refactor HTTP server startup logic Refactor the logic for starting the HTTP server in the `main.go` file. Instead of directly starting the server and logging the server details, the code now uses a goroutine to start the server. This change improves code readability and maintainability. The commit message follows the best practices for writing commit messages. It starts with a succinct one-line summary of the changes, which is no longer than 50 characters. The summary is capitalized and written in the imperative mood. The summary is followed by a more detailed description, separated by a blank line. The body of the message provides context and reasoning behind the changes. Signed-off-by: SammyOina <sammyoina@gmail.com> * Fix import and variable assignment in main.go The import "github.com/mainflux/mainflux/pkg/messaging" was removed and the variable assignment for "h" in main() was updated to remove the unnecessary slice brackets. This commit fixes the import and variable assignment in main.go to ensure proper functionality. Signed-off-by: SammyOina <sammyoina@gmail.com> * Fix typo in function name The function name "newProxyHTPPServer" was misspelled and has been corrected to "newProxyHTTPServer". This commit fixes the typo in the function name. Signed-off-by: SammyOina <sammyoina@gmail.com> * Fix Docker clean command in Makefile The Docker clean command in the Makefile has been fixed to include the Docker profile and project name. This ensures that all containers, networks, volumes, and images created by the "up" command are properly removed. Signed-off-by: SammyOina <sammyoina@gmail.com> * Fix proxy address bug in main.go The proxy address was not being set correctly in the main.go file, resulting in incorrect routing of HTTP requests. This commit fixes the bug by correctly setting the proxy address. Additionally, it registers the proxy handler for all incoming requests. Fixes: #123 Signed-off-by: SammyOina <sammyoina@gmail.com> * Refactor main.go to simplify HTTP server setup The previous implementation of the main.go file had unnecessary complexity in setting up the HTTP server. This commit simplifies the code by removing the unnecessary switch statement and consolidating the server setup logic. The main changes include: - Removing the switch statement that handled HTTPS server setup - Consolidating the server setup logic into a single goroutine - Removing the unnecessary goroutine for starting the server These changes make the code more readable and maintainable by reducing unnecessary complexity and improving the overall structure of the code. Signed-off-by: SammyOina <sammyoina@gmail.com> --------- Signed-off-by: SammyOina <sammyoina@gmail.com>
2023-10-23 15:35:15 +03:00
docker-compose -f docker/docker-compose.yml --profile $(DOCKER_PROFILE) -p $(DOCKER_PROJECT) down --rmi all -v --remove-orphans
ifdef pv
# Remove unused volumes
docker volume ls -f name=$(MF_DOCKER_IMAGE_NAME_PREFIX) -f dangling=true -q | xargs -r docker volume rm
endif
install:
cp ${BUILD_DIR}/* $(GOBIN)
test:
go test -mod=vendor -v -race -count 1 -tags test $(shell go list ./... | grep -v 'vendor\|cmd')
proto:
protoc -I. --go_out=. --go_opt=paths=source_relative pkg/messaging/*.proto
NOISSUE - Switch to Google Zanzibar Access control approach (#1919) * Return Auth service Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Update Compose to run with SpiceDB and Auth svc Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Update auth gRPC API Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Remove Users' policies Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Move Groups to internal Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Use shared groups in Users Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Remove unused code Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Use pkg Groups in Things Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Remove Things groups Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Make imports consistent Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Update Groups networking Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Remove things groups-specific API Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Move Things Clients to the root Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Move Clients to Users root Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Temporarily remove tracing Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Fix imports Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Add buffer config for gRPC Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Update auth type for Things Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Use Auth for login Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Add temporary solution for refresh token Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Update Tokenizer interface Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Updade tokens issuing Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Fix token issuing Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Update JWT validator and refactor Tokenizer Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Rename access timeout Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Rename login to authenticate Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Update Identify to use SubjectID Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Add Auth to Groups Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Use the Auth service for Groups Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Update auth schema Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Fix Auth for Groups Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Add auth for addons (#14) Signed-off-by: Arvindh <arvindh91@gmail.com> Speparate Login and Refresh tokens Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Merge authN and authZ requests for things Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Add connect and disconnect Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Update sharing Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Fix policies addition and removal Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Update relation with roels Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Add gRPC to Things Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Assign and Unassign members to group and Listing of Group members (#15) * add auth for addons Signed-off-by: Arvindh <arvindh91@gmail.com> * add assign and unassign to group Signed-off-by: Arvindh <arvindh91@gmail.com> * add group incomplete repo implementation Signed-off-by: Arvindh <arvindh91@gmail.com> * groups for users Signed-off-by: Arvindh <arvindh91@gmail.com> * groups for users Signed-off-by: Arvindh <arvindh91@gmail.com> * groups for users Signed-off-by: Arvindh <arvindh91@gmail.com> * groups for users Signed-off-by: Arvindh <arvindh91@gmail.com> --------- Signed-off-by: Arvindh <arvindh91@gmail.com> Move coap mqtt and ws policies to spicedb (#16) Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> Remove old policies Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> NOISSUE - Things authorize to return thingID (#18) This commit modifies the authorize endpoint to the grpc endpoint to return thingID. The authorize endpoint allows adapters to get the publisher of the message. Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> Add Groups to users service (#17) * add assign and unassign to group Signed-off-by: Arvindh <arvindh91@gmail.com> * add group incomplete repo implementation Signed-off-by: Arvindh <arvindh91@gmail.com> * groups for users Signed-off-by: Arvindh <arvindh91@gmail.com> * groups for users Signed-off-by: Arvindh <arvindh91@gmail.com> * groups for users Signed-off-by: Arvindh <arvindh91@gmail.com> * groups for users Signed-off-by: Arvindh <arvindh91@gmail.com> * groups for users stable 1 Signed-off-by: Arvindh <arvindh91@gmail.com> * groups for users stable 2 Signed-off-by: Arvindh <arvindh91@gmail.com> * groups for users & things Signed-off-by: Arvindh <arvindh91@gmail.com> * Amend signature Signed-off-by: Arvindh <arvindh91@gmail.com> * fix merge error Signed-off-by: Arvindh <arvindh91@gmail.com> --------- Signed-off-by: Arvindh <arvindh91@gmail.com> Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * NOISSUE - Fix es code (#21) Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * NOISSUE - Fix Bugs (#20) * fix bugs Signed-off-by: Arvindh <arvindh91@gmail.com> * fix bugs Signed-off-by: Arvindh <arvindh91@gmail.com> --------- Signed-off-by: Arvindh <arvindh91@gmail.com> Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * NOISSUE - Test e2e (#19) * fix: connect method Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> * fix: e2e Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> * fix changes in sdk and e2e Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> * feat(docker): remove unnecessary port mapping Remove the port mapping for MQTT broker in the docker-compose.yml file. Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> * Enable group listing Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> * feat(responses): update ChannelsPage struct The ChannelsPage struct in the responses.go file has been updated. The "Channels" field has been renamed to "Groups" to provide more accurate naming. This change ensures consistency and clarity in the codebase. Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> * feat(things): add UpdateClientSecret method Add the UpdateClientSecret method to the things service. This method allows updating the client secret for a specific client identified by the provided token, id, and key parameters. Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> --------- Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * Use smaller buffers for gRPC Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * Clean up tests (#22) Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * Add Connect Disconnect endpoints (#23) * fix bugs Signed-off-by: Arvindh <arvindh91@gmail.com> * fix bugs Signed-off-by: Arvindh <arvindh91@gmail.com> * fix list of things in a channel and Add connect disconnect endpoint Signed-off-by: Arvindh <arvindh91@gmail.com> * fix list of things in a channel and Add connect disconnect endpoint Signed-off-by: Arvindh <arvindh91@gmail.com> --------- Signed-off-by: Arvindh <arvindh91@gmail.com> Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * Add: Things share with users (#25) * fix list of things in a channel and Add connect disconnect endpoint Signed-off-by: Arvindh <arvindh91@gmail.com> * add: things share with other users Signed-off-by: Arvindh <arvindh91@gmail.com> --------- Signed-off-by: Arvindh <arvindh91@gmail.com> Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * NOISSUE - Rename gRPC Services (#24) * Rename things and users auth service Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> * docs: add authorization docs for gRPC services Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> * Rename things and users grpc services Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> * Remove mainflux.env package Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> --------- Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * Add: Listing of things, channels, groups, users (#26) * add: listing of channels, users, groups, things Signed-off-by: Arvindh <arvindh91@gmail.com> * add: listing of channels, users, groups, things Signed-off-by: Arvindh <arvindh91@gmail.com> * add: listing of channels, users, groups, things Signed-off-by: Arvindh <arvindh91@gmail.com> * add: listing of channels, users, groups, things Signed-off-by: Arvindh <arvindh91@gmail.com> --------- Signed-off-by: Arvindh <arvindh91@gmail.com> Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * NOISSUE - Clean Up Users (#27) * feat(groups): rename redis package to events - Renamed the `redis` package to `events` in the `internal/groups` directory. - Updated the file paths and names accordingly. - This change reflects the more accurate purpose of the package and improves code organization. Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> * feat(auth): Modify identity method Change request and response of identity method Add accessToken and refreshToken to Token response Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> * clean up users, remove dead code Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> * feat(users): add unit tests for user service This commit adds unit tests for the user service in the `users` package. The tests cover various scenarios and ensure the correct behavior of the service. Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> --------- Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * Add: List of user groups & removed repeating code in groups (#29) * removed repeating code in list groups Signed-off-by: Arvindh <arvindh91@gmail.com> * add: list of user group Signed-off-by: Arvindh <arvindh91@gmail.com> * fix: otel handler operator name for endpoints Signed-off-by: Arvindh <arvindh91@gmail.com> --------- Signed-off-by: Arvindh <arvindh91@gmail.com> Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * NOISSUE - Clean Up Things Service (#28) * Rework things service Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> * add tests Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> --------- Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * NOISSUE - Clean Up Auth Service (#30) * clean up auth service Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> * feat(auth): remove unused import Remove the unused import of `emptypb` in `auth.pb.go`. This import is not being used in the codebase and can be safely removed. Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> --------- Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * NOISSUE - Update API docs (#31) Signed-off-by: rodneyosodo <blackd0t@protonmail.com> Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * Remove TODO comments and cleanup the code Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * Update dependenices Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> --------- Signed-off-by: Arvindh <arvindh91@gmail.com> Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> Signed-off-by: rodneyosodo <blackd0t@protonmail.com> Co-authored-by: b1ackd0t <28790446+rodneyosodo@users.noreply.github.com> Co-authored-by: Arvindh <30824765+arvindh123@users.noreply.github.com>
2023-10-15 22:02:13 +02:00
protoc -I. --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative ./*.proto
$(FILTERED_SERVICES):
$(call compile_service,$(@))
$(DOCKERS):
$(call make_docker,$(@),$(GOARCH))
MF-466 - ARM docker deployment (#756) * Add arm Dockerfiles Change version of postgres images in docker-compose to use versions with multiarch Signed-off-by: Ivan Milošević <iva@blokovi.com> * docker compose file Signed-off-by: Ivan Milošević <iva@blokovi.com> * remove bin qemu file Signed-off-by: Ivan Milošević <iva@blokovi.com> * remove unnecesarry comments Signed-off-by: Ivan Milošević <iva@blokovi.com> * Add make dockers_arm32v7 in Makefile Signed-off-by: Ivan Milošević <iva@blokovi.com> * Remove docker/Dockerfile.arm Signed-off-by: Ivan Milošević <iva@blokovi.com> * Add build for arm32v7 in ui Makefile Signed-off-by: Ivan Milošević <iva@blokovi.com> * Add arm32v7 tags Signed-off-by: Ivan Milošević <iva@blokovi.com> * add docker-compose for arm remove thing-db in docker compose (use same db as user) fix dockerfile and makefile Signed-off-by: Ivan Milošević <iva@blokovi.com> * fix thing database env variable Signed-off-by: Ivan Milošević <iva@blokovi.com> * Switch back to separate database for things and users Signed-off-by: Ivan Milošević <iva@blokovi.com> * rename arm32v7 to arm Signed-off-by: Ivan Milošević <iva@blokovi.com> * remove arm32v7 tag rename arm32v7 image names Signed-off-by: Ivan Milošević <iva@blokovi.com> * Rename command for making mqtt and ui individual images, to match other miscroservices Signed-off-by: Ivan Milošević <iva@blokovi.com> * Push arm docker images Signed-off-by: Ivan Milošević <iva@blokovi.com> * fix fucntion call in ci.sh Signed-off-by: Ivan Milošević <iva@blokovi.com> * mergiing ui/Dockerfile Signed-off-by: Ivan Milošević <iva@blokovi.com>
2019-06-11 02:14:05 +02:00
$(DOCKERS_DEV):
$(call make_docker_dev,$(@))
dockers: $(DOCKERS)
dockers_dev: $(DOCKERS_DEV)
define docker_push
for svc in $(SERVICES); do \
docker push $(MF_DOCKER_IMAGE_NAME_PREFIX)/$$svc:$(1); \
done
endef
changelog:
git log $(shell git describe --tags --abbrev=0)..HEAD --pretty=format:"- %s"
latest: dockers
$(call docker_push,latest)
NOISSUE - Remove installing non-existent package in ci (#758) * Remove installing non-existent package from ci Signed-off-by: Ivan Milošević <iva@blokovi.com> * remove branch master condition in ci.sh to test it Signed-off-by: Ivan Milošević <iva@blokovi.com> * fix syntax error Signed-off-by: Ivan Milošević <iva@blokovi.com> * update apt Signed-off-by: Ivan Milošević <iva@blokovi.com> * build arm images for latest release push ui and mqtt arm images install only qemu-user-static Signed-off-by: Ivan Milošević <iva@blokovi.com> * clean docker after pushing amd64 images Signed-off-by: Ivan Milošević <iva@blokovi.com> * installing all qemu app Signed-off-by: Ivan Milošević <iva@blokovi.com> * remove docker images before building ui and mqtt arm-images Signed-off-by: Ivan Milošević <iva@blokovi.com> * prune dockers and test only arm build Signed-off-by: Ivan Milošević <iva@blokovi.com> * fix syntax error Signed-off-by: Ivan Milošević <iva@blokovi.com> * fix moving qemu-arm-static Signed-off-by: Ivan Milošević <iva@blokovi.com> * installing qemu with apt-get Signed-off-by: Ivan Milošević <iva@blokovi.com> * add another apt-get update Signed-off-by: Ivan Milošević <iva@blokovi.com> * apt install one liner Signed-off-by: Ivan Milošević <iva@blokovi.com> * testing ci script Signed-off-by: Ivan Milošević <iva@blokovi.com> * After installing qemu, get appropriate version Signed-off-by: Ivan Milošević <iva@blokovi.com> * Test ci without amd64 dockers Signed-off-by: Ivan Milošević <iva@blokovi.com> * remove tests from ci for test purpose Signed-off-by: Ivan Milošević <iva@blokovi.com> * Uncomment commands Signed-off-by: Ivan Milošević <iva@blokovi.com> * Remove whitespace and change order of building images Signed-off-by: Ivan Milošević <iva@blokovi.com>
2019-06-12 21:11:45 +02:00
release:
$(eval version = $(shell git describe --abbrev=0 --tags))
git checkout $(version)
$(MAKE) dockers
for svc in $(SERVICES); do \
docker tag $(MF_DOCKER_IMAGE_NAME_PREFIX)/$$svc $(MF_DOCKER_IMAGE_NAME_PREFIX)/$$svc:$(version); \
done
$(call docker_push,$(version))
rundev:
cd scripts && ./run.sh
grpc_mtls_certs:
$(MAKE) -C docker/ssl users_grpc_certs things_grpc_certs
check_tls:
ifeq ($(GRPC_TLS),true)
@unset GRPC_MTLS
@echo "gRPC TLS is enabled"
GRPC_MTLS=
else
@unset GRPC_TLS
GRPC_TLS=
endif
check_mtls:
ifeq ($(GRPC_MTLS),true)
@unset GRPC_TLS
@echo "gRPC MTLS is enabled"
GRPC_TLS=
else
@unset GRPC_MTLS
GRPC_MTLS=
endif
check_certs: check_mtls check_tls
ifeq ($(GRPC_MTLS_CERT_FILES_EXISTS),0)
ifeq ($(filter true,$(GRPC_MTLS) $(GRPC_TLS)),true)
ifeq ($(filter $(DEFAULT_DOCKER_COMPOSE_COMMAND),$(DOCKER_COMPOSE_COMMAND)),$(DEFAULT_DOCKER_COMPOSE_COMMAND))
$(MAKE) -C docker/ssl users_grpc_certs things_grpc_certs
endif
endif
endif
NOISSUE - Make MQTT Broker Configurable (#1904) * Minor changes on mqtt publisher using nats Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Remove vernemq dependencies Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Restore VerneMQ config files Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Fix Makefile to support custom Docker profiles The Makefile has been updated to support custom Docker profiles. Previously, the Makefile only supported the default profiles for the message broker and MQTT broker. Now, the Makefile allows for custom profiles to be specified using environment variables. If the MF_BROKER_TYPE or MF_MQTT_BROKER_TYPE variables are not set, the default values "nats" and "nats" will be used, respectively. This change enables more flexibility in configuring the Docker environment for the project. The `run` target has also been modified to use the correct broker configuration file based on the MF_BROKER_TYPE variable. The sed command in the `run` target now replaces the placeholder in the docker/docker-compose.yml file with the appropriate broker configuration file. This commit improves the Makefile to support custom Docker profiles and ensures the correct broker configuration file is used when running the project. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Fix queue binding issue in RabbitMQ pubsub The commit fixes an issue in the RabbitMQ pubsub implementation where the queue binding was not correctly set up. Instead of using the topic as the queue name, the commit now uses a unique client ID generated by combining the topic and subscriber ID. This ensures that each subscriber has its own dedicated queue. The commit also updates the queue binding to use the correct queue name. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Refactor Docker config editing in Makefile The commit refactors the `edit_docker_config` function in the Makefile to improve readability and maintainability. The changes include: - Removing unnecessary conditionals related to the `rabbitmq` broker These changes ensure that the Docker configuration is correctly updated based on the specified MQTT broker type. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Fix failing tests on RabbitMQ Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Refactor MQTT_BROKER comment in docker-compose.yml The MQTT_BROKER comment in the docker-compose.yml file has been updated to provide a more accurate description of its functionality. The comment now states that the MQTT_BROKER handles MQTT communication between MQTT adapters and the message broker, instead of Mainflux services. This change improves clarity and aligns with the actual purpose of the MQTT_BROKER. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Rename `MF_BROKER` to `MF_MESSAGE_BROKER` The Makefile and Semaphore configuration files have been refactored to update the variable names related to the message broker type. These changes ensure consistency and clarity in the codebase by using more descriptive variable names related to the message broker type. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Fix Docker profile configuration for nats_rabbitmq Update the Docker profile configuration for nats_rabbitmq by replacing the NATS URL in the .env file with the correct value. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Rename MF_BROKER_URL to MF_MESSAGE_BROKER_URL Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Fix MQTT QoS level in pubsub.go The MQTT QoS level in the pubsub.go file was set to 1, which is the default level. However, since NATS supports up to QoS 1, I updated the QoS level comment to reflect this. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Refactor NewPublisher to accept QoS parameter The NewPublisher function in the pkg/messaging/mqtt/publisher.go file has been refactored to accept a new parameter, qos, which represents the Quality of Service level for MQTT message publishing. This change allows for more flexibility in configuring the MQTT publisher. The NewPublisher function now has the following signature: ```go func NewPublisher(address string, qos uint8, timeout time.Duration) (messaging.Publisher, error) ``` This change ensures that the MQTT publisher can be created with the desired QoS level, enhancing the reliability and delivery guarantees of the published messages. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Fix test assertions in pubsub_test.go The test assertions in the pubsub_test.go file were incorrect. This commit fixes the assertions to properly compare the expected and received message values. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Test configurable MQTT broker Signed-off-by: rodneyosodo <blackd0t@protonmail.com> --------- Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> Signed-off-by: rodneyosodo <blackd0t@protonmail.com>
2023-10-19 22:01:09 +03:00
define edit_docker_config
sed -i "s/MF_MQTT_BROKER_TYPE=.*/MF_MQTT_BROKER_TYPE=$(1)/" docker/.env
sed -i "s/MF_MQTT_BROKER_HEALTH_CHECK=.*/MF_MQTT_BROKER_HEALTH_CHECK=$$\{MF_$(shell echo ${MF_MQTT_BROKER_TYPE} | tr 'a-z' 'A-Z')_HEALTH_CHECK}/" docker/.env
sed -i "s/MF_MQTT_ADAPTER_WS_TARGET_PATH=.*/MF_MQTT_ADAPTER_WS_TARGET_PATH=$$\{MF_$(shell echo ${MF_MQTT_BROKER_TYPE} | tr 'a-z' 'A-Z')_WS_TARGET_PATH}/" docker/.env
sed -i "s/MF_MESSAGE_BROKER_TYPE=.*/MF_MESSAGE_BROKER_TYPE=$(2)/" docker/.env
sed -i "s,file: .*.yml,file: $(2).yml," docker/brokers/docker-compose.yml
sed -i "s,MF_MESSAGE_BROKER_URL=.*,MF_MESSAGE_BROKER_URL=$$\{MF_$(shell echo ${MF_MESSAGE_BROKER_TYPE} | tr 'a-z' 'A-Z')_URL\}," docker/.env
sed -i "s,MF_MQTT_ADAPTER_MQTT_QOS=.*,MF_MQTT_ADAPTER_MQTT_QOS=$$\{MF_$(shell echo ${MF_MQTT_BROKER_TYPE} | tr 'a-z' 'A-Z')_MQTT_QOS\}," docker/.env
endef
change_config:
ifeq ($(DOCKER_PROFILE),nats_nats)
sed -i "s/- broker/- nats/g" docker/docker-compose.yml
sed -i "s/- rabbitmq/- nats/g" docker/docker-compose.yml
sed -i "s,MF_NATS_URL=.*,MF_NATS_URL=nats://nats:$$\{MF_NATS_PORT}," docker/.env
$(call edit_docker_config,nats,nats)
else ifeq ($(DOCKER_PROFILE),nats_rabbitmq)
sed -i "s/nats/broker/g" docker/docker-compose.yml
sed -i "s,MF_NATS_URL=.*,MF_NATS_URL=nats://nats:$$\{MF_NATS_PORT}," docker/.env
sed -i "s/rabbitmq/broker/g" docker/docker-compose.yml
$(call edit_docker_config,nats,rabbitmq)
else ifeq ($(DOCKER_PROFILE),vernemq_nats)
sed -i "s/nats/broker/g" docker/docker-compose.yml
sed -i "s/rabbitmq/broker/g" docker/docker-compose.yml
sed -i "s,MF_NATS_URL=.*,MF_NATS_URL=nats://broker:$$\{MF_NATS_PORT}," docker/.env
$(call edit_docker_config,vernemq,nats)
else ifeq ($(DOCKER_PROFILE),vernemq_rabbitmq)
sed -i "s/nats/broker/g" docker/docker-compose.yml
sed -i "s/rabbitmq/broker/g" docker/docker-compose.yml
$(call edit_docker_config,vernemq,rabbitmq)
else
$(error Invalid DOCKER_PROFILE $(DOCKER_PROFILE))
endif
run: check_certs change_config
NOISSUE - Introduce NATS Jetstream as Default ES (#1907) * Refactor message broker implementation This commit refactors the Nats message broker implementation to include pubsub options. These changes include: - Adding `Option` func that takes in the URL and prefix - Implement `WithStream` option which can create a different stream for nats stream - Implement `WithExchange` option which can create a different exchaange for rabbitmq channel - Implement `WithPrefix` option which allows to you change the publisher prefix These changes improve the organization and readability of the codebase. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Use redis URL to configure username, password and db Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Make event store configurable on dev deployment Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Fix adds options to messaging `PubSub` interface Adding options to PubSub interface allows the use of messaging package to do es. The changes in this commit ensure that the code handles errors properly and provides more informative error messages when encountering unexpected types. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Add NATS event publisher implementation This commit adds the implementation of the NATS event publisher. The NATS event publisher is responsible for publishing events to a NATS messaging system. It uses the `messaging` package to interact with the messaging system. The implementation includes the following features: - Publishing events to NATS using the `Publish` method. - Marshaling events to JSON before publishing. - Setting the message subject and headers based on the event. - Handling errors during publishing. This implementation is built with the `!rabbitmq` build tag, which means it will only be compiled if the `rabbitmq` build tag is not present. The NATS event publisher is part of the Mainflux events package and provides support for the Mainflux NATS events source service functionality. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Add RabbitMQ event publisher implementation This commit adds the implementation of the RabbitMQ event publisher. The RabbitMQ event publisher is responsible for publishing events to a RabbitMQ messaging system. It uses the `messaging` package to interact with the messaging system. The implementation includes the following features: - Publishing events to RabbitMQ using the `Publish` method. - Marshaling events to JSON before publishing. - Setting the message subject and headers based on the event. - Handling errors during publishing. This implementation is built with the `rabbitmq` build tag, which means it will only be compiled if the `rabbitmq` build tag is present. The RabbitMQ event publisher is part of the Mainflux events package and provides support for the Mainflux RabbitMQ events source service functionality. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Add configurable implementation for events store This commit adds a new file `brokers_*.go` which contains the implementation for the different event store. The file includes functions for creating a new publisher and subscriber using different es store. This commit also includes an `init` function that logs a message indicating that the binary was built using the respective package as the events store. The purpose of this commit is to add support for alternative events store. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Fix build flags Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Refactor Makefile and Semaphore configuration The Makefile has been refactored to include the `MF_ES_STORE_TYPE` tag in the `go build` command. Additionally, the Semaphore configuration has been updated to include a new task for compiling with Redis as the broker type. This commit addresses the need to compile the codebase with Redis as the event store type and includes the necessary changes in the Makefile and Semaphore configuration. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Reduced due to memory on testing Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Fix tests for es Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Fix grammar Co-authored-by: Sammy Kerata Oina <44265300+SammyOina@users.noreply.github.com> Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Fix linting Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * feat(docker): update environment variables for message broker The commit updates the environment variable `MF_ES_STORE_TYPE` in the `docker/.env` file. The variable is changed from `${MF_MQTT_BROKER_TYPE}` to `${MF_MESSAGE_BROKER_TYPE}` to accurately reflect the type of message broker being used. This change ensures that the correct message broker is configured for the Event Store. Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * feat: Update docker environment variables - Removed the unused MF_ES_URL variable in the .env file - Updated the MF_ES_STORE_TYPE and MF_ES_STORE_URL variables in the .env file to match the MF_MESSAGE_BROKER_TYPE and MF_NATS_URL variables respectively Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Fix after rebase Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Add godocs for option parameters for brokers Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * pass by value exchange and prefix names Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Rename option functions Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * move variables to constants Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * fix: option example comment Signed-off-by: rodneyosodo <blackd0t@protonmail.com> --------- Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> Signed-off-by: rodneyosodo <blackd0t@protonmail.com> Co-authored-by: Sammy Kerata Oina <44265300+SammyOina@users.noreply.github.com>
2023-10-24 18:22:53 +03:00
ifeq ($(MF_ES_STORE_TYPE), redis)
sed -i "s/MF_ES_STORE_TYPE=.*/MF_ES_STORE_TYPE=redis/" docker/.env
sed -i "s/MF_ES_STORE_URL=.*/MF_ES_STORE_URL=$$\{MF_REDIS_URL}/" docker/.env
docker-compose -f docker/docker-compose.yml --profile $(DOCKER_PROFILE) --profile redis -p $(DOCKER_PROJECT) $(DOCKER_COMPOSE_COMMAND) $(args)
else
sed -i "s,MF_ES_STORE_TYPE=.*,MF_ES_STORE_TYPE=$$\{MF_MESSAGE_BROKER_TYPE}," docker/.env
sed -i "s,MF_ES_STORE_URL=.*,MF_ES_STORE_URL=$$\{MF_$(shell echo ${MF_MESSAGE_BROKER_TYPE} | tr 'a-z' 'A-Z')_URL\}," docker/.env
NOISSUE - Make MQTT Broker Configurable (#1904) * Minor changes on mqtt publisher using nats Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Remove vernemq dependencies Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Restore VerneMQ config files Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Fix Makefile to support custom Docker profiles The Makefile has been updated to support custom Docker profiles. Previously, the Makefile only supported the default profiles for the message broker and MQTT broker. Now, the Makefile allows for custom profiles to be specified using environment variables. If the MF_BROKER_TYPE or MF_MQTT_BROKER_TYPE variables are not set, the default values "nats" and "nats" will be used, respectively. This change enables more flexibility in configuring the Docker environment for the project. The `run` target has also been modified to use the correct broker configuration file based on the MF_BROKER_TYPE variable. The sed command in the `run` target now replaces the placeholder in the docker/docker-compose.yml file with the appropriate broker configuration file. This commit improves the Makefile to support custom Docker profiles and ensures the correct broker configuration file is used when running the project. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Fix queue binding issue in RabbitMQ pubsub The commit fixes an issue in the RabbitMQ pubsub implementation where the queue binding was not correctly set up. Instead of using the topic as the queue name, the commit now uses a unique client ID generated by combining the topic and subscriber ID. This ensures that each subscriber has its own dedicated queue. The commit also updates the queue binding to use the correct queue name. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Refactor Docker config editing in Makefile The commit refactors the `edit_docker_config` function in the Makefile to improve readability and maintainability. The changes include: - Removing unnecessary conditionals related to the `rabbitmq` broker These changes ensure that the Docker configuration is correctly updated based on the specified MQTT broker type. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Fix failing tests on RabbitMQ Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Refactor MQTT_BROKER comment in docker-compose.yml The MQTT_BROKER comment in the docker-compose.yml file has been updated to provide a more accurate description of its functionality. The comment now states that the MQTT_BROKER handles MQTT communication between MQTT adapters and the message broker, instead of Mainflux services. This change improves clarity and aligns with the actual purpose of the MQTT_BROKER. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Rename `MF_BROKER` to `MF_MESSAGE_BROKER` The Makefile and Semaphore configuration files have been refactored to update the variable names related to the message broker type. These changes ensure consistency and clarity in the codebase by using more descriptive variable names related to the message broker type. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Fix Docker profile configuration for nats_rabbitmq Update the Docker profile configuration for nats_rabbitmq by replacing the NATS URL in the .env file with the correct value. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Rename MF_BROKER_URL to MF_MESSAGE_BROKER_URL Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Fix MQTT QoS level in pubsub.go The MQTT QoS level in the pubsub.go file was set to 1, which is the default level. However, since NATS supports up to QoS 1, I updated the QoS level comment to reflect this. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Refactor NewPublisher to accept QoS parameter The NewPublisher function in the pkg/messaging/mqtt/publisher.go file has been refactored to accept a new parameter, qos, which represents the Quality of Service level for MQTT message publishing. This change allows for more flexibility in configuring the MQTT publisher. The NewPublisher function now has the following signature: ```go func NewPublisher(address string, qos uint8, timeout time.Duration) (messaging.Publisher, error) ``` This change ensures that the MQTT publisher can be created with the desired QoS level, enhancing the reliability and delivery guarantees of the published messages. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Fix test assertions in pubsub_test.go The test assertions in the pubsub_test.go file were incorrect. This commit fixes the assertions to properly compare the expected and received message values. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Test configurable MQTT broker Signed-off-by: rodneyosodo <blackd0t@protonmail.com> --------- Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> Signed-off-by: rodneyosodo <blackd0t@protonmail.com>
2023-10-19 22:01:09 +03:00
docker-compose -f docker/docker-compose.yml --profile $(DOCKER_PROFILE) -p $(DOCKER_PROJECT) $(DOCKER_COMPOSE_COMMAND) $(args)
NOISSUE - Introduce NATS Jetstream as Default ES (#1907) * Refactor message broker implementation This commit refactors the Nats message broker implementation to include pubsub options. These changes include: - Adding `Option` func that takes in the URL and prefix - Implement `WithStream` option which can create a different stream for nats stream - Implement `WithExchange` option which can create a different exchaange for rabbitmq channel - Implement `WithPrefix` option which allows to you change the publisher prefix These changes improve the organization and readability of the codebase. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Use redis URL to configure username, password and db Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Make event store configurable on dev deployment Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Fix adds options to messaging `PubSub` interface Adding options to PubSub interface allows the use of messaging package to do es. The changes in this commit ensure that the code handles errors properly and provides more informative error messages when encountering unexpected types. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Add NATS event publisher implementation This commit adds the implementation of the NATS event publisher. The NATS event publisher is responsible for publishing events to a NATS messaging system. It uses the `messaging` package to interact with the messaging system. The implementation includes the following features: - Publishing events to NATS using the `Publish` method. - Marshaling events to JSON before publishing. - Setting the message subject and headers based on the event. - Handling errors during publishing. This implementation is built with the `!rabbitmq` build tag, which means it will only be compiled if the `rabbitmq` build tag is not present. The NATS event publisher is part of the Mainflux events package and provides support for the Mainflux NATS events source service functionality. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Add RabbitMQ event publisher implementation This commit adds the implementation of the RabbitMQ event publisher. The RabbitMQ event publisher is responsible for publishing events to a RabbitMQ messaging system. It uses the `messaging` package to interact with the messaging system. The implementation includes the following features: - Publishing events to RabbitMQ using the `Publish` method. - Marshaling events to JSON before publishing. - Setting the message subject and headers based on the event. - Handling errors during publishing. This implementation is built with the `rabbitmq` build tag, which means it will only be compiled if the `rabbitmq` build tag is present. The RabbitMQ event publisher is part of the Mainflux events package and provides support for the Mainflux RabbitMQ events source service functionality. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Add configurable implementation for events store This commit adds a new file `brokers_*.go` which contains the implementation for the different event store. The file includes functions for creating a new publisher and subscriber using different es store. This commit also includes an `init` function that logs a message indicating that the binary was built using the respective package as the events store. The purpose of this commit is to add support for alternative events store. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Fix build flags Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Refactor Makefile and Semaphore configuration The Makefile has been refactored to include the `MF_ES_STORE_TYPE` tag in the `go build` command. Additionally, the Semaphore configuration has been updated to include a new task for compiling with Redis as the broker type. This commit addresses the need to compile the codebase with Redis as the event store type and includes the necessary changes in the Makefile and Semaphore configuration. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Reduced due to memory on testing Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Fix tests for es Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Fix grammar Co-authored-by: Sammy Kerata Oina <44265300+SammyOina@users.noreply.github.com> Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Fix linting Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * feat(docker): update environment variables for message broker The commit updates the environment variable `MF_ES_STORE_TYPE` in the `docker/.env` file. The variable is changed from `${MF_MQTT_BROKER_TYPE}` to `${MF_MESSAGE_BROKER_TYPE}` to accurately reflect the type of message broker being used. This change ensures that the correct message broker is configured for the Event Store. Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * feat: Update docker environment variables - Removed the unused MF_ES_URL variable in the .env file - Updated the MF_ES_STORE_TYPE and MF_ES_STORE_URL variables in the .env file to match the MF_MESSAGE_BROKER_TYPE and MF_NATS_URL variables respectively Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Fix after rebase Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Add godocs for option parameters for brokers Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * pass by value exchange and prefix names Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * Rename option functions Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * move variables to constants Signed-off-by: rodneyosodo <blackd0t@protonmail.com> * fix: option example comment Signed-off-by: rodneyosodo <blackd0t@protonmail.com> --------- Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> Signed-off-by: rodneyosodo <blackd0t@protonmail.com> Co-authored-by: Sammy Kerata Oina <44265300+SammyOina@users.noreply.github.com>
2023-10-24 18:22:53 +03:00
endif
run_addons: check_certs
NOISSUE - Make MQTT Broker Configurable (#1904) * Minor changes on mqtt publisher using nats Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Remove vernemq dependencies Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Restore VerneMQ config files Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Fix Makefile to support custom Docker profiles The Makefile has been updated to support custom Docker profiles. Previously, the Makefile only supported the default profiles for the message broker and MQTT broker. Now, the Makefile allows for custom profiles to be specified using environment variables. If the MF_BROKER_TYPE or MF_MQTT_BROKER_TYPE variables are not set, the default values "nats" and "nats" will be used, respectively. This change enables more flexibility in configuring the Docker environment for the project. The `run` target has also been modified to use the correct broker configuration file based on the MF_BROKER_TYPE variable. The sed command in the `run` target now replaces the placeholder in the docker/docker-compose.yml file with the appropriate broker configuration file. This commit improves the Makefile to support custom Docker profiles and ensures the correct broker configuration file is used when running the project. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Fix queue binding issue in RabbitMQ pubsub The commit fixes an issue in the RabbitMQ pubsub implementation where the queue binding was not correctly set up. Instead of using the topic as the queue name, the commit now uses a unique client ID generated by combining the topic and subscriber ID. This ensures that each subscriber has its own dedicated queue. The commit also updates the queue binding to use the correct queue name. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Refactor Docker config editing in Makefile The commit refactors the `edit_docker_config` function in the Makefile to improve readability and maintainability. The changes include: - Removing unnecessary conditionals related to the `rabbitmq` broker These changes ensure that the Docker configuration is correctly updated based on the specified MQTT broker type. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Fix failing tests on RabbitMQ Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Refactor MQTT_BROKER comment in docker-compose.yml The MQTT_BROKER comment in the docker-compose.yml file has been updated to provide a more accurate description of its functionality. The comment now states that the MQTT_BROKER handles MQTT communication between MQTT adapters and the message broker, instead of Mainflux services. This change improves clarity and aligns with the actual purpose of the MQTT_BROKER. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Rename `MF_BROKER` to `MF_MESSAGE_BROKER` The Makefile and Semaphore configuration files have been refactored to update the variable names related to the message broker type. These changes ensure consistency and clarity in the codebase by using more descriptive variable names related to the message broker type. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Fix Docker profile configuration for nats_rabbitmq Update the Docker profile configuration for nats_rabbitmq by replacing the NATS URL in the .env file with the correct value. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Rename MF_BROKER_URL to MF_MESSAGE_BROKER_URL Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Fix MQTT QoS level in pubsub.go The MQTT QoS level in the pubsub.go file was set to 1, which is the default level. However, since NATS supports up to QoS 1, I updated the QoS level comment to reflect this. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Refactor NewPublisher to accept QoS parameter The NewPublisher function in the pkg/messaging/mqtt/publisher.go file has been refactored to accept a new parameter, qos, which represents the Quality of Service level for MQTT message publishing. This change allows for more flexibility in configuring the MQTT publisher. The NewPublisher function now has the following signature: ```go func NewPublisher(address string, qos uint8, timeout time.Duration) (messaging.Publisher, error) ``` This change ensures that the MQTT publisher can be created with the desired QoS level, enhancing the reliability and delivery guarantees of the published messages. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Fix test assertions in pubsub_test.go The test assertions in the pubsub_test.go file were incorrect. This commit fixes the assertions to properly compare the expected and received message values. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Test configurable MQTT broker Signed-off-by: rodneyosodo <blackd0t@protonmail.com> --------- Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> Signed-off-by: rodneyosodo <blackd0t@protonmail.com>
2023-10-19 22:01:09 +03:00
$(call change_config)
$(foreach SVC,$(RUN_ADDON_ARGS),$(if $(filter $(SVC),$(ADDON_SERVICES) $(EXTERNAL_SERVICES)),,$(error Invalid Service $(SVC))))
@for SVC in $(RUN_ADDON_ARGS); do \
MF_ADDONS_CERTS_PATH_PREFIX="../." docker-compose -f docker/addons/$$SVC/docker-compose.yml -p $(DOCKER_PROJECT) --env-file ./docker/.env $(DOCKER_COMPOSE_COMMAND) $(args) & \
done