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 read-only tbb_path/Browser/ #209

Open
milahu opened this issue Jun 17, 2024 · 2 comments · May be fixed by #210
Open

allow read-only tbb_path/Browser/ #209

milahu opened this issue Jun 17, 2024 · 2 comments · May be fixed by #210

Comments

@milahu
Copy link

milahu commented Jun 17, 2024

currently tbselenium does

# TB can't find bundled "fonts" if we don't switch to tbb_browser_dir
chdir(self.tbb_browser_dir)

which requires a writable tbb_browser_dir
for .cache/ and .tor project/

but this should also work with a read-only system-wide installation of torbrowser
and it should be possible to use a workdir in tmpfs

TB can't find bundled "fonts" if we don't switch to tbb_browser_dir

works for me


but my actual issue is

profile missing: your tor browser profile cannot be loaded. it may be missing or inaccessible.

which is caused by one of

sudo chown 0:0 "tbb_path/Browser/.cache/"
sudo chown 0:0 "tbb_path/Browser/.tor project/"

... but a different workdir does not fix that issue

i would need a read-only tbb_browser_dir = "tbb_path/Browser/"
and separate paths for .cache/ and .tor project/

@milahu milahu changed the title add parameter workdir allow read-only tbb_path/Browser/ Jun 17, 2024
@milahu milahu linked a pull request Jun 19, 2024 that will close this issue
@gunesacar
Copy link
Collaborator

Thanks for filing the issue. This is a busy time of the year, so it'll be a while until I get to this.

sudo chown 0:0 "tbb_path/Browser/.tor project/"

A clarifying question: I am not familiar with the .tor project/ directory. Could you link to the source code you are referring to or some public documentation?

but my actual issue is...

Just to clarify, you get this issue when you use tbselenium on nixos?

@milahu
Copy link
Author

milahu commented Jun 27, 2024

yes, this is on nixos linux, see my tbselenium.nix

selenium seems to use $tbb_browser_dir as $HOME hence $tbb_browser_dir/.tor project/

on linux, the torbrowser firefox profile is stored in ~/.tor project/firefox/xxxxxxxx.default/
for firefox that is ~/.mozilla/firefox/xxxxxxxx.default/
for librewolf that is ~/.librewolf/xxxxxxxx.default/
etc

this is not really documented...

i have not found the code for
lower($MOZ_APP_VENDOR/$MOZ_APP_BASENAME)

https://gitlab.torproject.org/tpo/applications/tor-browser/-/blob/tor-browser-115.12.0esr-13.5-1/browser/confvars.sh

MOZ_APP_VENDOR="Tor Project"

https://searchfox.org/mozilla-central/source/build/moz.configure/init.configure

def moz_app_basename(value, target_is_android):
    if value:
        return value[0]
    if target_is_android:
        return "Fennec"
    return "Firefox"

https://gitlab.torproject.org/tpo/applications/tor-browser/-/issues/20497#note_2873088

The profile for torbrowser ends up in $HOME/.tor project/torbrowser

https://issues.guix.gnu.org/42380#42-lineno202

;; Profile location (relative to "~/.").  Default is
;; lower($MOZ_APP_VENDOR/$MOZ_APP_BASENAME), which is:
;; ~/.tor project/firefox.
(setenv "MOZ_APP_PROFILE" "torbrowser/browser")

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