WebDav Storage backend #1162

Merged
nupplaphil merged 8 commits from feat/webdav_storage into develop 2021-10-05 20:42:05 +02:00
nupplaphil commented 2021-08-25 23:51:20 +02:00 (Migrated from github.com)

This a first cut for a WebDav Storage backend.

But I do need some additional business logic for creating DAV-collections for embedding files in them (I don't know webdav enough yet ;-) )

Needs https://github.com/friendica/friendica/pull/10637 and https://github.com/friendica/friendica/pull/10825 first

Functionality:

  • GET data from WebDav endpoint
  • PUT data to WebDav endpoint
  • DELETE data from WebDav endpoint
  • Recursively create directories for WebDav Endpoint
  • Recursively delete directories in case no element is left

ToDos:

  • Finalize functionality
  • Try to add tests ...
  • Try with other endpoints than my own Nextcloud :-D
  • Try it at my Friendica service
This a first cut for a WebDav Storage backend. But I do need some additional business logic for creating DAV-collections for embedding files in them (I don't know webdav enough yet ;-) ) Needs https://github.com/friendica/friendica/pull/10637 and https://github.com/friendica/friendica/pull/10825 first Functionality: - [x] GET data from WebDav endpoint - [x] PUT data to WebDav endpoint - [x] DELETE data from WebDav endpoint - [x] Recursively create directories for WebDav Endpoint - [x] Recursively delete directories in case no element is left ToDos: - [x] Finalize functionality - [x] Try to add tests ... - [ ] Try with other endpoints than my own Nextcloud :-D - [x] Try it at my Friendica service
annando commented 2021-08-26 06:48:32 +02:00 (Migrated from github.com)

Would it be possible to eventually extend this to be selectable via a user as well? So that individual users could select their own WebDAV storage?

Would it be possible to eventually extend this to be selectable via a user as well? So that individual users could select their own WebDAV storage?
nupplaphil commented 2021-08-26 08:08:28 +02:00 (Migrated from github.com)

The backend adapter would be the same, I guess we have to adapt the way how we save data per user. Since we already save the class-name in each table entry, I would say yes but with some additional logic at some core classes :)

The backend adapter would be the same, I guess we have to adapt the way how we save data per user. Since we already save the class-name in each table entry, I would say yes but with some additional logic at some core classes :)
MrPetovan commented 2021-08-26 17:21:52 +02:00 (Migrated from github.com)

Uuuuh, I feel like I have to put my foot down here, having per-user backend configuration would not only bring extreme complexity in an already sensitive area, but it would impact performance as well as users would connect with variously-powered WebDAV backends.

My opinion is that if a Friendica user knows about WebDAV and has their own server, they also can and probably should run their own Friendica node as well.

Uuuuh, I feel like I have to put my foot down here, having per-user backend configuration would not only bring extreme complexity in an already sensitive area, but it would impact performance as well as users would connect with variously-powered WebDAV backends. My opinion is that if a Friendica user knows about WebDAV and has their own server, they also can and probably should run their own Friendica node as well.
AlfredSK commented 2021-08-26 19:31:16 +02:00 (Migrated from github.com)

I think if we would provide some cloud storage feature it would make sense to let users add their own external storage (WebDAV, S3, ...) But we don't have such a feature and it would be out of the scope of Friendica. So, I think it's sufficient to have additional storage backends on node level (admin only).

I think if we would provide some cloud storage feature it would make sense to let users add their own external storage (WebDAV, S3, ...) But we don't have such a feature and it would be out of the scope of Friendica. So, I think it's sufficient to have additional storage backends on node level (admin only).
MrPetovan commented 2021-08-26 19:49:55 +02:00 (Migrated from github.com)

The Filesystem backend allows for cloud storage but I still think it's a mistake to allow individual users to set their own backend. It would create new and interesting issues that these users wouldn't be able to troubleshoot themselves without involving their node admin.

The Filesystem backend allows for cloud storage but I still think it's a mistake to allow individual users to set their own backend. It would create new and interesting issues that these users wouldn't be able to troubleshoot themselves without involving their node admin.
MrPetovan (Migrated from github.com) reviewed 2021-08-30 17:43:49 +02:00
nupplaphil (Migrated from github.com) reviewed 2021-08-30 19:50:53 +02:00
MrPetovan (Migrated from github.com) reviewed 2021-08-30 20:07:56 +02:00
nupplaphil (Migrated from github.com) reviewed 2021-08-30 20:10:49 +02:00
nupplaphil commented 2021-09-07 20:44:53 +02:00 (Migrated from github.com)

