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

fix: LOGFLARE_NODE_HOST startup script usage, remove OVERRIDE_MAGIC_COOKIE #1913

Merged
merged 1 commit into from
Jan 9, 2024

Conversation

Ziinc
Copy link
Contributor

@Ziinc Ziinc commented Jan 9, 2024

This PR simplifies the handling of LOGFLARE_NODE_HOST as well as RELEASE_COOKIE.

LOGFLARE_NODE_HOST

Previously, this was set under run.sh when LIBCLUSTER_TOPOLOGY=postgres. There are a few issues with this: the GCP specific networking logic is not of concern to the libcluster topology setting. The user should set the env var either at system level or in the env var file.

Furthermore, the .env.sh.eex template has another shell script that configures env vars for the release. We do not use this for setting the release env vars because migrations need to be run with env vars set before the release is run.

Hence, this has moved to the gcp instance template startup script for our platform specific logic.

RELEASE_COOKIE

The removal of OVERRIDE_MAGIC_COOKIE and the use of /tmp/.magic_cookie simplifies the magic cookie handling, and ensures that it will adhere to the default release behaviour where the releases/COOKIE file is used. As the RELEASE_COOKIE env var has priority on node startup for runtime configuration, it allows us to override it via the instance template, which is a much cleaner way to do so.

As the cookie is always generated at release compile time, it will be baked into the docker image.

https://hexdocs.pm/mix/1.14/Mix.Tasks.Release.html

@Ziinc Ziinc merged commit fbd26ca into main Jan 9, 2024
3 checks passed
@Ziinc Ziinc deleted the fix/logflare-node-host-setting branch January 9, 2024 18:42
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.

2 participants