~weird/pkg-openbsd

4 2

LibreWolf config files

Johannes Thyssen Tishman <johannes@thyssentishman.com>
Details
Message ID
<20220114205632.p2k4duilzenegsjv@jt-x200.localdomain>
DKIM signature
missing
Download raw message
Hi Weird,

First of all, thanks for porting LibreWolf to OpenBSD. I've been trying to change the downloads folder in the preferences but due to unveil the only visible directory to LibreWolf is ~/Downloads. By reading the pkg-readme I learned that I can edit the unveil.main file under /etc/librewolf, however this directory is not created when the software is installed and modifying the defaults under /usr/local/lib/librewolf/browser/defaults/preferences has no effect whatsoever (I assume that these are just example files of the defaults). I tried creating the /etc/librewolf folder and adding my own unveil.main, but that seems to override all defaults and LibreWolf breaks when starting. I also tried copying all the default files to /etc/librewolf and modifying those and it also breaks.

Could you please help me out here? I don't know what I'm doing wrong or how I can go about to solve this.

Thanks again for your time and support.

Kind regards,
Johannes Thyssen Tishman

--
Johannes Thyssen Tishman
E-Mail: johannes@thyssentishman.com
Website: thyssentishman.com
Details
Message ID
<f5b0b4a4-9260-ada2-f4c2-621b22fb59eb@weird.cafe>
In-Reply-To
<20220114205632.p2k4duilzenegsjv@jt-x200.localdomain> (view parent)
DKIM signature
pass
Download raw message
On 1/15/22 7:56 AM, Johannes Thyssen Tishman wrote:
> Hi Weird,

Hi,

> First of all, thanks for porting LibreWolf to OpenBSD. I've been trying to change the downloads folder in the preferences but due to unveil the only visible directory to LibreWolf is ~/Downloads. By reading the pkg-readme I learned that I can edit the unveil.main file under /etc/librewolf, however this directory is not created when the software is installed and modifying the defaults under /usr/local/lib/librewolf/browser/defaults/preferences has no effect whatsoever (I assume that these are just example files of the defaults). I tried creating the /etc/librewolf folder and adding my own unveil.main, but that seems to override all defaults and LibreWolf breaks when starting. I also tried copying all the default files to /etc/librewolf and modifying those and it also breaks.

LibreWolf should use these files to correctly call pledge and unveil 
unless you override them in /etc/librewolf. I'm not sure why 
/etc/librewolf is not created automatically like when you're installing 
firefox (I couldn't find anything what creates it by diagonally reading 
the firefox Makefile), but I don't think it's needed unless you want to 
override them.

> Could you please help me out here? I don't know what I'm doing wrong or how I can go about to solve this.

I think you need to override two files: unveil.main and unveil.content. 
Could you please try removing the /etc/librewolf and restoring the 
original files in /usr/local/lib/librewolf/browser/defaults/preferences 
if you changed them (like, by pkg_delete and then pkg_add librewolf), 
and then overriding these two files only by copying them and adding the 
directories you need? For example, here's what I did to allow access to 
my ~/Pictures directory:

   doas mkdir /etc/librewolf
   cd /usr/local/lib/librewolf/browser/defaults/preferences
   doas cp unveil.{main,content} /etc/librewolf/

   cd /etc/librewolf
   echo '~/Pictures rwc' | doas tee -a unveil.main
   echo '~/Pictures r' | doas tee -a unveil.content

After that I can access it via file:///home/weird/Pictures URL. It's 
identical to the ~/Downloads directory, but you should be able to 
replace rwc with rw if you want because LibreWolf does not create it by 
itself

> Thanks again for your time and support.
> 
> Kind regards,
> Johannes Thyssen Tishman
> 
> --
> Johannes Thyssen Tishman
> E-Mail: johannes@thyssentishman.com
> Website: thyssentishman.com
> 
Johannes Thyssen Tishman <johannes@thyssentishman.com>
Details
Message ID
<20220115195156.bjjsvvmot66qnyfl@jt-x200.localdomain>
In-Reply-To
<f5b0b4a4-9260-ada2-f4c2-621b22fb59eb@weird.cafe> (view parent)
DKIM signature
missing
Download raw message
Hi,

