nextcloud / photos

📸 Your memories under your control
GNU Affero General Public License v3.0
553 stars 61 forks source link

[Bug] Viewer in public albums is broken #1452

Closed nicokaiser closed 1 year ago

nicokaiser commented 1 year ago

Describe the bug When clicking on a thumbnail in public album view, the image is not loaded, but an error message "Error loading ..." is displayed.

The console reveals that the app is trying to load something like

https://nextcloud.example.com/apps/files_sharing/publicpreview/null?file=/photospublic/G3gmrpTgqfRLI1GA6RRG1yoyLoIhGyVM/275392-myimage.jpg&fileId=275392&x=2560&y=1440&a=true

which returns a 404 error.

To Reproduce Steps to reproduce the behavior:

  1. Create an album
  2. Create a public link
  3. Open the link (in a fresh browser / incognito mode)
  4. Click on a thumbnail

Expected behavior The image should be displayed

Screenshots If applicable, add screenshots to help explain your problem.

Server:

ximmox commented 1 year ago

Still the same on Nextcloud 25.0.2 released yesterday.

Sadly the long awaited "public albums" function for Photos is basically useless like this. 🙁

nicokaiser commented 1 year ago

I'm not sure if this behaviour has been there before, but with 25.0.2, opening photos in the grid view of a public album now asks for HTTP Basic Auth credentials.

I do not want to sound rude, but has the public album feature ever been tested at all, before being released to the public (and announced as a major new feature in NC25!)? I really do not understand how this could make it into the "stable" version.

If there is any help I can provide (e.g. provide a test installation – however it is broken in the official Docker image, so this does not seem like an edge case), please let me know.

ChristianHirsch commented 1 year ago

I can confirm that it's still not working. In case you need a quick workaround and are using a nginx server, you can add the following to your Nextcloud nginx config:

location ~ ^/apps/files_sharing/publicpreview/null {
        if ($args ~ "^file=/photospublic/([a-zA-Z0-9]*)/([0-9]*).*$") {
                set $w1 $1;
                rewrite .* /apps/photos/api/v1/publicPreview/$arg_fileId?x=1080&y=1080&token=$w1? redirect;
        }
}
DivineDominion commented 1 year ago

Ran into this just today, too. Sharing a public link to an album shows the album just fine, but looking at the pictures requires HTTP BASIC AUTH.

ProjektCamping commented 1 year ago

to share Albums in Public is a really nice function. I am heading the same problem that if you click on the pic to get the full res. pic it is asking for a AUTH. Is there a workaround or solution?

klauweg commented 1 year ago

I can confirm this behaviour with 25.0.2. It's really a pitty that this long awaited feature is unusable. Of course i can supply further information, logs etc. But since it is easy reproducible it may be not necessary anyway.

libf-de commented 1 year ago

I can confirm that it's still not working. In case you need a quick workaround and are using a nginx server, you can add the following to your Nextcloud nginx config:

location ~ ^/apps/files_sharing/publicpreview/null {
        if ($args ~ "^file=/photospublic/([a-zA-Z0-9]*)/([0-9]*).*$") {
                set $w1 $1;
                rewrite .* /apps/photos/api/v1/publicPreview/$arg_fileId?x=1080&y=1080&token=$w1? redirect;
        }
}

When running in Docker (and/or with reverse proxy), I had to add absolute_redirect off; in the location block to prevent redirection to the internal port

Draluy commented 1 year ago

Same here using 25.0.2. Basic auth asked, and "Error loading" message.

avinashpudota commented 1 year ago

I can confirm that it's still not working. In case you need a quick workaround and are using a nginx server, you can add the following to your Nextcloud nginx config:

Facing the same issue. Is there any workaround for Apache? Thanks.

bsaggy commented 1 year ago

Also hoping for a workaround in Apache.

iamjameswalters commented 1 year ago

Glad to find and +1 this bug. @XorgMC that looks promising, does this mean a PR is coming soon?

Edit: sorry, just saw that was your workaround. Thought that the issue might be related to the AIO Docker image.

ProjektCamping commented 1 year ago

I can confirm that it's still not working. In case you need a quick workaround and are using a nginx server, you can add the following to your Nextcloud nginx config:

location ~ ^/apps/files_sharing/publicpreview/null {
        if ($args ~ "^file=/photospublic/([a-zA-Z0-9]*)/([0-9]*).*$") {
                set $w1 $1;
                rewrite .* /apps/photos/api/v1/publicPreview/$arg_fileId?x=1080&y=1080&token=$w1? redirect;
        }
}

For me that workaround is not working. Still asking for the log in :/

kovlo commented 1 year ago

For me that workaround is not working. Still asking for the log in :/

@ProjektCamping, in NGINX Proxy Manager I set the following and the proposed workaround works:

image

jdaviescoates commented 1 year ago

Great there are workarounds flying about that seem to be working for some, but given this is a major new app shipped by default I can't help wondering why actually fixing it isn't a higher priority :thinking:

darguez commented 1 year ago

It seems the bug is still there in v25.0.3 😔

