Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

Support for forcing HTTPS #8

Closed
mike-north opened this issue May 6, 2016 · 25 comments
Closed

Support for forcing HTTPS #8

mike-north opened this issue May 6, 2016 · 25 comments

Comments

@mike-north
Copy link
Contributor

It would be excellent if we could figure out how to do this in a way that works across both the static and nodejs buildpacks (meaning the user doesn't have to care about whether their app is in "fastboot mode" or not)

@mike-north mike-north changed the title Support for forcing HTTPS traffic Support for forcing HTTPS May 6, 2016
@maletor
Copy link

maletor commented May 12, 2016

@mike-north, I think it does.

Just define a static.json file in the root of your project.

@mike-north
Copy link
Contributor Author

@maletor as far as I can see, this only would affect the static buildpack (the one used for a non-fastboot app)

@maletor
Copy link

maletor commented May 12, 2016

You're right. What do you propose? I can see issues with using the same JSON file.

@mike-north
Copy link
Contributor Author

I think that we need another config in the node.js buildpack that does something similar (redirects non-https traffic to https). This way developers could put both in place and then add/remove fastboot and see no change in http vs. https behavior.

@hone
Copy link
Member

hone commented May 13, 2016

potentially, this should be a thing added to the new fastboot-app-server. At some point, I'd like to explore fronting fastboot apps with nginx, but need to look into how tricky that'd be and managing multiple processes on a single dyno.

@t4t5
Copy link

t4t5 commented Jun 10, 2016

@mike-north Did you guys find a workaround for this issue?

@jsquirrelz
Copy link

Is there currently a way to do this with the static buildpack? I opened an issue here about the redirects not happening despite the presumed correct configuration. BTW, is this the main ember buildpack repo? If so, I can close the other issue.

@hone
Copy link
Member

hone commented Sep 29, 2016

Yeah, this is the main ember buildpack repo.

On 22/08/16 19:42, Justin Searles wrote:

Is there currently a way to do this with the static buildpack? I opened
an issue here
heroku/heroku-buildpack-ember-cli#13 about
the redirects not happening despite the presumed correct configuration.
BTW, is this the main ember buildpack repo? If so, I can close the other
issue.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#8 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AABASdkwgiq8t0KGXZlQxNmp1lug_mrYks5qikICgaJpZM4IYqx9.

@sgasser
Copy link

sgasser commented Oct 1, 2016

Any news? Coming soon? How we could hep?

@hone
Copy link
Member

hone commented Oct 3, 2016

I haven't had time to really tackle this, but the thought in my head
would be figuring out how to front a fastboot app with the static
buildpack and get the nginx upstream working nicely.

On 01/10/16 13:55, Stefan Gasser wrote:

Any news? Coming soon? How we could hep?


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#8 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AABASfChLbNvrI96pOJGywBNM-0QTuLSks5qvqyGgaJpZM4IYqx9.

@jakeleboeuf
Copy link

What's the status here?

@FutoRicky
Copy link

Anyone found a solution?

@stephanebruckert
Copy link

Adding the static file does what I need https://stackoverflow.com/questions/47795457/ember-force-https-with-heroku

@musaffa
Copy link

musaffa commented Apr 22, 2018

Need this feature for Fastboot apps. This is such an important feature! Any update?

@oskarrough
Copy link

@musaffa, try @stephanebruckert advice above. What worked for was adding a Procfile and this snippet oskarrough/ember-fastboot-now-deployment-example@3d2bdde

@musaffa
Copy link

musaffa commented Apr 22, 2018

static.json is only for static buildpack.

@oskarrough I tried your way in Heroku but I get this error: Cannot find module 'fastboot-app-server'

@oskarrough
Copy link

oskarrough commented Apr 22, 2018

Try to check how it is set up here https://github.com/oskarrough/ember-fastboot-now-deployment-example/tree/heroku. Basic idea is…

  1. Procfile decides which command is used to start fastboot on Heroku. I run an NPM script called start-fastboot.
  2. This npm script runs a node file called fastboot-server.js. In this file we also make sure to redirect to HTTPS. It requires fastboot-app-server to be installed so you'll have to npm i --save fastboot-app-server.

@musaffa
Copy link

musaffa commented Apr 22, 2018

I did exactly that. I've added a Procfile which points to the npm script. I've also added fastboot-app-server as a dependency in package.json.

Have you tried your app in Heroku?

@oskarrough
Copy link

@musaffa hmm… it used to work, as can be seen here: https://serene-lake-99852.herokuapp.com/. But I just attempted to deploy the same repo again and now I get the same error as you. Not sure what's up.

@musaffa
Copy link

musaffa commented Apr 23, 2018

I've ssh-ed into my Heroku app repository and I cannot see fastboot-app-server in the node modules folder. For some reason, it doesn't install fastboot-app-server whether it is in the devDependencies or dependencies.

@musaffa
Copy link

musaffa commented Apr 23, 2018

I've solved this problem. There's no need to add fastboot-app-server as a dependency. heroku-buildpack-emberjs installs fastboot-cli which has a dependency on fastboot-app-server. This fastboot-app-server module is hoisted to root dependencies. require('fastboot-app-server') will just work. Now the application is not crashing. Gzipping and Forcing HTTPs are also working.

But If you really want to add fastboot-app-server as a dependency and there's version mismatch with the one in fastboot-cli, then the fastboot-app-sever of fastboot-cli will be pushed to its own node_modules. So, in that case you will have to replace require('fastboot-app-server') with require('fastboot-cli/node_modules/fastboot-app-server').

@musaffa
Copy link

musaffa commented Apr 23, 2018

I've ended up forking fastboot-cli where I've added gzip and forced HTTPs support in its fastboot-app-server configuration. Add the forked fastboot-cli as a dependency by

$ yarn add https://github.com/musaffa/fastboot-cli

heroku-buildpack-emberjs will install this forked fastboot-cli instead of the one in the npm repository. Neither Procfile nor fastboot-app-server configuration is needed. Everything will just work.

@donaldwasserman
Copy link

@musaffa That works great. Is there a way to upstream that with some sort of configuration option?

@musaffa
Copy link

musaffa commented May 11, 2018

@hone said he is trying to make it work by fronting the fastboot apps with nginx like the static buildpack. That will be a more robust solution.

@edmorley
Copy link
Member

edmorley commented Aug 2, 2022

This buildpack has been deprecated (c06c1e3), and it's also no longer possible for changes to be made to it, due to the issues mentioned in #61.

@edmorley edmorley closed this as not planned Won't fix, can't repro, duplicate, stale Aug 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests