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

Proxy settings are ingored #164

Closed
laolux opened this issue Feb 22, 2021 · 7 comments
Closed

Proxy settings are ingored #164

laolux opened this issue Feb 22, 2021 · 7 comments
Labels

Comments

@laolux
Copy link

laolux commented Feb 22, 2021

This flatpak app seems to ignore my system wide proxy settings and can therefore not connect to the internet.
System: Fedora 33
DE: Gnome 3.38.4
Proxy set in Gnome settings / Network / Network Proxy

Trying to run flatpak run im.riot.Riot starts element, but element then only shows Failed to start and Your Element is misconfigured, Invalid homeserver discovery response.

Observing my network traffic with netstat -ntpc I see that element-deskt sents SYN_SENT to 104.20.21.236:443 and 172.217.161.46:443, whereas all other programs such as firefox and chromium connect to 172.16.20.20:8080, the address and port of our proxy server.

Can I convince element somehow to use a specific proxy server or to obey the system proxy settings?
Note that the chromium flatpak had the same issue before, but that was fixed. Maybe something similar needs to be done for element?

@Erick555
Copy link
Contributor

Doing same fix as chromium would need to build and patch electron from source which is quite hard thus unlikely to happen.

@SISheogorath
Copy link
Collaborator

I think electron has a --proxy parameter, but of course this doesn't necessarily solve all problems. I'll see if I can look into it tonight.

@laolux
Copy link
Author

laolux commented Feb 26, 2021

Yeah, I realize that this might not be easy, even though it would be very convenient.
However, there is a very simple workaround (I should have thought of this right away...): Start from command line with extra parameter, like
flatpak run im.riot.Riot --proxy-server=http://server.name:port
Also, my proxy server is set in the http_proxy and https_proxy environment variables. Maybe it would be simpler for the flatpak to simply read those and pass it on to the element app via the --proxy-server parameter?

@SISheogorath
Copy link
Collaborator

You could try to put it in here:

"commands": [
"export TMPDIR=\"$XDG_RUNTIME_DIR/app/$FLATPAK_ID\"",
"exec zypak-wrapper \"/app/Element/element-desktop\" \"$@\""
]

Each element in the array is a line in a shells script. We feel free to feel free to go ahead and submit a merge request :)

@laolux
Copy link
Author

laolux commented Mar 1, 2021

Thanks for pointing me towards that. I poked at it a bit, but failed (expectedly, as I have no experience building flatpaks yet).
However, thinking about it a bit more, I don't even think that using the http_proxy environment variable from my terminal is a good and portable idea. It does not get set automatically by selecting a network proxy in gnome-settings for example. So I need to manually set it in my terminal. At that point I might as well just pass it on directly to the flatpak app.
Long story short: If there is no convenient way of reading the system's proxy settings and passing it on to element, then it's probably best left to the user to find out what to do. Maybe documenting it somewhere would help, so if I find a good location for documenting how to set the proxy settings, I will go that route.

@vchernin
Copy link
Contributor

vchernin commented Sep 3, 2021

Maybe Element can do the same approach as here? flathub/com.google.Chrome#77

@SISheogorath
Copy link
Collaborator

This should be resolved by #488

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

No branches or pull requests

4 participants