nicokaiser commented 1 year ago

Sorry to say it like this, but Nextcloud Photos seems to be completely abandoned. Features (like this one) are teased in press statements but do not work at all (not just in some rare edge cases), fixes are – if at all – included in the next major version (i.e. ~once a year).

Memories seem to be maintained much much better, but also is very limited feature-wise. It requires Photos to be installed for some features and also does not support public album links (only public folder links, which then are displayed grouped by month).

jdaviescoates commented 1 year ago

Sorry to say it like this, but Nextcloud Photos seems to be completely abandoned.

I'd agree that it is a bit crazy that a core feature in a new featured plugin just not working at all, and that it is really rather bad, but I'm not sure it's fair to say it's been completely abandoned given the last commit was only 7 hours ago.

nicokaiser commented 1 year ago

Yes, the last commit was only 7 hours ago, but these commits are likely to not land in the next release (25.0.x) or in any minor or patch release, but only in the next major version (Nextcloud 26).

I know it might be unfair to say this is abandoned (it is not). However it is frustrating to see new features being only released as non-working UI skeletons which never worked and neither are fixed ASAP in a patch release. E.g. the public album feature should never have made it into the UI, it would be totally okay if it was greyed out and disabled. But adding a half-baked feature which breaks in production and produces unintuitive error messages is not the correct way IMHO.

jdaviescoates commented 1 year ago

But adding a half-baked feature which breaks in production and produces unintuitive error messages is not the correct way IMHO.

I'd have to agree with that.

Photos mostly works great! But it's really disappointing sharing public folders just doesn't work at all.

I agree that they should've just never mentioned the public sharing feature, nor included it anywhere in the UI, until it actually worked.

pulsejet commented 1 year ago

Memories seem to be maintained much much better, but also is very limited feature-wise. It requires Photos to be installed for some features and also does not support public album links (only public folder links, which then are displayed grouped by month).

FYI: Memories supports public album links now (v4.10+).

darguez commented 1 year ago

OMG, this is really amazing @pulsejet!!! Thank you for your excellent work with Memories app!! 👏👏

klauweg commented 1 year ago

Yes, it looks promising. But as far as i can see the album feature in Memories depends on installed and activated Photos app. And so public shared album links do not work either.

EDIT: That is a special problem with an installation on synology-diskstation.

kampfflunder commented 1 year ago

Nope, public albums work for me. Both photos and memories need to be activated.

darguez commented 1 year ago

Sharing albums via public link works like a charm for me with Memories v4.10+ and NC 25.0.3

darguez commented 1 year ago

BTW, @pulsejet how difficult would be to add a password to increase the security of sharing an album via public link? It would be nice to have an additional security layer when you share sensitive photos (e.g. children's albums)

Draluy commented 1 year ago

BTW, @pulsejet how difficult would be to add a password to increase the security of sharing an album via public link? It would be nice to have an additional security layer when you share sensitive photos (e.g. children's albums)

Seconded, it would be nice :)

Btw, just tested public album sharing and it works perfectly, thanks.

pulsejet commented 1 year ago

BTW, @pulsejet how difficult would be to add a password to increase the security of sharing an album via public link? It would be nice to have an additional security layer when you share sensitive photos (e.g. children's albums)

Opened an issue for this, but won't be trivial unless Photos supports this directly. Worst case we need yet another table to store the passwords; best case the hash can somehow be squeezed into the link token itself.

devnull4242 commented 1 year ago

I can not understand why it can be a security issue. It is no problem to see the thumbnails but access the normal photos. Why does the access work when sharing images via "Files" (one file or the directory). Where is the difference?

Photos 2.0 (thumbnails ok, photos not ok) https://i.imgur.com/1Ax7qP6.png

Files (thumbnails ok, photos ok) https://i.imgur.com/wEuCap6.png

ventoux84 commented 1 year ago

I want to share an album, but Nextcloud wants the user to log in when using the shared public link. The mozaic is displayed, but a password is required when clicking on a thumbnail. Nextcloud 25.0.3 - Photo 2.0.1 With "Firefox -safe-mode" the error message is : "Erreur au chargement de ..."

With Chromium, it asks for user name and password in a popup window "Se connecter".

simonspa commented 1 year ago

Hi @ventoux84

Nextcloud 25.0.4 has been released yesterday, it contains the fix to correctly display public albums. :)

ventoux84 commented 1 year ago

Thanks, it works after upgrade to 25.0.4.

darguez commented 1 year ago

Awesome! Thanks!

@artonge, is it planed to allow setting a password in a near future to increase security?

stefan-franz commented 1 year ago

I i share a link of an album via public link (NC 25.0.4) everyone can remove images. I think that is a bug.

devnull4242 commented 1 year ago

Yes. I think also it is a bug or a feature. I wrote an issue: https://github.com/nextcloud/photos/issues/1655

iamjameswalters commented 1 year ago

Thanks so much to @starypatyk for working on this for us!

starypatyk commented 1 year ago

@iamjameswalters Doing this for selfish reasons. :wink: I use Nextcloud myself...