docs: auth providers and file size limitations (#743)
* feat: document file size and improve auth providers * Minor text modifications --------- Co-authored-by: Flomp <Flomp@users.noreply.github.com> Co-authored-by: Christian Beutel <>
This commit is contained in:
@@ -105,9 +105,10 @@ export default defineConfig({
|
||||
items: [
|
||||
{ label: 'Overview', link: '/run/backend-configuration/' },
|
||||
{ label: 'SMTP', link: '/run/backend-configuration/smtp/' },
|
||||
{ label: 'OAuth2', link: '/run/backend-configuration/oauth2/' },
|
||||
{ label: 'Authentication Providers', link: '/run/backend-configuration/auth-providers/' },
|
||||
{ label: 'Backing up your server', link: '/run/backend-configuration/backup-server/' },
|
||||
{ label: 'Custom categories', link: '/run/backend-configuration/custom-categories/' },
|
||||
{ label: 'Adjust Filesize Limits', link: '/run/backend-configuration/adjust-filesize-limits/' },
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
BIN
docs/src/assets/guides/pocketbase_filesize.png
Normal file
BIN
docs/src/assets/guides/pocketbase_filesize.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 429 KiB |
BIN
docs/src/assets/guides/pocketbase_password.png
Normal file
BIN
docs/src/assets/guides/pocketbase_password.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 394 KiB |
@@ -0,0 +1,46 @@
|
||||
---
|
||||
title: Adjust Filesize Limits
|
||||
description: Configure which file sizes are permitted
|
||||
redirectFrom:
|
||||
- /run/backend-configuration/#adjust-filelimits
|
||||
---
|
||||
import { Aside } from '@astrojs/starlight/components';
|
||||
|
||||
<span class="-tracking-[0.075em]">wanderer</span> brings several mechanisms which allow limiting the maximum file size of content provided by users.
|
||||
Pictures in the users profile, trail highlights and gpx tracks fall under this file size limit.
|
||||
|
||||
<Aside>
|
||||
As <span class="-tracking-[0.075em]">wanderer</span> runs parts of the logic in the users browser those limits can only be enforced, when trying to save a ressource.
|
||||
This can lead to non-intuitive errors such as: editing and creating a trail, which is too large, is possible - saving it is not.
|
||||
</Aside>
|
||||
|
||||
### Body Size Limit
|
||||
|
||||
The `BODY_SIZE_LIMIT` is a setting for the frontend, which fails requests if their payload is too large with an `500: Payload Too Large` error.
|
||||
The standard value for this setting is `512kb`.
|
||||
|
||||
To adjust it, configure the `BODY_SIZE_LIMIT` [Environment Variable](../environment-configuration.md) to a value of you liking.
|
||||
To disable this limit entirely you can set this variable to `Infinity`.
|
||||
|
||||
```sh
|
||||
export BODY_SIZE_LIMIT=Infinity
|
||||
```
|
||||
|
||||
<Aside type="tip">Read more about the limitations and configuration possibilities on the [SvelteKit Reference](https://svelte.dev/docs/kit/adapter-node#Environment-variables-BODY_SIZE_LIMIT).</Aside>
|
||||
|
||||
### Backend Filesize Verification
|
||||
|
||||
After the file passes the middleware, PocketBase does an additional verification on the file uploaded.
|
||||
This verification includes a check for a maximum file size.
|
||||
|
||||
If this verification does not pass the request is terminated with a `500: error validation_file_size_limit`
|
||||
|
||||

|
||||
|
||||
To change this behaviour open the PocketBase admin panel and navigate to the designated table.
|
||||
Click the gear icon at the top to open the table's settings and select the gear icon in the row you want to change.
|
||||
Adjust the `Max File Size` property.
|
||||
|
||||
<Aside>
|
||||
The maximum file size has to be specified in bytes. The theoretical maximum of a single file attachment is ~8GB as specified by the [pocketbase documentation](https://pocketbase.io/docs/files-handling/)
|
||||
</Aside>
|
||||
@@ -0,0 +1,33 @@
|
||||
---
|
||||
title: Configure Authentication Providers
|
||||
description: Adjust login methods
|
||||
redirectFrom:
|
||||
- /run/backend-configuration/#auth-providers
|
||||
---
|
||||
|
||||
### Create an OAuth app
|
||||
|
||||
This step will vary wildly from provider to provider. Please refer to your provider's documentation for the specific steps.
|
||||
|
||||
No matter your provider, you will need a redirect URL. This redirect URL must have the following format: `$ORIGIN/login/redirect`.
|
||||
`$ORIGIN` refers to the `ORIGIN` environment variable that defines the public host at which your <span class="-tracking-[0.075em]">wanderer</span> instance can be reached.
|
||||
So for the default installation, the redirect URL is `http://localhost:3000/login/redirect`.
|
||||
|
||||
In any case, once you have successfully created your OAuth app you will receive a Client ID and a Client Secret.
|
||||
|
||||
### Enable a provider in PocketBase
|
||||

|
||||
|
||||
In the PocketBase admin panel navigate to the `users` table. Click the gear icon at the top to open the table's settings and navigate to `Options`.
|
||||
In the tab `OAuth2`, add your provider and fill in the Client ID and Client Secret from the step before and save your changes.
|
||||
|
||||
### Disable password authentication
|
||||
|
||||
After enabling the neccessary OAuth2 providers for your application you may want to disable the standard local password authentication.
|
||||
|
||||

|
||||
|
||||
In the PocketBase admin panel navigate to the `users` table.
|
||||
Click the gear icon at the top to open the table's settings and navigate to `Options`.
|
||||
|
||||
In the tab `Identity/Password`, toggle the switch and save the configuration.
|
||||
@@ -20,8 +20,9 @@ Via the online dashboard, you will now have access with the user "email@example.
|
||||
For specific configuration guides see:
|
||||
|
||||
- [SMTP settings](./smtp/)
|
||||
- [OAuth2 providers](./oauth2/)
|
||||
- [Auth providers](./auth-providers/)
|
||||
- [Backup server](./backup-server/)
|
||||
- [Custom categories](./custom-categories/)
|
||||
- [Adjust Filesize Limits](./adjust-filesize-limits/)
|
||||
|
||||
To learn more about what you can do in the admin dashboard please refer to PocketBase's [documentation](https://pocketbase.io/docs/).
|
||||
|
||||
Reference in New Issue
Block a user