Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document environment variables #5735

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 16 additions & 1 deletion docs/source/configuration/environmentvariables.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ myst:
This page describes environment variables and their usage for configuration of your Volto application at runtime.

Manas-Kenge marked this conversation as resolved.
Show resolved Hide resolved

For more detailed information about environment variables and other configurations, you can refer to the [Razzle Documentation](https://razzlejs.org/docs/environment-variables).
Manas-Kenge marked this conversation as resolved.
Show resolved Hide resolved

## Runtime environment variables

```{versionadded} 13
Expand All @@ -24,10 +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`: Represents the host or IP address on which a server should listen, default is port 0.0.0.0.
Manas-Kenge marked this conversation as resolved.
Show resolved Hide resolved

`process.env.PORT`: Used to specify the port on which a web server should listen for incoming requests, default is port 3000.
Manas-Kenge marked this conversation as resolved.
Show resolved Hide resolved

`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.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of these environment variables should follow the existing pattern as the glossary items below.

I also don't know whether the prefix process.env. is necessary. Perhaps a Volto core maintainer knows?

Finally, do these belong under this heading or another? Again, perhaps a Volto core maintainer knows?

Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stevepiercy @Manas-Kenge process.env. is not part of the name of the environment variable. It's how the variable is accessed in Node. It doesn't make sense to use it here, which is explaining variables that can be set, not how to write code that uses them.

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}
Expand Down
1 change: 1 addition & 0 deletions packages/volto/news/5319.documentation
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Document environment variables and link the Razzle documentation.
Manas-Kenge marked this conversation as resolved.
Show resolved Hide resolved