Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Nextcloud a great image hosting/upload service #2523

Closed
eppfel opened this issue Dec 5, 2016 · 41 comments · Fixed by #6599
Closed

Make Nextcloud a great image hosting/upload service #2523

eppfel opened this issue Dec 5, 2016 · 41 comments · Fixed by #6599
Assignees
Labels
1. to develop Accepted and waiting to be taken care of design Design, UI, UX, etc. enhancement feature: files feature: sharing
Milestone

Comments

@eppfel
Copy link
Member

eppfel commented Dec 5, 2016

@jospoortvliet mentioned in #1472 it would be nice to serve images directly from Nextcloud to embed them in forums/github/etc.

Besides the image preview generated by Nextlcoud, there is the, not so obvious, direct /download shortcut you can add to share links:

So this:

![Test picture of Khao Sok National Park, Thailand](https://epp.cloud/s/HBXk2Hy9BkW0GTc/download)

Creates this:

![Test picture of Khao Sok National Park, Thailand](https://cloud.githubusercontent.com/assets/1899308/20925855/9d086ff6-bbb9-11e6-9995-fcc0ad570c28.jpg)

But the file is just downloaded by github, instead of directly served by my cloud. Embedding in HTML does not work this way.
Edit: The file is downloaded each time, but served from a github domain https://camo.githubusercontent.com/521c7650d7f562c307edee29b2366e98ce7249bf/68747470733a2f2f6570702e636c6f75642f732f4842586b32487939426b57304754632f646f776e6c6f6164. Problem now is, that my activity feed is flooded. Removed the direct link.

Maybe we could create something like:

https://epp.cloud/s/HBXk2Hy9BkW0GTc/preview

or even with image resize:

https://epp.cloud/s/HBXk2Hy9BkW0GTc/720p

From users POV this would need to be possible without fiddling with the url itself. @nextcloud/designers

@nextcloud/sharing Thoughts?

@eppfel eppfel added 0. Needs triage Pending check for reproducibility or if it fits our roadmap design Design, UI, UX, etc. enhancement feature: files feature: sharing labels Dec 5, 2016
@rullzer
Copy link
Member

rullzer commented Dec 6, 2016

Creating such an URL should be doable. But I have no idea how to do the US there.

@MorrisJobke
Copy link
Member

MorrisJobke commented Dec 6, 2016

This is done by intention. Serving the content as inline content would allow XSS attacks. To properly do this we should serve raw content from a different domain. (Like the githubusercontent domain here on Github)

Cc @LukasReschke

@LukasReschke
Copy link
Member

LukasReschke commented Dec 6, 2016

Correct. We need a separate domain or only allow this for images that we have re-encoded. (e.g. passed through our preview class)

@LukasReschke
Copy link
Member

So a preview endpoint sounds sane to me - but what is the expected behaviour if we can't generate one? Error message? File icon?

@rullzer
Copy link
Member

rullzer commented Dec 6, 2016

just a 404?

@jm-andonegi
Copy link

Hi:
Could it be possible to apply something similar to HTML files so that we could serve static websites?

@LukasReschke
Copy link
Member

LukasReschke commented Dec 6, 2016

Could it be possible to apply something similar to HTML files so that we could serve static websites?

That is not possible for security reasons without having a usercontent domain as @MorrisJobke in #2523 (comment) pointed out. Even then, I highly doubt that we're going to do that for phishing protection etc…

@eppfel eppfel added 1. to develop Accepted and waiting to be taken care of and removed 0. Needs triage Pending check for reproducibility or if it fits our roadmap labels Dec 6, 2016
@jm-andonegi
Copy link

And could it be possible to replicate the content in a public folder of the server and offer the user the public link?

@jancborchardt
Copy link
Member

So there is absolutely no other way to do this? Because then a normal person just installing their Nextcloud on shared hosting or such can’t really be expected to configure another subdomain just for image embedding. :\

@LukasReschke
Copy link
Member

So there is absolutely no other way to do this? Because then a normal person just installing their Nextcloud on shared hosting or such can’t really be expected to configure another subdomain just for image embedding. :\

As long as we re-encode images that is fine, see #2523 (comment). But we can't serve user content directly without any re-encoding. Thus this will only work for some limited file types, basically those that we can preview already.

@jospoortvliet
Copy link
Member

@LukasReschke well that does cover the most important file types, images in particular.

@jm-andonegi
Copy link

But the public folder could be created in the installation process and a subfolder could be created by the system for each user (or just for some users with public publishing priviledges). The copy would be managed by the local external storage mechanism and the system could offer public link (right click menu).

@eppfel
Copy link
Member Author

eppfel commented Dec 6, 2016

@jm-andonegi I think the discussion shows, this is a different topic. I think there was already a similar request in another issue. Please search for it or open a new issue, so we can focus on the image previews here. Thx 😉

@jm-andonegi
Copy link

Sorry. Just thought both needs could be solved the same way.

I didn't find any issue about HTML files so I opened a new one here.

@jancborchardt
Copy link
Member

Totally agree with @jospoortvliet:

will only work for some limited file types, basically those that we can preview already.

This is completely fine. Takes care of bitmap images and even some other things.

@Cerberus-tm
Copy link

Seafile allows direct links to files (like JPG and CSS), from the same domain. Does that mean it is vulnerable? In what kind of scenario should I be worried about this?

@LukasReschke
Copy link
Member

Seafile allows direct links to files (like JPG and CSS), from the same domain. Does that mean it is vulnerable? In what kind of scenario should I be worried about this?

I don't comment on Seafile security but I'd encourage them to seriously reconsider doing this. Also it wouldn't be the first time that we've found a vulnerability in Seafile: https://seacloud.cc/group/3/wiki/security-records

But honestly, I don't have any time to look in detail at Seafile security.

@Cerberus-tm
Copy link

@LukasReschke Oh, yes, I'm sorry, I didn't mean it that way. I was just wondering whether any kind of service that allows direct file links is insecure. And I was wondering in what kind of situation this might be exploited in practice.

@shyamal890
Copy link

shyamal890 commented May 9, 2017

It would be great to have this feature in Nextcloud. This feature is already available in Google drive, Dropbox.

Direct link to image in dropbox: Append the url with ?raw=1

Direct link to image in Google Drive: https://drive.google.com/uc?export=view&id={fileId}

@drjagan
Copy link

drjagan commented May 23, 2017

Actually, it would be good to look into the oEmbed specs for this purpose.

oEmbed is a format for allowing an embedded representation of a URL on third party sites. The simple API allows a website to display embedded content (such as photos or videos) when a user posts a link to that resource, without having to parse the resource directly.

oEmbed Github

@X4LD1M0
Copy link

X4LD1M0 commented Aug 2, 2017

It feels this feature has been pushed in the background. I was wondering what the current status and where it is currently on the roadmap.

@jospoortvliet
Copy link
Member

@io-node 90% of efforts right now are still focused on bugfixing, making 12.0.1 as good as possible. I guess around the conference efforts will move to shiny new things like this...

@Happyfeet01
Copy link

What is the roadmap about this feature? Would be nice if this worked. Easier sharing Gallery to my Wordpress Blog.

@jospoortvliet
Copy link
Member

@Happyfeet01 from what I can tell this isn't a customer requirement so it depends on somebody willing to put in his/her free time. And until somebody steps up to do that, the ETA is essentially infinite :(

I had hoped we'd have some time at the conf and maybe somebody did but I didn't discuss it with anyone...

@rullzer rullzer mentioned this issue Sep 21, 2017
1 task
@jancborchardt
Copy link
Member

Pull request at #6599, everyone please review. :)

@Nottt
Copy link

Nottt commented May 2, 2018

Any news on this?

I want to serve a .json file directly with a url that ends like this https://nextcloud.com/file.json. Is it possible ?

Example: http://softwarebakery.com/apps/drivedroid/repositories/main.json

@SlavikCA
Copy link

SlavikCA commented May 2, 2018

@Nottt This is closed issue. What kind of news do you expect?

By the way, hosting files on the same domains, as NextCloud may be security issue.

You can always have related domain / subdomain, and configure Apache / Nginx / ... to point to one of your data (sub)folder in NextCloud and enable Indexes for that location.

@4nd3r
Copy link

4nd3r commented May 2, 2018

You can always have related domain / subdomain, and configure Apache / Nginx / ... to point to one of your data (sub)folder in NextCloud and enable Indexes for that location.

not really, since nextcloud (by default) modifies access bits of data folder (to 770):

chmod($dataDirectory, 0770);

unless you are running httpd as same user as your php process, which is usually bad idea.

tho, looks like you can turn it off using check_data_directory_permissions config option.

YMMV, of course. and sorry for spamming in closed issue.

@jcklpe
Copy link

jcklpe commented Dec 9, 2018

Has the work on this feature been dropped? It seems to me like it would be super valuable. I've been using github gists to sync some custom css styling for Vscode but every time I change I have to change the url and stuff in my settings.json. I used to have it pointed to the local version of the file but that became a problem when switching between linux windows environments that didn't necessarily have the same local path.

@kesselb
Copy link
Contributor

kesselb commented Dec 9, 2018

Has the work on this feature been dropped?

No. This feature request was about "Make Nextcloud a great image hosting/upload service" and has been resolved with #6599.

When you think that the image hosting feature should be extended to show insert your filetype here as well you may open a new feature request for it.

@jcklpe
Copy link

jcklpe commented Dec 10, 2018

Okay cool thanks. I see how the preview thing works now. Doesn't work with raw text files so I'll put up a request. Thanks!

@gbraad
Copy link

gbraad commented Jan 9, 2023

Not sure where this preview option is available, a currently sharing a file leads to a page but services and apps like WhatsApp can't load a preview this way

@soyelmismo
Copy link

Not sure where this preview option is available

yeh, we need a link ending with the image extension, i can't use the preview link in some websites as embed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1. to develop Accepted and waiting to be taken care of design Design, UI, UX, etc. enhancement feature: files feature: sharing
Projects
None yet
Development

Successfully merging a pull request may close this issue.