Skip to content

Commit 7d93fec

Browse files
committed
update dggs api redirects strategy to result in correct links reporting by responses
1 parent 9ceb96f commit 7d93fec

File tree

3 files changed

+25
-7
lines changed

3 files changed

+25
-7
lines changed

birdhouse/components/dggs/config/proxy/conf.extra-service.d/dggs.conf.template

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@
3333
proxy_set_header X-Forwarded-Host $http_host:$server_port;
3434
#proxy_set_header X-Script-Name ${DGGS_API_PATH};
3535
}
36-
location = ${DGGS_API_PATH}/json {
37-
rewrite ^/${DGGS_API_PATH}/(.*) /$1 break;
36+
# '/api' is the standard path by OGC: https://ogcapi.ogc.org/common/overview.html
37+
location = ${DGGS_API_PATH}/api {
38+
rewrite ^${DGGS_API_PATH}/(.*) ${DGGS_API_PATH_INTERNAL}/$1 break;
3839
proxy_pass http://dggs:8000;
3940
proxy_set_header Host $host;
4041
proxy_set_header X-Original-URI $request_uri;

birdhouse/components/dggs/default.env

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# must use single quotes to avoid early expansion before overrides in env.local
99
# are applied and must be added to the list of DELAYED_EVAL.
1010

11-
export DGGS_VERSION=0.2.0-rc
11+
export DGGS_VERSION=0.2.1-rc
1212
export DGGS_DOCKER=crim-ca/pydggsapi
1313
export DGGS_IMAGE='ghcr.io/${DGGS_DOCKER}:${DGGS_VERSION}'
1414
export DGGS_IMAGE_URI='${DGGS_IMAGE}'
@@ -25,6 +25,15 @@ export DGGS_CONFIG_PATH=./components/dggs/config/dggs/pydggsapi-config.json
2525
# API runtime configuration
2626
export DGGS_WORKERS=8
2727
export DGGS_LOG_LEVEL=info
28+
export DGGS_API_TITLE='Birdhouse - Discrete Global Grid System API'
29+
export DGGS_API_DESCRIPTION='PyDGGSAPI implementation of Discrete Global Grid System references and data retrieval.'
30+
export DGGS_API_CONTACT='
31+
{
32+
"name": "Contact API Maintainer",
33+
"url": "https://crim.ca/",
34+
"email": "[email protected]"
35+
}
36+
'
2837

2938
### --- danger zone --- ###
3039
# Following variables are used to more easily map various API components across configurations.
@@ -40,7 +49,7 @@ export DGGS_API_NAME=dggs-api
4049
export DGGS_API_PATH='/${DGGS_API_NAME}'
4150
# internal path used by the actual API application from proxy redirection
4251
# this variable wiil allow 'DGGS_API_PATH' to be mapped directly to the API root
43-
export DGGS_API_PATH_INTERNAL=/dggs-api/dggs-api
52+
export DGGS_API_PATH_INTERNAL=/dggs-api
4453
# same as above, but for the additional tiles capabilities provided by the service
4554
export DGGS_TILES_NAME=tiles-api
4655
export DGGS_TILES_PATH='/${DGGS_TILES_NAME}'
@@ -74,6 +83,9 @@ OPTIONAL_VARS="
7483
\$DGGS_IMAGE_URI
7584
\$DGGS_LOG_LEVEL
7685
\$DGGS_WORKERS
86+
\$DGGS_API_TITLE
87+
\$DGGS_API_DESCRIPTION
88+
\$DGGS_API_CONTACT
7789
\$SECURE_DATA_PROXY_AUTH_INCLUDE
7890
"
7991

birdhouse/components/dggs/docker-compose-extra.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,15 @@ services:
1414
HOSTNAME: ${BIRDHOUSE_FQDN}
1515
HTTP_HOST: ${BIRDHOUSE_FQDN}
1616
FORWARDED_ALLOW_IPS: "*"
17-
ROOT_PATH: "${DGGS_API_PATH}"
17+
API_TITLE: "${DGGS_API_TITLE}"
18+
API_CONTACT: "${DGGS_API_CONTACT}"
19+
API_DESCRIPTION: "${DGGS_API_DESCRIPTION}"
20+
#ROOT_PATH: "${DGGS_API_PATH}"
21+
SERVICE_META_URL: "${BIRDHOUSE_FQDN_PUBLIC}/services/${DGGS_API_PATH}"
1822
DOCS_URL: ${DGGS_API_PATH}${DGGS_DOCS_PATH_INTERNAL}
19-
OPENAPI_URL: /json
20-
DGGS_PREFIX: ""
23+
OPENAPI_URL: ${DGGS_API_PATH}/api
24+
TILES_PREFIX: "${DGGS_TILES_PATH}"
25+
DGGS_PREFIX: "${DGGS_API_PATH}"
2126
PYDGGSAPI_PORT: 8000
2227
PYDGGSAPI_WORKERS: ${DGGS_WORKERS}
2328
PYDGGSAPI_LOG_LEVEL: ${DGGS_LOG_LEVEL}

0 commit comments

Comments
 (0)