Skip to content

Config Hydration#19

Merged
aryanmehrotra merged 16 commits intozopdev:mainfrom
akshat-kumar-singhal:main
Mar 10, 2026
Merged

Config Hydration#19
aryanmehrotra merged 16 commits intozopdev:mainfrom
akshat-kumar-singhal:main

Conversation

@akshat-kumar-singhal
Copy link
Contributor

Config File Hydration

When the CONFIG_FILE_PATH environment variable is set, the server replaces any ${VAR} placeholders in that file at startup using values from the environment (including .env files). The file is rewritten in-place before serving begins.

This is useful for injecting runtime configuration into static front-end apps without rebuilding them.

If any placeholders have no matching environment variable, the server still writes the file (substituting empty strings for missing values) and logs an error listing the unresolved variables.

akshat-kumar-singhal and others added 15 commits February 27, 2026 11:28
Enable native arm64 support for Apple Silicon users by building
multi-architecture images via buildx. Uses TARGETARCH for explicit
Go cross-compilation.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Required for arm64 emulation on amd64 runners.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Replace QEMU emulation with native cross-compilation by adding
--platform=$BUILDPLATFORM to the build stage. Go cross-compiles
to the target architecture natively, eliminating slow emulation.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- actions/checkout v4 → v6
- actions/setup-go v4 → v6 (caching now enabled by default)
- golangci/golangci-lint-action v8 → v9
- Add step to output pushed image registry path

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
 Add config file hydration and update README

const filePathVar = "CONFIG_FILE_PATH"

func HydrateFile(fs file.FileSystem, cfg config.Config) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

config should not be sent here, we should read in main.go and inject the key value pairs, config.Config should not be the dependency.

Copy link
Contributor

Choose a reason for hiding this comment

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

We can also add a comment of why this is being done is because we are doing something which is not recommended and we also need to make sure we don't follow this elsewhere and it was done here because this is the cleanest way as of now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@aryanmehrotra aryanmehrotra merged commit e8d0988 into zopdev:main Mar 10, 2026
4 checks passed
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