Signed-off-by: Julien Riou <julien@riou.xyz>
This commit is contained in:
parent
0ce540e92d
commit
7c94a62d80
1 changed files with 41 additions and 1 deletions
|
@ -32,4 +32,44 @@ The file format is **JSON**:
|
|||
* **prometheus_notes_metric** (string): Name of the notes count metric (default "collerd_notes")
|
||||
* **observation_internal** (int): Number of seconds to wait between two observations (default 60)
|
||||
|
||||
The configuration file is not required but the service might not be exposed to the public.
|
||||
The configuration file is not required but the service might not be exposed to the public.
|
||||
|
||||
## API
|
||||
|
||||
### GET /health
|
||||
|
||||
Returns 200 OK.
|
||||
|
||||
### POST /api/note
|
||||
|
||||
Create a note.
|
||||
|
||||
Body (JSON):
|
||||
* **content** (string): base64 encoded content (required)
|
||||
* **password** (string): user-provided password
|
||||
* **encrypted** (bool): true if the note has been encrypted by the client
|
||||
* **expiration** (int): lifetime of the note in seconds (must be supported by the server)
|
||||
* **delete_after_read** (bool): delete the note after the first read
|
||||
|
||||
Response (JSON):
|
||||
* **id** (string): ID of the note
|
||||
|
||||
|
||||
### GET /<id>/<password>
|
||||
|
||||
> [!IMPORTANT]
|
||||
> Potential password leak
|
||||
|
||||
Return content of a note encrypted by the given password.
|
||||
|
||||
### GET /<id>
|
||||
|
||||
Return content of a note.
|
||||
|
||||
If the note is encrypted, the encrypted value is returned (application/octet-stream). Otherwise, the text is returned (text/plain).
|
||||
|
||||
### Errors
|
||||
|
||||
Errors return **500 Server Internal Error** with the **JSON** payload:
|
||||
* **message** (string): message of the response
|
||||
* **error** (string): error if any
|
Loading…
Add table
Add a link
Reference in a new issue