Skip to content

Commit 037a8fb

Browse files
committed
Add logging and new env vars to readme [skip ci]
1 parent 586edac commit 037a8fb

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,33 @@ for each file:
168168
- Size
169169
- Owner ID
170170

171+
#### Logging
172+
173+
Endpoints beginning with `/api/...` should be monitored for error codes to prevent bruteforcing.
174+
175+
For example:
176+
177+
- `/login` is the endpoint for the login web page, this only loads static content
178+
- This will always return a `200` response, since there is nothing sensitive about loading
179+
the login page.
180+
- `/api/login` is the endpoint for submitting credentials
181+
- This can return an error code depending on the failure (i.e. `403` for invalid credentials,
182+
`404` for a non-existent user, etc)
183+
184+
You can limit requests to all `/api` endpoints in a Nginx config, for example, with something like
185+
this:
186+
187+
```nginx
188+
limit_req_zone $binary_remote_addr zone=api_limit:10m rate=10r/m;
189+
190+
// ...
191+
192+
location /api/ {
193+
limit_req zone=api_limit burst=20 nodelay;
194+
proxy_pass http://backend;
195+
}
196+
```
197+
171198
## CLI Configuration
172199

173200
The YeetFile CLI tool can be configured using a `config.yml` file in the following path:
@@ -251,6 +278,9 @@ All environment variables can be defined in a file named `.env` at the root leve
251278
| YEETFILE_CACHE_MAX_FILE_SIZE | The maximum file size to cache | 0 | An int value of bytes |
252279
| YEETFILE_TLS_KEY | The SSL key to use for connections | | The string key contents (not a file path) |
253280
| YEETFILE_TLS_CERT | The SSL cert to use for connections | | The string cert contents (not a file path) |
281+
| YEETFILE_INSTANCE_ADMIN | The user ID or email of the user to set as admin | | A valid YeetFile email or account ID |
282+
| YEETFILE_LIMITER_SECONDS | The number of seconds to use in rate limiting repeated requests | 30 | Any number of seconds |
283+
| YEETFILE_LIMITER_ATTEMPTS | The number of attempts to allow before rate limiting | 6 | Any number of requests |
254284

255285
#### Backblaze Environment Variables
256286

0 commit comments

Comments
 (0)