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

sundry

v0.3.3

Published

A dynamically configurable, load balancing, reverse proxy.

Downloads

31

Readme

Sundry

The respectably rugged, remarkably reliable, reconfigurable, round-robin reverse proxy.

Sundry is a caching, dynamically configurable, reverse proxy, written in NodeJS and backed by redis.

NPM Version Linux

Cool Stuff

  • Dynamically add and remove hosts and backends with 0 downtime.
  • Wildcard https, http -> https redirect built in.
  • Centralize request logging and error handling without exposing backend errors.
  • Programically control backend access in real time.

Features

  • Separate CLI app to view and manage hosts and routes.
  • Really, Really fast, workload is very nearly 100% Asyncronous (Aside from a couple of ifs and assigments on each request)
  • System Daemon, can drop privleges to bind to ports 80 and 443, or use Authbind.

Installation and setup

Requirements

  • Redis server (with events enabled)

  • NodeJS v.11.0 +

  • AuthBind for port 80/443 bindings as non root user.

  • Upstart for running as a system daemon.

Install Sundry

Installation

$ npm install -g sundry

Configuration

Sundry relies on several configuration values, all of which can be provided in two ways.

  1. Enviornment Variables. (Useful for running as a system daemon)
  2. Values in $HOME/.sundry/config.json

You can generate a skeleton config by running...

$ sundry config build

This will create ~/.sundry/, ~/.sundry/ssl and ~/.sundry/config.json

Default files

Sundry uses some generic files for its default host, 404 and 500 error pages. You can override any of these by placing the correctly named file in ~/.sundry/html/<index/404/5xx>.html

Run Sundry

Production (some recent flavor of Ubuntu assumed.)

Create a new system user
$ sudo adduser --disabled-password sundry
Build default config (Optional)
$ sudo su -- sundry
$ sundry config build
Install/configure authbind
$ sudo apt-get install authbind
$ sudo touch /etc/authbind/byport/80 /etc/authbind/byport/443
$ sudo chown sundry:sundry /etc/authbind/byport/80 /etc/authbind/byport/443
$ sudo chmod 755 /etc/authbind/byport/80 /etc/authbind/byport/443
Create sundry.conf upstart file.
$ sudo touch /etc/init/sundry.conf
$ sudo <vi/emacs/nano/ed> /etc/init/sundry.conf
# no flame wars here
description "Sundry Dynamic Router"
author      "PaperElectron"

start on (local-filesystems and net-device-up IFACE=eth0)
stop on shutdown

# Automatically Respawn:
respawn
respawn limit 5 60

script
  export HOME=/home/sundry
  export NODE_ENV=production
  exec start-stop-daemon --start -u sundry --exec /usr/bin/authbind sundry start
end script

Test / Development

Generate a self signed cert.

Browsers will flag this as an insecure certificate.

$ cd ~/.sundry/ssl
$ openssl genrsa -out key.pem 2048
$ openssl req -new -key key.pem -out server.csr
$ openssl x509 -req -days 365 -in server.csr -signkey key.pem -out cert.pem