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

Consolidate hostname/domain configuration #1746

Open
metasoarous opened this issue Nov 15, 2023 · 0 comments
Open

Consolidate hostname/domain configuration #1746

metasoarous opened this issue Nov 15, 2023 · 0 comments
Labels
feature-request For new feature suggestions
Milestone

Comments

@metasoarous
Copy link
Member

metasoarous commented Nov 15, 2023

Problem:
Right now there are 5 different environment variables for configuring the main server hostname:

  • API_DEV_HOSTNAME
  • API_PROD_HOSTNAME
  • DOMAIN_OVERRIDE
  • EMBED_ SERVICE_HOSTNAME
  • SERVICE_URL

For a production deployment, at least 3 of these (API_PROD_HOSTNAME, DOMAIN_OVERRIDE and EMBED_SERVICE_HOSTNAME) are required, and should always be set to the same value. Meanwhile, SERVICE_URL is only used for client-report, and only necessary if hosted separately from the API service. Further, API_DEV_HOSTNAME and API_PROD_HOSTNAME serve the same function, just in different environments, and behave the same, except that for DEV, can default to localhost if unset.

Suggested solution:

  • Unify API_DEV_HOSTNAME and API_PROD_HOSTNAME to a single configuration variable (possibly using DEV_MODE to determine whether to allow localhost as a default if unset, to match current behavior)
  • Call this new variable API_HOSTNAME? POLIS_HOSTNAME? SERVER_HOSTNAME? Just HOSTNAME?
  • Remove the other configuration variables, in favor of afore mentioned merged variable

Additional context:

  • At the moment, it's unclear whether SERVICE_URL is only necessary for dev, when you might want to run a HMR server separately, outside of docker, or if it's necessary if you use (e.g.) s3 to host static assets separately from the docker (or other server) deployment infrastructure. Should ascertain this to decide whether this variable needs to be removed or not, and if not, whether another name would be more appropriate.
  • Consider whether we want a graceful fallback to API_PROD_HOSTNAME if whatever the new variable name is called isn't present (probably with a deprecation warning), to avoid this being a breaking change.
@metasoarous metasoarous added the feature-request For new feature suggestions label Nov 15, 2023
@metasoarous metasoarous added this to the v1-release milestone Nov 15, 2023
@metasoarous metasoarous changed the title Please write a concise description of the problem here Consolidate hostname/domain configuration Nov 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request For new feature suggestions
Projects
None yet
Development

No branches or pull requests

1 participant