frontend: Set frontend hostname as an env var #283
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The frontend needs to know its URL in order to do single sign-on, so let's set it as an environment variable.
AI Description
This pull request introduces a new environment variable,
NEXT_PUBLIC_FRONTEND_HOSTNAME
, which specifies the URL for the frontend client. This variable is added to multiple configuration files and scripts to ensure consistent usage across the application..env-template
: TheNEXT_PUBLIC_FRONTEND_HOSTNAME
variable is added with a default value ofhttp://localhost:4000
.docker-compose.yml
: TheNEXT_PUBLIC_FRONTEND_HOSTNAME
variable is included in theenvironment
section, allowing it to be set directly in the Docker Compose file.docker_scripts/env-defaults
: A new export statement is added forNEXT_PUBLIC_FRONTEND_HOSTNAME
, defaulting tohttp://localhost:4000
.docs/setup.md
: Documentation is updated to includeNEXT_PUBLIC_FRONTEND_HOSTNAME
in the list of environment variables. It describes its purpose as "The URL for the frontend client" and provides the default value.src/backend/cli/main.py
: TheNEXT_PUBLIC_FRONTEND_HOSTNAME_DEFAULT
variable is introduced with a value ofhttp://localhost:4000
. This default value is used when prompting for the frontend hostname during the configuration process.src/interfaces/coral_web/.env.development
and.env.production
: TheNEXT_PUBLIC_FRONTEND_HOSTNAME
variable is added to both development and production environment configuration files, setting the frontend hostname tohttp://localhost:4000
.src/interfaces/coral_web/src/env.mjs
: TheNEXT_PUBLIC_FRONTEND_HOSTNAME
variable is included in thecreateEnv
configuration, allowing it to be accessed within the application.src/interfaces/coral_web/src/hooks/authConfig.ts
: ThebaseUrl
is updated to use the value ofNEXT_PUBLIC_FRONTEND_HOSTNAME
from theenv.mjs
module.