-
Notifications
You must be signed in to change notification settings - Fork 207
Allows the bridge to be in a separate server not just localhost #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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -49,13 +49,13 @@ func NewTLSTemplate() (*x509.Certificate, error) { | |
| Country: []string{"CH"}, | ||
| Organization: []string{"Proton AG"}, | ||
| OrganizationalUnit: []string{"Proton Mail"}, | ||
| CommonName: "127.0.0.1", | ||
| CommonName: "0.0.0.0", | ||
| }, | ||
| KeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature | x509.KeyUsageCertSign, | ||
| ExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageServerAuth, x509.ExtKeyUsageClientAuth}, | ||
| BasicConstraintsValid: true, | ||
|
Comment on lines
+52
to
56
|
||
| IsCA: true, | ||
| IPAddresses: []net.IP{net.ParseIP("127.0.0.1")}, | ||
| IPAddresses: []net.IP{net.ParseIP("0.0.0.0")}, | ||
| NotBefore: time.Now(), | ||
|
Comment on lines
+58
to
59
|
||
| NotAfter: time.Now().Add(20 * 365 * 24 * time.Hour), | ||
| }, nil | ||
|
|
@@ -110,7 +110,7 @@ func GetConfig(certPEM, keyPEM []byte) (*tls.Config, error) { | |
| //nolint:gosec // We need to support older TLS versions for AppleMail and Outlook | ||
| return &tls.Config{ | ||
| Certificates: []tls.Certificate{c}, | ||
| ServerName: "127.0.0.1", | ||
| ServerName: "0.0.0.0", | ||
| ClientAuth: tls.VerifyClientCertIfGiven, | ||
|
Comment on lines
111
to
114
|
||
| RootCAs: caCertPool, | ||
| ClientCAs: caCertPool, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -33,6 +33,6 @@ func TestEscapeXMLString(t *testing.T) { | |
| func _TestInstallCert(t *testing.T) { //nolint:unused | ||
| require.NoError( | ||
| t, | ||
| (&AppleMail{}).Configure(`127.0.0.1`, 1143, 1025, true, false, `user&>>`, `<<abc&&'"def>>`, `user&a`, []byte(`ir8R9vhdNXyB7isWzhyEkQ`)), | ||
| (&AppleMail{}).Configure(`0.0.0.0`, 1143, 1025, true, false, `user&>>`, `<<abc&&'"def>>`, `user&a`, []byte(`ir8R9vhdNXyB7isWzhyEkQ`)), | ||
| ) | ||
|
Comment on lines
+36
to
37
|
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -68,7 +68,7 @@ const ( | |
| KeyChainName = "bridge-v3" | ||
|
|
||
| // Host is the hostname of the bridge server. | ||
| Host = "127.0.0.1" | ||
| Host = "0.0.0.0" | ||
| ) | ||
|
Comment on lines
70
to
72
|
||
|
|
||
| // nolint:goconst | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -34,7 +34,7 @@ import ( | |||||
| ) | ||||||
|
|
||||||
| const ( | ||||||
| Host = "127.0.0.1" | ||||||
| Host = "0.0.0.0" | ||||||
|
||||||
| Host = "0.0.0.0" | |
| Host = "127.0.0.1" |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -67,7 +67,7 @@ void GRPCServerWorker::run() { | |||||
| builder.AddListeningPort(QString("unix://%1").arg(fileSocketPath).toStdString(), credentials); | ||||||
| config.fileSocketPath = fileSocketPath; | ||||||
| } else { | ||||||
| builder.AddListeningPort("127.0.0.1:0", credentials, &port); | ||||||
| builder.AddListeningPort("0.0.0.0:0", credentials, &port); | ||||||
|
||||||
| builder.AddListeningPort("0.0.0.0:0", credentials, &port); | |
| builder.AddListeningPort("127.0.0.1:0", credentials, &port); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -155,7 +155,7 @@ QUrl getApiUrl() { | |
| QUrl url; | ||
| // use default url. | ||
| url.setScheme("http"); | ||
| url.setHost("127.0.0.1"); | ||
| url.setHost("0.0.0.0"); | ||
| url.setPort(1042); | ||
|
Comment on lines
157
to
159
|
||
|
|
||
| // override with what can be found in the prefs.json file. | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -29,7 +29,7 @@ namespace { | |||||
|
|
||||||
|
|
||||||
| Empty empty; ///< Empty protobuf message, re-used across calls. | ||||||
| QString const hostname = "127.0.0.1"; ///< The hostname of the focus service. | ||||||
| QString const hostname = "0.0.0.0"; ///< The hostname of the focus service. | ||||||
|
||||||
| QString const hostname = "0.0.0.0"; ///< The hostname of the focus service. | |
| QString const hostname = "127.0.0.1"; ///< The hostname of the focus service. |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -127,9 +127,9 @@ void GRPCClient::connectToServer(QString const &sessionID, QString const &config | |||||
| grpc::ChannelArguments chanArgs; | ||||||
| if (useFileSocketForGRPC()) { | ||||||
| address = QString("unix://" + config.fileSocketPath); | ||||||
| chanArgs.SetSslTargetNameOverride("127.0.0.1"); // for file socket, we skip name verification to avoid a confusion localhost/127.0.0.1 | ||||||
| chanArgs.SetSslTargetNameOverride("0.0.0.0"); // for file socket, we skip name verification to avoid a confusion localhost/127.0.0.1 | ||||||
| } else { | ||||||
| address = QString("127.0.0.1:%1").arg(config.port); | ||||||
| address = QString("0.0.0.0:%1").arg(config.port); | ||||||
|
||||||
| address = QString("0.0.0.0:%1").arg(config.port); | |
| address = QString("127.0.0.1:%1").arg(config.port); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -141,7 +141,7 @@ func NewService( | |
| } | ||
| } else { | ||
| var err error | ||
| listener, err = net.Listen("tcp", "127.0.0.1:0") // Port should be provided by the OS. | ||
| listener, err = net.Listen("tcp", "0.0.0.0:0") // Port should be provided by the OS. | ||
| if err != nil { | ||
| logrus.WithError(err).Panic("Could not create gRPC listener") | ||
|
Comment on lines
+144
to
146
|
||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -67,7 +67,7 @@ func runBlocker(startPort, endPort int) { | |||||
| } | ||||||
|
|
||||||
| for port := startPort; port <= endPort; port++ { | ||||||
| listener, err := net.Listen("tcp", "127.0.0.1:"+strconv.Itoa(port)) | ||||||
| listener, err := net.Listen("tcp", "0.0.0.0:"+strconv.Itoa(port)) | ||||||
|
||||||
| listener, err := net.Listen("tcp", "0.0.0.0:"+strconv.Itoa(port)) | |
| listener, err := net.Listen("tcp", "127.0.0.1:"+strconv.Itoa(port)) |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -29,7 +29,7 @@ import ( | |||||
| ) | ||||||
|
|
||||||
| var ( | ||||||
| serverURL = flag.String("server", "127.0.0.1:1025", "SMTP server address:port") | ||||||
| serverURL = flag.String("server", "0.0.0.0:1025", "SMTP server address:port") | ||||||
|
||||||
| serverURL = flag.String("server", "0.0.0.0:1025", "SMTP server address:port") | |
| serverURL = flag.String("server", "127.0.0.1:1025", "SMTP server address:port") |
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.
Dialing the IMAP client at 0.0.0.0 will generally fail because 0.0.0.0 is not a valid destination address. Use 127.0.0.1/localhost (or the same advertised/connect host used elsewhere, e.g. constants.Host if it remains a connect host) when creating the IMAP client connection for diagnostics.