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

Allow appimageupdatetool work with Torsocks #244

Closed
ivan-hc opened this issue Feb 1, 2025 · 5 comments · Fixed by ivan-hc/AM#1325
Closed

Allow appimageupdatetool work with Torsocks #244

ivan-hc opened this issue Feb 1, 2025 · 5 comments · Fixed by ivan-hc/AM#1325

Comments

@ivan-hc
Copy link

ivan-hc commented Feb 1, 2025

Hi, in my scripts I often need to update AppImages from several github sources, and these may fail if I reach github API calls limit per hour. Normally as a workaround I use Torsocks, and in other cases, when I don't use appimageupdatetool, it works. On the contrary, using appimageupdatetool with Torsocks fails. I get an error message about insecure Torsocks connection, as it is not secure.

Please, made appimageupdatetool work with torsocks.

Thanks in advance.

@probonopd
Copy link
Member

probonopd commented Feb 2, 2025

As someone who has never heard of Torsocks:
How do you invoke it when running appimageupdatetool?

@ivan-hc
Copy link
Author

ivan-hc commented Feb 2, 2025

Hi @probonopd this package is in the repo of almost all distributions https://gitlab.torproject.org/tpo/core/torsocks/ it is enough to use it before a command, for example

torsocks wget $URL

the behaviour should be the same for appimageupdatetool, but for some strange reason it fails.

This is a comparison between zsync and appimageupdatetool using Torsocks

simplescreenrecorder-2025-02-02_19.51.10.mp4

this is the message

Checking for updates...
1738522316 WARNING torsocks[11624]: [connect] Connection to a local address are denied since it might be a TCP DNS query to a local DNS server. Rejecting it for safety reasons. (in tsocks_connect() at connect.c:191)
1738522316 WARNING torsocks[11624]: [connect] Connection to a local address are denied since it might be a TCP DNS query to a local DNS server. Rejecting it for safety reasons. (in tsocks_connect() at connect.c:191)
terminate called after throwing an instance of 'appimage::update::updateinformation::UpdateInformationError'
  what():  Failed to parse GitHub response: [json.exception.parse_error.101] parse error at line 1, column 1: syntax error while parsing value - unexpected end of input; expected '[', '{', or a literal
Annullato (core dump creato)

@probonopd
Copy link
Member

So how does it work? Does it do some LD_PRELOAD?

@ivan-hc
Copy link
Author

ivan-hc commented Feb 2, 2025

So how does it work? Does it do some LD_PRELOAD?

yes, according to what they wrote on the README

BE ADVISE: It uses the LD_PRELOAD mechanism (man ld.so.8) which means that if the application is not using the libc or for instance uses raw syscalls, torsocks will be useless and the traffic will not go through Tor.

@ivan-hc
Copy link
Author

ivan-hc commented Feb 3, 2025

@probonopd according to this https://gitlab.torproject.org/legacy/trac/-/issues/34158 it is enough to uncomment AllowOutboundLocalhost 1 from /etc/tor/torsocks.conf to allow torsocks working with appimageupdatetool

Just tested using an alternative torsocks.conf file and the update worked.

Btw would like to know how much is safe this approach.

simplescreenrecorder-2025-02-03_15.06.41.mp4

ivan-hc added a commit to ivan-hc/AM that referenced this issue Feb 3, 2025
ivan-hc added a commit to ivan-hc/AM that referenced this issue Feb 3, 2025
* Update APP-MANAGER

- fix AppImageCommunity/AppImageUpdate#244
- remove "$AMDATADIR"/torsocks.conf after the use
- suggest to restart tor.service
- fix plural on 1 second elapsed
github-actions bot pushed a commit to oSoWoSo/AM that referenced this issue Feb 5, 2025
* Update APP-MANAGER

- fix AppImageCommunity/AppImageUpdate#244
- remove "$AMDATADIR"/torsocks.conf after the use
- suggest to restart tor.service
- fix plural on 1 second elapsed
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.

2 participants