Skip to content

Commit 240988f

Browse files
committed
add docs
1 parent 5ac7a29 commit 240988f

File tree

5 files changed

+74
-5
lines changed

5 files changed

+74
-5
lines changed

CHANGES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ As a part of this release, this repository was extracted from the main
224224
### Added
225225

226226
- Nginx service as second docker-compose stack to demonstrate proxy ([#503](https://github.com/stac-utils/stac-fastapi/pull/503))
227-
- Validation checks in CI using [stac-api-validator](github.com/stac-utils/stac-api-validator) ([#508](https://github.com/stac-utils/stac-fastapi/pull/508))
227+
- Validation checks in CI using [stac-api-validator](https://github.com/stac-utils/stac-api-validator) ([#508](https://github.com/stac-utils/stac-fastapi/pull/508))
228228
- Required links to the sqlalchemy ItemCollection endpoint ([#508](https://github.com/stac-utils/stac-fastapi/pull/508))
229229
- Publication of docker images to GHCR ([#525](https://github.com/stac-utils/stac-fastapi/pull/525))
230230

docs/api/stac_fastapi/pgstac/version.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/settings.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
2+
3+
### Application Extension
4+
5+
The default `stac-fastapi-pgstac` application comes will **all** extensions enabled (except transaction). Users can use `ENABLED_EXTENSIONS` environment variable to limit the supported extensions.
6+
7+
Available values for `ENABLED_EXTENSIONS`:
8+
9+
- `query`
10+
- `sort`
11+
- `fields`
12+
- `filter`
13+
- `free_text` (only for collection-search)
14+
- `pagination`
15+
- `collection_search`
16+
17+
Example: `ENABLED_EXTENSIONS="pagination,sort"`
18+
19+
20+
Since `6.0.0`, the transaction extension is not enabled by default. To add the transaction endpoints, users can set `ENABLE_TRANSACTIONS_EXTENSIONS=TRUE/YES/1`.
21+
22+
### Database config
23+
24+
- `PGUSER`: postgres username
25+
- `PGPASSWORD`: postgres password
26+
- `PGHOST`: hostname for the connection
27+
- `PGPORT`: database port
28+
- `PGDATABASE`: database name
29+
- `DB_MIN_CONN_SIZE`: Number of connection the pool will be initialized with. Defaults to `1`
30+
- `DB_MAX_CONN_SIZE` Max number of connections in the pool. Defaults to `10`
31+
- `DB_MAX_QUERIES`: Number of queries after a connection is closed and replaced with a new connection. Defaults to `50000`
32+
- `DB_MAX_INACTIVE_CONN_LIFETIME`: Number of seconds after which inactive connections in the pool will be closed. Defaults to `300`
33+
- `SEARCH_PATH`: Postgres search path. Defaults to `"pgstac,public"`
34+
- `APPLICATION_NAME`: PgSTAC Application name. Defaults to `"pgstac"`
35+
36+
##### Deprecated
37+
38+
In version `6.0.0` we've renamed the PG configuration variable to match the official naming convention:
39+
40+
- `POSTGRES_USER` -> `PGUSER`
41+
- `POSTGRES_PASS` -> `PGPASSWORD`
42+
- `POSTGRES_HOST_READER` -> `PGHOST`
43+
- `POSTGRES_HOST_WRITER` -> `PGHOST`*
44+
- `POSTGRES_PORT` -> `PGPORT`
45+
- `POSTGRES_DBNAME` -> `PGDATABASE`
46+
47+
\* Since version `6.0`, users cannot set a different host for `writer` and `reader` database but will need to customize the application and pass a specific `stac_fastapi.pgstac.config.PostgresSettings` instance to the `connect_to_db` function.
48+
49+
### Validation/Serialization
50+
51+
- `ENABLE_RESPONSE_MODELS`: use pydantic models to validate endpoint responses. Defaults to `False`
52+
- `ENABLE_DIRECT_RESPONSE`: by-pass the default FastAPI serialization by wrapping the endpoint responses into `starlette.Response` classes. Defaults to `False`
53+
54+
### Misc
55+
56+
- `STAC_FASTAPI_VERSION` (string) is the version number of your API instance (this is not the STAC version)
57+
- `STAC FASTAPI_TITLE` (string) should be a self-explanatory title for your API
58+
- `STAC FASTAPI_DESCRIPTION` (string) should be a good description for your API. It can contain CommonMark
59+
- `STAC_FASTAPI_LANDING_ID` (string) is a unique identifier for your Landing page
60+
- `ROOT_PATH`: set application root-path (when using proxy)
61+
- `CORS_ORIGINS`: A list of origins that should be permitted to make cross-origin requests. Defaults to `*`
62+
- `CORS_METHODS`: A list of HTTP methods that should be allowed for cross-origin requests. Defaults to `"GET,POST,OPTIONS"`
63+
- `USE_API_HYDRATE`: perform hydration of stac items within stac-fastapi
64+
- `INVALID_ID_CHARS`: list of characters that are not allowed in item or collection ids (used in Transaction endpoints)

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ extra:
1515
# Layout
1616
nav:
1717
- Home: "index.md"
18+
- Configuration: "settings.md"
1819
- API:
1920
- stac_fastapi.pgstac:
2021
- module: api/stac_fastapi/pgstac/index.md

stac_fastapi/pgstac/config.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,7 @@ class PostgresSettings(BaseSettings):
5858
pghost: hostname for the connection.
5959
pgport: database port.
6060
pgdatabase: database name.
61-
use_api_hydrate: perform hydration of stac items within stac-fastapi.
62-
invalid_id_chars: list of characters that are not allowed in item or collection ids.
61+
6362
"""
6463

6564
postgres_user: Annotated[
@@ -157,7 +156,13 @@ def connection_string(self):
157156

158157

159158
class Settings(ApiSettings):
160-
"""Api Settings."""
159+
"""API settings.
160+
161+
Attributes:
162+
use_api_hydrate: perform hydration of stac items within stac-fastapi.
163+
invalid_id_chars: list of characters that are not allowed in item or collection ids.
164+
165+
"""
161166

162167
use_api_hydrate: bool = False
163168
invalid_id_chars: List[str] = DEFAULT_INVALID_ID_CHARS

0 commit comments

Comments
 (0)