mirror of
https://github.com/directus/directus.git
synced 2026-04-25 03:00:53 -04:00
Show warning when PUBLIC_URL isn't correctly configured (#6840)
Closes #6539
This commit is contained in:
@@ -47,6 +47,12 @@ import { session } from './middleware/session';
|
||||
export default async function createApp(): Promise<express.Application> {
|
||||
validateEnv(['KEY', 'SECRET']);
|
||||
|
||||
try {
|
||||
new URL(env.PUBLIC_URL);
|
||||
} catch {
|
||||
logger.warn('PUBLIC_URL is not a valid URL');
|
||||
}
|
||||
|
||||
await validateDBConnection();
|
||||
|
||||
if ((await isInstalled()) === false) {
|
||||
|
||||
@@ -7,15 +7,18 @@
|
||||
|
||||
## General
|
||||
|
||||
| Variable | Description | Default Value |
|
||||
| ------------------ | ---------------------------------------------------------------------------------------------------------- | ------------- |
|
||||
| `CONFIG_PATH` | Where your config file is located. See [Config Files](/reference/config-files/) | `.env` |
|
||||
| `PORT` | What port to run the API under. | `8055` |
|
||||
| `PUBLIC_URL` | URL where your API can be reached on the web. | `/` |
|
||||
| `LOG_LEVEL` | What level of detail to log. One of `fatal`, `error`, `warn`, `info`, `debug`, `trace` or `silent`. | `info` |
|
||||
| `LOG_STYLE` | Render the logs human readable (pretty) or as JSON. One of `pretty`, `raw`. | `pretty` |
|
||||
| `MAX_PAYLOAD_SIZE` | Controls the maximum request body size. Accepts number of bytes, or human readable string. | `100kb` |
|
||||
| `ROOT_REDIRECT` | Where to redirect to when navigating to `/`. Accepts a relative path, absolute URL, or `false` to disable. | `./admin` |
|
||||
| Variable | Description | Default Value |
|
||||
| -------------------------- | ---------------------------------------------------------------------------------------------------------- | ------------- |
|
||||
| `CONFIG_PATH` | Where your config file is located. See [Config Files](/reference/config-files/) | `.env` |
|
||||
| `PORT` | What port to run the API under. | `8055` |
|
||||
| `PUBLIC_URL`<sup>[1]</sup> | URL where your API can be reached on the web. | `/` |
|
||||
| `LOG_LEVEL` | What level of detail to log. One of `fatal`, `error`, `warn`, `info`, `debug`, `trace` or `silent`. | `info` |
|
||||
| `LOG_STYLE` | Render the logs human readable (pretty) or as JSON. One of `pretty`, `raw`. | `pretty` |
|
||||
| `MAX_PAYLOAD_SIZE` | Controls the maximum request body size. Accepts number of bytes, or human readable string. | `100kb` |
|
||||
| `ROOT_REDIRECT` | Where to redirect to when navigating to `/`. Accepts a relative path, absolute URL, or `false` to disable. | `./admin` |
|
||||
|
||||
<sup>[1]</sup> The PUBLIC_URL value is used for things like oAuth redirects, forgot-password emails, and logos that
|
||||
needs to be publicly available on the internet.
|
||||
|
||||
## Database
|
||||
|
||||
|
||||
Reference in New Issue
Block a user