-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support Basic Auth in staging testing mode (#15)
- Loading branch information
Showing
15 changed files
with
692 additions
and
590 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,16 @@ | ||
#!/bin/bash | ||
|
||
# USAGE: dev_launcher.sh [staging] | ||
|
||
cd /workspace | ||
|
||
# Default backend type is the mock service worker | ||
backend_type="msw" | ||
|
||
# The hostname used for the staging deployment | ||
staging_server="data.staging.ghga.dev" | ||
|
||
# Check command line argument | ||
# allow passing modes as arguments | ||
if [ "$1" = "staging" ]; then | ||
backend_type="staging" | ||
fi | ||
|
||
# Create a suitable proxy config file | ||
if [ "$backend_type" = "staging" ]; then | ||
echo "Using staging backend.ç.." | ||
server="$staging_server" | ||
server_ip=$(dig +short $server @8.8.8.8) | ||
port=443 | ||
ssl=true | ||
cp proxy.staging.conf.json proxy.conf.json | ||
if ! grep -qs "^$server_ip" /etc/hosts; then | ||
echo "Adding $server to /etc/hosts" | ||
echo "$server_ip $server" | sudo tee -a /etc/hosts | ||
export data_portal_base_url="https://data.staging.ghga.dev" | ||
if [[ "$2" = *:* ]]; then | ||
export data_portal_basic_auth="$2" | ||
fi | ||
echo "Please configure your host computer" | ||
echo "to resolve $server to 127.0.0.1." | ||
else | ||
echo "Using mock service worker..." | ||
server="localhost" | ||
server_ip="127.0.0.1" | ||
port=8080 | ||
ssl=false | ||
echo "{}" > proxy.conf.json | ||
elif [ "$1" = "msw" ]; then | ||
export data_portal_base_url="http://127.0.0.1:8080" | ||
fi | ||
|
||
export data_portal_host=127.0.0.1 | ||
export data_portal_port=$port | ||
export data_portal_ssl=$ssl | ||
|
||
# start development server | ||
/workspace/run.js --dev | ||
# start the development server | ||
./run.js --dev |
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
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
Oops, something went wrong.