Skip to content

Conversation

malexw
Copy link
Collaborator

@malexw malexw commented Jun 25, 2024

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: The NEXT_PUBLIC_FRONTEND_HOSTNAME variable is added with a default value of http://localhost:4000.
  • docker-compose.yml: The NEXT_PUBLIC_FRONTEND_HOSTNAME variable is included in the environment section, allowing it to be set directly in the Docker Compose file.
  • docker_scripts/env-defaults: A new export statement is added for NEXT_PUBLIC_FRONTEND_HOSTNAME, defaulting to http://localhost:4000.
  • docs/setup.md: Documentation is updated to include NEXT_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: The NEXT_PUBLIC_FRONTEND_HOSTNAME_DEFAULT variable is introduced with a value of http://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: The NEXT_PUBLIC_FRONTEND_HOSTNAME variable is added to both development and production environment configuration files, setting the frontend hostname to http://localhost:4000.
  • src/interfaces/coral_web/src/env.mjs: The NEXT_PUBLIC_FRONTEND_HOSTNAME variable is included in the createEnv configuration, allowing it to be accessed within the application.
  • src/interfaces/coral_web/src/hooks/authConfig.ts: The baseUrl is updated to use the value of NEXT_PUBLIC_FRONTEND_HOSTNAME from the env.mjs module.

@codecov-commenter
Copy link

codecov-commenter commented Jun 25, 2024

Codecov Report

Attention: Patch coverage is 20.00000% with 4 lines in your changes missing coverage. Please review.

Please upload report for BASE (main@487f01b). Learn more about missing BASE report.

Files Patch % Lines
src/backend/cli/main.py 20.00% 4 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #283   +/-   ##
=======================================
  Coverage        ?   85.27%           
=======================================
  Files           ?      161           
  Lines           ?     5928           
  Branches        ?        0           
=======================================
  Hits            ?     5055           
  Misses          ?      873           
  Partials        ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@malexw malexw merged commit a2da4e5 into main Jun 25, 2024
@malexw malexw deleted the alexw/frontend-hostname-env-var branch June 25, 2024 19:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants