From ffe4126bfc0e63b113b84788d45d2ca9e8c50415 Mon Sep 17 00:00:00 2001 From: Manas Kenge <110519001+Manas-Kenge@users.noreply.github.com> Date: Wed, 31 Jan 2024 18:26:05 +0530 Subject: [PATCH 1/5] linked Razzle docs --- docs/source/configuration/environmentvariables.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/source/configuration/environmentvariables.md b/docs/source/configuration/environmentvariables.md index a090d00691..5fa9811ab1 100644 --- a/docs/source/configuration/environmentvariables.md +++ b/docs/source/configuration/environmentvariables.md @@ -24,6 +24,8 @@ In the frontend we can access this variable with: window.env.RAZZLE_MY_VARIABLE ``` +For more detailed information about environment variables and other configurations, you can refer to the [Razzle Documentation](https://razzlejs.org/docs/environment-variables). + ## Runtime environment variables All the environment variables that are configurable work at runtime, not only at build time. This works since Volto 13 onwards. From 2c339cb3a719aadd91c5484e07f799eceab3f461 Mon Sep 17 00:00:00 2001 From: Manas Kenge <110519001+Manas-Kenge@users.noreply.github.com> Date: Mon, 5 Feb 2024 22:25:45 +0530 Subject: [PATCH 2/5] document environment variables --- docs/source/configuration/environmentvariables.md | 14 ++++++++++++++ packages/volto/news/5319.documentation | 1 + 2 files changed, 15 insertions(+) create mode 100644 packages/volto/news/5319.documentation diff --git a/docs/source/configuration/environmentvariables.md b/docs/source/configuration/environmentvariables.md index 5fa9811ab1..dd2f800fb9 100644 --- a/docs/source/configuration/environmentvariables.md +++ b/docs/source/configuration/environmentvariables.md @@ -44,6 +44,20 @@ yarn build && RAZZLE_API_PATH=https://plone.org yarn start:prod ``` ```` +`process.env.HOST`: Represents the host or IP address on which a server should listen, default is port 0.0.0.0. + +`process.env.PORT`: Used to specify the port on which a web server should listen for incoming requests, default is port 3000. + +`process.env.RAZZLE_API_PATH`: Used to configure the API path for the application. + +`process.env.RAZZLE_PUBLIC_URL`: Used specify the base URL or path where static assets (such as images, stylesheets, and other resources) are hosted or served. + +`process.env.RAZZLE_DEV_PROXY_API_PATH`: Used during development to configure a proxy for API requests. + +`process.env.RAZZLE_INTERNAL_API_PATH`: Used to specify the path to an internal API that the server-rendered application should use. + +`process.env.RAZZLE_PROXY_REWRITE_TARGET`: Used to specify the target URL for a proxy server. + This brings you a lot of power since you don't have to rebuild on every config change. You can also generate builds on your CI, then deploy them anywhere. diff --git a/packages/volto/news/5319.documentation b/packages/volto/news/5319.documentation new file mode 100644 index 0000000000..0eff01850d --- /dev/null +++ b/packages/volto/news/5319.documentation @@ -0,0 +1 @@ +Document environment variables and link the Razzle documentation. \ No newline at end of file From a3616358c197a8d11bc2e5753d84c9672b62a9e6 Mon Sep 17 00:00:00 2001 From: Manas Kenge Date: Sat, 9 Mar 2024 20:51:54 +0530 Subject: [PATCH 3/5] Apply suggestions from code review Co-authored-by: Steve Piercy --- docs/source/configuration/environmentvariables.md | 10 +++++++--- packages/volto/news/5319.documentation | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/docs/source/configuration/environmentvariables.md b/docs/source/configuration/environmentvariables.md index 0467ff7e93..b9c272ced7 100644 --- a/docs/source/configuration/environmentvariables.md +++ b/docs/source/configuration/environmentvariables.md @@ -11,9 +11,9 @@ myst: This page describes environment variables and their usage for configuration of your Volto application at runtime. - For more detailed information about environment variables and other configurations, you can refer to the [Razzle Documentation](https://razzlejs.org/docs/environment-variables). + ## Runtime environment variables ```{versionadded} 13 @@ -26,9 +26,13 @@ You could, for example, build your Volto application, then start it in productio yarn build && RAZZLE_API_PATH=https://plone.org yarn start:prod ``` -`process.env.HOST`: Represents the host or IP address on which a server should listen, default is port 0.0.0.0. +`process.env.HOST` + Represents the host or IP address on which a server should listen. + Default is `0.0.0.0`. -`process.env.PORT`: Used to specify the port on which a web server should listen for incoming requests, default is port 3000. +`process.env.PORT` + Used to specify the port on which a web server should listen for incoming requests. + Default is `3000`. `process.env.RAZZLE_API_PATH`: Used to configure the API path for the application. diff --git a/packages/volto/news/5319.documentation b/packages/volto/news/5319.documentation index 0eff01850d..bd787892c5 100644 --- a/packages/volto/news/5319.documentation +++ b/packages/volto/news/5319.documentation @@ -1 +1 @@ -Document environment variables and link the Razzle documentation. \ No newline at end of file +Document environment variables and link the Razzle documentation. @Manas-Kenge \ No newline at end of file From 840af3b8b816cb7adc9a027ba17efe8ec28fc1f9 Mon Sep 17 00:00:00 2001 From: Manas Kenge <110519001+Manas-Kenge@users.noreply.github.com> Date: Sun, 10 Mar 2024 00:31:20 +0530 Subject: [PATCH 4/5] Removed process.env --- docs/source/configuration/environmentvariables.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/source/configuration/environmentvariables.md b/docs/source/configuration/environmentvariables.md index b9c272ced7..48b6b34086 100644 --- a/docs/source/configuration/environmentvariables.md +++ b/docs/source/configuration/environmentvariables.md @@ -26,23 +26,23 @@ You could, for example, build your Volto application, then start it in productio yarn build && RAZZLE_API_PATH=https://plone.org yarn start:prod ``` -`process.env.HOST` +`HOST` Represents the host or IP address on which a server should listen. Default is `0.0.0.0`. -`process.env.PORT` +`PORT` Used to specify the port on which a web server should listen for incoming requests. Default is `3000`. -`process.env.RAZZLE_API_PATH`: Used to configure the API path for the application. +`RAZZLE_API_PATH`: Used to configure the API path for the application. -`process.env.RAZZLE_PUBLIC_URL`: Used specify the base URL or path where static assets (such as images, stylesheets, and other resources) are hosted or served. +`RAZZLE_PUBLIC_URL`: Used specify the base URL or path where static assets (such as images, stylesheets, and other resources) are hosted or served. -`process.env.RAZZLE_DEV_PROXY_API_PATH`: Used during development to configure a proxy for API requests. +`RAZZLE_DEV_PROXY_API_PATH`: Used during development to configure a proxy for API requests. -`process.env.RAZZLE_INTERNAL_API_PATH`: Used to specify the path to an internal API that the server-rendered application should use. +`RAZZLE_INTERNAL_API_PATH`: Used to specify the path to an internal API that the server-rendered application should use. -`process.env.RAZZLE_PROXY_REWRITE_TARGET`: Used to specify the target URL for a proxy server. +`RAZZLE_PROXY_REWRITE_TARGET`: Used to specify the target URL for a proxy server. This brings you a lot of power since you don't have to rebuild on every configuration change. You can also generate builds on your continuous integration, then deploy them anywhere. From 7bd7ce80dc417838acfa74bc21bd58d69df357c7 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sat, 9 Mar 2024 11:40:22 -0800 Subject: [PATCH 5/5] Convert to a Glossary, minor grammar fixes --- .../configuration/environmentvariables.md | 23 +++++++++++++------ 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/docs/source/configuration/environmentvariables.md b/docs/source/configuration/environmentvariables.md index 48b6b34086..74758c262f 100644 --- a/docs/source/configuration/environmentvariables.md +++ b/docs/source/configuration/environmentvariables.md @@ -26,6 +26,8 @@ You could, for example, build your Volto application, then start it in productio yarn build && RAZZLE_API_PATH=https://plone.org yarn start:prod ``` +```{glossary} +:sorted: `HOST` Represents the host or IP address on which a server should listen. Default is `0.0.0.0`. @@ -34,22 +36,29 @@ yarn build && RAZZLE_API_PATH=https://plone.org yarn start:prod Used to specify the port on which a web server should listen for incoming requests. Default is `3000`. -`RAZZLE_API_PATH`: Used to configure the API path for the application. +`RAZZLE_API_PATH` + Used to configure the API path for the application. -`RAZZLE_PUBLIC_URL`: Used specify the base URL or path where static assets (such as images, stylesheets, and other resources) are hosted or served. +`RAZZLE_PUBLIC_URL` + Used to specify the base URL or path where static assets—such as images, stylesheets, and other resources—are hosted or served. -`RAZZLE_DEV_PROXY_API_PATH`: Used during development to configure a proxy for API requests. +`RAZZLE_DEV_PROXY_API_PATH` + Used during development to configure a proxy for API requests. -`RAZZLE_INTERNAL_API_PATH`: Used to specify the path to an internal API that the server-rendered application should use. +`RAZZLE_INTERNAL_API_PATH` + Used to specify the path to an internal API that the server-rendered application should use. -`RAZZLE_PROXY_REWRITE_TARGET`: Used to specify the target URL for a proxy server. +`RAZZLE_PROXY_REWRITE_TARGET` + Used to specify the target URL for a proxy server. +``` This brings you a lot of power since you don't have to rebuild on every configuration change. You can also generate builds on your continuous integration, then deploy them anywhere. + ## Environment variable reference -````{glossary} +```{glossary} :sorted: `RAZZLE_LEGACY_TRAVERSE` If `true`, Volto will construct API URLs without the `/++api++` prefix. @@ -203,7 +212,7 @@ You can also generate builds on your continuous integration, then deploy them an ```shell VOLTOCONFIG=../../volto.config.js yarn start ``` -```` +``` ## Access environment variables in a browser