scubajeff / lespas

Les Pas, photo album app for Nextcloud user
Apache License 2.0
447 stars 22 forks source link

Allow picking a different Nextcloud folder #3

Closed icewind1991 closed 1 year ago

icewind1991 commented 3 years ago

I would like to use this app to show my existing image gallery I have stored in my Nextcloud, limiting the app to only use the /lespas folder seems needlessly restrictive.

scubajeff commented 3 years ago

agree. an option to customize home folder can be a useful feature. and cosidering sharing to other Nextcloud user, this folder might need to be a group filer too. all these are in the planned roadmap. but right now, i'm working on integrating with Snapseed for photo editing. so stay tuned.

On dim., 27 déc. 2020 à 9:30 AM Robin Appelman a écrit :

I would like to use this app to show my existing image gallery I have stored in my Nextcloud, limiting the app to only use the /lespas folder seems needlessly restrictive.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub [https://github.com/scubajeff/lespas/issues/3], or unsubscribe [https://github.com/notifications/unsubscribe-auth/AADP2MDB7GTM5RWZPBFJIBTSWYVNJANCNFSM4VKD2G2A] .[https://github.com/notifications/beacon/AADP2MGAI4ODWVHAPPGT3E3SWYVNJA5CNFSM4VKD2G2KYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4LRQJNWQ.gif]

[https://api.criptext.com/email/open/%3C1609032952099.890441%40criptext.com%3E]

Happyfeet01 commented 3 years ago

Any updates to this feature?

scubajeff commented 3 years ago

This one is pretty outdated. By using some other APIs, Les Pas now support sharing albums within Nextcloud users and groups, and even offer feature like joint album for a group of users to edit simutaneously.

As for preference of home folder name, one can always use symlink.

lmgarret commented 3 years ago

Hi @scubajeff! Actually I don't think you can use symlinks with Nextcloud, all the threads I could find mentionned that it was disabled for security reasons.. Personnally I'm still waiting on this to try LesPas, as I have all my photos stored in other nested dirs that are already shared with different people (so that they can share theirs and see the others'). So unfortunately, using lespas dir or a symlink is not an option here for me :/

armaccloud commented 3 years ago

Same for me, I am waiting for this functionality to be implemented before I can use LesPas. Looking forward to it.

scubajeff commented 3 years ago

That's weird. In my testing environment, self-hosted Nextcloud 21.0.4 on Raspberry Pi 3B, I symlink Photos/ folder to lespas/nextcloud/ without any problems.

Can anybody give me some more hints of why symlink is not possible? No root access? Files in another partition?

sunjam commented 3 years ago

are you using the external storage app? I use that to define directories.

On Tue, Aug 31, 2021, 4:46 PM scubajeff @.***> wrote:

That's weird. In my testing environment, self-hosted Nextcloud 21.0.4 on Raspberry Pi 3B, I symlink Photos/ folder to lespas/nextcloud/ without any problems.

Can anybody give me some more hints of why symlink is not possible? No root access? Files in another partition?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/scubajeff/lespas/issues/3#issuecomment-909735234, or unsubscribe https://github.com/notifications/unsubscribe-auth/AANUKZTL3RW4ZYVUILVAYH3T7VSUBANCNFSM4VKD2G2A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

scubajeff commented 3 years ago

What is external storage app? a nextcloud app?

lmgarret commented 3 years ago

TBF I haven't personally tested symlinks, I only read that it wasn't (supposed to be ?) supported in the forums. I'll check when I have time how it behaves in my system :)

rgarisson commented 2 years ago

Hi @scubajeff , I am discovering Les pas and how it's meant to be used. I would love to switch to it but as the others say I would need the possibility to change the main folder, not just to use symlinks. I liked to have my folders organised, not just my photos, and having a "les pas" and a "DCIM" folders at the root of my nexcloud server is a no go for me. Is it technically possible and is it a feature you are planning to add ? Thanks !

scubajeff commented 2 years ago

As they said, impossible is nothing. Although I'm still not convinced this is such a show stopper. And yes, it needs some careful and time consuming code refactoring.

rgarisson commented 2 years ago

I understand. if you don't have/see the interest, it's would be painfull to rewrite your app. But still, it was the second issue raised and the most discuted. Whatever you choose is fine tho.

ghost commented 2 years ago

For me, while symlinks are possible, I would like to keep the remote root folder as clean as possible. I looked at the code a bit, would making the lespas_base_folder_name a setting under the Storage category be enough? (no folder selector, just type the path). Or is it more complex than just doing that? (e.g. would it break sharing?)

scubajeff commented 2 years ago

This can not be a setting that user can change all the time, things like published album and sync might break.

ElucGeek commented 2 years ago

Hello, the app looks really amazing but I'm in the same boat as many here, I don't think I will use it if I cannot select the target folder on my Nextcloud. I have already a Photos folder shared with other Nextcloud users as well as some album folders shared with external and it would be great if we can continue to use them without a complete migration and new sharing of links.

By the way is it intended for multiple users? If we are 2-3 to sync to a shared folder (let's say I share the folder "lespas" with another users on my Nextcloud, can he setup Les Pas and it will get photos from the shared folder already with the name "lespas"?

scubajeff commented 2 years ago

@ElucGeek Lespas manages three folders on server

Lespas follows NC's rules to do sharing on server. NC dumps all your received shares in the same folder, and as you may already know, if you shared a file and then rename the file, the receiver will not see the name change. That why allowing app root folder name change is kind of tricky, especially in a multi-user environment.

ElucGeek commented 2 years ago

Thanks for the details. Until now I have a photos folder shared with other users and they can edit any files, including names, within the folder and sub folder. Only the share name can be changed and is not reflected.

According to your answer, I guess Lespas is only a solution for single user environment. Too bad.

-------- Original Message -------- On Jun 5, 2022, 10:12, scubajeff wrote:

@.***(https://github.com/ElucGeek) Lespas manages three folders on server

  • DCIM/for backup of your phone's camera
  • lespas/ the place to store your albums
  • shared_with_me folder which actual name is specified in your NC config for all the share you get from other users Lespas follows NC's rules to do sharing on server. NC dumps all your received shares in the same folder, and as you may already know, if you shared a file and then rename the file, the receiver will not see the name change. That why allowing app root folder name change is kind of tricky, especially in a multi-user environment.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

scubajeff commented 2 years ago

Well, LesPas is far from perfect. It can't fit in all use cases. I can't say I feel bad if it doesn't work out for yours. Wish you every luck of finding a perfect alternative. Meanwhile, I'm sharing photos with my family in my not so multiuser environment, and I'm really enjoying it.

ruffson commented 2 years ago

Well, LesPas is far from perfect. It can't fit in all use cases. I can't say I feel bad if it doesn't work out for yours. Wish you every luck of finding a perfect alternative. Meanwhile, I'm sharing photos with my family in my not so multiuser environment, and I'm really enjoying it.

I understand that you are making it work for your use case and I am sure a lot of other people find it very useful as well. It is just odd to me that you would hard-code the folder name and not just let the user set the path and then you go with that instead.

A third-party add-on requiring the user to change their data directory path instead of configuring the add-on is just bad style IMO. Especially since the hard-coded path is not the default Nextcloud path for photos but add-on specific.

Having said that, although I will not use it myself dur to this issue I am very grateful for the work you have put into this. It looks great on the screenshots and fills a niche that is left open by the very lacking Nextcloud photo app.

scubajeff commented 2 years ago

@ruffson As you might notice, Lespas doesn't have any server end app (the reason is simply that I don't have skill on php). So all I can do is to strictly use file system folder structure to organize photos (though this happen to be one of my intents too) and follow NC api to do everything on server.

When it comes to sharing, NC dump every shares a user got to a single folder, so Lespas needs to find out those belongs to it among them. And the way to do this is by matching folder name. When user change the root folder to something else, NC won't populate the name change to those share receivers. The next time user create a new share, that new one will carry the new root folder name. Now at receiver end, Lespas will have a hard time figuring out which one is which.

Tracking changes like this require a lot of change to the code base than merely adding a setting preference, and probably won't happen without a server end app.

madranet commented 2 years ago

Another obvious use case for being able to select the upload folder is when your Nextcloud uses external storage. I have my Nextcloud setup to use an Amazon S3 bucket as external storage and I want to backup my photos and videos to that. The actual server the Nextcloud s running on only has about 10GB free space, whereas the Amazon S3 bucket capacity is essentially unlimited.

Unfortunately it's another "me too" here. I was excited to discover Les Pas, after being frustrated with the official Nextcloud app where photo sync doesn't work at all. But with no option to set the destination folder for uploads, I can't use it.

scubajeff commented 2 years ago

@madranet I saw your review on google play too. Thank you for reporting here, since this is a much comfortable place to follow up issues.

Your use case sounds very reasonable. But I don't have any experience with external storage. Is it a mounted folder in your home folder, and you want lespas/ and DCIM/ sit in there?

madranet commented 2 years ago

@scubajeff I must admit I don't have much experience of NextCloud's 'external storage' myself either. I only happen to have a NextCloud running as it comes bundled with a MIAB server I set up and I only configured 'external storage' yesterday, to see if I could use my NextCloud as a conduit to backup my photos to Amazon S3 [trying to move all my 'stuff' off Google].

Assuming you're an Admin on your NextCloud, look under 'Apps' in the menu under your username...

SS 2022-09-25 at 10 55 16

And you'll find an option for 'External Storage Support'. I had to enable it on my NextCloud setup. It wasn't enabled by default...

SS 2022-09-25 at 10 50 15

Once enabled in Apps, go back to your user settings and you'll see an 'External Storages' option...

SS 2022-09-25 at 11 06 23

There you'll find several options for types of external storage you can add...

SS 2022-09-25 at 10 51 32

Now you can spend many a happy hour trying to make sense of NextClouds piss-poor documentation to try and get it successfully configured [or was that just me?]...

SS 2022-09-25 at 11 18 56

When [if!] you eventually get it setup properly, the external storage [in my case Amazon S3] appears as another folder in the root of your NextCloud...

SS 2022-09-25 at 11 21 09

As I said above, I think this would be a pretty common use case for Les Pas / NextCloud. If you could enable us to choose our own destination folder on the NextCloud server. Many people run NextCloud instances on small servers or hardware such as Raspberry Pis, with limited storage, so availing of external storage is pretty much essential.

scubajeff commented 2 years ago

@madranet Are you using that folder just like the others? Do you need to enter credential when you access it? What's the path name of it? Is 'AmazonS3' a fixed default name or just so happen you created it like that? Can you rename it after you created it?

madranet commented 2 years ago

Are you using that folder just like the others?

Well, I'm not using it at all at the moment, as I only created it with a view to backing up my Android photos to S3 but...

Do you need to enter credential when you access it?

No. The credentials are filled in on the setup dialogue [see above screengrab] They're the two boxes just below where it says 'Legacy (V2) Authentication'. In Amazon S3's case with an Access Key and Secret Access Key. Once connected. I can access the folder without having to fill in any credentials

What's the path name of it?

I get a URL of <my iNextCloud domain>/index.php/apps/files/?dir=/AmazonS3

Is 'AmazonS3' a fixed default name or just so happen you created it like that?

That was the default name, but I could have changed it during setup. Again in the setup dialogue screenshot above, you can see it to the right of the green tick. I just left it as the default.

Can you rename it after you created it?

No. Nor move it or delete it [without first removing it as External Storage from the Admin settings]. All of which makes sense as I'm sure that would really mess up the syncronisation.

External Storage folder...

SS 2022-09-25 at 14 39 13

Normal folder...

SS 2022-09-25 at 14 39 21

scubajeff commented 2 years ago

This

/index.php/apps/files/?dir=/AmazonS3 makes me uncomfortable.

If you have root access to your nc instance, can you find out what is now in your home folder? Is that S3 storage being mounted there? Can you simply cd into it?

scubajeff commented 2 years ago

@madranet I read some documents on External Storage and from the screenshot you posted, there is a 'Folder Name' field in the external storage creation screen, can you help to confirm that there really is a folder named 'AmazonS3' in your home directory after you linked this external storage? And when you cd into it, you can list all the files you stored in it?

madranet commented 2 years ago

I can see the created directory when I browse my NextCloud through the web GUI or the NextCloud app. and interact with it like any other folder [except, as above, I can't move/rename or delete it]. However I can't even see that directory when I ls my NextCloud files in a terminal...

SS 2022-09-25 at 15 10 54

So I don't know what that means. Is NextCloud presenting it as a directory in the GUI but internally treating it as something else?.... or is the External Storage directory stored elsewhere than in my user folder?

I'm not familiar with NextCloud's directory structure to know where else to look and [as I said above] this NextCloud instance came bundled with a MailInABox install. So it may not even follow a default layout.

scubajeff commented 2 years ago

If it's not in ls result list, that would make thing really complicated. File access needs to go through some fancy virtual file system of NC. I will do some math first, see if NC provides WebDAV access to it.

scubajeff commented 2 years ago

I added a SFTP external storage and confirmed that it can be read/updated with WebDAV just like the other folders. So setting up lespas's home folder and camera backup folder in external storage home folder CAN be done. I need some more time to check out the file sharing API compatibility, but pretty sure that it will work too as long as Enable sharing option has been ticked

So this is what to be expected in future version: After authenticating lespas against NC server, a dialog will be shown for user to choose a folder from the server. The choice will be used as the base directory when lespas/ and DCIM/ will stay in. Once this choice has been made, user will have no way to change this location.

madranet commented 2 years ago

Sounds Good. I'll look forward to that.

scubajeff commented 2 years ago

Depends on the link speed to your external third party storage, it might be pretty slow for graphic app like lespas.

sunjam commented 2 years ago

True, external storage tends to be less responsive, but it depends on the particular setup.

BettaGeorge commented 2 years ago

I added a SFTP external storage and confirmed that it can be read/updated with WebDAV just like the other folders. So setting up lespas's home folder and camera backup folder in external storage home folder CAN be done. I need some more time to check out the file sharing API compatibility, but pretty sure that it will work too as long as Enable sharing option has been ticked

So this is what to be expected in future version: After authenticating lespas against NC server, a dialog will be shown for user to choose a folder from the server. The choice will be used as the base directory when lespas/ and DCIM/ will stay in. Once this choice has been made, user will have no way to change this location.

Very happy this is finally happening. It's basically the only reason why I don't really use lespas.