Introducing the Robotnetwork Project: slack integration using HSLHttp and a python based relay server

Robotnetwork

This is my third repository release aimed at facilitating Slack instant messaging integration with VENUS, this time using a relay server.

Why a Relay Server?

The direct approach initially seemed straightforward but encountered challenges within the VENUS HTTP library (see here). Implementing a relay server allowed me to overcome these hurdles. Additionally, the relay server improves our security framework by centralizing the management of sensitive communications. For example: 1. slack api credentials can be easily stored in a configuration file rather then hard coded. 2. The server checks the length of messages to ensure they do not exceed security limits before sending notifications to Slack, thereby preventing potential data leaks through this channel.

Prerequisites

  • Python 3.x: A compatible version of Python.
  • pip: Python’s package installer, required for managing external
    libraries.

Installation steps (detailed in github):

1. Download the repository

pip install robotnetwork

2. Generate a slack webhook

1.1. Create a Slack App:

  • Go to the Slack API page and click on “Create New App” (ensure you are signed in).
  • Choose “From scratch,” name your app, and select the Slack workspace
    where you want to send notifications.
  • Click “Create App.”

1.2. Configure Incoming Webhooks:

  • In your app settings, navigate to “Incoming Webhooks” from the sidebar.
  • Enable the feature by toggling the activation switch to “On.”
  • Click “Add New Webhook to Workspace” and choose the Slack channel
    where you wish to receive notifications.
  • Slack will generate a Webhook URL; copy this URL as it will be used during
    setup, so that the server can send notifications from your application.

3. Run the Server

Run the FastAPI server using this command:

robotnetwork

During the first run, you will be prompted to input the Slack webhook URL.

4. Install Hamilton HTTP library

Before you can add Slack notifications to your VENUS methods, you need to install the official Hamilton Http library on your your VENUS (Windows) computer:

Note: If you already have pyhamilton installed, this library is included, and you can skip this step.
To install the library, run the script:

run_installer.bat

Safety: The HSLHttp tool is developed and distributed by Hamilton, ensuring that it is safe and reliable. This can be verified through the included installer and documentation files within the ‘HSLHttp’ directory in our github repository.

5. Setup your VENUS method to send http requests to the server

Integrate HTTP request sections into your VENUS method scripts, as demonstrated in the provided aliquotes_slack.pkg method as a template for how to structure these requests within your method. I provide both the sources, and an exported package.

Summary

This release marks my third attempt to integrate Slack messaging with VENUS, now using a relay server for improved reliability and security.

5 Likes