From 8f8ca1880d19ddb87fb9fdbd6f159096d5296928 Mon Sep 17 00:00:00 2001 From: rhysrevans3 Date: Thu, 10 Apr 2025 13:26:14 +0100 Subject: [PATCH 1/3] Allow landing page id to be configurable. --- stac_fastapi/elasticsearch/stac_fastapi/elasticsearch/app.py | 5 ++++- stac_fastapi/opensearch/stac_fastapi/opensearch/app.py | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/stac_fastapi/elasticsearch/stac_fastapi/elasticsearch/app.py b/stac_fastapi/elasticsearch/stac_fastapi/elasticsearch/app.py index 5e6307e7..63c92e60 100644 --- a/stac_fastapi/elasticsearch/stac_fastapi/elasticsearch/app.py +++ b/stac_fastapi/elasticsearch/stac_fastapi/elasticsearch/app.py @@ -89,7 +89,10 @@ settings=settings, extensions=extensions, client=CoreClient( - database=database_logic, session=session, post_request_model=post_request_model + database=database_logic, + session=session, + post_request_model=post_request_model, + landing_page_id=os.getenv("STAC_FASTAPI_LANDING_PAGE_ID", "stac-fastapi"), ), search_get_request_model=create_get_request_model(search_extensions), search_post_request_model=post_request_model, diff --git a/stac_fastapi/opensearch/stac_fastapi/opensearch/app.py b/stac_fastapi/opensearch/stac_fastapi/opensearch/app.py index 8be0eafd..98186ab8 100644 --- a/stac_fastapi/opensearch/stac_fastapi/opensearch/app.py +++ b/stac_fastapi/opensearch/stac_fastapi/opensearch/app.py @@ -89,7 +89,10 @@ settings=settings, extensions=extensions, client=CoreClient( - database=database_logic, session=session, post_request_model=post_request_model + database=database_logic, + session=session, + post_request_model=post_request_model, + landing_page_id=os.getenv("STAC_FASTAPI_LANDING_PAGE_ID", "stac-fastapi"), ), search_get_request_model=create_get_request_model(search_extensions), search_post_request_model=post_request_model, From fa0b9d65a9a660324815a69c8e2299b3f3ae6b8b Mon Sep 17 00:00:00 2001 From: rhysrevans3 Date: Fri, 9 May 2025 14:24:46 +0100 Subject: [PATCH 2/3] Adding to README, CHANGELOG, & docker composes. --- CHANGELOG.md | 4 +++ README.md | 33 ++++++++++--------- docker-compose.yml | 1 + examples/auth/docker-compose.basic_auth.yml | 1 + examples/auth/docker-compose.oauth2.yml | 1 + .../docker-compose.route_dependencies.yml | 1 + examples/pip_docker/docker-compose.yml | 1 + .../rate_limit/docker-compose.rate_limit.yml | 1 + 8 files changed, 27 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8830459b..d08acc55 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Changed +### Added + +- Added configurable landing page ID `STAC_FASTAPI_LANDING_PAGE_ID` [#352](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/352) + ## [v3.2.4] - 2025-03-14 ### Added diff --git a/README.md b/README.md index 84c38d12..50d10aa8 100644 --- a/README.md +++ b/README.md @@ -80,22 +80,23 @@ You can customize additional settings in your `.env` file: | Variable | Description | Default | Required | |------------------------------|--------------------------------------------------------------------------------------|--------------------------|---------------------------------------------------------------------------------------------| -| `ES_HOST` | Hostname for external Elasticsearch/OpenSearch. | `localhost` | Optional | -| `ES_PORT` | Port for Elasticsearch/OpenSearch. | `9200` (ES) / `9202` (OS)| Optional | -| `ES_USE_SSL` | Use SSL for connecting to Elasticsearch/OpenSearch. | `false` | Optional | -| `ES_VERIFY_CERTS` | Verify SSL certificates when connecting. | `false` | Optional | -| `STAC_FASTAPI_TITLE` | Title of the API in the documentation. | `stac-fastapi-elasticsearch` or `stac-fastapi-opensearch` | Optional | -| `STAC_FASTAPI_DESCRIPTION` | Description of the API in the documentation. | N/A | Optional | -| `STAC_FASTAPI_VERSION` | API version. | `2.1` | Optional | -| `APP_HOST` | Server bind address. | `0.0.0.0` | Optional | -| `APP_PORT` | Server port. | `8080` | Optional | -| `ENVIRONMENT` | Runtime environment. | `local` | Optional | -| `WEB_CONCURRENCY` | Number of worker processes. | `10` | Optional | -| `RELOAD` | Enable auto-reload for development. | `true` | Optional | -| `STAC_FASTAPI_RATE_LIMIT` | API rate limit per client. | `200/minute` | Optional | -| `BACKEND` | Tests-related variable | `elasticsearch` or `opensearch` based on the backend | Optional | -| `ELASTICSEARCH_VERSION` | ElasticSearch version | `7.17.1` | Optional | -| `OPENSEARCH_VERSION` | OpenSearch version | `2.11.0` | Optional | +| `ES_HOST` | Hostname for external Elasticsearch/OpenSearch. | `localhost` | Optional | +| `ES_PORT` | Port for Elasticsearch/OpenSearch. | `9200` (ES) / `9202` (OS)| Optional | +| `ES_USE_SSL` | Use SSL for connecting to Elasticsearch/OpenSearch. | `false` | Optional | +| `ES_VERIFY_CERTS` | Verify SSL certificates when connecting. | `false` | Optional | +| `STAC_FASTAPI_TITLE` | Title of the API in the documentation. | `stac-fastapi-elasticsearch` or `stac-fastapi-opensearch` | Optional | +| `STAC_FASTAPI_DESCRIPTION` | Description of the API in the documentation. | N/A | Optional | +| `STAC_FASTAPI_VERSION` | API version. | `2.1` | Optional | +| `STAC_FASTAPI_LANDING_PAGE_ID` | Landing page ID | `stac-fastapi` | Optional | +| `APP_HOST` | Server bind address. | `0.0.0.0` | Optional | +| `APP_PORT` | Server port. | `8080` | Optional | +| `ENVIRONMENT` | Runtime environment. | `local` | Optional | +| `WEB_CONCURRENCY` | Number of worker processes. | `10` | Optional | +| `RELOAD` | Enable auto-reload for development. | `true` | Optional | +| `STAC_FASTAPI_RATE_LIMIT` | API rate limit per client. | `200/minute` | Optional | +| `BACKEND` | Tests-related variable | `elasticsearch` or `opensearch` based on the backend | Optional | +| `ELASTICSEARCH_VERSION` | ElasticSearch version | `7.17.1` | Optional | +| `OPENSEARCH_VERSION` | OpenSearch version | `2.11.0` | Optional | > [!NOTE] > The variables `ES_HOST`, `ES_PORT`, `ES_USE_SSL`, and `ES_VERIFY_CERTS` apply to both Elasticsearch and OpenSearch backends, so there is no need to rename the key names to `OS_` even if you're using OpenSearch. diff --git a/docker-compose.yml b/docker-compose.yml index da4633b9..2151b2a7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,6 +12,7 @@ services: - STAC_FASTAPI_TITLE=stac-fastapi-elasticsearch - STAC_FASTAPI_DESCRIPTION=A STAC FastAPI with an Elasticsearch backend - STAC_FASTAPI_VERSION=2.1 + - STAC_FASTAPI_LANDING_PAGE_ID=stac-fastapi-elasticsearch - APP_HOST=0.0.0.0 - APP_PORT=8080 - RELOAD=true diff --git a/examples/auth/docker-compose.basic_auth.yml b/examples/auth/docker-compose.basic_auth.yml index a6292a1f..c2975523 100644 --- a/examples/auth/docker-compose.basic_auth.yml +++ b/examples/auth/docker-compose.basic_auth.yml @@ -12,6 +12,7 @@ services: - STAC_FASTAPI_TITLE=stac-fastapi-elasticsearch - STAC_FASTAPI_DESCRIPTION=A STAC FastAPI with an Elasticsearch backend - STAC_FASTAPI_VERSION=3.0.0a2 + - STAC_FASTAPI_LANDING_PAGE_ID=stac-fastapi-elasticsearch - APP_HOST=0.0.0.0 - APP_PORT=8080 - RELOAD=true diff --git a/examples/auth/docker-compose.oauth2.yml b/examples/auth/docker-compose.oauth2.yml index 8cd8f72f..5094f97c 100644 --- a/examples/auth/docker-compose.oauth2.yml +++ b/examples/auth/docker-compose.oauth2.yml @@ -12,6 +12,7 @@ services: - STAC_FASTAPI_TITLE=stac-fastapi-elasticsearch - STAC_FASTAPI_DESCRIPTION=A STAC FastAPI with an Elasticsearch backend - STAC_FASTAPI_VERSION=3.0.0a1 + - STAC_FASTAPI_LANDING_PAGE_ID=stac-fastapi-elasticsearch - APP_HOST=0.0.0.0 - APP_PORT=8080 - RELOAD=true diff --git a/examples/auth/docker-compose.route_dependencies.yml b/examples/auth/docker-compose.route_dependencies.yml index b10fbb6f..b64e9af8 100644 --- a/examples/auth/docker-compose.route_dependencies.yml +++ b/examples/auth/docker-compose.route_dependencies.yml @@ -12,6 +12,7 @@ services: - STAC_FASTAPI_TITLE=stac-fastapi-elasticsearch - STAC_FASTAPI_DESCRIPTION=A STAC FastAPI with an Elasticsearch backend - STAC_FASTAPI_VERSION=3.0.0a2 + - STAC_FASTAPI_LANDING_PAGE_ID=stac-fastapi-elasticsearch - APP_HOST=0.0.0.0 - APP_PORT=8080 - RELOAD=true diff --git a/examples/pip_docker/docker-compose.yml b/examples/pip_docker/docker-compose.yml index 3b2e6926..4e2fbfe3 100644 --- a/examples/pip_docker/docker-compose.yml +++ b/examples/pip_docker/docker-compose.yml @@ -19,6 +19,7 @@ services: - ES_PORT=9200 - ES_USE_SSL=false - ES_VERIFY_CERTS=false + - STAC_FASTAPI_LANDING_PAGE_ID=stac-fastapi-elasticsearch ports: - "8080:8080" volumes: diff --git a/examples/rate_limit/docker-compose.rate_limit.yml b/examples/rate_limit/docker-compose.rate_limit.yml index 5416e139..71203f19 100644 --- a/examples/rate_limit/docker-compose.rate_limit.yml +++ b/examples/rate_limit/docker-compose.rate_limit.yml @@ -12,6 +12,7 @@ services: - STAC_FASTAPI_TITLE=stac-fastapi-elasticsearch - STAC_FASTAPI_DESCRIPTION=A STAC FastAPI with an Elasticsearch backend - STAC_FASTAPI_VERSION=2.1 + - STAC_FASTAPI_LANDING_PAGE_ID=stac-fastapi-elasticsearch - APP_HOST=0.0.0.0 - APP_PORT=8080 - RELOAD=true From b5e4c4939e4df14c06bde0b1844d20c3b273059c Mon Sep 17 00:00:00 2001 From: Jonathan Healy Date: Sat, 10 May 2025 11:50:26 +0800 Subject: [PATCH 3/3] Update CHANGELOG.md --- CHANGELOG.md | 1 - 1 file changed, 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 37162a23..83f9b501 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Added - Added configurable landing page ID `STAC_FASTAPI_LANDING_PAGE_ID` [#352](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/352) -- Updated dynamic mapping for items to map long values to double versus float [#326](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/326) ### Changed