mirror of
https://git.asonix.dog/asonix/pict-rs
synced 2024-11-20 11:21:14 +00:00
More readme & config doc fixes
This commit is contained in:
parent
7e26e7281a
commit
d4c5158e57
2 changed files with 8 additions and 20 deletions
22
README.md
22
README.md
|
@ -328,17 +328,14 @@ pict-rs offers the following endpoints:
|
|||
|
||||
|
||||
The following endpoints are protected by an API key via the `X-Api-Token` header, and are disabled
|
||||
unless the `--api-key` option is passed to the binary or the PICTRS_API_KEY environment variable is
|
||||
unless the `--api-key` option is passed to the binary or the PICTRS_SERVER__API_KEY environment variable is
|
||||
set.
|
||||
|
||||
A secure API key can be generated by any password generator.
|
||||
- `POST /internal/import` for uploading an image while preserving the filename. This should not be
|
||||
exposed to the public internet, as it can cause naming conflicts with saved files. The upload
|
||||
format and response format are the same as the `POST /image` endpoint.
|
||||
- `POST /internal/purge?...` Purge a file by it's filename or alias. This removes all aliases and
|
||||
- `POST /internal/import` for uploading an image while preserving the filename as the first alias.
|
||||
The upload format and response format are the same as the `POST /image` endpoint.
|
||||
- `POST /internal/purge?alias={alias} Purge a file by it's alias. This removes all aliases and
|
||||
files associated with the query.
|
||||
- `?file=asdf.png` purge by filename
|
||||
- `?alias=asdf.png` purge by alias
|
||||
|
||||
This endpoint returns the following JSON
|
||||
```json
|
||||
|
@ -347,19 +344,10 @@ A secure API key can be generated by any password generator.
|
|||
"aliases": ["asdf.png"]
|
||||
}
|
||||
```
|
||||
- `GET /internal/aliases?...` Get the aliases for a file by it's filename or alias
|
||||
- `?file={filename}` get aliases by filename
|
||||
- `GET /internal/aliases?alias={alias} Get the aliases for a file by it's alias
|
||||
- `?alias={alias}` get aliases by alias
|
||||
|
||||
This endpiont returns the same JSON as the purge endpoint
|
||||
- `GET /internal/filename?alias={alias}` Get the filename for a file by it's alias
|
||||
This endpoint returns the following JSON
|
||||
```json
|
||||
{
|
||||
"msg": "ok",
|
||||
"filename": "asdf.png"
|
||||
}
|
||||
```
|
||||
|
||||
Additionally, all endpoints support setting deadlines, after which the request will cease
|
||||
processing. To enable deadlines for your requests, you can set the `X-Request-Deadline` header to an
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
## Server configuration
|
||||
[server]
|
||||
## Optional: pict-rs binding address
|
||||
# environment variable: PICTRS_ADDRESS
|
||||
# environment variable: PICTRS_SERVER__ADDRESS
|
||||
# default: 0.0.0.0:8080
|
||||
address = '0.0.0.0:8080'
|
||||
|
||||
## Optional: pict-rs worker id
|
||||
# environment variable PICTRS_WORKER_ID
|
||||
# environment variable PICTRS_SERVER__WORKER_ID
|
||||
# default: pict-rs-1
|
||||
#
|
||||
# This is used for the internal job queue. It will have more meaning once a shared metadata
|
||||
|
@ -14,7 +14,7 @@ address = '0.0.0.0:8080'
|
|||
worker_id = 'pict-rs-1'
|
||||
|
||||
## Optional: shared secret for internal endpoints
|
||||
# environment variable: PICTRS_API_KEY
|
||||
# environment variable: PICTRS_SERVER__API_KEY
|
||||
# default: empty
|
||||
#
|
||||
# Not specifying api_key disables internal endpoints
|
||||
|
|
Loading…
Reference in a new issue