Opened 3 years ago

Last modified 2 years ago

#20497 new enhancement

Add --enable-tor-browser-data-in-home-dir configure option and code

Reported by: attila Owned by: tbb-team
Priority: Medium Milestone:
Component: Applications/Tor Browser Version:
Severity: Normal Keywords: TBB
Cc: brade, mcs Actual Points:
Parent ID: #20557 Points:
Reviewer: Sponsor:

Description

The attached patch adds a new configure option called --enable-tor-browser-data-in-home-dir and code to honor it.

This is effectively a special case of --enable-tor-browser-data-outside-app-dir. I developed this patch for the port of TBB to OpenBSD because we need to solve the problem of where the TorBrowser-Data directory goes. Under Linux it lives in the bundle. On Win/Mac there are canonical places for it to go. Under OpenBSD (and the other BSDs, at least), the logical place is the user's home directory, so I added this option and use it in my port's Makefile.

After discussion on #tor-dev I'm proposing this as a new feature to make it easier for other BSD/non-MacWinLin porting efforts.

Child Tickets

Attachments (1)

tbb-605-homedir.diff (1.9 KB) - added by attila 3 years ago.
Diff/patch to add --enable-tor-browser-data-in-home-dir

Download all attachments as: .zip

Change History (7)

Changed 3 years ago by attila

Attachment: tbb-605-homedir.diff added

Diff/patch to add --enable-tor-browser-data-in-home-dir

comment:1 Changed 3 years ago by yawning

nb: Not really a Tor Browser developer, though I sometimes play one on tv.

While this is sort of a Linux-ism, any thoughts on using XDG Base Directories (https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html). In this case something like $XDG_DATA_HOME/<subdir>/, with a default of ~/.local/share/ if the env var isn't set (~/.local/share/tor-browser/ for example).

comment:2 in reply to:  1 ; Changed 3 years ago by attila

Replying to yawning:

nb: Not really a Tor Browser developer, though I sometimes play one on tv.

While this is sort of a Linux-ism, any thoughts on using XDG Base Directories (https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html). In this case something like $XDG_DATA_HOME/<subdir>/, with a default of ~/.local/share/ if the env var isn't set (~/.local/share/tor-browser/ for example).

I don't see why the actual path chosen in the tor-data-in-home-dir case couldn't be whatever the group comes to consensus on. If ~/.local/share/TorBrowser-Data (or whatever) is more in line with what you want that's fine by me. I'm sure a lot of *BSD users do use some kind of desktop env (I don't but I'm arguably weird). This would be like everything else that adheres to the freedesktop.org spec.

Last edited 3 years ago by attila (previous) (diff)

comment:3 in reply to:  2 Changed 3 years ago by mcs

Cc: brade mcs added

Replying to attila:

I don't see why the actual path chosen in the tor-data-in-home-dir case couldn't be whatever the group comes to consensus on. If ~/.local/share/TorBrowser-Data (or whatever) is more in line with what you want that's fine by me. I'm sure a lot of *BSD users do use some kind of desktop env (I don't but I'm arguably weird). This would be like everything else that adheres to the freedesktop.org spec.

It is not a strong opinion, but I favor $XDG_DATA_HOME/tor-browser with a fallback to ~/.local/share/tor-browser/.
I also wonder if we want to add a runtime option for this as well (via a command line flag) so that users who want data to be stored under $XDG_DATA_HOME would always have that option available to them. On OSX we make a similar decision automatically based on where TorBrowser.app is installed, but I don't know how to do that on the Unix/Linux systems.

comment:4 Changed 3 years ago by yawning

Parent ID: #20557

I felt inspired, and think we should examine the other patches as well, and merge/upstream things that are sensible.

comment:5 Changed 2 years ago by attila

It looks like the world has changed, autoconf is out and python is in. The patch I attached to this ticket is probably never going to fly.

I am studying the new python config/build stuff. I would like to produce a patch that you guys would find acceptable on this in whatever form is best, if a patch is even needed. Please advise at your earliest.

comment:6 Changed 2 years ago by gk

I think following the feedback yawning and mcs gave and following the Firefox build changes would be a good way to go. Regarding the runtime option: it seems to me we can have this in a separate ticket if *BSD users really want that.

Note: See TracTickets for help on using tickets.