1.0.23 • Published 3 years ago

@honcho/messages-gateway v1.0.23

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

Overview

Teams Messages Gateway it's a NodeJs Server that runs behind the client firewall. The Gateway subscribes to MS Graph Notifications, requesting ALL Teams Messages, and filters those notifications sending to Honcho only those from specified Monitored Users

Requirements

Install & Configure

  1. Run npm init
  2. Install the gateway integration running npm install @honcho/messages-gateway
  3. Edit the config/.env, adding the right values and configuration for the messages gateway

       # App Configs
       SERVER_URL='server.client.com' # The internet exposed URL used by MS Graph to send notifications
       PORT=3000 # The HTTP port (only needed if HTTP_ENABLED)
       HTTPS_PORT=8443 # The HTTPS port (only needed if HTTPS_ENABLED)
    
       # Endpoints
       ENDPOINT_GRAPH_LOGIN_BASE='https://login.microsoftonline.com' # Do not change
       ENDPOINT_GRAPH_BASE="https://graph.microsoft.com" # Do not change
       ENDPOINT_GRAPH_LOGIN="/oauth2/v2.0/token" # Do not change
       ENDPOINT_GRAPH_SCOPE=".default" # Do not change
       ENDPOINT_GRAPH="v1.0/teams" # Do not change
       ENDPOINT_GRAPH_SUBSCRIPTIONS='beta/subscriptions' # Do not change
       ENDPOINT_HONCHO_BASE="https://teams.getwhistler.io" # Do not change
       MEMBERS_ENDPOINT="members" # Do not change
       HONCHO_MONITORED_USERS_ENDPOINT="" # Do not change
       HONCHO_NOTIFICATIONS_ENDPOINT="" # Do not change
    
       # Other configs
       HTTPS_CERT="" # The path to the Cert
       HTTPS_KEY="" # The path to the Key
       HTTPS_ENABLED=false # Set to true to run HTTPS Server
       HTTP_ENABLED=true # Set to true to run HTTP Server
       CLIENT_ID="<ms_graph_app_id>" # MS Graph App Id (can be retrieved on Azure)
       TENANT_ID="<ms_graph_tenant_id>" # MS Graph Tenant Id (can be retrieved on Azure)
  4. Create a config/.env.private file, adding decreption key and app secret (look at config.env.private.example)

    DECRYPTION_KEY=123123123abcdefg # Base64 Private Key used to decrypt notifications
    CLIENT_PUBLIC_KEY=00000000 # Base64 Public Key or Certificate used to encrypt notification by MS Graph
    CLIENT_SECRET=123123123 # MS Graph Secret (can be retrieved on Azure)
  1. Populate config/monitored_users.json with a list of users that are supposed to be monitored. The list is a JSON Array of Object. The only mandatory field, at the moment, is the teamsId.
[    
    {
        "teamsId": "123123123" 
    },  
    {
        "teamsId": "abcdefghi" 
    }
]
  1. Run command npm run restart

NOTE: Any configuration changes must be followed by an app restart. ( Step 5 above )

HTTPS

The notification URL ( HONCHO_NOTIFICATIONS_ENDPOINT ), in .env is required to be under HTTPS. How this will be implemented depends on client infrastructure and it is a configurable / editable value by the client. The Gateway could be started as an HTTP or HTTPS server (look at the config/.env configuration file). In the latter case it would require for key and cert path to be specified inside the config/.env file.

Troubleshooting

Logs

Run npm run log to navigate through the gateway logs. Is possible to run npm run monit to get more details about the process running.

Debug

You can run npm run debug to zip the entire folder (excluding .env.private file) and the gateway logs. Then you can send the zip file to Honcho's Customer Support via email, in order to receive a better and quicker support.

1.0.23

3 years ago

1.0.19

3 years ago

1.0.22

3 years ago

1.0.21

3 years ago

1.0.20

3 years ago

1.0.17

3 years ago

1.0.16

3 years ago

1.0.15

3 years ago

1.0.14

3 years ago

1.0.13

3 years ago

1.0.11

3 years ago

1.0.10

3 years ago

1.0.12

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago