heroku / heroku-buildpack-static

[DEPRECATED] Heroku buildpack for handling static sites and single page web apps

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ability to enable / disable basic auth using env vars

cancan101 opened this issue · comments

Repost from #45 (comment):
A way to enable / disable basic auth based on an env var.

Struggled with this for a couple hours myself, I checked the spec file and saw that it can be conditionally toggled by creating/removing BASIC_AUTH_USERNAME

json["basic_auth"] = true unless ENV['BASIC_AUTH_USERNAME'].nil?

Might be nice to have this be a bit more clear in the docs.

Just to clarify, no config is necessarry in the static.json. If the ENV contains a BASIC_AUTH_USERNAME and a hashed BASIC_AUTH_PASSWORD, basic auth will be enabled.

Hi

This buildpack is now deprecated and we are recommending people move the more actively maintained heroku-buildpack-nginx. For migration advice see here.

As such, I'm closing this issue out since we won't be making further changes to this buildpack.