-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into remove-external-ports
- Loading branch information
Showing
18 changed files
with
315 additions
and
2 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
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
config/proxy/conf.extra-service.d/stac.conf | ||
config/canarie-api/canarie_api_monitoring.py |
35 changes: 35 additions & 0 deletions
35
birdhouse/components/stac/config/canarie-api/canarie_api_monitoring.py.template
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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
SERVICES['STAC'] = { | ||
'info': { | ||
'name': 'STAC', | ||
'synopsis': 'STAC is the common name of the REST API that implements the STAC specification, common representation of geospatial information.', | ||
'version': "", | ||
'institution': 'CRIM', | ||
'releaseTime': "2023-06-16T00:00:00Z", | ||
'researchSubject': 'Any', | ||
'supportEmail': '${SUPPORT_EMAIL}', | ||
'category': 'Data Manipulation', | ||
'tags': ['Catalog', 'Data', 'OGC'] | ||
}, | ||
'stats': { | ||
'method': '.*', | ||
'route': "/stac/.*" | ||
}, | ||
'redirect': { | ||
'doc': 'https://stac-utils.github.io/stac-fastapi/', | ||
'releasenotes': 'https://github.com/crim-ca/sac-app/blob/master/CHANGES.rst', | ||
'support': 'https://github.com/crim-ca/stac-app/issues', | ||
'source': 'https://github.com/crim-ca/stac-app', | ||
'tryme': 'https://${PAVICS_FQDN_PUBLIC}/stac/', | ||
'licence': 'https://github.com/crim-ca/stac-app/blob/master/LICENSE', | ||
'provenance': 'https://github.com/crim-ca/stac-app' | ||
}, | ||
"monitoring": { | ||
"STAC": { | ||
'request': { | ||
'url': 'http://stac:8000/stac' | ||
} | ||
} | ||
} | ||
} | ||
|
||
# vi: tabstop=8 expandtab shiftwidth=4 softtabstop=4 syntax=python |
5 changes: 5 additions & 0 deletions
5
birdhouse/components/stac/config/canarie-api/docker-compose-extra.yml
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
version: "3.4" | ||
services: | ||
proxy: | ||
volumes: | ||
- ./components/stac/config/canarie-api/canarie_api_monitoring.py:${CANARIE_MONITORING_EXTRA_CONF_DIR}/stac_canarie_api_monitoring.py:ro |
29 changes: 29 additions & 0 deletions
29
birdhouse/components/stac/config/proxy/conf.extra-service.d/stac.conf.template
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
|
||
location /stac { | ||
# We need the first `/stac` for service resolution. | ||
# We need the second `/stac` for API redirect in STAC (see `root-path` and `ROUTER_PREFIX`). | ||
# See https://github.com/stac-utils/stac-fastapi/issues/427 | ||
# See https://github.com/crim-ca/stac-app/blob/main/stac_app.py#L60 | ||
proxy_pass https://${PAVICS_FQDN_PUBLIC}${TWITCHER_PROTECTED_PATH}/stac/stac; | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Forwarded-Host $host:$server_port; | ||
proxy_buffering off; | ||
include /etc/nginx/conf.d/cors.include; | ||
} | ||
|
||
location /stac-browser/ { | ||
# STAC API is protected behind Twitcher so we might not need to protect the browser as well. | ||
# In case we encounter a valid use case in which we need to protect the browser, we might | ||
# consider using Twitcher's verify capability to protect the route in an efficient manner. | ||
proxy_pass http://stac-browser:8080/; | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-Host localhost; | ||
proxy_set_header X-Forwarded-Server localhost; | ||
proxy_set_header X-Forwarded-Proto $scheme; | ||
proxy_set_header X-Forwarded-For $remote_addr; | ||
proxy_set_header Origin localhost; | ||
proxy_hide_header Access-Control-Allow-Origin; | ||
proxy_redirect off; | ||
} |
5 changes: 5 additions & 0 deletions
5
birdhouse/components/stac/config/proxy/docker-compose-extra.yml
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
version: "3.4" | ||
services: | ||
proxy: | ||
volumes: | ||
- ./components/stac/config/proxy/conf.extra-service.d:/etc/nginx/conf.extra-service.d/stac:ro |
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
export STAC_POSTGRES_USER=${POSTGRES_PAVICS_USERNAME} | ||
export STAC_POSTGRES_PASSWORD=${POSTGRES_PAVICS_PASSWORD} | ||
export STAC_PGUSER=${POSTGRES_PAVICS_USERNAME} | ||
export STAC_PGPASSWORD=${POSTGRES_PAVICS_PASSWORD} | ||
|
||
# add any new variables not already in 'VARS' or 'OPTIONAL_VARS' that must be replaced in templates here | ||
# single quotes are important in below list to keep variable names intact until 'pavics-compose' parses them | ||
EXTRA_VARS=' | ||
$STAC_POSTGRES_USER | ||
$STAC_POSTGRES_PASSWORD | ||
$STAC_PGUSER | ||
$STAC_PGPASSWORD | ||
' | ||
# extend the original 'VARS' from 'birdhouse/pavics-compose.sh' to employ them for template substitution | ||
# adding them to 'VARS', they will also be validated in case of override of 'default.env' using 'env.local' | ||
VARS="$VARS $EXTRA_VARS" |
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 |
---|---|---|
@@ -0,0 +1,63 @@ | ||
version: "3.4" | ||
|
||
x-logging: | ||
&default-logging | ||
driver: "json-file" | ||
options: | ||
max-size: "50m" | ||
max-file: "10" | ||
|
||
services: | ||
stac: | ||
container_name: stac | ||
image: ghcr.io/crim-ca/stac-app:main | ||
depends_on: | ||
- stac-db | ||
environment: | ||
- POSTGRES_USER=${STAC_POSTGRES_USER} | ||
- POSTGRES_PASS=${STAC_POSTGRES_PASSWORD} | ||
- POSTGRES_DBNAME=postgis | ||
- POSTGRES_HOST_READER=stac-db | ||
- POSTGRES_HOST_WRITER=stac-db | ||
- POSTGRES_PORT=5432 | ||
- ROUTER_PREFIX=/stac | ||
- OPENAPI_URL=/stac/api | ||
- DOCS_URL=/stac/api.html | ||
logging: *default-logging | ||
restart: always | ||
|
||
stac-browser: | ||
container_name: stac-browser | ||
image: ghcr.io/crim-ca/stac-browser:docker_image_push | ||
environment: | ||
- CATALOG_URL=https://${PAVICS_FQDN_PUBLIC}/stac/ | ||
- ROOT_PATH=/stac-browser/ | ||
|
||
stac-db: | ||
container_name: stac-db | ||
image: ghcr.io/stac-utils/pgstac:v0.6.10 | ||
environment: | ||
- POSTGRES_USER=${STAC_POSTGRES_USER} | ||
- POSTGRES_PASSWORD=${STAC_POSTGRES_PASSWORD} | ||
- POSTGRES_DB=postgis | ||
- PGUSER=${STAC_PGUSER} | ||
- PGPASSWORD=${STAC_PGPASSWORD} | ||
- PGHOST=localhost | ||
- PGDATABASE=postgis | ||
volumes: | ||
- stac-db:/var/lib/postgresql/data | ||
healthcheck: | ||
test: ["CMD-SHELL", "pg_isready"] | ||
interval: 10s | ||
timeout: 5s | ||
retries: 5 | ||
|
||
# extend proxy with endpoint and config for STAC API access | ||
proxy: | ||
volumes: | ||
- ./components/stac/conf.extra-service.d:/etc/nginx/conf.extra-service.d/stac:ro | ||
links: | ||
- stac | ||
|
||
volumes: | ||
stac-db: |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
export STAC_ASSET_GENERATOR_TIMEOUT=200 | ||
|
||
# add any new variables not already in 'VARS' or 'OPTIONAL_VARS' that must be replaced in templates here | ||
# single quotes are important in below list to keep variable names intact until 'pavics-compose' parses them | ||
EXTRA_VARS=' | ||
$STAC_ASSET_GENERATOR_TIMEOUT | ||
' | ||
# extend the original 'VARS' from 'birdhouse/pavics-compose.sh' to employ them for template substitution | ||
# adding them to 'VARS', they will also be validated in case of override of 'default.env' using 'env.local' | ||
VARS="$VARS $EXTRA_VARS" | ||
|
||
# add any component that this component requires to run | ||
COMPONENT_DEPENDENCIES=" | ||
./components/stac | ||
" |
21 changes: 21 additions & 0 deletions
21
birdhouse/optional-components/stac-populator/docker-compose-extra.yml
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
version: "3.4" | ||
|
||
x-logging: | ||
&default-logging | ||
driver: "json-file" | ||
options: | ||
max-size: "50m" | ||
max-file: "10" | ||
|
||
services: | ||
# populates STAC catalog with sample collection items | ||
stac-populator: | ||
container_name: stac-populator | ||
image: ghcr.io/crim-ca/stac-populator:master | ||
environment: | ||
- STAC_ASSET_GENERATOR_TIMEOUT=${STAC_ASSET_GENERATOR_TIMEOUT} | ||
- STAC_HOST=http://stac:8000/stac # STAC API internally accessed to avoid Twitcher authentication | ||
command: > | ||
bash -c "./wait-for-it.sh stac:8000 -t 30 && ./populate.sh" | ||
depends_on: | ||
- stac |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
config/magpie/config.yml |
19 changes: 19 additions & 0 deletions
19
birdhouse/optional-components/stac-public-access/config/magpie/config.yml.template
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
providers: | ||
# definition of STAC service for API access | ||
stac: | ||
url: http://stac:8000 | ||
title: STAC | ||
public: true | ||
c4i: false | ||
type: api | ||
sync_type: api | ||
|
||
permissions: | ||
- service: stac | ||
permission: read | ||
group: anonymous | ||
action: create | ||
- service: stac | ||
permission: write | ||
group: stac-admin | ||
action: create |
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# add any component that this component requires to run | ||
COMPONENT_DEPENDENCIES=" | ||
./components/stac | ||
" |
6 changes: 6 additions & 0 deletions
6
birdhouse/optional-components/stac-public-access/docker-compose-extra.yml
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
version: "3.4" | ||
services: | ||
magpie: | ||
volumes: | ||
- ./optional-components/stac-public-access/config/magpie/config.yml:${MAGPIE_PERMISSIONS_CONFIG_PATH}/stac-public-access.yml:ro | ||
- ./optional-components/stac-public-access/config/magpie/config.yml:${MAGPIE_PROVIDERS_CONFIG_PATH}/stac-public-access.yml:ro |