thank you for your quick response. I tried what you suggested and just like you
I'm now able to access the folders via file://path however I still cannot change
the downloads folder under about:preferences. When prompted to select a folder
using the internal file manager I cannot navigate to other folders nor select
the ones allowed by unveil.

I feel like this doesn't have to do with unveil, but with the default
preferences of LibreWolf and it's internal file manager, right? I just don't
know how something this simple is giving me such a hard time.

Anyways, if you have any clue on how to solve this, please let me know.

Thanks again for your time.

Kind regards,
Johannes Thyssen Tishman

PS Sorry for the bad formatting in my previous email. Lines are wrapped now :)

PPS Also sorry for not replying to the thread. Neomutt (my mail client) didn't append the In-Reply-To header. Hope this time it works.

--
Johannes Thyssen Tishman
E-Mail: johannes@thyssentishman.com
Website: thyssentishman.com
Details
Message ID
<bf412a61-a205-94d2-7fdb-03c7a61c603c@weird.cafe>
In-Reply-To
<20220115195156.bjjsvvmot66qnyfl@jt-x200.localdomain> (view parent)
DKIM signature
pass
Download raw message
On 1/16/22 06:51, Johannes Thyssen Tishman wrote:
> Hi,
> 
> thank you for your quick response. I tried what you suggested and just like you
> I'm now able to access the folders via file://path however I still cannot change
> the downloads folder under about:preferences. When prompted to select a folder
> using the internal file manager I cannot navigate to other folders nor select
> the ones allowed by unveil.

You can work around this by adding bookmarks to the file picker's
sidebar. I'm not sure what the best way to do this, but I created the
.config/gtk-3.0/bookmarks file with the following line:

    file:///home/weird/Pictures

And I now can access the dir from the file picker (after modifying
unveil files) and choose it as a download destination when the download
dialog appears.

> I feel like this doesn't have to do with unveil, but with the default
> preferences of LibreWolf and it's internal file manager, right? I just don't
> know how something this simple is giving me such a hard time.

Regarding choosing another dir as the default download directory, I
can't change it either in both LibreWolf and Firefox. I think this is
due to this[1] patch to the Firefox port which I also use for LibreWolf.
It looks like the downloads directory is hardcoded and I don't really
know why. I guess it's because unveil hides all paths except for
~/Downloads and not everyone has XDG_DOWNLOAD_DIR, so without that patch
Firefox wouldn't know where to download files, and the file picker
wouldn't be able to access anything because ~ is not unveiled. But I
just guessing here, you can drop a mail to openbsd-misc@ to ask about
why it's like that.

If you're building the port yourself, you can try to change the dir or
to drop the patch and use file picker's bookmarks.

[1]:
https://git.sr.ht/~weird/openbsd-ports/tree/7.0/item/www/librewolf/patches/patch-toolkit_components_downloads_DownloadUIHelper_jsm


> Anyways, if you have any clue on how to solve this, please let me know.
> 
> Thanks again for your time.
> 
> Kind regards,
> Johannes Thyssen Tishman
> 
> PS Sorry for the bad formatting in my previous email. Lines are wrapped now :)
> 
> PPS Also sorry for not replying to the thread. Neomutt (my mail client) didn't append the In-Reply-To header. Hope this time it works.
> 
> --
> Johannes Thyssen Tishman
> E-Mail: johannes@thyssentishman.com
> Website: thyssentishman.com
> 
Johannes Thyssen Tishman <johannes@thyssentishman.com>
Details
Message ID
<20220116170906.5brg4caqofnl34or@jt-x200.localdomain>
In-Reply-To
<f5b0b4a4-9260-ada2-f4c2-621b22fb59eb@weird.cafe> (view parent)
DKIM signature
missing
Download raw message
I see. I guess I'll have to settle for the bookmarks workaround. Thank you very
much for your help!

Kind regards,
Johannes Thyssen Tishman

--
Johannes Thyssen Tishman
E-Mail: johannes@thyssentishman.com
Website: thyssentishman.com
Reply to thread Export thread (mbox)