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

taskforce-connector-invincibles

v1.31.4

Published

Connects queues to Taskforce

Downloads

6

Readme

Taskforce Connector

This small service allows you to connect queues to Taskforce acting as a proxy between your queues and the UI. It is useful for connecting local development queues as well as production grade queues without the need of sharing passwords or establishing SSH tunnels.

Currently the connector supports Bull and BullMQ queues.

The connector is designed to be lightweight and using a minimal set of resources from the local queues.

Install

Using yarn

yarn global add taskforce-connector

Using npm:

npm install -g taskforce-connector

Usage

Call the tool and get a help on the options:

✗ taskforce --help

  Usage: taskforce [options]


  Options:

    -V, --version               output the version number
    -n, --name [name]           connection name [My Connection] (default: "My Connection")
    -t, --token [token]         api token (get yours at https://taskforce.sh)
    -p, --port [port]           redis port [6379] (default: "6379")
    --tls [tls]                 (default: "Activate secured TLS connection to Redis")
    -h, --host [host]           redis host [localhost] (default: "localhost")
    -d, --database [db]         redis database [0] (default: "0")
    --username [username]       redis username
    --passwd [passwd]           redis password
    --spasswd [spasswd]         redis sentinel password
    -u, --uri [uri]             redis uri
    --team [team]               specify team where to put the connection
    -b, --backend [host]        backend domain [api.taskforce.sh] (default: "wss://api.taskforce.sh")
    -s, --sentinels [host:port] comma-separated list of sentinel host/port pairs
    -m, --master [name]         name of master node used in sentinel configuration
    -h, --help                  output usage information
    --nodes [nodes]             comma-separated list of cluster nodes uris to connect to (Redis Cluster)
    --queues <queues>           optional comma-separated list of queues to monitor
    --queuesFile <queuesFile>   optional file with queues to monitor

Example:

✗ taskforce -n "transcoder connection" -t 2cfe6a1b-5f0e-466f-99ad-12f51bea79a7

The token 2cfe6a1b-5f0e-466f-99ad-12f51bea79a7 is a private token that can be retrieved at your Taskforce account.

After running the command, you should be able to see the connection appear automatically on the dashboard.

Sentinel Example:

✗ taskforce -n "transcoder connection" -t 2cfe6a1b-5f0e-466f-99ad-12f51bea79a7 -s sentinel1.mydomain:6379,sentinel2.mydomain:6379 -m mymaster

Note: You can also specify the following with environment variables.

token                 TASKFORCE_TOKEN
port                  REDIS_PORT
host                  REDIS_HOST
password              REDIS_PASSWD
sentinel-password     REDIS_SENTINEL_PASSWD
uri                   REDIS_URI
sentinels             REDIS_SENTINELS (comma separated list of sentinels)
master                REDIS_MASTER
nodes                 REDIS_NODES (comma separated list of nodes for Redis Cluster)

Note for Redis Cluster: You may also need to specify following with environment variables.

Cluster TLS Certificate      REDIS_CLUSTER_TLS

If your redis cluster still cannot connect due to failing certificate validation, you may need to pass this env to skip cert validation.

NODE_TLS_REJECT_UNAUTHORIZED="0"

Secured TLS Connections

Services that support TLS can also be used using the connector, use the --tls flag. Note that some services such as Heroku expects the port number to be "one more" than the normal unencrypted port read more.

Teams

You can use the connector to spawn queue connections to any team that you created on your organization, just pass the team name as an option:

✗ taskforce -n "transcoder connection" -t 2cfe6a1b-5f0e-466f-99ad-12f51bea79a7 --team "my awesome team"

Use as a library

It is also possible to add the connector as a library:

As a commonjs dependency:

const { Connect } = require("taskforce-connector");

const taskforceConnection = Connect("my connection", "my token", {
  host: "my redis host",
  port: "my redis port",
  password: "my redis password",
});

or as a es6 module:

import { Connect } from "taskforce-connector";

const taskforceConnection = Connect("my connection", "my token", {
  host: "my redis host",
  port: "my redis port",
  password: "my redis password",
});

If you are using the On Premises version of Taskforce, you can also specify the backend domain:

const taskforceConnection = Connect(
  "my connection",
  "my token",
  {
    host: "my redis host",
    port: "my redis port",
    password: "my redis password",
  },
  "My Prod Team", // optional team name
  "wss://mybackend.domain"
);