auth0/heroku-private-modules

Name: heroku-private-modules

Owner: Auth0

Description: [DEPRECATED] Use private GitHub repos as npm dependencies on Heroku.

Created: 2016-09-15 03:39:18.0

Updated: 2018-01-02 15:59:24.0

Pushed: 2016-10-14 18:12:00.0

Homepage:

Size: 6

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

This package is deprecated

Doesn't work with private packages inside other packages, I tried to solve this using the npm hook preinstall but this npm bug/feature makes the solution inviable preinstall execution order in npm@3.x.

See next branch for the last unreleased version.

Heroku Private Modules

Use private GitHub repos as npm dependencies on Heroku.

Heroku doesn't has access to your private git repositories so every deploy of an app with private git dependencies fails.

This changes your package.json private GitHub dependencies (before Heroku installs your dependencies) with a url of the dependency with a GitHub access token.

Installation
i --save heroku-private-modules
Usage
  1. Create a Github OAuth token with “repo” scope.
  2. Set on Heroku the config var GITHUB_TOKEN with the token of the previous step.
  3. On your app add the npm script heroku-prebuild with npm i heroku-private-modules && heroku-private-modules.
    oku-prebuild": "npm i heroku-private-modules && heroku-private-modules"
    
Background

I choose this solution to have the secrets out of the source control, keep the projects with the minimum configuration required and also because it seems to me the less risky solution.

Recommendation: create a GitHub user and only give him permissions to the required private repos, and use the token from this account. So if the token gets compromised the attacker will only access to only a part of the privates repos of your org/personal user.

Other solutions with different tradeoffs:

License

Heroku Private Modules is MIT licensed.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.