Skip to content

Commit 61f44dc

Browse files
authored
Book changes for the (upcoming) v0.15 release (#21)
* Add CORS flag * Add storage settings
1 parent 8167869 commit 61f44dc

File tree

1 file changed

+85
-2
lines changed

1 file changed

+85
-2
lines changed

book/src/configuration.md

+85-2
Original file line numberDiff line numberDiff line change
@@ -83,17 +83,61 @@ The default configuration file currently contains the following:
8383
#
8484
# This section is used to control local storage options. This section
8585
# is optional.
86+
#
87+
# Options for each item are `.unlimited = {}` to set the storage to be
88+
# unbounded, or `.fifo-megabytes = N`, where N is the (approximate) number
89+
# of megabytes (specifically mebibytes, N * 1024 * 1024 bytes) to be used
90+
# for storing data in a first-in first-out basis.
91+
#
92+
# Defaults are shown commented out.
93+
#
8694
# [storage]
95+
# # Tracing history of Poststation
96+
# tracing.fifo-megabytes = 32
97+
98+
# # Historical "endpoint" request and response data
99+
# endpoints.fifo-megabytes = 128
87100

88-
# There are no configuration options for this yet.
101+
# # Historical "topics in" message data
102+
# topics-in.fifo-megabytes = 128
103+
104+
# # Historical "topics out" message data
105+
# topics-out.fifo-megabytes = 128
106+
107+
# # Historical device log data
108+
# logs.fifo-megabytes = 128
109+
110+
# # History of connected devices and their metadata
111+
# devices.fifo-megabytes = 64
89112

90113
# # `experimental`
91114
#
92115
# This section is used to control experimental, unstable features. This
93116
# section is subject to change without stability guarantees
94117
# [experimental]
95118

96-
# There are no configuration options for this yet.
119+
# # Unsafe Inhibit CORS
120+
#
121+
# Setting this to "true" will add HTTP handlers for OPTIONS requests and
122+
# the addition of headers to requests allowing origin `*` and the following
123+
# headers:
124+
#
125+
# * Accept-Encoding
126+
# * Connection
127+
# * Host
128+
# * Origin
129+
# * Referer
130+
# * Sec-Fetch-Dest
131+
# * Sec-Fetch-Mode
132+
# * Sec-Fetch-Site
133+
# * User-Agent
134+
# * Content-Type
135+
#
136+
# This is NOT recommended for production usage, and may allow malicious websites
137+
# to interact with your poststation server. This configuration is only effective
138+
# if `apis.http` is enabled.
139+
#
140+
# unsafe-inhibit-cors = false
97141
```
98142

99143
## The `apis` section
@@ -170,3 +214,42 @@ the following configuration:
170214
security.insecure = {}
171215
listener.local-only = { port = 4444 }
172216
```
217+
218+
## The `storage` section
219+
220+
This section limits the maximum persistent history used by Poststation.
221+
222+
Be careful when reducing these numbers! If your current history exceeds the new limits,
223+
the old data will be deleted, and this is NOT recoverable!
224+
225+
Each item may be set to "unlimited" storage, for example:
226+
227+
```toml
228+
[storage]
229+
# Historical "endpoint" request and response data
230+
endpoints.unlimited = {}
231+
```
232+
233+
Or be set to "First In, First Out", which deletes data when the storage exceeds
234+
the set limit:
235+
236+
```toml
237+
[storage]
238+
# Historical "endpoint" request and response data
239+
endpoints.fifo-megabytes = 128
240+
```
241+
242+
## The `experimental` section
243+
244+
These flags are experimental, and may be removed at any time.
245+
246+
### `experimental.unsafe-inhibit-cors`
247+
248+
This flags causes the `http` API to emit flags that allow for cross-site requests.
249+
250+
This is necessary if you'd like a web browser to interact directly with poststation's REST API.
251+
252+
This is NOT recommended, and may expose poststation to malicious website requests.
253+
254+
If you are building a web frontend, it is recommended to instead make API requests with your backend,
255+
and have the web frontend speak to your server, rather than poststation directly.

0 commit comments

Comments
 (0)