nextcloud / cookbook

🍲 A library for all your recipes
https://apps.nextcloud.com/apps/cookbook
GNU Affero General Public License v3.0
537 stars 93 forks source link

[Feature Request] Share recipe with other nextcloud users #120

Open GambaJo opened 4 years ago

GambaJo commented 4 years ago

I would like to share my recipe for example with my wife (she has an account in our nextcloud). We don't want to have all the recipe twice.

mrzapp commented 4 years ago

@GambaJo for the time being, you can just share the folder in your recipe library with, ask her to move it to her library and then either wait a minute or rescan the library.

Either that, or just have all your recipes in a shared folder

GambaJo commented 4 years ago

@GambaJo for the time being, you can just share the folder in your recipe library with, ask her to move it to her library and then either wait a minute or rescan the library.

Either that, or just have all your recipes in a shared folder

Ok, it's a little bit "tricky" but it works. Thx.

spikusmax commented 4 years ago

HI there,

I second this request. I have people I would like to share some/all my recipes with who are not highly skilled in the tech department but very active in the cooking - my mother mostly. We are both avid cooks, but mum and I have very different cooking styles and values (I have scales that go to .01g, but she does not own a set!). So the features that I'd be keen to see would be some way for mum to be able to see my recipes, be able add her own to her own library and for me not to see her recipes (this is the issue with the shared recipe folder) unless she deliberately shares one with me, and then perhaps then I could 'Add'/copy to my library (a duplication as I may wish to modify the recipe whilst preserving her version).

Cheers,

Spike

mrzapp commented 4 years ago

@spikusmax I hadn't though about it that way before. Maybe this whole sharing business is more of a copying business.

The main bulk of this work lies in the UX. When a user shares a recipe with another user, what happens? Does the other user just receive the recipe right away, or do they have to confirm it somehow? And how would this work on federated accounts?

The above need to be answered before we move on with implementation.

drewgreat commented 4 years ago

I'd like to be able to share to non users as well. Either a single recipe or the entire thing (ideally, by tag or something too, but don't need to get too carried away). It should work the same way gallery share links do (by opening the image up). I love the app, but I was surprised to see that it was allocated to a single directory I kinda thought it would work more like the gallery app does and could be opened on any folder that contains recipes.

mrzapp commented 4 years ago

@drewgreat the general consensus is to actually move away from files towards database only storage in the future, as it makes indexing for search a lot easier.

I think we need that improvement implemented before we start working on the sharing issue, as there are probably standard ways to do this in NextCloud, which we'd want to follow

drewgreat commented 4 years ago

@mrzapp oh, thanks for that info. In that case count me out. File based storage was the thing I liked about this over any other system since I keep my files external to nextcloud and would be able to access the JSON data separately in the event of a nextcloud outage or create my own offline processor for it. If it's just going to be a database then it should be a stand alone tool. I guess I'll be keeping my recipes in word documents.

Teifun2 commented 4 years ago

I think this would be a good point to discuss the future of this project (maybe)? I think, to have the database in a file format for nextcloud is generally a good idea. The problem as already mentioned is that we have problems searching through files, as this cannot be done very effectively.

