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

Added docs for https #3

Merged
merged 5 commits into from Jun 11, 2019

Conversation

@fatmali
Copy link
Contributor

commented Jun 6, 2019

No description provided.

README.md Outdated
This setup involves generating a root certificate locally as described in this [gist](https://gist.github.com/blittle/a9c74f43a5cec05cd6797b51f2f1b52d) and getting the remote instance to trust the generated certificate. After creating the root certificate as described in the gist above, you'll have two files: *key.pem* and *public.pem*

If your browser doesn't trust the certificate, add an exception to allow invalid certificates for resources loaded from localhost.

This comment has been minimized.

Copy link
@fatmali

fatmali Jun 6, 2019

Author Contributor

Tried adding the public key to the root certificate, curl worked fine but all browsers still didn't trust it. Only worked when I enabled the insecure localhost setting in chrome.

README.md Outdated

* Run:
`npm start <PORT>`

This comment has been minimized.

Copy link
@joeldenning

joeldenning Jun 6, 2019

Collaborator

npm start -- --port <PORT>, since this line no longer has --port in it

This comment has been minimized.

Copy link
@fatmali

fatmali Jun 10, 2019

Author Contributor

resolved this

README.md Outdated

The next step is to create a bash [alias](https://davidwalsh.name/alias-bash) in order to start the webpack-dev-server with https. Add this line to your .bashrc:
`alias npm-start-https='webpack-dev-server --https --key=$1 --cert=$2 --port`

This comment has been minimized.

Copy link
@joeldenning

joeldenning Jun 6, 2019

Collaborator

I think it would be easier for people if $1 and $2 were not arguments to the bash script, but rather hard coded into the bash alias. So that people can just do npm-start-https 8082

This comment has been minimized.

Copy link
@fatmali

fatmali Jun 6, 2019

Author Contributor

ok, also realized we need to add cmd instructions as well for windows users, what do you think?

This comment has been minimized.

Copy link
@joeldenning

joeldenning Jun 7, 2019

Collaborator

Yeah for windows they won't be able to do an alias so we should show the equivalent. Also I just realized that this alias is incorrect. It should be this:

alias npm-start-https='npm start --https --key=~/.openmrs-ssl/key.pem --cert=~/.openmrs-ssl/public.pem --port

We should not assume that webpack-dev-server is available as a bash command, but only that npm is.

This comment has been minimized.

Copy link
@fatmali

fatmali Jun 10, 2019

Author Contributor

updated this @joeldenning , since the flags are passed to webpack-dev-server shouldn't it be alias npm-start-https='npm start -- --https --key=~/.openmrs-ssl/key.pem --cert=~/.openmrs-ssl/public.pem --port

@fatmali fatmali force-pushed the fatmali:https branch from bebc516 to 5b4e75c Jun 10, 2019

README.md Outdated

And finally use the new alias:
`npm-start-https <PATH>/key.pem <PATH>/public.pem <PORT>`

This comment has been minimized.

Copy link
@joeldenning

joeldenning Jun 10, 2019

Collaborator

This should be changed to npm-start-https <PORT> now that npm-start-https has been updated to no longer require the key.pem and public.pem as args

This comment has been minimized.

Copy link
@fatmali

fatmali Jun 11, 2019

Author Contributor

whoops! resolved in the next commit

@fatmali

This comment has been minimized.

Copy link
Contributor Author

commented Jun 11, 2019

updated the docs to auto-generate certs instead

@fatmali fatmali force-pushed the fatmali:https branch from c875d05 to a2a97c6 Jun 11, 2019

@fatmali

This comment has been minimized.

Copy link
Contributor Author

commented Jun 11, 2019

fixed conflicts

@joeldenning joeldenning merged commit f944013 into openmrs:master Jun 11, 2019

2 checks passed

Travis CI - Pull Request Build Passed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.