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

rethinkdb-proxy

v0.0.6

Published

Reverse Proxy for RethinkDB. Make your RethinkDB publicly accessible through limiting what kind of queries can be executed on your RethinkDB database.

Downloads

3

Readme

RethinkDB Proxy

Build Status npm version

Reverse proxy for RethinkDB

Make your RethinkDB publicly accessible through limiting what kind of queries can be executed on your RethinkDB database.

Introduction by Example

First, start the proxy.

$ rethinkdb-proxy --port 8125

Using the proxy, getting all users in the users table is allowed.

r.connect({ port: 8125 }).then((conn) => {
  r.table('users').coerceTo('array').run(conn)
    .then((results) => {
      // We have some results!
      console.log(results); // [{ name: 'jorge' }, ... ]
    });
});

But deleting the users is not:

import rethinkDBProxy from 'rethinkdb-proxy';
rethinkDBProxy({ port: 8125 });

r.connect({ port: 8125 }).then((conn) => {
  r.table('users').delete('array').run(conn)
    .catch((err) => {
      // We get an error!
      console.log(err); // RqlClientError: Cannot execute query. "DELETE" query not allowed
    });
});

Running rethinkdb-proxy

CLI

rethinkdb-proxy comes with a CLI out-of-the box:

rethinkdb-proxy --port 8125 

Module

You can also import rethinkdb-proxy into Node.js:

import rethinkDBProxy from 'rethinkdb-proxy';
rethinkDBProxy({ port: 8125, allowInsert: true });

Options

Port

| Module Parameter | CLI Parameter | Default | API Reference | |--------------------|-------------------------|-------------|---------------| | port | --port | 8125 | |

Port in which to listen for driver connections. You should point your driver to this port.

RethinkDB Host

| Module Parameter | CLI Parameter | Default | API Reference | |--------------------|-------------------------|-------------|-------------------------------------------------------------| | rdbHost | --rdb-host | localhost | connect |

Host in which RethinkDB is running.

RethinkDB Port

| Module Parameter | CLI Parameter | Default | API Reference | |--------------------|-------------------------|-------------|--------------------------------------------------------------| | rdbPort | --rdb-host | localhost | connect |

Host in which RethinkDB is running.

Databases

| Module Parameter | CLI Parameter | Default | API Reference | |--------------------|-------------------------|-------------|---------------| | dbs | --dbs | [ ] | |

Database to allow access to. By default, all database are allowed except rethinkdb.

Allow System Database Access

| Module Parameter | CLI Parameter | Default | API Reference | |--------------------|-------------------------|-------------|---------------| | allowSysDbAccess | --allow-sys-db-access | false | |

Allow access to the rethinkdb database. This is not allowed by default, because access to this database allows to delete all other data.

Tables

| Module Parameter | CLI Parameter | Default | API Reference | |--------------------|-------------------------|-------------|---------------| | tables | --tables | [ ] | |

Tables to allow access to. Tables must include their database db.table.

Allow Writes

| Module Parameter | CLI Parameter | Default | API Reference | |--------------------|-------------------------|-------------|---------------| | allowWrites | --allow-writes | false | |

Allow all operations that write to the database (insert, update, delete).

Allow insert

| Module Parameter | CLI Parameter | Default | API Reference | |--------------------|-------------------------|-------------|-----------------------------------------------------------| | allowInsert | --allow-insert | false | insert |

Allow insert queries.

Allow update

| Module Parameter | CLI Parameter | Default | API Reference | |--------------------|-------------------------|-------------|-----------------------------------------------------------| | allowUpdate | --allow-update | false | update |

Allow update queries.

Allow delete

| Module Parameter | CLI Parameter | Default | API Reference | |--------------------|-------------------------|-------------|-----------------------------------------------------------| | allowDelete | --allow-delete | false | delete |

Allow delete queries.

Allow replace

| Module Parameter | CLI Parameter | Default | API Reference | |--------------------|-------------------------|-------------|------------------------------------------------------------| | allowReplace | --allow-replace | false | replace |

Allow replace queries.

Allow dbCreate

| Module Parameter | CLI Parameter | Default | API Reference | |--------------------|-------------------------|-------------|----------------------------------------------------------------| | allowDbCreate | --allow-db-create | false | dbCreate |

Allow dbCreate queries

Allow dbDrop

| Module Parameter | CLI Parameter | Default | API Reference | |--------------------|-------------------------|-------------|------------------------------------------------------------| | allowDbDrop | --allow-db-drop | false | dbDrop |

Allow dbDrop queries

Allow tableCreate

| Module Parameter | CLI Parameter | Default | API Reference | |--------------------|-------------------------|-------------|----------------------------------------------------------------------| | allowTableCreate | --allow-table-create | false | tableCreate |

Allow tableCreate queries.

Allow tableDrop

| Module Parameter | CLI Parameter | Default | API Reference | |--------------------|-------------------------|-------------|-------------------------------------------------------------------| | allowTableDrop | --allow-table-drop | false | tableDrop |

Allow tableDrop queries.

Allow Indexes

| Module Parameter | CLI Parameter | Default | API Reference | |--------------------|-------------------------|-------------|---------------| | allowIndexes | --allow-indexes | false | |

Allow all operations on indexes (indexCreate, indexDrop, indexRename).

Allow indexCreate

| Module Parameter | CLI Parameter | Default | API Reference | |--------------------|-------------------------|-------------|----------------------------------------------------------------------| | allowIndexCreate | --allow-index-create | false | indexCreate |

Allow indexCreate queries.

Allow indexDrop

| Module Parameter | CLI Parameter | Default | API Reference | |--------------------|-------------------------|-------------|------------------------------------------------------------------| | allowIndexDrop | --allow-index-drop | false | indexDrop |

Allow indexDrop queries.

Allow indexRename

| Module Parameter | CLI Parameter | Default | API Reference | |--------------------|-------------------------|-------------|----------------------------------------------------------------------| | allowIndexRename | --allow-index-rename | false | indexRename |

Allow indexRename queries.

Allow reconfigure

| Module Parameter | CLI Parameter | Default | API Reference | |--------------------|-------------------------|-------------|---------------------------------------------------------------------| | allowReconfigure | --allow-reconfigure | false | reconfigure |

Allow reconfigure queries.

Allow rebalance

| Module Parameter | CLI Parameter | Default | API Reference | |--------------------|-------------------------|-------------|----------------------------------------------------------------------| | allowRebalance | --allow-rebalance | false | rebalance |

Allow rebalance queries.

Allow http

| Module Parameter | CLI Parameter | Default | API Reference | |--------------------|-------------------------|-------------|-------------------------------------------------------| | allowHttp | --allow-http | false | http |

Allow queries with the http term.

Allow js

| Module Parameter | CLI Parameter | Default | API Reference | |--------------------|-------------------------|-------------|----------------------------------------------------| | allowJavascript | --allow-javascript | false | js |

Allow queries with the js term.