stac-utils / stac-fastapi-elasticsearch-opensearch

Elasticsearch backend for stac-fastapi with Opensearch support.
https://stac-utils.github.io/stac-fastapi-elasticsearch-opensearch
MIT License
28 stars 13 forks source link

Enable custom API title and description #207

Closed jamesfisher-geo closed 6 months ago

jamesfisher-geo commented 6 months ago

Related Issue(s):

Description: Adds API title and description parameters from environment variables STAC_API_TITLE and STAC_API_DESCRIPTION, respectively.

PR Checklist:

jamesfisher-geo commented 5 months ago

@jonhealy1 Could not really follow the discussion in #639 and #657. Are there any change needed to this?

jonhealy1 commented 5 months ago

I think the ENV variable names/ meanings may have changed, it's still nice to have our own defaults. We should probably include all of these. Once v2.5.0 is released we can update and make sure everything works. What do you think? I may be missing something here.


- `STAC_FASTAPI_VERSION` (string) is the version number of your API instance (this is not the STAC version).
- `STAC FASTAPI_TITLE` (string) should be a self-explanatory title for your API.
- `STAC FASTAPI_DESCRIPTION` (string) should be a good description for your API. It can contain CommonMark.
- `STAC_FASTAPI_LANDING_ID` (string) is a unique identifier for your Landing page.```
jamesfisher-geo commented 5 months ago

Sounds great. Would the defaults be defined when instantiating StacApi like below? Or will they be defined in a separate app config file?

api = StacApi(
    title=os.getenv("STAC_FASTAPI_TITLE", "stac-fastapi-elasticsearch"),
    description=os.getenv("STAC_FASTAPI_DESCRIPTION", "stac-fastapi-elasticsearch"),
    api_version=os.getenv("STAC_FASTAPI_VERSION", "2.1"),
    settings=settings,
    extensions=extensions,
    client=CoreClient(
        database=database_logic, session=session, post_request_model=post_request_model
    ),
    search_get_request_model=create_get_request_model(extensions),
    search_post_request_model=post_request_model,
)
jonhealy1 commented 5 months ago

we could add something like this to the config file and then import them if we want: https://github.com/stac-utils/stac-fastapi/blob/f7d2eb3c30bef338e3bf6cce5c425b531a653a5e/stac_fastapi/types/stac_fastapi/types/config.py#L7-L42