Make it easier to self host on Heroku -- launch with port

I got very close to running writefreely on Heroku – used the JawsDB add-on for a database and the nginx-buildpack – but I can’t (easily) pass in an environment variable for the port that writefreely needs to bind to. This is randomly created by Heroku and available as an environment variable.

If writefreely --port $PORT were available, this would be easy :slight_smile:

Otherwise I’m off to the bash scripting mines at some point to write this into the config.

Is this something that people want, to make it easy for people to host on Heroku?

2019-12-27T07:55:58.591735+00:00 app[web.1]: 2019/12/27 07:55:58 Starting WriteFreely 0.11.2...
2019-12-27T07:55:58.591742+00:00 app[web.1]: 2019/12/27 07:55:58 Loading config.ini configuration...
2019-12-27T07:55:58.591895+00:00 app[web.1]: 2019/12/27 07:55:58 Loading templates...
2019-12-27T07:55:58.612582+00:00 app[web.1]: 2019/12/27 07:55:58 Loading pages...
2019-12-27T07:55:58.624555+00:00 app[web.1]: 2019/12/27 07:55:58 Loading user pages...
2019-12-27T07:55:58.640452+00:00 app[web.1]: 2019/12/27 07:55:58 Loading encryption keys...
2019-12-27T07:55:58.640583+00:00 app[web.1]: 2019/12/27 07:55:58 Connecting to mysql database...
2019-12-27T07:55:58.669916+00:00 app[web.1]: 2019/12/27 07:55:58 Adding {domain} routes (single user)...
2019-12-27T07:55:58.676825+00:00 app[web.1]: 2019/12/27 07:55:58 Going to serve...
2019-12-27T07:55:58.677027+00:00 app[web.1]: 2019/12/27 07:55:58 Serving on http://0.0.0.0:80
2019-12-27T07:55:58.677035+00:00 app[web.1]: 2019/12/27 07:55:58 ---
2019-12-27T07:55:58.677233+00:00 app[web.1]: ERROR: 2019/12/27 07:55:58 app.go:463: Unable to start: listen tcp 0.0.0.0:80: bind: permission denied

yes.