diff --git a/.env.sample b/.env.sample index e9e3b31a..1f10957c 100644 --- a/.env.sample +++ b/.env.sample @@ -3,7 +3,7 @@ REACT_APP_WORKSPACES_ENABLED=false # Enable when working with Dug REACT_APP_SEMANTIC_SEARCH_ENABLED='true' # Points the app to the Dug API -REACT_APP_HELX_SEARCH_URL='https:\/\/heal-dev.apps.renci.org' +REACT_APP_HELX_SEARCH_URL='https:\/\/heal-dev.apps.renci.org\/search-api' # Only necessary if working with analytics specifically. # Should be a project token/GA property. Make sure to configure details # in env.json @@ -19,4 +19,4 @@ REACT_APP_HIDDEN_RESULT_TABS='' # Some static assets such as app logo are loaded externally from the dockstore repository (helx-apps). REACT_APP_DOCKSTORE_BRANCH=master # Some static assets such as brand logo are loaded externally from the Appstore repository. -REACT_APP_APPSTORE_ASSET_BRANCH=master \ No newline at end of file +REACT_APP_APPSTORE_ASSET_BRANCH=master diff --git a/Dockerfile b/Dockerfile index 8117c2f0..f7acc43d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,7 +23,7 @@ RUN npm run build FROM nginx:latest COPY nginx/nginx.conf /etc/nginx/conf.d/default.conf COPY --from=builder /usr/src/app/build/ /usr/share/nginx/static/ -RUN mv /usr/share/nginx/static/frontend/index.html /usr/share/nginx/html/ +# RUN mv /usr/share/nginx/static/frontend/index.html /usr/share/nginx/html/ WORKDIR /usr/src/app COPY bin /usr/src/app/bin diff --git a/bin/create_index b/bin/create_index new file mode 100755 index 00000000..9030b542 --- /dev/null +++ b/bin/create_index @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +if [ -z "$1" ] + then + echo "Usage: create_index /path/to/build" + exit 1 +fi + +title="${META_TITLE:-HeLx UI}" +description="${META_DESCRIPTION:-HeLx UI}" + +cat "$1/index_template.html" | sed \ + -e "s/%META_TITLE%/$title/" \ + -e "s/%META_DESCRIPTION%/$description/" \ + > $1/index.html \ No newline at end of file diff --git a/bin/populate_env b/bin/populate_env index e88ed36e..d99de9b6 100755 --- a/bin/populate_env +++ b/bin/populate_env @@ -16,6 +16,8 @@ hidden_support_sections="${REACT_APP_HIDDEN_SUPPORT_SECTIONS}" hidden_result_tabs="${REACT_APP_HIDDEN_RESULT_TABS}" deployment_namespace="${REACT_APP_DEPLOYMENT_NAMESPACE}" appstore_asset_branch="${REACT_APP_APPSTORE_ASSET_BRANCH}" +meta_title="${META_TITLE:-HeLx UI}" +meta_description="${META_DESCRIPTION:-HeLx UI}" template='{ @@ -36,7 +38,11 @@ template='{ "hidden_support_sections": "%HIDDEN_SUPPORT_SECTIONS%", "hidden_result_tabs": "%HIDDEN_RESULT_TABS%", "deployment_namespace": "%DEPLOYMENT_NAMESPACE%", - "appstore_asset_branch": "%APPSTORE_ASSET_BRANCH%" + "appstore_asset_branch": "%APPSTORE_ASSET_BRANCH%", + "meta": { + "title": "%META_TITLE%", + "description": "%META_DESCRIPTION%" + } }' echo "$template" | sed \ @@ -50,4 +56,6 @@ echo "$template" | sed \ -e "s/%TRANQL_URL%/$tranql_url/" \ -e "s/%DEPLOYMENT_NAMESPACE%/$deployment_namespace/" \ -e "s/%APPSTORE_ASSET_BRANCH%/$appstore_asset_branch/" \ + -e "s/%META_TITLE%/$meta_title/" \ + -e "s/%META_DESCRIPTION%/$meta_description/" \ > $1 \ No newline at end of file diff --git a/bin/start_server b/bin/start_server index 010b8136..b9863566 100755 --- a/bin/start_server +++ b/bin/start_server @@ -6,5 +6,12 @@ if [ -z "$1" ] echo "Usage: start_server /path/to/output/env.json" exit 1 fi + +# Create env.json file populate_env $1 +# Generate the index.html file +create_index /usr/share/nginx/static/frontend +# Move into nginx html folder +mv /usr/share/nginx/static/frontend/index.html /usr/share/nginx/html/ + nginx -g "daemon off;" \ No newline at end of file diff --git a/public/favicon.ico b/public/favicon.ico index a11777cc..491d22e5 100644 Binary files a/public/favicon.ico and b/public/favicon.ico differ diff --git a/public/index.ejs b/public/index.ejs index f8a0b7dd..d0c576f1 100644 --- a/public/index.ejs +++ b/public/index.ejs @@ -2,19 +2,21 @@
- + " /> - + - + -