FossifyOrg / Calendar

A simple calendar with events, customizable widgets and no ads.
https://www.fossify.org
GNU General Public License v3.0
660 stars 53 forks source link

Better selection of backup location #101

Open mpldr opened 7 months ago

mpldr commented 7 months ago

Checklist

Feature description

When selecting a backup-location it is not possible to just add an existing directory to the storage locations.

As an example, I want my Backups in /storage/emulated/0/Backups/Calendar/. /storage/emulated/0/Backups/ already exists. I now can't add the subdirectory, as I simply can not select it.

Why do you want this feature?

I am backing up my stuff with syncthing and, for this purpose, have the aptly named Backup directory, where all the backups are stored and then synchronised with my other devices.

Additional information

No response

mpldr commented 7 months ago

This also affects the other apps, it's just that the calendar is where it is most urgent for me.

Aga-C commented 7 months ago

Actually, it seems to be a bug. I have no problem with adding a subdirectory and setting backup there. Can you add details about your phone model and OS version?

Please also check if you can do this in other paths, not managed by Syncthing.

mpldr commented 7 months ago

On Wed 24 Jan 2024 13:29:52, Agnieszka C wrote:

Actually, it seems to be a bug. I have no problem with adding a subdirectory and setting backup there. Can you add details about your phone model and OS version?

Android 14 (GrapheneOS), Pixel 5

Please also check if you can do this in other paths, not managed by Syncthing.

I can not. I'll provide a screencast, maybe that helps with illustrating :)

-- Moritz Poldrack https://moritz.sh Official sponsor of the letter @

For office use only.

mpldr commented 7 months ago

Here's the promised screencast. Unfortunately too large for GitHub: https://0x0.st/HGpU.mp4

Aga-C commented 7 months ago

Thanks for sharing the screencast!

I have to admit, that's strange - I tested on two different phones (both with stock Android 13) and emulator (Android 14) and in this view I have this view, so I can select anything:

I suppose it may be related to GrapheneOS or custom ROMs in general. Can anybody else confirm this bug?

mpldr commented 7 months ago

This might be related to some hardening done by Graphene… I'll poke around in the settings a bit.

mpldr commented 7 months ago

Couldn't find anything I could toggle. Since one has to grant access manually anyways, why not just use the system prompt, though?

naveensingh commented 7 months ago

@mpldr It does seem like a GrapheneOS security feature. Hopefully, other GrapheneOS users will confirm this. Normally, the app would be able to see the "Internal/Backups" directory but not its content.

Since one has to grant access manually anyways, why not just use the system prompt, though?

I agree. This needs to be reworked using SAF directly so the users can pick whatever directory they want.

In your particular case, as a workaround, I think you can tinker around with storage scopes to grant Fossify Calendar access to the Internal/Backups directory which was created by Syncthing. You can find more info at https://discuss.grapheneos.org/d/1935-how-do-i-enable-storage-scopes and https://grapheneos.org/usage#storage-scopes. If that doesn't work, then consider using another directory like Internal/Calendar until this is fixed.

min7-i commented 7 months ago

I tested it on GrapheneOS and I could select the following directories as a location for automatic backups: Internal\Download and Internal\Android\media. It was also possible to create new folders in those directories and in Internal.

However, I couldn't select any other existing directory.

I think you can tinker around with storage scopes to grant Fossify Calendar access to the Internal/Backups directory...

Storage Scopes can only be used when an app requests file permissions. As this is not the case with Fossify Calendar storage scopes are not available for this app in GrapheneOS.

genodeftest commented 6 months ago

Since this issue seems to be specific to GrapheneOS, how about adapting the title to include that information?

mpldr commented 6 months ago

Since this issue seems to be specific to GrapheneOS, how about adapting the title to include that information?

While the specific issue that prompted the suggestion is specific to GrapheneOS, the suggestion itself very much isn't. I do think it would overall help very much with focussing development efforts to not maintain a file picker when one is already provided by the OS.

mpldr commented 6 months ago

It might be an idea to move this issue to common though, as it also happens with the other apps.

serrq commented 3 months ago

Your file picker doesn't see my other "volume" created with Anemo app.

Please turn to another file picker or repair this one.

mpldr commented 3 months ago

On Wed 29 May 2024 04:43:00, serrq wrote:

Please turn to another file picker or repair this one.

Personally, I'd prefer using the one integrated into the system.

-- Moritz Poldrack https://moritz.sh

Keep out of the sunlight.

serrq commented 3 months ago

Personally, I'd prefer using the one integrated into the system.

Yes, it is called SAF if I don't wrong.