Skip to content

Commit

Permalink
allow env vars for API service metadata configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
tomkralidis committed Dec 2, 2024
1 parent 060f96f commit 5468390
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 29 deletions.
58 changes: 29 additions & 29 deletions wis2-gdc-api/docker/wis2-gdc-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ server:
bind:
host: 0.0.0.0
port: 5000
url: ${WIS2_GDC_API_URL}
url: ${WIS2_GDC_API_URL-:http://localhost}
mimetype: application/json; charset=UTF-8
encoding: utf-8
language: en-US
Expand All @@ -18,40 +18,40 @@ server:
output_dir: /tmp/

logging:
level: ${WIS2_GDC_LOGGING_LEVEL}
level: ${WIS2_GDC_LOGGING_LEVEL:-ERROR}

metadata:
identification:
title: WMO WIS2 Global Discovery Catalogue instance
description: WMO WIS2 Global Discovery Catalogue instance
title: ${WIS2_GDC_METADATA_IDENTIFICATION_TITLE:-WMO WIS2 Global Discovery Catalogue instance}
description: ${WIS2_GDC_METADATA_IDENTIFICATION_DESCRIPTION:-WMO WIS2 Global Discovery Catalogue instance}
keywords:
- wmo
- wis2
- gdc
keywords_type: theme
terms_of_service: https://creativecommons.org/licenses/by/4.0
url: https://github.com/wmo-im/wis2-gdc
terms_of_service: ${WIS2_GDC_METADATA_IDENTIFICATION_TERMS_OF_SERVICE:-https://creativecommons.org/licenses/by/4.0}
url: ${WIS2_GDC_METADATA_IDENTIFICATION_TITLE:-https://wis2-gdc.readthedocs.io}
license:
name: CC-BY 4.0 license
url: https://creativecommons.org/licenses/by/4.0
name: ${WIS2_GDC_METADATA_LICENSE_NAME:-CC-BY 4.0 license}
url: ${WIS2_GDC_METADATA_LICENSE_URL:-https://creativecommons.org/licenses/by/4.0}
provider:
name: GDC provider name
url: https://github.com/wmo-im/wis2-gdc
name: ${WIS2_GDC_METADATA_PROVIDER_NAME:-GDC provider name}
url: ${WIS2_GDC_METADATA_PROVIDER_URL:-https://github.com/wmo-im/wis2-gdc}
contact:
name: Firstname Lastname
position: Position name
address: Mailing Address
city: City
stateorprovince: Administrative Area
postalcode: Zip or Postal Code
country: Country
phone: +xx-xxx-xxx-xxxx
fax: +xx-xxx-xxx-xxxx
email: [email protected]
url: https://github.com/wmo-im/wis2-gdc
hours: Mo-Fr 08:00-17:00
instructions: During hours of service. Off on weekends.
role: pointOfContact
name: ${WIS2_GDC_METADATA_CONTACT_NAME:-Firstname Lastname}
position: ${WIS2_GDC_METADATA_CONTACT_POSITION:Position name}
address: ${WIS2_GDC_METADATA_CONTACT_ADDRESS:-Mailing Address}
city: ${WIS2_GDC_METADATA_CONTACT_CITY:-City}
stateorprovince: ${WIS2_GDC_METADATA_CONTACT_STATEORPROVICE:-Administrative Area}
postalcode: ${WIS2_GDC_METADATA_CONTACT_POSTALCODE:-Zip or Postal Code}
country: ${WIS2_GDC_METADATA_CONTACT_COUNTRY:-Country}
phone: ${WIS2_GDC_METADATA_CONTACT_PHONE:-+xx-xxx-xxx-xxxx}
fax: ${WIS2_GDC_METADATA_CONTACT_FAX:-+xx-xxx-xxx-xxxx}
email: ${WIS2_GDC_METADATA_CONTACT_EMAIL:-[email protected]}
url: ${WIS2_GDC_METADATA_CONTACT_URL:-https://github.com/wmo-im/wis2-gdc}
hours: ${WIS2_GDC_METADATA_CONTACT_HOURS:-Mo-Fr 08:00-17:00}
instructions: ${WIS2_GDC_METADATA_CONTACT_INSTRUCTIONS:-During hours of service. Off on weekends.}
role: ${WIS2_GDC_METADATA_CONTACT_ROLE:-pointOfContact}

resources:
wis2-discovery-metadata:
Expand All @@ -65,18 +65,18 @@ resources:
- type: application/zip
rel: archives
title: Metadata archive (generated daily)
href: ${WIS2_GDC_API_URL}/wis2-discovery-metadata-archive.zip
href: ${WIS2_GDC_API_URL:-http://localhost}/wis2-discovery-metadata-archive.zip
hreflang: en-CA
length: -1
- type: text/plain
rel: related
title: OpenMetrics
href: ${WIS2_GDC_API_URL}/wis2-gdc-metrics.txt
href: ${WIS2_GDC_API_URL:-http://localhost}/wis2-gdc-metrics.txt
hreflang: en-CA
- type: text/html
rel: related
title: Analytics and monitoring dashboard
href: ${WIS2_GDC_API_URL}/grafana
href: ${WIS2_GDC_API_URL:-http://localhost}/grafana
hreflang: en-CA
- type: text/html
rel: canonical
Expand All @@ -89,8 +89,8 @@ resources:
crs: http://www.opengis.net/def/crs/OGC/1.3/CRS84
providers:
- type: record
name: ${WIS2_GDC_BACKEND_TYPE}
data: ${WIS2_GDC_BACKEND_CONNECTION}
name: ${WIS2_GDC_BACKEND_TYPE:-Elasticsearch}
data: ${WIS2_GDC_BACKEND_CONNECTION:-http://wis2-gdc-backend:9200/wis2-discovery-metadata}
id_field: id
time_field: updated
title_field: title
Expand Down
24 changes: 24 additions & 0 deletions wis2-gdc.env
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,27 @@ export WIS2_GDC_GB_LINK_METEOFRANCE="fr-meteo-france-global-broker,mqtts://every
export WIS2_GDC_GB_LINK_CMA="cn-cma-global-broker,mqtts://everyone:[email protected]:8883,China Meteorological Agency, Global Broker Service"
export WIS2_GDC_GB_LINK_NOAA="us-noaa-nws-global-broker,mqtts://everyone:[email protected]:8883,National Oceanic and Atmospheric Administration, National Weather Service, Global Broker Service"
export WIS2_GDC_GB_LINK_INMET="br-inmet-global-broker,mqtts://everyone:[email protected]:8883,Instituto Nacional de Meteorologia (Brazil), Global Broker Service"

# GDC API service metadata
#export WIS2_GDC_METADATA_IDENTIFICATION_TITLE=title
#export WIS2_GDC_METADATA_IDENTIFICATION_DESCRIPTION=description
#export WIS2_GDC_METADATA_IDENTIFICATION_TERMS_OF_SERVICE=CC-BY 4.0
#export WIS2_GDC_METADATA_IDENTIFICATION_URL=https://example.org/tos
#export WIS2_GDC_METADATA_LICENSE_NAME=CC-BY 4.0
#export WIS2_GDC_METADATA_LICENSE_URL=https://creativecommons.org/licenses/by/4.0
#export WIS2_GDC_METADATA_PROVIDER_NAME=Firstname Lastname
#export WIS2_GDC_METADATA_PROVIDER_URL=https://example.org/provider
#export WIS2_GDC_METADATA_CONTACT_NAME=Firstname Lastname
#export WIS2_GDC_METADATA_CONTACT_POSITION=staff
#export WIS2_GDC_METADATA_CONTACT_ADDRESS=123 Main street
#export WIS2_GDC_METADATA_CONTACT_CITY=city
#export WIS2_GDC_METADATA_CONTACT_STATEORPROVINCE=province
#export WIS2_GDC_METADATA_CONTACT_POSTALCODE=postal code
#export WIS2_GDC_METADATA_CONTACT_COUNTRY=country
#export WIS2_GDC_METADATA_CONTACT_PHONE=+xx-xxx-xxx-xxxx
#export WIS2_GDC_METADATA_CONTACT_FAX=+xx-xxx-xxx-xxxx
#export [email protected]
#export WIS2_GDC_METADATA_CONTACT_URL=https://example.org/contact
#export WIS2_GDC_METADATA_CONTACT_HOURS=hours of service
#export WIS2_GDC_METADATA_CONTACT_INSTRUCTIONS=contact instructions
#export WIS2_GDC_METADATA_CONTACT_ROLE=host

0 comments on commit 5468390

Please sign in to comment.