update-torbrowser tb_onion config setting ignored.

Environment: QubesOS, untested on any other platform but it seems agnostic.

When setting tb_onion=true in any of the config files in /etc/torbrowser.d/ the update-torbrowser script doesn’t download the Tor Browser using the onion services. However the onion services are used when you call update-torbrowser --onion or tb_onion=true update-torbrowser.

For example using: echo "tb_onion=true" | sudo tee -a "/etc/torbrowser.d/50_user.conf"

Looking at the script [1][2] it appears setting the download URL (in function tb_preparation) [4][5] happens before the config files are loaded (function tb_config_folder_parser) [3], hence as the URL is already set loading the config files from /etc/torbrowser.d/ with tb_onion=true doesn’t make a difference.

The function tb_config_folder_parser [6] depends on the variable $tb_settings_folder being set to work and this appears to be only set in the function tb_preparation [7], hence moving the function tb_config_folder_parser before tb_preparation doesn’t work [3][4]. I’ve got it to work by moving the function call tb_config_folder_parser [3] into the function tb_preparation somewhere between setting $tb_settings_folder (line 629 [7]) and using $tb_onion (line 787 [5]). Another solution would be to refactor function tb_preparation into two smaller functions and call tb_config_folder_parser in between them.

I’m not as familiar with the scripts internals so I don’t want to make a patch, I thought to just posting my findings on here and you can decide how it should be done.

This isn’t relevant to the bug, but this my first direct interaction. I’ve used Whonix most days for ~5 years and really appreciate the work that has been put in. :slight_smile:

Relevant ticket: [8]

[1] https://github.com/Whonix/tb-updater/tree/188cc1e12c01b57cf9e363e87ddd57aed464feba/
[2] https://github.com/Whonix/tb-updater/blob/188cc1e12c01b57cf9e363e87ddd57aed464feba/usr/bin/update-torbrowser
[3] https://github.com/Whonix/tb-updater/blob/188cc1e12c01b57cf9e363e87ddd57aed464feba/usr/bin/update-torbrowser#L2037
[4] https://github.com/Whonix/tb-updater/blob/188cc1e12c01b57cf9e363e87ddd57aed464feba/usr/bin/update-torbrowser#L2036
[5] https://github.com/Whonix/tb-updater/blob/188cc1e12c01b57cf9e363e87ddd57aed464feba/usr/bin/update-torbrowser#L787
[6] https://github.com/Whonix/tb-updater/blob/188cc1e12c01b57cf9e363e87ddd57aed464feba/usr/bin/update-torbrowser#L434
[7] https://github.com/Whonix/tb-updater/blob/188cc1e12c01b57cf9e363e87ddd57aed464feba/usr/bin/update-torbrowser#L629
[8] https://phabricator.whonix.org/T678


Welcome to the forums! Good to hear! Bug should be fixed. Committed to git just now but untested.

[Imprint] [Privacy Policy] [Cookie Policy] [Terms of Use] [E-Sign Consent] [DMCA] [Contributors] [Investors] [Priority Support] [Professional Support]