Improve tcp server#27
Merged
Merged
Conversation
Support for additional contexts that are container images (especially local ones) varies between compose implementations, so just mounting the source code in and building it is a better option.
Now that pop and smtp are building the tcp_server code directly instead of pulling the binary from a container image, there is no need to have the tcp_server container. Fixes #26. if the container doesn't exist, it certainly can't produce any error messages...
24f7246 to
40c8366
Compare
40c8366 to
9d37c92
Compare
Since the primary consumers are building the server themselves, letting them configure the default means they need less configuration at runtime as it turns out, this also fixes #18, and even better prevents that kind error where the default port could mismatch between documentation (-h output) and code categorically since the value of the DEFAULT_PORT macro is now the one and only source of truth.
By setting the default port to the desired value when building, we can avoid needing to specify it with `-p` on the entrypoint cmdline. This has an infinitesimal positive effect on startup time (since the tcp server no longer has to parse the `-p` option or its argument), but more importantly, it opens the door to being able to specify the port that the servers will listen on via a build time argument. Which was previously impossible because there is no way to resolve an ARG value in an `ENTRYPOINT` command other than to make it part of the environment and rely on a shell to do the subtition which isn't an option in a container without a shell (i.e. `FROM scratch`) like pop/smtp.
9d37c92 to
27c306e
Compare
theyoyojo
approved these changes
Mar 18, 2024
theyoyojo
left a comment
Contributor
There was a problem hiding this comment.
paradigm shift achieved
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.
Substantial cleanup to pop/smtp/tcp_server code.