diff --git a/docs/astro.config.mjs b/docs/astro.config.mjs index 481464c7..e1631377 100644 --- a/docs/astro.config.mjs +++ b/docs/astro.config.mjs @@ -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/' }, ] } ] diff --git a/docs/src/assets/guides/pocketbase_filesize.png b/docs/src/assets/guides/pocketbase_filesize.png new file mode 100644 index 00000000..0be18128 Binary files /dev/null and b/docs/src/assets/guides/pocketbase_filesize.png differ diff --git a/docs/src/assets/guides/pocketbase_password.png b/docs/src/assets/guides/pocketbase_password.png new file mode 100644 index 00000000..96e13a4b Binary files /dev/null and b/docs/src/assets/guides/pocketbase_password.png differ diff --git a/docs/src/content/docs/run/backend-configuration/adjust-filesize-limits.mdx b/docs/src/content/docs/run/backend-configuration/adjust-filesize-limits.mdx new file mode 100644 index 00000000..c578a66a --- /dev/null +++ b/docs/src/content/docs/run/backend-configuration/adjust-filesize-limits.mdx @@ -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'; + +wanderer 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. + + + +### 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 +``` + + + +### 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` + +![Pocketbase Filesize](../../../../assets/guides/pocketbase_filesize.png) + +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. + + diff --git a/docs/src/content/docs/run/backend-configuration/auth-providers.md b/docs/src/content/docs/run/backend-configuration/auth-providers.md new file mode 100644 index 00000000..fdc2f5aa --- /dev/null +++ b/docs/src/content/docs/run/backend-configuration/auth-providers.md @@ -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 wanderer 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 +![Pocketbase OAuth](../../../../assets/guides/pocketbase_oauth.png) + +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. + +![Pocketbase OAuth](../../../../assets/guides/pocketbase_password.png) + +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. diff --git a/docs/src/content/docs/run/backend-configuration/index.md b/docs/src/content/docs/run/backend-configuration/index.md index 955d4249..2a5344a3 100644 --- a/docs/src/content/docs/run/backend-configuration/index.md +++ b/docs/src/content/docs/run/backend-configuration/index.md @@ -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/).