Skip to content
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

Cannot connect behind corporate proxy #23

Open
swsnr opened this issue Mar 3, 2021 · 10 comments
Open

Cannot connect behind corporate proxy #23

swsnr opened this issue Mar 3, 2021 · 10 comments

Comments

@swsnr
Copy link
Contributor

swsnr commented Mar 3, 2021

Hello,

I cannot connect to a Mattermost instance behind a corporate HTTP proxy when using the Flatpak package. This appears to be quite specific to the Flatpak variant; my proxy configuration works

  • with normal desktop apps,
  • with other Flatpak apps (I can e.g. send me messages with Signal Desktop through the same proxy), and even
  • with the Linux binary one can download from https://mattermost.com/download/#mattermostApps/ (the one also listed as source in the flatpak manifest JSON).

It's really just the Mattermost Flatpak which is stuck in the loading spinner behind a proxy (it works if I use a public network, so it's really a proxy issue I guess). I can really just download the binary listed as source in the JSON, run in directly and it works, so I really believe some flatpak stuff is to blame here.

Unfortunately I know neither Mattermost nor Flatpak sufficiently to do any debugging; I'd very much appreciate pointers in the right direction.

Kind regards

@SemaiCZE
Copy link
Collaborator

Hi,

I don't know much about proxies in flatpak, but I found this issue: flathub/com.microsoft.Teams#27

Can you try to run Mattermost with following command?

$ flatpak run --env=http_proxy=$http_proxy --env=https_proxy=$https_proxy com.mattermost.Desktop

Thanks,
-Petr

@swsnr
Copy link
Contributor Author

swsnr commented Mar 15, 2021

Thanks🙏 I'll try this, and also did a little deeper with the debugging suggestions in that ticket.

But I still wonder why all other flatpaks (even electron based ones) I use work just fine with a proxy 🤔

@swsnr
Copy link
Contributor Author

swsnr commented Mar 23, 2021

This didn't change anything 😞 It still fails to connect to the server.

@swsnr
Copy link
Contributor Author

swsnr commented Jul 26, 2021

I had a look at this again: I need to set the proxy inside the flatpak environment directly:

$ flatpak run --command=sh com.mattermost.Desktop

And then inside this shell:

$ settings set org.gnome.system.proxy mode manual
$ gsettings set org.gnome.system.proxy.http host REDACTED
$ gsettings set org.gnome.system.proxy.http port REDACTED
$ gsettings set org.gnome.system.proxy.https host REDACTED
$ gsettings set org.gnome.system.proxy.https port REDACTED

To me this looks as if the dconf/gsettings integration of this flatpak is somehow not correct.

@SemaiCZE
Copy link
Collaborator

@lunaryorn Thanks, that sounds like a piece of information that could move us a bit further. I'll look into it after my vacation. I'm definitely not a flatpak expert, but I'll try to get some inspiration in other projects 😁

@swsnr
Copy link
Contributor Author

swsnr commented Jul 26, 2021

@SemaiCZE Thanks 🙏

Perhaps as another data point: I have to do the same shebang for the org.standardnotes.standardnotes flatpak, but not for the org.signal.Signal flatpak even though that's also an electron thing as far as I remember. I checked permissions of all these in flatseal but didn't notice any difference obviously related to this 🤷 This is certainly a little weird 🤔

If you'd like me to try another Electron flatpak do tell me.

@SemaiCZE
Copy link
Collaborator

SemaiCZE commented Aug 8, 2021

What I've found so far is that Mattermost settings are at ~/.var/app/com.mattermost.Desktop/config/glib-2.0/settings/keyfile. When you run the gsettings commands from inside the flatpak, the keyfile is altered with

[system/proxy/http]
host='REDACTED'

But that doesn't tell us why it's not using the system proxy if no configuration is present in the keyfile.

@vchernin
Copy link
Collaborator

I think the workaround is this: flathub/com.google.Chrome#77

@CaptainMalu
Copy link

gsettings set org.gnome.system.proxy.https port

I had a look at this again: I need to set the proxy inside the flatpak environment directly:

$ flatpak run --command=sh com.mattermost.Desktop

And then inside this shell:

$ settings set org.gnome.system.proxy mode manual
$ gsettings set org.gnome.system.proxy.http host REDACTED
$ gsettings set org.gnome.system.proxy.http port REDACTED
$ gsettings set org.gnome.system.proxy.https host REDACTED
$ gsettings set org.gnome.system.proxy.https port REDACTED

To me this looks as if the dconf/gsettings integration of this flatpak is somehow not correct.

Thanks, that works.

We have a funny setup so we actually would love to see proxy settings within the mattermost app.

We have a mattermost server for our company. So far so nice. Now we have a client who get's his own mattermost server from us.
The network of this client is a little bit tricky and so we have to use a proxy for the connection to his server.

That means at the end of the day we are connecting from the mattermost desktop client to two different servers and only need a proxy for one of them.

Maybe there could be something implemented, that you can specify a proxy for any server individually.

We also use mattermost on mac, linux and windows and don't need the proxy system wide.

@Pathsis
Copy link

Pathsis commented Apr 1, 2024

I vowed not to waste another minute on flatpak! I can't use the system proxy by any means and can't find any official resources to solve this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants