mirror of
https://github.com/directus/directus.git
synced 2026-04-25 03:00:53 -04:00
Merge branch 'main' into aggregation
This commit is contained in:
@@ -65,7 +65,7 @@ example.com/assets/1ac73658-8b62-4dea-b6da-529fbc9d01a4?fit=cover&width=200&heig
|
||||
```
|
||||
|
||||
For even more advanced control over the file generation, Directus exposes
|
||||
[the full `sharp` API](https://sharp.pixelplumbing.com/api-operation) through the `transform` query parameter. This
|
||||
[the full `sharp` API](https://sharp.pixelplumbing.com/api-operation) through the `transforms` query parameter. This
|
||||
parameter accepts a two-dimensional array with the format `[Operation, ...arguments]`, for example:
|
||||
|
||||
```
|
||||
|
||||
@@ -50,9 +50,6 @@ Additional default values for the role.
|
||||
`fields` **array**\
|
||||
What fields the user is allowed to alter.
|
||||
|
||||
`limit` **integer**\
|
||||
How many items the user is able to alter at once in batch operations.
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="right">
|
||||
@@ -72,8 +69,7 @@ How many items the user is able to alter at once in batch operations.
|
||||
"presets": {
|
||||
"published": false
|
||||
},
|
||||
"fields": ["title", "translations"],
|
||||
"limit": null
|
||||
"fields": ["title", "translations"]
|
||||
}
|
||||
```
|
||||
|
||||
@@ -190,8 +186,7 @@ GET /permissions/:id
|
||||
"presets": {
|
||||
"published": false
|
||||
},
|
||||
"fields": ["title", "translations"],
|
||||
"limit": null
|
||||
"fields": ["title", "translations"]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
@@ -23,17 +23,18 @@ needs to be publicly available on the internet.
|
||||
|
||||
## Database
|
||||
|
||||
| Variable | Description | Default Value |
|
||||
| ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | ------------- |
|
||||
| `DB_CLIENT` | **Required**. What database client to use. One of `pg` or `postgres`, `mysql`, `oracledb`, `mssql`, or `sqlite3`. | -- |
|
||||
| `DB_HOST` | Database host. **Required** when using `pg`, `mysql`, `oracledb`, or `mssql`. | -- |
|
||||
| `DB_PORT` | Database port. **Required** when using `pg`, `mysql`, `oracledb`, or `mssql`. | -- |
|
||||
| `DB_DATABASE` | Database name. **Required** when using `pg`, `mysql`, `oracledb`, or `mssql`. | -- |
|
||||
| `DB_USER` | Database user. **Required** when using `pg`, `mysql`, `oracledb`, or `mssql`. | -- |
|
||||
| `DB_PASSWORD` | Database user's password. **Required** when using `pg`, `mysql`, `oracledb`, or `mssql`. | -- |
|
||||
| `DB_FILENAME` | Where to read/write the SQLite database. **Required** when using `sqlite3`. | -- |
|
||||
| `DB_CONNECTION_STRING` | When using `pg`, you can submit a connection string instead of individual properties. Using this will ignore any of the other connection settings. | -- |
|
||||
| `DB_POOL_*` | Pooling settings. Passed on to [the `tarn.js`](https://github.com/vincit/tarn.js#usage) library. | -- |
|
||||
| Variable | Description | Default Value |
|
||||
| ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | --------------- |
|
||||
| `DB_CLIENT` | **Required**. What database client to use. One of `pg` or `postgres`, `mysql`, `oracledb`, `mssql`, or `sqlite3`. | -- |
|
||||
| `DB_HOST` | Database host. **Required** when using `pg`, `mysql`, `oracledb`, or `mssql`. | -- |
|
||||
| `DB_PORT` | Database port. **Required** when using `pg`, `mysql`, `oracledb`, or `mssql`. | -- |
|
||||
| `DB_DATABASE` | Database name. **Required** when using `pg`, `mysql`, `oracledb`, or `mssql`. | -- |
|
||||
| `DB_USER` | Database user. **Required** when using `pg`, `mysql`, `oracledb`, or `mssql`. | -- |
|
||||
| `DB_PASSWORD` | Database user's password. **Required** when using `pg`, `mysql`, `oracledb`, or `mssql`. | -- |
|
||||
| `DB_FILENAME` | Where to read/write the SQLite database. **Required** when using `sqlite3`. | -- |
|
||||
| `DB_CONNECTION_STRING` | When using `pg`, you can submit a connection string instead of individual properties. Using this will ignore any of the other connection settings. | -- |
|
||||
| `DB_POOL_*` | Pooling settings. Passed on to [the `tarn.js`](https://github.com/vincit/tarn.js#usage) library. | -- |
|
||||
| `DB_EXCLUDE_TABLES` | CSV of tables you want Directus to ignore completely | spatial_ref_sys |
|
||||
|
||||
::: tip Additional Database Variables
|
||||
|
||||
@@ -73,6 +74,32 @@ your project and API on different domains, make sure to verify your configuratio
|
||||
|
||||
:::
|
||||
|
||||
### Hashing
|
||||
|
||||
| Variable | Description | Default Value |
|
||||
| ---------------------- | -------------------------------------------------------------------------------------------------------------------------------- | ------------------- |
|
||||
| `HASH_MEMORY_COST` | How much memory to use when generating hashes, in KiB. | `4096` (4 MiB) |
|
||||
| `HASH_LENGTH` | The length of the hash function output in bytes. | `32` |
|
||||
| `HASH_TIME_COST` | The amount of passes (iterations) used by the hash function. It increases hash strength at the cost of time required to compute. | `3` |
|
||||
| `HASH_PARALLELISM` | The amount of threads to compute the hash on. Each thread has a memory pool with `HASH_MEMORY_COST` size. | `1` (single thread) |
|
||||
| `HASH_TYPE` | The variant of the hash function (`0`: argon2d, `1`: argon2i, or `2`: argon2id). | `1` (argon2i) |
|
||||
| `HASH_ASSOCIATED_DATA` | An extra and optional non-secret value. The value will be included B64 encoded in the parameters portion of the digest. | -- |
|
||||
|
||||
Argon2's hashing function is used by Directus for three purposes: 1) hashing user passwords, 2) generating hashes for
|
||||
the `Hash` field type in collections, and 3) the
|
||||
[generate a hash API endpoint](https://docs.directus.io/reference/api/system/utilities/#generate-a-hash).
|
||||
|
||||
All `HASH_*` environment variable parameters are passed to the `argon2.hash` function. See the
|
||||
[node-argon2 library options page](https://github.com/ranisalt/node-argon2/wiki/Options) for reference.
|
||||
|
||||
::: tip Memory Usage
|
||||
|
||||
Modifying `HASH_MEMORY_COST` and/or `HASH_PARALLELISM` will affect the amount of memory directus uses when computing
|
||||
hashes; each thread gets `HASH_MEMORY_COST` amount of memory, so the total additional memory will be these two values
|
||||
multiplied. This may cause out of memory errors, especially when running in containerized environments.
|
||||
|
||||
:::
|
||||
|
||||
## CORS
|
||||
|
||||
| Variable | Description | Default Value |
|
||||
@@ -240,12 +267,12 @@ Based on your configured driver, you must also provide the following configurati
|
||||
|
||||
### Azure (`azure`)
|
||||
|
||||
| Variable | Description | Default Value |
|
||||
| ----------------------------------- | -------------------------- | ------------------------------------- |
|
||||
| `STORAGE_<LOCATION>_CONTAINER_NAME` | Azure Storage container | -- |
|
||||
| `STORAGE_<LOCATION>_ACCOUNT_NAME` | Azure Storage account name | -- |
|
||||
| `STORAGE_<LOCATION>_ACCOUNT_KEY` | Azure Storage key | -- |
|
||||
| `STORAGE_<LOCATION>_ENDPOINT` | Azure URL | "{ACCOUNT_KEY}.blob.core.windows.net" |
|
||||
| Variable | Description | Default Value |
|
||||
| ----------------------------------- | -------------------------- | --------------------------------------------- |
|
||||
| `STORAGE_<LOCATION>_CONTAINER_NAME` | Azure Storage container | -- |
|
||||
| `STORAGE_<LOCATION>_ACCOUNT_NAME` | Azure Storage account name | -- |
|
||||
| `STORAGE_<LOCATION>_ACCOUNT_KEY` | Azure Storage key | -- |
|
||||
| `STORAGE_<LOCATION>_ENDPOINT` | Azure URL | "https://{ACCOUNT_KEY}.blob.core.windows.net" |
|
||||
|
||||
### Google Cloud Storage (`gcs`)
|
||||
|
||||
|
||||
@@ -48,28 +48,28 @@
|
||||
|
||||
## Filter Operators
|
||||
|
||||
| Operator | Description |
|
||||
| --------------- | -------------------------------------- |
|
||||
| `_eq` | Equal to |
|
||||
| `_neq` | Not equal to |
|
||||
| `_lt` | Less than |
|
||||
| `_lte` | Less than or equal to |
|
||||
| `_gt` | Greater than |
|
||||
| `_gte` | Greater than or equal to |
|
||||
| `_in` | Exists in one of the values |
|
||||
| `_nin` | Not in one of the values |
|
||||
| `_null` | It is null |
|
||||
| `_nnull` | It is not null |
|
||||
| `_contains` | Contains the substring |
|
||||
| `_ncontains` | Doesn't contain the substring |
|
||||
| `_starts_with` | Contains the substring |
|
||||
| `_nstarts_with` | Doesn't contain the substring |
|
||||
| `_ends_with` | Contains the substring |
|
||||
| `_nends_with` | Doesn't contain the substring |
|
||||
| `_between` | The value is between two values |
|
||||
| `_nbetween` | The value is not between two values |
|
||||
| `_empty` | The value is empty (null or falsy) |
|
||||
| `_nempty` | The value is not empty (null or falsy) |
|
||||
| Operator | Description |
|
||||
| --------------- | ------------------------------------- |
|
||||
| `_eq` | Equal to |
|
||||
| `_neq` | Not equal to |
|
||||
| `_lt` | Less than |
|
||||
| `_lte` | Less than or equal to |
|
||||
| `_gt` | Greater than |
|
||||
| `_gte` | Greater than or equal to |
|
||||
| `_in` | Matches any of the values |
|
||||
| `_nin` | Doesn't match any of the values |
|
||||
| `_null` | Is `null` |
|
||||
| `_nnull` | Is not `null` |
|
||||
| `_contains` | Contains the substring |
|
||||
| `_ncontains` | Doesn't contain the substring |
|
||||
| `_starts_with` | Starts with |
|
||||
| `_nstarts_with` | Doesn't start with |
|
||||
| `_ends_with` | Ends with |
|
||||
| `_nends_with` | Doesn't end with |
|
||||
| `_between` | Is between two values (inclusive) |
|
||||
| `_nbetween` | Is not between two values (inclusive) |
|
||||
| `_empty` | Is empty (`null` or falsy) |
|
||||
| `_nempty` | Is not empty (`null` or falsy) |
|
||||
|
||||
The following operators are **only available in validation permissions**:
|
||||
|
||||
|
||||
@@ -480,10 +480,22 @@ await directus.auth.logout();
|
||||
|
||||
### Request a Password Reset
|
||||
|
||||
By default, the address defined in `PUBLIC_URL` on `.env` file is used for the link to the reset password page sent in
|
||||
the email:
|
||||
|
||||
```js
|
||||
await directus.auth.password.request('admin@example.com');
|
||||
```
|
||||
|
||||
But a custom address can be passed as second argument:
|
||||
|
||||
```js
|
||||
await directus.auth.password.request(
|
||||
'admin@example.com',
|
||||
'https://myapp.com' // In this case, the link will be https://myapp.com?token=FEE0A...
|
||||
);
|
||||
```
|
||||
|
||||
### Reset a Password
|
||||
|
||||
```js
|
||||
|
||||
Reference in New Issue
Block a user