-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
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
feat(v2): add support for key,cert in https #3594
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ThakurKarthik could you please add some docs about using this feature?
Deploy preview for docusaurus-2 ready! Built with commit b7d88ed |
Sure @lex111 , you want me to document this in the website right? I will add that ! |
@ThakurKarthik yes please, and resolve conflict too. |
LGTM Yeah basically we need the docs to know how to run Docusaurus on https locally so that our users know how to do it too. Basically it's adding your test plans to the docs somewhere (maybe on the start command doc?) Need to resolve the merge conflict I know from source issue (#3445) that CRA use env variables. Wonder how they made the choice of env variables VS cli options. Any idea? |
Hey @slorber I will add the steps to enable https in docs soon, as for your question of choice between env vs cli options, I am not that sure I tracked the original implementation in CRA facebook/create-react-app#5845 , sadly i can't find the reasoning behind the choice and here is a comment about moving env vars to a config file facebook/create-react-app#5845 (comment) |
Thanks @ThakurKarthik Hi @andriijas or @alexbrazier, wonder if you can give us some insights regarding this feature? |
@ThakurKarthik do you want me to complete the PR, and write some docs? We can keep the env variables for now, that should be fine (HTTPS is already an env variable anyway) |
Hey @slorber sorry for delay,I can update them by today evening if you won't mind. |
sure, no hurry, just wanted to be sure this pr won't become stale :) |
Hi @slorber, there wasn't really much of a discussion around the decision, it just happened to be how we had setup our fork of cra and it had been working well for our team for over 2 years. I think part of the original decision would have been because |
Thanks, LGTM, just made the docs simpler. Thanks @alexbrazier , as we already have env.HTTPS I guess we should do the same :) |
Motivation
Adding support for https with key and cert files in docusaurus
Have you read the Contributing Guidelines on pull requests?
Yes
Test Plan
1.Install mkcert anywhere to create certificates for local testing
2.In the root folder of docusaurus run
mkcert localhost 127.0.0.1 ::1
. mkcert will generate two files, one is key file and other cert file for testing.Move these two files towebsite
folder.3.Run
HTTPS=true SSL_CRT_FILE=localhost+2.pem SSL_KEY_FILE=localhost+2-key.pem yarn start
Note please replace
localhost+2.pem
andlocalhost+2-key.pem
with the files you will get from mkcert.Hey @slorber @lex111 can you Please review these changes, Thanks !
Ref: #3445