One potential idea i have (i don't know if it could work) is to use json database entries. Bot PostgreSQL and MySQL allow for columns with the type json (jsonb) and it is possible to search these entries. If this would be efficient enough for searching and inserts etc. this could be a possible solution. This would only mean wee need to check from time to time that the json in file format correlate to the json strings in the database.

This way the sync between "file storage" and "database storage" could be relatively low maintenance and we could have both systems running (aka. both advantages).

What is your thinking?

Another option would be to have the recipes only in database format and allow for regular / maybe even scheduled dump of all recipes to a specific folder in json format.

spikusmax commented 4 years ago

Hi all,

I do think that copying is the way to go in this instance, indeed the ability to do this for myself not just with other users would be desirable. Beyond the issue of me not wanting to see mum's (who is a nextcloud user) modifications with whatever overpriced supposedly healthy everything-free substitute is fancy of the month, I also frequently refine recipes, experiment with them, and would ultimately like to do this whilst preserving the original/other iterations.

Re the db vs file issue... I am not fussed really, but with my plan to add recipes from 15 years (monthly) of recipes from my Australian Gourmet Traveller magazine collection, I certainly priorities search capacities. I do like the idea of having some redundancy though (especially if a plan to ditch the hardcopies). It is less about an outage for me and more about some update/new function somehow messing up in an obscure way that isn't picked up on well beyond the last back-up (e.g. truncates all recipe directions that contain "é" which would wipe out a bunch but by no means all). Perhaps a scheduled dump of only modified recipes into said specific folder.

It might be nice at some stage to have an export function that could export to PDF or a RTF to enable sharing via email with people one does not necessarily want on one's server.

Cheers,

Spike

mrzapp commented 4 years ago

I seem to have misinterpreted the general consensus :D

I think, if we're going to store JSON data, let's stick with the files on disk, as they can double as an outage remedy without needing export from the database.

The solution to all of this might be less of a database centric rewrite and more of a revision of the indexing we already have.

@danielroehrig what's your take on this? Should we just focus on improving the search index, or is there a good reason to go full-on database (in which case we'd also need a solution for image storage)?

drewgreat commented 4 years ago

Prior to this week I hadn't had my nextcloud server running for over 1 year. When I was looking at new apps and saw the cookbook app I was excited because currently my recipes are a collection of hyperlinks (which can die, which makes me nervous), photos of recipes, word documents, txt files, and PDFs. One of my goals is to consolidate a little. Once I had nextcloud running and had the opportunity to use the app I was surprised at how it functioned. Not to detract at all from what you've done, I think it works great it just doesn't work like I had expected.

I expected that I would have to develop a folder structure to store my recipes in, for example:

/Recipes/Cakes /Recipes/BBQ /Recipes/Sweets /Recipes/Sweets/Untested

and that the cookbook app would work similar to the PDF app and allow for in browser rendering of the JSON data. I assumed if I wanted to share a recipe that all I'd have to do is share the JSON file (using built in sharing functionality) or one of the above folders. Obviously sharing the JSON file wouldn't share the images, that's not something I'd considered before.

I hadn't expected a database, or indexing, or search. I see how that could be useful, but like I said in the above post I view nextcloud (maybe wrongly) as a file storage system so the apps in it should also more or less file based. I know there are a lot of apps that don't (social, communication, mapping, etc) but this one feels to me like it could be.

Don't let my post be the sway that changes your vision for the app. Like I said at the top, I think what's here is great. But probably not for me.

seyfeb commented 4 years ago

Let me return to the topic of recipe sharing and away from how Cookbook does/should/could store the recipe information.

I would suggest to leave the decision if one wants to copy or link to an existing recipe to the users (both the one sharing and the one receiving the recipe). This is also the case when sharing, e.g., folders in Nextcloud.

1) The user sharing the recipe with another user or non-user (no account) could be allowed to choose between read & write access.

2a) If the recipe has been shared with read or write access,

2b) If the recipe has been shared with write access,

christianlupus commented 4 years ago

In fact the question how things are to be stored potentially restrict our options here. If I understand your comment right, you are concerned about if shared recipes should be saved as individual clones or linked together.

I other NC apps (and the file core module) sharing means always a link. No clones are created. It makes sense to me to stick with that semantics. Are you okay with that interpretation?

seyfeb commented 4 years ago

I see the connection, but I’m not sure this is the correct issue to discuss such a fundamental architectural decision ;) However, I totally agree, if there was an issue discussing the storage, this issue here should be linked and considered!

I think you understood me correctly, but I think I might have said even more. If I, in turn, understand you correctly this means that using the default NC behavior it is possible to share recipes with read or read&write permissions but no copies are created.

I guess, this would allow everything described in my comment above regarding 2b) (editing the original recipe for everybody) and 2a) opening the recipe for reading.

What would remain to be solved is: Can and, if yes, how do we add someone elses shared recipe to our own cookbook

christianlupus commented 4 years ago

@seyfeb see #340.

JoshuaPettus commented 3 years ago

Just my 2 cents months later, but If you were to move everything to the database level then files, it would kill the android app I love so much. After all it only works leveraging the nextcloud file system which I thought was a clever way to get around a tough problem. Not to mention it'll break some of the benefits from using nextcloud. Sharing between internal users with shared folders, ease of access to data for end user, and ease of backups This last one is huge. Granted we sysadmins know how to do a sql dump, but I've never had to restore from one, and wouldn't want to try if I didn't have too as that wouldn't just effect 1 app but the whole system. Also if I just wanted to restore a single recipe, that would be hard at the sql level. Really at that point it would be a totally different application then what we have become use to with nextcloud.

christianlupus commented 3 years ago

Just a quick result: We do not want to drop the support of the JSON files in the file system completely. Instead, we want to use the (much faster) database as a sort of caching on top of the files + a more flexible way to store additional data. So no worries about the files no longer being able to be used by 3rd party programs (this is one of the basic principles) and backup.

JoshuaPettus commented 3 years ago

Oh! That does sound like a fine plan then. Thank-you for clarifying!

Mace68 commented 3 years ago

I'd like to be able to share to non users as well. Either a single recipe or the entire thing (ideally, by tag or something too, but don't need to get too carried away). It should work the same way gallery share links do (by opening the image up). I love the app, but I was surprised to see that it was allocated to a single directory I kinda thought it would work more like the gallery app does and could be opened on any folder that contains recipes.

If I'm understanding correctly perhaps sharing to non Nextcloud users could be an automated 'convert the printed format to PDFs followed by a share by email' process. Just a thought.

seyfeb commented 3 years ago

This could be one way of sharing recipes with others. Although in the sense of sharing other nextcloud resources publicly, sharing means via a link. (I.e., make the recipe page publicly available) Improved sharing with other NC users means sharing with an arbitrary number and also managing access permissions (read write), etc

xundeenergie commented 3 years ago

My first thougts on this app were: Cool... and Import works great! I want to share my recipies with my wife... oh wait.

My personally wishes for this app are:

1) Group recipies in different "Cookbooks" 2) Make each Cookbook extra shareable with other users or the public. 3) "other users" are users on the same nextcloud-instance and via federated id from other instances and even via email and "shared Link". The same i can share files from nextcloud.

seyfeb commented 3 years ago

Thank you for adding your required features. Currently sharing with other users is only possible by sharing a folder as shown here. So, at least, you could have a shared cookbook with your wife! Hopefully, one day we will have fully-fledged sharing options!

hydrian commented 2 years ago
  • as a link (files remain in the creators folder, edits will be seen by everybody)?

With an unauthenticated link, any person who has the URL could edit the recipe and add nasty stuff, (XSS, exploits, etc.). Unauthenticated access should only have read-only access and features based on read-only access available. If you want edit access to the recipe, I think authentication should be required.

seyfeb commented 2 years ago

Hello hydrian, thanks for your input! Linking the recipe of another user of your Nextcloud instance into your own cookbook would require the other user to be authenticated with the Nextcloud instance anyway. Otherwise there would be no cookbook and no recipe to be linked in the first place!

hydrian commented 2 years ago

@seyfeb Sorry, I forgot this request was only for already existing nextcloud users.

I'd love to see a way to share unauthenticated users read-only links with the recipe web UI instead of the raw JSON.

christianlupus commented 2 years ago

@hydrian there is another issue related to public sharing. I think it is in #392. (Sorry, I am abroad at the moment)

VincentMeilinger commented 9 months ago

I think this was described similarly before, but I think a quite intuitive solution could be the following: Allow the Cookbook app to accept multiple recipe folders/databases from different users as recipe sources.

This would be quite flexible, as a single user could even own multiple folders with different access permissions. The approach would be kind of similar to a 'federated' recipe cloud, and this concept could be expanded to support federated Nextcloud instances as well.

I have no experience in developing for Nextcloud and Nextcloud Cookbook, so I cannot tell how feasible this is. The ideas listed here are a continuation of some comments above.