-
Notifications
You must be signed in to change notification settings - Fork 146
fix proxy protocol issue and refactored proxyprotocol configuration #519
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
Open
lodatol
wants to merge
3
commits into
Mailu:master
Choose a base branch
from
lodatol:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+63
−49
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -655,31 +655,13 @@ ingress: | |||||
| ## @param ingress.realIpHeader Sets the value of `REAL_IP_HEADER` environment variable in the `front` pod | ||||||
| realIpHeader: X-Forwarded-For | ||||||
|
|
||||||
| ## @param ingress.realIpFrom Sets the value of `REAL_IP_FROM` environment variable in the `front` pod | ||||||
| realIpFrom: "" | ||||||
|
|
||||||
|
|
||||||
| ## @param ingress.tlsFlavorOverride Overrides the value of `TLS_FLAVOR` environment variable in the `front` pod | ||||||
| ## This is normally auto-detected, only change it if you know what you are doing. | ||||||
| tlsFlavorOverride: "" | ||||||
|
|
||||||
| ## @param ingress.proxyProtocol.pop3 Enable PROXY protocol for POP3 (110/tcp) | ||||||
| ## @param ingress.proxyProtocol.pop3s Enable PROXY protocol for POP3S (995/tcp) | ||||||
| ## @param ingress.proxyProtocol.imap Enable PROXY protocol for IMAP (143/tcp) | ||||||
| ## @param ingress.proxyProtocol.imaps Enable PROXY protocol for IMAPS (993/tcp) | ||||||
| ## @param ingress.proxyProtocol.smtp Enable PROXY protocol for SMTP (25/tcp) | ||||||
| ## @param ingress.proxyProtocol.smtps Enable PROXY protocol for SMTPS (465/tcp) | ||||||
| ## @param ingress.proxyProtocol.submission Enable PROXY protocol for Submission (587/tcp) | ||||||
| ## @param ingress.proxyProtocol.manageSieve Enable PROXY protocol for ManageSieve (4190/tcp) | ||||||
| ## Enabling any of these requires to have ingress.realIpFrom set | ||||||
| proxyProtocol: | ||||||
| pop3: false | ||||||
| pop3s: false | ||||||
| imap: false | ||||||
| imaps: false | ||||||
| smtp: false | ||||||
| smtps: false | ||||||
| submission: false | ||||||
| manageSieve: false | ||||||
|
|
||||||
|
|
||||||
| ## @section Proxy auth configuration | ||||||
| ## ref: https://mailu.io/master/configuration.html#header-authentication-using-an-external-proxy | ||||||
|
|
@@ -768,6 +750,41 @@ front: | |||||
| submission: 587 | ||||||
| manageSieve: 4190 | ||||||
|
|
||||||
| ## @section ProxyProtocol configuration | ||||||
| ## If the front service is sitting behind a load balancer that supports | ||||||
| ## PROXY protocol (e.g. HAPROXY, AWS ELB/ALB), you can enable it here. | ||||||
| ## This will make Mailu aware of the original client IP address. | ||||||
| ## ref: https://mailu.io/master/configuration.html#proxy-protocol | ||||||
| proxyProtocol: | ||||||
| ## @param front.proxyProtocol.enabled Enable PROXY protocol support in the `front` pod | ||||||
| enabled: false | ||||||
|
|
||||||
| ## @param front.proxyProtocol.realIpFrom Sets the value of `REAL_IP_FROM` environment variable in the `front` pod | ||||||
| ## This should be set to the CIDR(s) of the load balancer(s) in front of Mailu | ||||||
| ## or pod that forwards traffic to Mailu supporting PROXY protocol. | ||||||
| ## For example, if using an Ingress controller, this should be set to the | ||||||
| ## pod CIDR of the cluster. | ||||||
| realIpFrom: "10.42.0.0/16" | ||||||
|
|
||||||
| ## @param front.proxyProtocol.ports.pop3 Enable PROXY protocol for POP3 (110/tcp) | ||||||
| ## @param front.proxyProtocol.ports.pop3s Enable PROXY protocol for POP3S (995/tcp) | ||||||
| ## @param front.proxyProtocol.ports.imap Enable PROXY protocol for IMAP (143/tcp) | ||||||
| ## @param front.proxyProtocol.ports.imaps Enable PROXY protocol for IMAPS (993/tcp) | ||||||
| ## @param front.proxyProtocol.ports.smtp Enable PROXY protocol for SMTP (25/tcp) | ||||||
| ## @param front.proxyProtocol.ports.smtps Enable PROXY protocol for SMTPS (465/tcp) | ||||||
| ## @param front.proxyProtocol.ports.submission Enable PROXY protocol for Submission (587/tcp) | ||||||
| ## @param front.proxyProtocol.ports.manageSieve Enable PROXY protocol for ManageSieve (4190/tcp) | ||||||
| ## Enabling any of these requires to have ingress.realIpFrom set | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Note I'm not a mod, just wanting to use this code too
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good catch! Great I forgot this doc |
||||||
| ports: | ||||||
| pop3: false | ||||||
| pop3s: false | ||||||
| imap: false | ||||||
| imaps: false | ||||||
| smtp: false | ||||||
| smtps: false | ||||||
| submission: false | ||||||
| manageSieve: false | ||||||
|
|
||||||
| ## @param front.kind Kind of resource to create for the front (`Deployment` or `DaemonSet`) | ||||||
| kind: Deployment | ||||||
|
|
||||||
|
|
||||||
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.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to get 587 into this list for submission to work
otherwise https://github.com/Mailu/Mailu/blob/master/core/nginx/dovecot/proxy.conf#L162 fails
mailu.enabledPortsFeeds intoenvvars-configmap.yamlLine 117PORTSthat is used in https://github.com/Mailu/Mailu/blob/master/core/base/libs/socrate/socrate/system.py#L144-L147 which would setPORT_587which the above proxy.conf line usesUh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem was not with submission, but with managesieve.
With the previous version it would never be deployed when using the ingress controller.
The same issue was written also in other defect.