Skip to content

Allow landing page id to be configurable #352

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
May 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ 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)

### Changed

### Fixed
Expand All @@ -28,6 +30,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- 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)
- 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)

### Changed

### Fixed

- 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)
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ You can customize additional settings in your `.env` file:
| `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 |
Expand Down
1 change: 1 addition & 0 deletions compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ services:
- STAC_FASTAPI_TITLE=stac-fastapi-elasticsearch
- STAC_FASTAPI_DESCRIPTION=A STAC FastAPI with an Elasticsearch backend
- STAC_FASTAPI_VERSION=4.1.0
- STAC_FASTAPI_LANDING_PAGE_ID=stac-fastapi-elasticsearch
- APP_HOST=0.0.0.0
- APP_PORT=8080
- RELOAD=true
Expand Down
1 change: 1 addition & 0 deletions examples/auth/compose.basic_auth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ services:
- STAC_FASTAPI_TITLE=stac-fastapi-elasticsearch
- STAC_FASTAPI_DESCRIPTION=A STAC FastAPI with an Elasticsearch backend
- STAC_FASTAPI_VERSION=4.1.0
- STAC_FASTAPI_LANDING_PAGE_ID=stac-fastapi-elasticsearch
- APP_HOST=0.0.0.0
- APP_PORT=8080
- RELOAD=true
Expand Down
1 change: 1 addition & 0 deletions examples/auth/compose.oauth2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ services:
- STAC_FASTAPI_TITLE=stac-fastapi-elasticsearch
- STAC_FASTAPI_DESCRIPTION=A STAC FastAPI with an Elasticsearch backend
- STAC_FASTAPI_VERSION=4.1.0
- STAC_FASTAPI_LANDING_PAGE_ID=stac-fastapi-elasticsearch
- APP_HOST=0.0.0.0
- APP_PORT=8080
- RELOAD=true
Expand Down
1 change: 1 addition & 0 deletions examples/auth/compose.route_dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ services:
- STAC_FASTAPI_TITLE=stac-fastapi-elasticsearch
- STAC_FASTAPI_DESCRIPTION=A STAC FastAPI with an Elasticsearch backend
- STAC_FASTAPI_VERSION=4.1.0
- STAC_FASTAPI_LANDING_PAGE_ID=stac-fastapi-elasticsearch
- APP_HOST=0.0.0.0
- APP_PORT=8080
- RELOAD=true
Expand Down
1 change: 1 addition & 0 deletions examples/pip_docker/compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,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:
Expand Down
1 change: 1 addition & 0 deletions examples/rate_limit/compose.rate_limit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ services:
- STAC_FASTAPI_TITLE=stac-fastapi-elasticsearch
- STAC_FASTAPI_DESCRIPTION=A STAC FastAPI with an Elasticsearch backend
- STAC_FASTAPI_VERSION=4.1.0
- STAC_FASTAPI_LANDING_PAGE_ID=stac-fastapi-elasticsearch
- APP_HOST=0.0.0.0
- APP_PORT=8080
- RELOAD=true
Expand Down
5 changes: 4 additions & 1 deletion stac_fastapi/elasticsearch/stac_fastapi/elasticsearch/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,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,
Expand Down
5 changes: 4 additions & 1 deletion stac_fastapi/opensearch/stac_fastapi/opensearch/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,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,
Expand Down