Fixes #37. BREAKING CHANGE: API routes are prefixed by /api/note. Signed-off-by: Julien Riou <julien@riou.xyz>
This commit is contained in:
parent
61ca30690b
commit
9e0254c0b5
16 changed files with 713 additions and 135 deletions
|
@ -22,6 +22,8 @@ The file format is **JSON**:
|
|||
* **encryption_key_length** (int): Number of characters for generated encryption key (default 16)
|
||||
* **allow_client_encryption_key** (bool): Allow encryption key provided by the client on the web UI
|
||||
* **allow_no_encryption** (bool): Allow notes without encryption
|
||||
* **enable_password_encryption** (bool): Enable password to protect notes (default true)
|
||||
* **enable_upload_file_button** (bool): Display the upload file button in the UI (default true)
|
||||
* **expiration_interval** (int): Number of seconds to wait between two expiration runs
|
||||
* **listen_address** (string): Address to listen for the web server (default "0.0.0.0")
|
||||
* **listen_port** (int): Port to listen for the web server (default 8080)
|
||||
|
@ -35,7 +37,6 @@ The file format is **JSON**:
|
|||
* **observation_internal** (int): Number of seconds to wait between two observations (default 60)
|
||||
* **languages** ([]string): List of supported [languages](https://github.com/microsoft/monaco-editor/tree/main/src/basic-languages)
|
||||
* **language** (string): Default language (default "text")
|
||||
* **enable_upload_file_button** (bool): Display the upload file button in the UI (default true)
|
||||
* **tls_cert_file** (string): Path to TLS certificate file to enable HTTPS
|
||||
* **tls_key_file** (string): Path to TLS key file to enable HTTPS
|
||||
* **bootstrap_directory** (string): Serve [Bootstrap](https://getbootstrap.com/) assets from this local directory (ex: "./node_modules/bootstrap/dist"). See **Dependencies** for details.
|
||||
|
@ -64,19 +65,38 @@ Response (JSON):
|
|||
* **id** (string): ID of the note
|
||||
|
||||
|
||||
### GET /\<id\>/\<encryptionKey\>
|
||||
### GET /api/note/\<id\>/\<encryptionKey\>
|
||||
|
||||
> [!WARNING]
|
||||
> Potential encryption key leak
|
||||
|
||||
Return content of a note encrypted by the given encryption key.
|
||||
|
||||
### GET /\<id\>
|
||||
### POST /api/note/\<id\>/\<encryptionKey\>
|
||||
|
||||
> [!WARNING]
|
||||
> Potential encryption key leak
|
||||
|
||||
Return content of a protected note encrypted by the given encryption key.
|
||||
|
||||
Body (JSON):
|
||||
* **password** (string): password used to protect the note (required)
|
||||
|
||||
### GET /api/note/\<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).
|
||||
|
||||
### POST /api/note/\<id\>
|
||||
|
||||
Return content of a protected note.
|
||||
|
||||
If the note is encrypted, the encrypted value is returned (application/octet-stream). Otherwise, the text is returned (text/plain).
|
||||
|
||||
Body (JSON):
|
||||
* **password** (string): password used to protect the note (required)
|
||||
|
||||
### Errors
|
||||
|
||||
Errors return **500 Server Internal Error** with the **JSON** payload:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue