Skip to content

Commit 43f911e

Browse files
Allow landing page id to be configurable (#352)
**Description:** Allow landing page id to be configured through env variable. **PR Checklist:** - [x] Code is formatted and linted (run `pre-commit run --all-files`) - [x] Tests pass (run `make test`) - [x] Documentation has been updated to reflect changes, if applicable - [x] Changes are added to the changelog --------- Co-authored-by: Jonathan Healy <[email protected]>
1 parent 7405916 commit 43f911e

File tree

10 files changed

+19
-2
lines changed

10 files changed

+19
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
99

1010
### Added
1111

12+
- Added configurable landing page ID `STAC_FASTAPI_LANDING_PAGE_ID` [#352](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/352)
13+
1214
### Changed
1315

1416
### Fixed
@@ -28,6 +30,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
2830
- Changed item update operation to use Elasticsearch index API instead of delete and create for better efficiency and atomicity. [#75](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/issues/75)
2931
- Bulk insertion via `BulkTransactionsClient` now strictly validates all STAC Items using the Pydantic model before insertion. Any invalid item will immediately raise a `ValidationError`, ensuring consistent validation with single-item inserts and preventing invalid STAC Items from being stored. This validation is enforced regardless of the `RAISE_ON_BULK_ERROR` setting. [#368](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/368)
3032

33+
### Changed
34+
3135
### Fixed
3236

3337
- Refactored `create_item` and `update_item` methods to share unified logic, ensuring consistent conflict detection, validation, and database operations. [#368](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/368)

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ You can customize additional settings in your `.env` file:
104104
| `STAC_FASTAPI_TITLE` | Title of the API in the documentation. | `stac-fastapi-elasticsearch` or `stac-fastapi-opensearch` | Optional |
105105
| `STAC_FASTAPI_DESCRIPTION` | Description of the API in the documentation. | N/A | Optional |
106106
| `STAC_FASTAPI_VERSION` | API version. | `2.1` | Optional |
107+
| `STAC_FASTAPI_LANDING_PAGE_ID` | Landing page ID | `stac-fastapi` | Optional |
107108
| `APP_HOST` | Server bind address. | `0.0.0.0` | Optional |
108109
| `APP_PORT` | Server port. | `8080` | Optional |
109110
| `ENVIRONMENT` | Runtime environment. | `local` | Optional |

compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ services:
1010
- STAC_FASTAPI_TITLE=stac-fastapi-elasticsearch
1111
- STAC_FASTAPI_DESCRIPTION=A STAC FastAPI with an Elasticsearch backend
1212
- STAC_FASTAPI_VERSION=4.1.0
13+
- STAC_FASTAPI_LANDING_PAGE_ID=stac-fastapi-elasticsearch
1314
- APP_HOST=0.0.0.0
1415
- APP_PORT=8080
1516
- RELOAD=true

examples/auth/compose.basic_auth.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ services:
1010
- STAC_FASTAPI_TITLE=stac-fastapi-elasticsearch
1111
- STAC_FASTAPI_DESCRIPTION=A STAC FastAPI with an Elasticsearch backend
1212
- STAC_FASTAPI_VERSION=4.1.0
13+
- STAC_FASTAPI_LANDING_PAGE_ID=stac-fastapi-elasticsearch
1314
- APP_HOST=0.0.0.0
1415
- APP_PORT=8080
1516
- RELOAD=true

examples/auth/compose.oauth2.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ services:
1010
- STAC_FASTAPI_TITLE=stac-fastapi-elasticsearch
1111
- STAC_FASTAPI_DESCRIPTION=A STAC FastAPI with an Elasticsearch backend
1212
- STAC_FASTAPI_VERSION=4.1.0
13+
- STAC_FASTAPI_LANDING_PAGE_ID=stac-fastapi-elasticsearch
1314
- APP_HOST=0.0.0.0
1415
- APP_PORT=8080
1516
- RELOAD=true

examples/auth/compose.route_dependencies.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ services:
1010
- STAC_FASTAPI_TITLE=stac-fastapi-elasticsearch
1111
- STAC_FASTAPI_DESCRIPTION=A STAC FastAPI with an Elasticsearch backend
1212
- STAC_FASTAPI_VERSION=4.1.0
13+
- STAC_FASTAPI_LANDING_PAGE_ID=stac-fastapi-elasticsearch
1314
- APP_HOST=0.0.0.0
1415
- APP_PORT=8080
1516
- RELOAD=true

examples/pip_docker/compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ services:
1717
- ES_PORT=9200
1818
- ES_USE_SSL=false
1919
- ES_VERIFY_CERTS=false
20+
- STAC_FASTAPI_LANDING_PAGE_ID=stac-fastapi-elasticsearch
2021
ports:
2122
- "8080:8080"
2223
volumes:

examples/rate_limit/compose.rate_limit.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ services:
1010
- STAC_FASTAPI_TITLE=stac-fastapi-elasticsearch
1111
- STAC_FASTAPI_DESCRIPTION=A STAC FastAPI with an Elasticsearch backend
1212
- STAC_FASTAPI_VERSION=4.1.0
13+
- STAC_FASTAPI_LANDING_PAGE_ID=stac-fastapi-elasticsearch
1314
- APP_HOST=0.0.0.0
1415
- APP_PORT=8080
1516
- RELOAD=true

stac_fastapi/elasticsearch/stac_fastapi/elasticsearch/app.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,10 @@
9494
settings=settings,
9595
extensions=extensions,
9696
client=CoreClient(
97-
database=database_logic, session=session, post_request_model=post_request_model
97+
database=database_logic,
98+
session=session,
99+
post_request_model=post_request_model,
100+
landing_page_id=os.getenv("STAC_FASTAPI_LANDING_PAGE_ID", "stac-fastapi"),
98101
),
99102
search_get_request_model=create_get_request_model(search_extensions),
100103
search_post_request_model=post_request_model,

stac_fastapi/opensearch/stac_fastapi/opensearch/app.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,10 @@
9494
settings=settings,
9595
extensions=extensions,
9696
client=CoreClient(
97-
database=database_logic, session=session, post_request_model=post_request_model
97+
database=database_logic,
98+
session=session,
99+
post_request_model=post_request_model,
100+
landing_page_id=os.getenv("STAC_FASTAPI_LANDING_PAGE_ID", "stac-fastapi"),
98101
),
99102
search_get_request_model=create_get_request_model(search_extensions),
100103
search_post_request_model=post_request_model,

0 commit comments

Comments
 (0)