flathub / cc.arduino.IDE2

https://flathub.org/apps/details/cc.arduino.IDE2
6 stars 4 forks source link

Granularize home directory access #59

Closed IverCoder closed 1 year ago

IverCoder commented 1 year ago

Right now, Arduino litters the home directory with .arduino folders and has access to the entire home directory even though sketches are only stored in the Arduino folder by default.

This PR modifies the build files to limit home directory access and remaps the dotfolders to the ~/var/app/cc.arduino.IDE2 folder. There's now also a tutorial to change where sketches can be saved by default if the user wants to do so.

flathubbot commented 1 year ago

Started test build 62620

flathubbot commented 1 year ago

Build 62620 successful To test this build, install it from the testing repository:

flatpak install --user https://dl.flathub.org/build-repo/45254/cc.arduino.IDE2.flatpakref
SuperNinja-4965 commented 1 year ago

Right now, Arduino litters the home directory with .arduino folders and has access to the entire home directory even though sketches are only stored in the Arduino folder by default.

This PR modifies the build files to limit home directory access and remaps the dotfolders to the ~/var/app/cc.arduino.IDE2 folder.

This is a good idea in theory. However, while the folder that Arduino opens when saving a project is the sketchbook location, the application allows someone to save (and open) their project anywhere. When initially packaging the application I decided to keep the folder access to the home folder as alot of hobbyists will not always save their projects to the sketchbook folder (as this is an IDE).

With the target audience of arduino being so wide there is a chance that not everyone will understand quite how flatpak works and when following guides on how to add libraries, change sketchbook locations etc documenting and instructing users where to find these folders changing their locations may confuse people. Also while restricting folder access is one of the aims of flatpak with the nature of an IDE it becomes difficult to justify without inconveniencing people.

Finally, this decision was also made to ensure that the flatpak release of the Arduino IDE v2 is compatible when moving from a different version or packaging format of the IDE. For example on Flathub the v1 version (https://github.com/flathub/cc.arduino.arduinoide) also uses the default folders so changing this would mean people would have to intervene on the upgrade process. Keeping this compatibility is especially important if an ARM release is made for the v2 version of the IDE as people who use Raspberry Pi's for the IDE will want to just install and upgrade their version of the IDE with as little hassle as possible.

I hope i wrote that in a clear way! Let me know your thoughts as i am interested in hearing your POV Joshua.

PS. adding the content rating is also a good idea but as the IDE doesn't technically have a content rating (or require one) this could be misleading.

EDIT: While i remember, making this change now after the release (and after people are using it) is more likely to cause more frustration and inconvenience than its worth for this change.

IverCoder commented 1 year ago

You have a good point, I think things like this are best done manually by people who want it, enabling it for everyone might be an unneeded trouble. Also, per the OARS stuff, I think Arduino's API for downloading board packages triggers the Information Sharing clause? Though please correct me if I'm wrong here.

Overall it might be good if this change is done as a paragraph in the Flathub description and as a Markdown doc detailing the procedure and other stuff, so people who want to control filesystem access get an easy tutorial, and leaving the defaults for people who are fine with it.

flathubbot commented 1 year ago

Started test build 62630

SuperNinja-4965 commented 1 year ago

You have a good point, I think things like this are best done manually by people who want it, enabling it for everyone might be an unneeded trouble. Also, per the OARS stuff, I think Arduino's API for downloading board packages triggers the Information Sharing clause? Though please correct me if I'm wrong here.

Overall it might be good if this change is done as a paragraph in the Flathub description and as a Markdown doc detailing the procedure and other stuff, so people who want to control filesystem access get an easy tutorial, and leaving the defaults for people who are fine with it.

This sounds like a good idea. Also leaving the OARS in should be fine and if there is an issue we can remove it at a later date.

IverCoder commented 1 year ago

I'll work on it on a new repo, I messed up my current fork lol

flathubbot commented 1 year ago

Build 62630 successful To test this build, install it from the testing repository:

flatpak install --user https://dl.flathub.org/build-repo/45264/cc.arduino.IDE2.flatpakref
flathubbot commented 1 year ago

Started test build 62633

flathubbot commented 1 year ago

Build 62633 was cancelled