Skip to content

Commit

Permalink
dev env, added Windows cert install instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
jkasten2 committed Apr 30, 2024
1 parent 5c4c81e commit 15bc160
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
11 changes: 5 additions & 6 deletions express_webpack/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@
```
docker cp "$(docker-compose ps -q onesignal-web-sdk-dev)":sdk/express_webpack/certs/dev-ssl.crt .
```
- If you're running the container in a VM, get the cert file onto the VM's host (e.g: use `scp`)
- add cert to keychain (mac OSX):
```
sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain dev-ssl.crt
```
- If you're running the container in a VM, get the cert file onto the VM's host (e.g: use `scp`)
- Add cert to system's trusted store
- macOS: `sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain dev-ssl.crt`
- Windows: `Import-Certificate -FilePath dev-ssl.crt -CertStoreLocation cert:\CurrentUser\Root`
3. Make sure the common name (e.g: localhost, texas, oregon, etc...) maps to the correct IP in your `/etc/hosts` file
4. Visit [https://localhost:4001?app_id=](https://localhost:4001?app_id=) and insert your app id as a URL query parameter
Expand Down Expand Up @@ -127,4 +126,4 @@ If you get the error `Node Sass could not find a binding for your current enviro
npm rebuild node-sass
```
from *inside* the docker container shell.
from *inside* the docker container shell.
5 changes: 3 additions & 2 deletions express_webpack/certs/gen-cert.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ if test -f "$FILE"; then
else
echo "express_webpack:\n------ generating new SSL certs ------"
echo "copy dev-ssl.crt from container to host with:\n> docker cp <containerId>:sdk/express_webpack/certs/dev-ssl.crt ."
echo "add cert to keychain (MacOSX):\n> sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain ~/dev-ssl.crt\n"
echo "macOS - add cert to keychain:\n> sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain ~/dev-ssl.crt\n"
echo "Windows - add cert to cert store:\n> Import-Certificate -FilePath dev-ssl.crt -CertStoreLocation cert:\CurrentUser\Root"
echo "restart browser\n--------------------------------------"

# generate cert/key based on conf file
# defaults to use Common Name: texas
openssl req -config ./certs/ssl-cert-gen.conf -subj '/C=US/CN=texas' -new -x509 -newkey rsa:2048 -nodes -keyout certs/dev-ssl.key -days 365 -out certs/dev-ssl.crt
Expand Down

0 comments on commit 15bc160

Please sign in to comment.