Git Product home page Git Product logo

heroku-buildpack-xmlsec's Introduction

heroku-buildpack-xmlsec

A buildpack for installing xmlsec1 on Heroku

Usage

You may need to use this buildpack in conjunction with another; use the heroku cli

heroku buildpacks:add https://github.com/uktrade/heroku-buildpack-xmlsec#1.2.26

or use the heroku admin website to add that buildpack.

Once xmlsec1 is installed via the buildpack you can run it with:

heroku run xmlsec1

Why Fork

Security

Minimise Surface Area

This fork of a fork is because we didn't want to download a binary from someone else's s3 bucket. Instead we're compiling our own binary and including it in the buildpack.

Ability to quickly update

If there are any security vulnerabilities we should be in the position to deploy an updated version without relying on third-parties.

Ease of switching Heroku stacks

If we want to change the stack from heroku:16-build to a newer stack we can update our Dockerfile to build from the correct image provided by Heroku.

How it works

We are building the binary from source, this is slightly complicated because the binary will be running inside of Heroku so if we build on a developer's machine then there is no guarantee that any shared libraries the compiler links to will be the same in Heroku.

To get around this we are building in a Docker image that is based on the Heroku heroku:16-build image, our image then downloads the source tarball for xmlsec1 and compiles it then tar's the output to stdout. This is redirected into a file outside of the docker container and into the local filesystem as xmlsec.tar.gz this file is committed into the repo.

But committing binaries into a repo is an anti-pattern

Yes but this means we don't need to have a CI pipeline pushing the tarball somewhere like Amazon S3 and this isn't really a repository of code, we're not really using it for source control. It's a git repo because that's what Heroku wants custom buildpacks to be.

The downside of this is that it expects you to have Docker installed locally.

How to update the binary

$ export VERSION=1.2.26 # or whatever the version you want to build
$ git rm *.sig
$ make build
$ make release
$ git add xmlsec* README.md
$ git commit -m "update to version $VERSION"
$ git tag -a $VERSION -m "update to $VERSION"
$ git push --follow-tags

Then update your heroku application to use the buildpack with the tag you just set e.g:

https://github.com/uktrade/heroku-buildpack-xmlsec#1.2.26

heroku-buildpack-xmlsec's People

Watchers

 avatar  avatar  avatar  avatar  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.