diff --git a/.env-example b/.env-example index 4a88b43ae..26e43eeb8 100644 --- a/.env-example +++ b/.env-example @@ -27,6 +27,11 @@ HEADWAY_PUBLIC_URL=http://127.0.0.1:8080 HEADWAY_HTTP_PORT=8080 +HEADWAY_ABOUT_URL="https://about.maps.earth" +HEADWAY_ABOUT_LINK_TEXT="About maps.earth" +HEADWAY_CONTACT_URL="mailto:info@maps.earth?subject=Hello,%20Earth" +HEADWAY_CONTACT_LINK_TEXT="Contact Us" + ## # The following are only needed for the scripts in bin/* # If you're not using them, we can leave these blank. diff --git a/builds/planet/env.sh b/builds/planet/env.sh index 94b0f7230..18ef5e765 100644 --- a/builds/planet/env.sh +++ b/builds/planet/env.sh @@ -7,3 +7,7 @@ export HEADWAY_ENABLE_TRANSIT_ROUTING=1 export HEADWAY_TRANSIT_AREAS="Barcelona LosAngeles PugetSound" export PELIAS_ELASTICSEARCH_MEMORY_REQUEST=8Gi export VALHALLA_MEMORY_REQUEST=4Gi +export HEADWAY_ABOUT_URL="https://about.maps.earth" +export HEADWAY_ABOUT_LINK_TEXT="About maps.earth" +export HEADWAY_CONTACT_URL="mailto:info@maps.earth?subject=Hello,%20Earth" +export HEADWAY_CONTACT_LINK_TEXT="Contact Us" diff --git a/builds/seattle/env.sh b/builds/seattle/env.sh index adfc1654a..60eaec1a7 100644 --- a/builds/seattle/env.sh +++ b/builds/seattle/env.sh @@ -7,3 +7,7 @@ export HEADWAY_TRANSIT_AREAS=Seattle export HEADWAY_BBOX="-122.462 47.394 -122.005 47.831" export PELIAS_ELASTICSEARCH_MEMORY_REQUEST=750Mi export VALHALLA_MEMORY_REQUEST=250Mi +export HEADWAY_ABOUT_URL="https://about.maps.earth" +export HEADWAY_ABOUT_LINK_TEXT="About maps.earth" +export HEADWAY_CONTACT_URL="mailto:info@maps.earth?subject=Hello,%20Earth" +export HEADWAY_CONTACT_LINK_TEXT="Contact Us" diff --git a/k8s/_template/deployment-config.yaml.tpl b/k8s/_template/deployment-config.yaml.tpl index 7f672647e..79507ee18 100644 --- a/k8s/_template/deployment-config.yaml.tpl +++ b/k8s/_template/deployment-config.yaml.tpl @@ -7,6 +7,10 @@ data: public-url: ${HEADWAY_PUBLIC_URL} bbox: "${HEADWAY_BBOX}" enable-transit-routing: "${HEADWAY_ENABLE_TRANSIT_ROUTING}" + www-about-url: "${HEADWAY_ABOUT_URL}" + www-about-link-text: "${HEADWAY_ABOUT_LINK_TEXT}" + www-contact-url: "${HEADWAY_CONTACT_URL}" + www-contact-link-text: "${HEADWAY_CONTACT_LINK_TEXT}" terrain-source-url: ${HEADWAY_K8S_ARTIFACT_ROOT}/${HEADWAY_DATA_TAG}/terrain.mbtiles landcover-source-url: ${HEADWAY_K8S_ARTIFACT_ROOT}/${HEADWAY_DATA_TAG}/landcover.mbtiles areamap-source-url: ${HEADWAY_K8S_ARTIFACT_ROOT}/${HEADWAY_DATA_TAG}/${HEADWAY_AREA_TAG}/${HEADWAY_AREA}.mbtiles diff --git a/k8s/_template/frontend-deployment.yaml.tpl b/k8s/_template/frontend-deployment.yaml.tpl index e14899594..3d1b5db16 100644 --- a/k8s/_template/frontend-deployment.yaml.tpl +++ b/k8s/_template/frontend-deployment.yaml.tpl @@ -39,6 +39,26 @@ spec: configMapKeyRef: name: deployment-config key: enable-transit-routing + - name: HEADWAY_ABOUT_URL + valueFrom: + configMapKeyRef: + name: deployment-config + key: www-about-url + - name: HEADWAY_ABOUT_LINK_TEXT + valueFrom: + configMapKeyRef: + name: deployment-config + key: www-about-link-text + - name: HEADWAY_CONTACT_URL + valueFrom: + configMapKeyRef: + name: deployment-config + key: www-contact-url + - name: HEADWAY_CONTACT_LINK_TEXT + valueFrom: + configMapKeyRef: + name: deployment-config + key: www-contact-link-text resources: limits: memory: 100Mi diff --git a/k8s/configs/planet-dev/deployment-config.yaml b/k8s/configs/planet-dev/deployment-config.yaml index 845a6e7ae..b8949998a 100644 --- a/k8s/configs/planet-dev/deployment-config.yaml +++ b/k8s/configs/planet-dev/deployment-config.yaml @@ -7,6 +7,10 @@ data: public-url: https://maps.earth bbox: "" enable-transit-routing: "1" + www-about-url: "https://about.maps.earth" + www-about-link-text: "About maps.earth" + www-contact-url: "mailto:info@maps.earth?subject=Hello,%20Earth" + www-contact-link-text: "Contact Us" terrain-source-url: https://data.example.com/0.6.0/terrain.mbtiles landcover-source-url: https://data.example.com/0.6.0/landcover.mbtiles areamap-source-url: https://data.example.com/0.6.0/maps-earth-planet-v1.36/maps-earth-planet-v1.36.mbtiles diff --git a/k8s/configs/planet-dev/frontend-deployment.yaml b/k8s/configs/planet-dev/frontend-deployment.yaml index bdabb94d7..4d98e729d 100644 --- a/k8s/configs/planet-dev/frontend-deployment.yaml +++ b/k8s/configs/planet-dev/frontend-deployment.yaml @@ -39,6 +39,26 @@ spec: configMapKeyRef: name: deployment-config key: enable-transit-routing + - name: HEADWAY_ABOUT_URL + valueFrom: + configMapKeyRef: + name: deployment-config + key: www-about-url + - name: HEADWAY_ABOUT_LINK_TEXT + valueFrom: + configMapKeyRef: + name: deployment-config + key: www-about-link-text + - name: HEADWAY_CONTACT_URL + valueFrom: + configMapKeyRef: + name: deployment-config + key: www-contact-url + - name: HEADWAY_CONTACT_LINK_TEXT + valueFrom: + configMapKeyRef: + name: deployment-config + key: www-contact-link-text resources: limits: memory: 100Mi diff --git a/k8s/configs/planet/deployment-config.yaml b/k8s/configs/planet/deployment-config.yaml index 845a6e7ae..b8949998a 100644 --- a/k8s/configs/planet/deployment-config.yaml +++ b/k8s/configs/planet/deployment-config.yaml @@ -7,6 +7,10 @@ data: public-url: https://maps.earth bbox: "" enable-transit-routing: "1" + www-about-url: "https://about.maps.earth" + www-about-link-text: "About maps.earth" + www-contact-url: "mailto:info@maps.earth?subject=Hello,%20Earth" + www-contact-link-text: "Contact Us" terrain-source-url: https://data.example.com/0.6.0/terrain.mbtiles landcover-source-url: https://data.example.com/0.6.0/landcover.mbtiles areamap-source-url: https://data.example.com/0.6.0/maps-earth-planet-v1.36/maps-earth-planet-v1.36.mbtiles diff --git a/k8s/configs/planet/frontend-deployment.yaml b/k8s/configs/planet/frontend-deployment.yaml index b0c38a8b4..239361231 100644 --- a/k8s/configs/planet/frontend-deployment.yaml +++ b/k8s/configs/planet/frontend-deployment.yaml @@ -39,6 +39,26 @@ spec: configMapKeyRef: name: deployment-config key: enable-transit-routing + - name: HEADWAY_ABOUT_URL + valueFrom: + configMapKeyRef: + name: deployment-config + key: www-about-url + - name: HEADWAY_ABOUT_LINK_TEXT + valueFrom: + configMapKeyRef: + name: deployment-config + key: www-about-link-text + - name: HEADWAY_CONTACT_URL + valueFrom: + configMapKeyRef: + name: deployment-config + key: www-contact-url + - name: HEADWAY_CONTACT_LINK_TEXT + valueFrom: + configMapKeyRef: + name: deployment-config + key: www-contact-link-text resources: limits: memory: 100Mi diff --git a/k8s/configs/seattle-dev/deployment-config.yaml b/k8s/configs/seattle-dev/deployment-config.yaml index fcf1dbc0e..3a90e6fe5 100644 --- a/k8s/configs/seattle-dev/deployment-config.yaml +++ b/k8s/configs/seattle-dev/deployment-config.yaml @@ -7,6 +7,10 @@ data: public-url: https://seattle.maps.earth bbox: "-122.462 47.394 -122.005 47.831" enable-transit-routing: "1" + www-about-url: "https://about.maps.earth" + www-about-link-text: "About maps.earth" + www-contact-url: "mailto:info@maps.earth?subject=Hello,%20Earth" + www-contact-link-text: "Contact Us" terrain-source-url: https://data.example.com/dev/terrain.mbtiles landcover-source-url: https://data.example.com/dev/landcover.mbtiles areamap-source-url: https://data.example.com/dev/seattle-latest/Seattle.mbtiles diff --git a/k8s/configs/seattle-dev/frontend-deployment.yaml b/k8s/configs/seattle-dev/frontend-deployment.yaml index bdabb94d7..4d98e729d 100644 --- a/k8s/configs/seattle-dev/frontend-deployment.yaml +++ b/k8s/configs/seattle-dev/frontend-deployment.yaml @@ -39,6 +39,26 @@ spec: configMapKeyRef: name: deployment-config key: enable-transit-routing + - name: HEADWAY_ABOUT_URL + valueFrom: + configMapKeyRef: + name: deployment-config + key: www-about-url + - name: HEADWAY_ABOUT_LINK_TEXT + valueFrom: + configMapKeyRef: + name: deployment-config + key: www-about-link-text + - name: HEADWAY_CONTACT_URL + valueFrom: + configMapKeyRef: + name: deployment-config + key: www-contact-url + - name: HEADWAY_CONTACT_LINK_TEXT + valueFrom: + configMapKeyRef: + name: deployment-config + key: www-contact-link-text resources: limits: memory: 100Mi diff --git a/services/frontend/generate_config.sh b/services/frontend/generate_config.sh index c483e5582..add68bb1b 100755 --- a/services/frontend/generate_config.sh +++ b/services/frontend/generate_config.sh @@ -20,9 +20,9 @@ Examples: EOS } -if [ ! -z "$HEADWAY_BBOX" ]; then +if [ -n "$HEADWAY_BBOX" ]; then # remove leading and trailing space, then comma separate - comma_seperated_bounds=$(echo $HEADWAY_BBOX | sed 's/^ *//' | sed 's/ *$//' | sed 's/ */,/g') + comma_seperated_bounds=$(echo "$HEADWAY_BBOX" | sed 's/^ *//' | sed 's/ *$//' | sed 's/ */,/g') bbox_json="[${comma_seperated_bounds}]" else bbox_json="null" @@ -39,10 +39,38 @@ else transit_routing_enabled_json="true" fi +if [[ -z "$HEADWAY_ABOUT_URL" ]]; then + about_url_json="null" +else + about_url_json="\"$HEADWAY_ABOUT_URL\"" +fi + +if [[ -z "$HEADWAY_ABOUT_LINK_TEXT" ]]; then + about_link_text_json="null" +else + about_link_text_json="\"$HEADWAY_ABOUT_LINK_TEXT\"" +fi + +if [[ -z "$HEADWAY_CONTACT_URL" ]]; then + contact_url_json="null" +else + contact_url_json="\"$HEADWAY_CONTACT_URL\"" +fi + +if [[ -z "$HEADWAY_CONTACT_LINK_TEXT" ]]; then + contact_link_text_json="null" +else + contact_link_text_json="\"$HEADWAY_CONTACT_LINK_TEXT\"" +fi + cat << EOS { "maxBounds": $bbox_json, - "transitRoutingEnabled": $transit_routing_enabled_json + "transitRoutingEnabled": $transit_routing_enabled_json, + "aboutUrl": $about_url_json, + "aboutLinkText": $about_link_text_json, + "contactUrl": $contact_url_json, + "contactLinkText": $contact_link_text_json } EOS