Git Product home page Git Product logo

taskforce-connector's Introduction

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 queues, with more to come in later releases.

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")
    --passwd [passwd]           redis 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

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
uri       REDIS_URI
sentinels REDIS_SENTINELS
master    REDIS_MASTER

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",
});

taskforce-connector's People

Contributors

dependabot[bot] avatar dubiousdavid avatar ex7r3me avatar manast avatar niek avatar ritter avatar semantic-release-bot 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.