|
| 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) |
0 commit comments