-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moving self-signed SSL cert creation to docker entrypoint script. (#56)
* Moving self-signed SSL cert creation to entrypoint script. * update development docs * Update Changelog --------- Co-authored-by: Michael Chin <[email protected]>
- Loading branch information
1 parent
295d8a0
commit 1f26af3
Showing
5 changed files
with
41 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/sh | ||
|
||
if [ $(grep -e 'GRAPH_EXP_HTTPS_CONNECTION' ./packages/graph-explorer/.env | cut -d "=" -f 2) ]; then | ||
|
||
if [ $HOST ]; then | ||
echo "Generating new self-signed SSL cert using $HOST..." | ||
cd /graph-explorer/packages/graph-explorer-proxy-server/cert-info/ | ||
sed -i "21s/$/ $HOST:*/" csr.conf | ||
sed -i "8s/$/ $HOST:*/" cert.conf | ||
openssl req -x509 -sha256 -days 356 -nodes -newkey rsa:2048 -subj "/CN=Amazon Neptune/C=US/L=Seattle" -keyout rootCA.key -out rootCA.crt | ||
openssl genrsa -out ./server.key 2048 | ||
openssl req -new -key ./server.key -out ./server.csr -config ./csr.conf | ||
openssl x509 -req -in ./server.csr -CA ./rootCA.crt -CAkey ./rootCA.key -CAcreateserial -out ./server.crt -days 365 -sha256 -extfile ./cert.conf | ||
else | ||
echo "No HOST environment variable specified." | ||
if [ -f "./rootCA.key" ] && [ -f "./rootCA.crt" ] && [ -f "./rootCA.crt" ] && [ -f "./server.csr"] && [ -f "./server.crt"]; then | ||
echo "Found existing self-signed SSL certificate. Re-using existing cert." | ||
else | ||
echo "No existing self-signed SSL certificate found. Please specify --env HOST=<hostname> during docker run command to create SSL cert." | ||
exit 1 | ||
fi | ||
fi | ||
|
||
else | ||
echo "SSL disabled. Skipping self-signed certificate generation." | ||
exit 1 | ||
fi | ||
echo "Starting graph explorer..." | ||
pnpm -w start:proxy-server |