OK, I tried it locally and the unit tests ran fine .. It should work, but I'm a little bit unsure gg .. I will add another dev-instance and try it for some time with full logs :D ..

Edit: I don't currently know what's happening to the test :D

OK, I tried it locally and the unit tests ran fine .. It **should** work, but I'm a little bit unsure *gg* .. I will add another dev-instance and try it for some time with full logs :D .. Edit: I don't currently know what's happening to the test :D
MrPetovan (Migrated from github.com) reviewed 2021-09-07 22:57:02 +02:00
nupplaphil (Migrated from github.com) reviewed 2021-10-02 23:20:57 +02:00
MrPetovan (Migrated from github.com) reviewed 2021-10-03 00:29:55 +02:00
nupplaphil commented 2021-10-03 19:54:29 +02:00 (Migrated from github.com)

It's still working .. not errors so far, every picture appears at the timeline and private posting works as well :X ...
I deleted a picture as well and the files including preview and the empty folder got deleted as well ..

I believe I will set it "ready for review" after adding the feedback of @MrPetovan ...

@annando / @MrPetovan / @tobiasd - any suggestions for tests?
What I did:

  • Upload a photo and add it to a post
  • Upload a photo and add it to a comment
  • Edit a photo
  • Delete a previously uploaded photo
It's still working .. not errors so far, every picture appears at the timeline and private posting works as well :X ... I deleted a picture as well and the files including preview and the empty folder got deleted as well .. I believe I will set it "ready for review" after adding the feedback of @MrPetovan ... @annando / @MrPetovan / @tobiasd - any suggestions for tests? What I did: - [x] Upload a photo and add it to a post - [x] Upload a photo and add it to a comment - [x] Edit a photo - [x] Delete a previously uploaded photo
nupplaphil (Migrated from github.com) reviewed 2021-10-03 19:59:12 +02:00
MrPetovan (Migrated from github.com) reviewed 2021-10-03 21:27:26 +02:00
nupplaphil (Migrated from github.com) reviewed 2021-10-04 00:47:48 +02:00
tobiasd commented 2021-10-04 08:30:40 +02:00 (Migrated from github.com)

I have no real usable idea for how to test it under stress situations for the server. I think that would be interesting, how the performance compares for "big" nodes.

I have no real usable idea for how to test it under stress situations for the server. I think that would be interesting, how the performance compares for "big" nodes.
annando commented 2021-10-04 13:02:47 +02:00 (Migrated from github.com)

Concerning this "individual credentials" thing: I have the idea of combining Nextcloud with Friendica. This means that one could then login to Nextcloud via Friendica (or vice versa?). Pictures would be uploaded to the personal Nextcloud storage and could then be accessed by Friendica via WebDAV.

Concerning this "individual credentials" thing: I have the idea of combining Nextcloud with Friendica. This means that one could then login to Nextcloud via Friendica (or vice versa?). Pictures would be uploaded to the personal Nextcloud storage and could then be accessed by Friendica via WebDAV.
nupplaphil commented 2021-10-05 10:19:07 +02:00 (Migrated from github.com)

Latest branch is working as well including the new Config class
--> here we go :-) Ready for Review

Don't forget https://github.com/friendica/friendica/pull/10825 beforehand

Latest branch is working as well including the new Config class --> here we go :-) Ready for Review Don't forget https://github.com/friendica/friendica/pull/10825 beforehand
MrPetovan commented 2021-10-05 15:33:38 +02:00 (Migrated from github.com)

Don't forget friendica/friendica#10825 beforehand

I've reviewed this PR and requested several changes, I'm waiting for your input.

> Don't forget [friendica/friendica#10825](https://github.com/friendica/friendica/pull/10825) beforehand I've reviewed this PR and requested several changes, I'm waiting for your input.
MrPetovan (Migrated from github.com) approved these changes 2021-10-05 20:42:00 +02:00
Sign in to join this conversation.
No description provided.