site  contact  subhomenews

All downloads now to /files folder

December 07, 2021 — BarryK

A couple days ago, posted about starting to think about this:

https://bkhome.org/news/202112/mapping-all-download-folders-to-one-folder.html

As you can see in the photo in above link, there is /files, with sub-directories such as 'downloads', 'media', etc. Folder /files is no longer a symlink. Up to the current release of EasyOS, /files is a symlink to the actual /files folder at /mnt/wkg/files, that is, on the working-partition.

/files exists in easy.sfs, as an actual folder, with sub-folders. However, at bootup it is overlaid, like this, assuming the working-partition is sdb2 and working-folder is easyos:

# mount --bind /mnt/sdb2/easyos/files /files

What this does is replace /files with the one at /mnt/sdb2/easyos/files

I have removed all /home/*/Downloads and /root/Downloads folders. Apps are now setup to default to save to /files

Note also, /root/my-applications and /root/my-documents folders have been removed. These are legacy folders, not needed anymore.

In the case of Firefox running as a non-root client, with home folder /home/firefox, Firefox is able to save outside of /home/firefox, at /files, as /files and it's sub-folders belong to the 'filesgrp' group.

drwxrwxr-x 2 root filesgrp 4096 Feb 19  2017 files/archive
drwxrwxr-x 2 root filesgrp 4096 Dec 7 09:14 files/downloads
drwxrwxr-x 3 root filesgrp 4096 Jan 12 2017 files/grisbi
drwxrwxr-x 5 root filesgrp 4096 Feb 19 2017 files/media
drwxrwxr-x 2 root filesgrp 4096 Feb 19 2017 files/other
drwxrwxr-x 2 root filesgrp 4096 Feb 19 2017 files/personal
drwxrwxr-x 2 root filesgrp 4096 Sep 19 09:33 files/portable
drwxrwxr-x 2 root filesgrp 4096 Feb 19 2017 files/projects
drwxrwxr-x 2 root filesgrp 4096 Dec 7 09:18 files/shared

And user 'firefox' is a member of 'filesgrp' group. As shown in /etc/group:

filesgrp::122:root,spot,zeus,rover,seamonkey,chromium,chrome,firefox

If it is ever required for Firefox not be able to save outside its /home/firefox folder, it is simple, just remove "firefox" from that line in /etc/group

In a container, Firefox will also default to download|save|save-as to /files, but in this case /mnt/sdb2/easyos/files is not bind-mounted on /files. So you would only be saving to /files inside the container.

However, if save to /files/shared, then the saved file will also show up on the main desktop, at the same place, /files/shared

Note, this works because /files/shared on the main desktop is bind-mounted on /files/shared in the container. This can be disabled if you want to isolate the app in the container more completely.

This is now all very simple, streamlined, and is a pleasure to use. The only thing that I don't like, is when chose to save an image file in Firefox, it displays these extra things:

img1

Huh? Why are /proc, /dev/pts, /dev/shm and /sys being listed? The little up-arrow symbol is for unmounting them. But no way do we want users to be attempting to unmount any of those. Want to get rid of those, but cannot see how. Will ask on the forum.

EDIT:
A refinement. The folders under /files are shown above as having permissions rwxrwxr-x, which is 775. I have changed this to 770. This means that if "firefox" is removed from the "filesgrp" line in /etc/group, then a Firefox save dialog will not be able to change into those folders.
Thus, the contents will be hidden. This is a security improvement. There may be a network-connected app that you run non-root and you don't want it to be able to see your personal files.
      

Tags: easy