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

gorf

v0.6.1

Published

A simple webserver to trigger deployments on the server

Downloads

6

Readme

gorf is a very specific tool that exposes endpoints to listen for deploy commands for git repositories with a Dockerfile. When a deploy command is sent, it clones the repository and builds the project.

gorf is very much still a work in progress. It should only be used experimentally at this time.

Install

npm install -g gorf

Github / Gitlab hooks

Github and Gitlab both exposes an option called webhooks. Whenever a commit is pushed, it calls the specified webhook URL with a payload containing information about the commit.

What gorf does

gorf exposes a small express server that can receive these calls. The webhook URL, along with the webhook payload, contains the information that gorf uses to deploy the application.

Right now, gorf's reaction to a push is always to clone and build the expected Dockerfile inside the project. It then runs the built image.

How to use it

The minimum configuration is to set the SECRET env var, which is used to obfuscate the URL used for deployments:

SECRET=very-secret-url gorf

gorf then exposes the webhooks on localhost:9900. You can optionally set a HOST env var, which will be passed on to the started containers (see below).

The endpoints at which gorf will receive instructions to deploy are defined as follows:

  • Github: /SECRET/github/push/id
  • Gitlab: /SECRET/gitlab/push/id
  • Manual: /SECRET/manual/push/id

The id is passed on to the env vars for the started containers (see below).

Usage with nginx-proxy

When the built image is run, a VIRTUAL_HOST env variable is set to [ref].[id].[host]. ref will be the git ref name with any slashes converted to underscore (master / feature_add-input), if available. If it does not have a ref, it will be the commit sha. id is the last part of the push URL. host is ENV var set for gorf (for example test.com), and will default to localhost.

So, for instance, the resulting URL could be master.myproject.test.com.

If the docker machine is running a nginx-proxy image, the VIRTUAL_HOST env var will be automatically picked up and proxied through this service.