npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

cloudelements-petit

v0.6.34

Published

A Cloud Elements http proxy, named after Phillipe Petit

Downloads

21

Readme

Cloud Elements Ground2Cloud

npm version Semver Github Flow Circle CI

This is the Cloud Elements Ground2Cloud Remote Connector (a.k.a. 'Petit', after Phillipe Petit, a.k.a. 'Tightrope', a.k.a. 'Elements Connect'), which is used to allow a private backend service to expose itself to the Cloud Elements product.

Documentation on the Ground2Cloud configuration file, by default ~/.petit/config.toml can be found here. You can use the petit-client init or petit-server init (see below) to create this file.

Background

Most CE elements connect to "backend services" to operate. These customer-run services are either publically available via the internet, or co-located on the same private cloud deployment. However, some customers rightly wish to allow CE to access their services, while they want or need more stringent restrictions on everyone else. This is especially true when the services in question are located on end-user personal or business computers, and are generally not hosted environments.

In the past, the options for these customers were limited to:

  • keeping an up-to-date IP-based access whitelist
  • installing a full CE private cloud deployment
  • maintaining some sort of expensive and/or intrusive VPN setup

The Cloud Elements On-Prem Connector was created to solve this problem; it allows individual service providers to quickly and easily expose their service (and only their service) to elements that are located on the public cloud.

How It Works

The Cloud Elements On-Prem Connector comes in two parts: a server that runs on the CE public cloud, and a client that runs on the backend service machine or subnet. The client application registers itself with the server, and then opens a reverse proxy tunnel from the server machine to its host environment. As long as the client is running, public elements on the server environment will be able to access the target service on the client machine as if they were co-located.

Communication along the tunnel is protected by a TLS layer, so all chatter between the endpoints is secured. The connector implements a robust protocol for registration and selection, so all clients connect to all elements--and only those elements--which are destined for that customer.

Installation and Maintenance

The Cloud Elements On-Prem Connector is executed and distributed using the Node.js runtime environment. To expose a customer service, you will need to download and install Node on the client machine.

Note: The node version should be greater or equal to 10 node>=10

Once Node is installed, you can use the "Node Package Manager" (npm) to install the On-Prep Connector package. Run the following command with root or administrator privilege:

# npm install -g cloudelements-petit

You can keep the client up-to-date at any time using npm as well:

# npm update -g cloudelements-petit

Installation with Docker

You can use docker to create a node-based container, without having node installed on the host.

$ docker-compose build && docker-compose up

Currently, when using Ctrl-C to exit docker-compose, it does not shutdown cleanly, leaving a lock file in the container. If this happens, you need to run $ docker-compose up --force-recreate to start up the server again.

To avoid this issue entirely, don't use Ctrl-C to exit docker-compose; instead, issue a STOP command to the server:

$ echo -ne "STOP\x03" | nc <host> 3016

On linux, host is the actual host machine (i.e. localhost). When running on a MacOS, the host is the VirtualBox machine on which the Docker service runs. It's usually something like 192.168.99.100. Run docker-machine ls to find the actual IP.

Running the Client

Once installed, you can run petit-client commands to control the client process. For example, you can initialize the client like this (you don't need administrator privilege to run petit-client commands):

$ petit-client init

This command creates a default ~/.petit/config.toml configuration file in your home directory. You can edit the config file at this point to suit your needs: read more about the config file here.

Once the configuration is to your liking, you can register with the server:

$ petit-client register

And then start:

$ petit-client start

start will open the connection between your service and the public elements that use it. If you need to restart the machine where the Connector is running, be sure to start the Connector again.

Some other commands that you may find useful:

$ petit-client stop         # shutdown the connector
$ petit-client status       # output the connector status
$ petit-client unregister   # unregister from the server
$ petit-client config       # show the current configuration
$ petit-client sping        # to test server communication