Fix illogical setting defaults re. SSH_PORT and SSH_LISTEN_PORT #8656
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.
Fix issue whereby setting SSH_PORT, for the purpose of constructing a superficial git-clone URL, would implicitly also set SSH_LISTEN_PORT that the SSH service binds to, if the latter is not explicitly configured.
Manifestation
SSH_PORT=2222
Would cause Gitea to also modify SSH_LISTEN_PORT and start up SSH on port 2222.
Work around would be to simultaneously force service port binding back to 22:
SSH_PORT=2222
SSH_LISTEN_PORT=22
So, the actual service binding SSH_LISTEN_PORT is being defaulted to SSH_PORT that's used for 'external decoration.' It should really be the other way around.
Rationale
Documentation states that:
Therefore, it stands to reason to expect that:
Additional Info
Documentation files are updated accordingly.
This may be considered a corrective fix to prior merged PR issues #8453 and #8477.