Code Monkey home page Code Monkey logo

hoop-multi-connector's Introduction

Hoop Multi Connector

This Python script allows you to connect to multiple Hoop.dev protected databases and services at once.

Prerequisites

  • Python 3 with the toml package installed. Python 3.11 has it built-in.
  • Hoop CLI installed and authenticated

Setup

  1. Clone this repository.
  2. Copy the connections.example.toml file to connections.toml.
  3. Edit connections.toml to include your Hoop connections and their corresponding ports.

Python versions lower than 3.11

pip install tomli

Usage

Run the script with Python:

python3 hoop-multi-connector.py

Or make it executable:

chmod +x hoop-multi-connector.py
./hoop-multi-connector.py

What it does?

The script will check your Hoop installation and authentication, read the connections from connections.toml, and connect to all of them. It will wait for an EOF signal (Ctrl+D in most systems) to disconnect from all servers.

Functions

  • check_hoop(): Checks if Hoop is installed.
  • check_auth(): Checks if Hoop is authenticated.
  • read_connections_file(): Reads the connections from connections.toml.
  • connect_to_all(connections): Connects to all servers listed in connections.
  • wait_for_eof(): Waits for an EOF signal to disconnect from all servers.
  • register_cleanup_fn_on_signal_handlers(cleanup_fn): Registers a cleanup function to be called when the script receives a termination signal.

License

This project is licensed under the MIT License.

hoop-multi-connector's People

Contributors

maeroso avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.