Can't access rustup documentation with Firefox

Like the title says, rustup doc opens Firefox, and I get an “access denied” error.

In my googling, I’ve discovered that snap disallows access to any hidden file. So /home/iain/.rustup/anything_at_all is off limits.

Security is nice, but arbitrarily denying me access to my own files is a little much.

Is there a way I can access Rust documentation offline?

Thanks

Bueller? Bueller?

How do I access my files, or do I have to find a non-snap browser? In this state, snap is less than useless to me. It refuses to let me access my files.

Can you go the other way around and start in Firefox? If you go Ctrl + O, a portal file chooser appears, which supports proxying those hidden files. However, I’m pretty sure it only supports one file at a time right now, which might not be enough for Rust’s docs.

A very easy-to-implement idea would be a bind mount:

mkdir -p ~/anything-at-all
sudo mount --bind ~/.rustup/anything_at_all ~/anything-at-all
firefox ~/anything-at-all/the_docs.html

^O is not really a solution, as there are manymany pages of documentation.

According to people in other forums, Firefox should have access to /home/iain/.rustup/whatever, but refuses to open the pages. In other words, snap connections shows that Firefox has the personal-files interface connected and everything.

The bind mount works, so I’ll use that. Not really a solution as the problem with snap and Firefox still exists – the bind mount simply sidesteps it.

Thanks

The only personal-files declaration I’m seeing is this:

  dot-mozilla-firefox:
    interface: personal-files
    read:
    - $HOME/.mozilla/firefox

…which only gives access to $HOME/.mozilla/firefox.

Another option I think is quite attractive (and rustup should probably offer this by default): Run a tiny webserver to serve those HTML files via HTTP, see https://github.com/rust-lang/cargo/issues/4966.

There’s

As for the local files in a hidden folder, the snap policies explicitly forbid accessing them in this way, so that’s working as intended.

Aha. I was led to believe that the personal-files interface allowed access to all files under $HOME.

Thanks for the update on that.

A tiny webserver also looks attractive. Thanks.

1 Like