Skip to content

HTTPS Support for Development Environment#238

Open
BKreisel wants to merge 4 commits intoaws-supportfrom
dev-https-support
Open

HTTPS Support for Development Environment#238
BKreisel wants to merge 4 commits intoaws-supportfrom
dev-https-support

Conversation

@BKreisel
Copy link
Copy Markdown
Collaborator

  • HTTPS Self-Signed Certificate Auto-Generation.
  • Some ES6-ification
  • Move Constant Strings out to Separate Module

// we need to default to the hosted dev DB is there is a username and password vars configured
var devDBConnection;
if (typeof (process.env.MOSAICGROUPS_USERNAME) != 'undefined' && typeof (process.env.MOSAICGROUPS_PASSWORD) != 'undefined') {
devDBConnection = 'mongodb://' + process.env.MOSAICGROUPS_USERNAME + ':' + process.env.MOSAICGROUPS_PASSWORD + '@ds061288.mlab.com:61288/mosaicgroups-dev';
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Correct me if I'm wrong, but we never used this dev instance.

logger.log('Configuring scheduler');
require('./server/config/scheduler')();

logger.log('environment: ' + config.env);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Wy remove a print out of what environment is running? I feel like that could be helpful in some cases.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nevermind. I see that it's moved now.


logger.log('Listening on port ' + config.http.port);
if (config.env === constants.DEV) {
logger.log(`Starting HTTPS listener on port: ${config.https.port}`);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Do we need this duplicated log?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I think it's useful because it lets you know what port the HTTP vs the HTTPS listener are configured on.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Fair enough.

@mnmercer
Copy link
Copy Markdown
Collaborator

How do I run the local version now? I'm getting "no such file" error for dev.key?

@BKreisel
Copy link
Copy Markdown
Collaborator Author

BKreisel commented Jan 22, 2018

Give it a go now. I tested it a couple more times and found out that there was a chance that startup process would check for the key before it was finished being generated.

I didn't realize exec was asynchronous! Of course node thought of this and there is in fact an execSync function which waits for the child process to return. Switched to that and it seems to work better now.

You should still be able to go with npm start

@mnmercer
Copy link
Copy Markdown
Collaborator

The website runs now, but I'm getting errors in the console about insecure responses.

errors

@BKreisel
Copy link
Copy Markdown
Collaborator Author

Are you getting this on any page? I'm unable to replicate the issue in either Chrome or in Firefox. Are you using https://localhost:3031 ?

@mnmercer
Copy link
Copy Markdown
Collaborator

Ah I was using http://localhost:3030. Everything is working now. Why is the 3030 port still being used?

@BKreisel
Copy link
Copy Markdown
Collaborator Author

🤷‍♂️ . We really don't need it anymore. Might as well remove it

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants