Repository navigation
feat(config): support flexible wrapper deployment - #9
Merged
Merged
Conversation
yusufozmis
reviewed
Aug 4, 2026
yusufozmis
approved these changes
Aug 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
This PR introduces the configuration and transport-policy foundation required to run archive-wrapper in different deployment environments without changing the binary.
It replaces implicit local-file assumptions with an explicit configuration contract, adds deterministic CLI/environment/YAML precedence, and allows operators to choose between loopback-only and trusted private-network gRPC listeners.
This is the bottom PR in the flexible deployment stack.
Motivation
The previous runtime assumed that archive-wrapper and its client shared the same host and network namespace. That made a loopback listener appropriate for local sidecar deployments, but it prevented the same binary from being used safely in container topologies where Pulsar and archive-wrapper communicate through private service-network addresses.
Configuration was also split between relative paths, environment variables, and CLI behavior without one explicit precedence model. That made container startup dependent on the process working directory and made an explicitly empty override difficult to distinguish from an omitted value.
Configuration Resolution
Runtime configuration now follows one deterministic precedence order:
The config path is resolved as:
The Pulsar chain home is resolved as:
There is no implicit
./config.yamlfallback in the binary. This makes startup independent from the process working directory and requires deployments to identify their configuration explicitly.CLI overrides preserve whether a flag was actually supplied. An explicitly empty flag or environment value is therefore validated as an explicit value rather than silently falling back to a lower-priority source.
Runtime overrides are available for:
gRPC Transport Policy
The configuration now includes an explicit transport mode:
Supported modes are:
loopbackRestricts the plaintext gRPC listener to literal loopback addresses such as:
This remains the default and preserves the local-sidecar security boundary.
trusted-networkAllows literal loopback, private, and unspecified bind addresses, including:
This mode is intended for controlled private container networks. It records an explicit operator decision to expose plaintext gRPC beyond loopback, but it does not verify firewall rules, authenticate clients, or encrypt traffic.
TLS/mTLS remains required before supporting untrusted or public-network exposure.
Validation and Failure Behavior
Configuration validation rejects:
trusted-networkmodeloopbackmodeInvalid configuration fails before LevelDB, PostgreSQL, the control socket, or the gRPC listener is opened.
Logging Safety
PostgreSQL-related runtime errors are converted to safe operational summaries before logging. Raw credential-bearing PostgreSQL errors and connection strings are not emitted through normal logs.
The implementation intentionally keeps this policy narrow and includes a follow-up security note for moving toward structured secret classification if additional secret-bearing integrations are introduced.
Tests
The new tests cover:
Stack
development