diff --git a/.env b/.env index 004bbdb7..d5d04b6a 100644 --- a/.env +++ b/.env @@ -21,3 +21,5 @@ LOG_LEVEL_CONSOLE=warn FRACTAL_RUNNER_BACKEND=local #WARNING_BANNER_PATH=/path/to/banner.txt ENABLE_INTERACTIVE_ATTRIBUTE_FILTERS=false + +BODY_SIZE_LIMIT=5000000 diff --git a/CHANGELOG.md b/CHANGELOG.md index b6b44453..d57323ca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ * Used `FRACTAL_BACKEND_RUNNER=local` instead of `local_experimental` (\#713); * Moved job submission healthcheck page to user menu (\#713); * Fixed bug in task-groups deletion in admin page (\#713); +* Fixed bug in task order modal drag and drop (\#713); +* Added admin accounting page (\#713); +* Implemented user impersonation (\#713); +* Improved error handling in proxy functions and documented the usage of Svelte Kit `BODY_SIZE_LIMIT` environment variable (\#713); # 1.15.0 diff --git a/__tests__/AlertError.test.js b/__tests__/AlertError.test.js index d674a0f8..f8c8e050 100644 --- a/__tests__/AlertError.test.js +++ b/__tests__/AlertError.test.js @@ -43,4 +43,9 @@ describe('AlertError class', () => { ); expect(error.getSimpleValidationMessage('zarr_url')).eq('error message'); }); + + it('Extract field error', () => { + const error = new AlertError({ message: 'Payload Too Large' }, 413); + expect(error.getSimpleValidationMessage()).eq('Payload Too Large'); + }); }); diff --git a/docs/environment-variables.md b/docs/environment-variables.md index 2abec190..4bbbeb3c 100644 --- a/docs/environment-variables.md +++ b/docs/environment-variables.md @@ -24,7 +24,8 @@ The following environment variables can be used to configure fractal-web. When running directly using `node` command these extra variables can also be configured: * `PORT`: specifies the port where Svelte server will run; the default value is 5173; -* `ORIGIN` the URL where the app will be served (e.g. http://localhost:5173, or https://subdomain.example.org). +* `ORIGIN` the URL where the app will be served (e.g. http://localhost:5173, or https://subdomain.example.org); +* `BODY_SIZE_LIMIT`: the maximum request body size accepted in bytes; see [official SvelteKit documentation](https://svelte.dev/docs/kit/adapter-node#Environment-variables-BODY_SIZE_LIMIT). ## Common issues related to environment variables diff --git a/docs/quickstart.md b/docs/quickstart.md index 2fa8a9c8..b9274fc5 100644 --- a/docs/quickstart.md +++ b/docs/quickstart.md @@ -49,6 +49,7 @@ export AUTH_COOKIE_DOMAIN= export ORIGIN=http://localhost:5173 export PORT=5173 +export BODY_SIZE_LIMIT=5000000 export LOG_FILE=fractal-web.log # default values for logging levels (uncomment if needed) diff --git a/src/lib/common/errors.js b/src/lib/common/errors.js index d184a861..4a2710ed 100644 --- a/src/lib/common/errors.js +++ b/src/lib/common/errors.js @@ -89,6 +89,9 @@ export function extractErrorDetail(errorResponse) { * @returns {null | { loc: string[], msg: string } | string} */ function getSimpleValidationMessage(reason, statusCode) { + if (typeof reason === 'object' && 'message' in reason && typeof reason.message === 'string') { + return reason.message; + } if (!isValidationError(reason, statusCode)) { return null; } diff --git a/src/routes/healthcheck/+page.svelte b/src/routes/healthcheck/+page.svelte index 3e19c19e..1bcdf09c 100644 --- a/src/routes/healthcheck/+page.svelte +++ b/src/routes/healthcheck/+page.svelte @@ -228,7 +228,7 @@ {#if inProgress}