-
Notifications
You must be signed in to change notification settings - Fork 19
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
Enable custom API title and description #207
Conversation
@@ -60,6 +62,8 @@ | |||
post_request_model = create_post_request_model(extensions) | |||
|
|||
api = StacApi( | |||
title=os.getenv("STAC_FASTAPI_TITLE", "stac-fastapi"), | |||
description=os.getenv("STAC_FASTAPI_DESCRIPTION", "stac-fastapi"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we include the STAC_FASTAPI_VERSION from the pr in stac-fastapi? api_version=os.getenv("STAC_FASTAPI_VERSION", "2.1"))
Also, should these have more specific default values? The title here for instance could be stac-fastapi.elasticsearch. The api version would be 2.1. If we could pull the default version in from the version file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, good call. I will make those changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could add the new env vars to the app-opensearch and app-elasticsearch in the docker-compose.yml file too. It might help people realize that they can change those things.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool. Added that as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great
@jonhealy1 Could not really follow the discussion in #639 and #657. Are there any change needed to this? |
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.
|
Sounds great. Would the defaults be defined when instantiating 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,
) |
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 |
Related Issue(s):
Description:
Adds API
title
anddescription
parameters from environment variablesSTAC_API_TITLE
andSTAC_API_DESCRIPTION
, respectively.PR Checklist:
pre-commit run --all-files
)make test
)