Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a "Deploy to Heroku" button #238

Open
sjparkinson opened this issue Jul 23, 2019 · 4 comments
Open

Add a "Deploy to Heroku" button #238

sjparkinson opened this issue Jul 23, 2019 · 4 comments

Comments

@sjparkinson
Copy link

See https://devcenter.heroku.com/articles/heroku-button.

This button would live on the README.md and look something like:

image

Pressing it would allow anyone with a Heroku account to quickly set up a new Pa11y dashboard.

@sjparkinson
Copy link
Author

More than happy to submit a PR for this if there is interest.

@joeyciechanowicz
Copy link
Member

Thanks. This sounds really useful in theory.

Couple of questions:

  • Can heroku sites block all traffic except for whitelisted IPs? As pa11y-dashboard is not meant as a tool that's publicly available.
  • How would this work with specify a config.json or ENV variables?

@sjparkinson
Copy link
Author

* Can heroku sites block all traffic except for whitelisted IPs?

Interesting question. Not out of the box. However I would imagine there is a Buildpack out there that we could make use of. I'll have a look around.

* How would this work with specify a `config.json` or ENV variables?

Environment variables are covered, and a configuration file I will have a look at how it works in this project first.

@sjparkinson
Copy link
Author

Interesting question. Not out of the box. However I would imagine there is a Buildpack out there that we could make use of. I'll have a look around.

There is one robust answer to this which would be to provision the Heroku app inside a Heroku Private Space.

https://www.heroku.com/private-spaces

That would allow IP access lists to be defined and managed within Heroku, no maintenance required. There is an increased cost associated with provisioning an app in a Private Space however.

Spend Alert. Each Heroku Private Space costs $1000 in Add-on Credits/month (pro-rated to the second).

Buildpack wise, the route seems to be using an nginx based Buildpack configured with a list of IPs from a file. However the ones I've found all deal with static sites only. I'll dig into what one that supports this project would look like.


Configuration wise, looks like this would work just fine with the way the Heroku Deploy button supports asking for environment variables.

port: Number(env('PORT', '4000')),
noindex: env('NOINDEX', 'true') === 'true',
readonly: env('READONLY', 'false') === 'true',
webservice: env('WEBSERVICE_URL', {
database: env('WEBSERVICE_DATABASE', 'mongodb://localhost/pa11y-webservice'),
host: env('WEBSERVICE_HOST', '0.0.0.0'),
port: Number(env('WEBSERVICE_PORT', '3000')),
cron: env('WEBSERVICE_CRON', false)
})

https://devcenter.heroku.com/articles/app-json-schema#env

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants