Skip to content
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.

adding https option for running with TLS/SSL #140

Merged
merged 3 commits into from
Oct 28, 2014
Merged

adding https option for running with TLS/SSL #140

merged 3 commits into from
Oct 28, 2014

Conversation

jloveland
Copy link
Contributor

This addresses issue #86 by adding the option to configure express using https instead of http. The 'all' and 'production' environment configuration includes a property named 'secure' to enable https.

@NeverOddOrEven
Copy link
Contributor

Forcing port 443/security in the production.js file seems to add a lot of opinion to the boilerplate. It also seems a little inconsistent with the rest of the commit, where the boilerplate appears to be configurable to run http as well as https, based on environment variable being set.

You could possibly create a secured_production.js and leave the regular production.js in place, with relevant changes throughout the codebase to use the proper configuration based on environment settings.

@@ -0,0 +1,7 @@
#!/bin/bash
echo "Generating self-signed certificates..."
aopenssl genrsa -out key.pem
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am going to add -aes256 to encrypt the private key with specified cipher before outputting it. Also planning to add 1024 numbits option to increase the size of the private key to generate in bitsoption instead of default 512.

@jloveland
Copy link
Contributor Author

Alex, I agree, thanks for the help! I will keep the original production.js in place and provide a secure.js env option.

@palpalani
Copy link

Excellent work. I am using MySql instead of MongoDb, but i am not able to connect MySql using Sequelizejs.

@palpalani
Copy link

Heroku also not supporting custom SSL, we need to use their ssl-endpoint addon.

@rschwabco
Copy link
Member

This is a fantastic pull request, but we should add this as an option in the generator. @jloveland - would you be willing to convert this and submit a PR in the generator repo?

@jloveland
Copy link
Contributor Author

Sure, I will take a crack at it.

On Oct 9, 2014, at 12:45 AM, Roie Cohen notifications@github.com wrote:

This is a fantastic pull request, but we should add this as an option in the generator. @jloveland - would you be willing to convert this and submit a PR in the generator repo?


Reply to this email directly or view it on GitHub.

@ilanbiala
Copy link
Member

@jloveland any progress on this? I checked around for an Express-specific HTTPS setup, but it doesn't seem to be as performant and as useful as an SSL terminator. Maybe we should look at that instead.

@jloveland
Copy link
Contributor Author

I am going to work on it this week. I will be adding it to the generator project. Initial iteration will use express setup, however I will look into SSL terminator after I get that working.

On Oct 21, 2014, at 4:32 PM, Ilan Biala notifications@github.com wrote:

@jloveland any progress on this? I checked around for an Express-specific HTTPS setup, but it doesn't seem to be as performant and as useful as an SSL terminator. Maybe we should look at that instead.


Reply to this email directly or view it on GitHub.

@lirantal
Copy link
Member

@jloveland I've also got some working https setup from another repo so let me know if you still want to continue on this or not

@lirantal
Copy link
Member

@jloveland didn't notice you already set out a PR for that, great!
@roieki why not also merge it to master/part of 0.4? looks decent enough for it to be available in the repo for everyone not using the yeoman generator tool.

@jloveland
Copy link
Contributor Author

I haven't been using the generator. So I submitted the PR to be merged not considering it.

I am still reviewing the generator project and plan to add my code contribution. If I have questions I will append to this thread. In the near term, feel free to merge in case others want to use it.

On Oct 24, 2014, at 6:23 AM, Liran Tal notifications@github.com wrote:

@jloveland didn't notice you already set out a PR for that, great!
@roieki why not also merge it to master/part of 0.4? looks decent enough for it to be available in the repo for everyone not using the yeoman generator tool.


Reply to this email directly or view it on GitHub.

@dancancro
Copy link

Hi jloveland, since you wrote that you're still reviewing the project, I thought this might help. Picking one of them is somewhat committal so the more informed you are the better.

@jloveland
Copy link
Contributor Author

Thanks Dan, I am actually sold on mean. At this point, I am just trying to make sure my Pull Request on the mean generator is done right. Will your post help me with this? I just saw you have a comparison of mvc spa technology.

I am having trouble getting the production config setting to render in the browser. The development config works fine. Have you run mean in production? I am copying t the production.js config and trying to use it for my secure config.

On Oct 27, 2014, at 7:05 AM, Dan Cancro notifications@github.com wrote:

Hi jloveland, since you wrote that you're still reviewing the project, I thought this might help. Picking one of them is somewhat committal so the more informed you are the better.


Reply to this email directly or view it on GitHub.

@dancancro
Copy link

Nope, not at all :) I'm just here to prevent uninformed decisions. Good luck.

@rschwabco
Copy link
Member

@dancancro - I'm not sure what you're trying to achieve, but I don't think this thread (and other issues in this repo) are the proper place for this kind of discussion. If you want to discuss the alternatives to MeanJS, you're welcome to open a single issue, in which people could be exposed to comparisons such as the one you created. Especially avoid posing such comments if they have no actual relevance to the issue at hand.

Let me know what you think, I don't mean to offend - I'm interested in providing the discussion you are generating the proper platform it deserves.

@rschwabco rschwabco reopened this Oct 28, 2014
@rschwabco rschwabco merged commit f786dda into meanjs:master Oct 28, 2014
@rschwabco
Copy link
Member

@jloveland - With the release of 0.4, we'll have a bunch of updates for the generator, so I'll make sure this PR gets in there as well. Thanks, and I'm sorry it took so long.

@jloveland
Copy link
Contributor Author

@roieki I am also adding this to the generator project. I am testing now...

@rschwabco
Copy link
Member

Oh great! Thanks! I'll check for the PR there.

@jloveland jloveland deleted the feature/use-https branch October 28, 2014 02:40
@dancancro
Copy link

Hi @roieki

I mistakenly took jloveland's "still reviewing the generator project" to mean that he was still considering whether he wanted to use it. He didn't publish his contact info so I couldn't write to him directly. Given the inertia that signing on to any project can create, I hope you can forgive this. My reply was about that statement only. Probably same thing for the other threads you're talking about. Since none of the project home pages do anything to make people aware of all the options, I make the same comments in all of the discussions. So I'm not picking on meanjs. Who knows? Maybe some of your tribe were directed to meanjs from one of them.

Thanks for your suggestion about making a separate thread. I'm not going to do that because it can be marked as 'closed' before the problem is solved. I'd need to start a new issue every time someone new came along.

Just trying to help. :)

@brokyo
Copy link

brokyo commented Nov 1, 2015

Apologies for bumping a year old thread but did anything ever come of this? Looking to run an app through SSL and hoping I'm just overlooking a config variable somewhere

@codydaig
Copy link
Member

codydaig commented Nov 1, 2015

@brokyo The latest version has https support. There's instructions in the README, and there is a config option to set the 'secure' : true

@jloveland
Copy link
Contributor Author

@brokyo this was merged and you can run Mean.js with TLS/SSL. You need to do the following:

  1. generate your ssl certificates ./scripts/generate-ssl-certs.sh
  2. run the app in production mode grunt prod or gulp prod
  3. navigate to https://localhost:8443/

@brokyo
Copy link

brokyo commented Nov 2, 2015

God that's beyond embarrassing. It's right there in the docs! Total user error :(

Thanks so much to both of you

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

Successfully merging this pull request may close these issues.

9 participants