dshoreman / nextshot

A simple tool for taking screenshots on Linux and sharing via Nextcloud
GNU General Public License v2.0
42 stars 3 forks source link

No config option for cloud without "pretty URLs" #67

Closed mmigel closed 4 years ago

mmigel commented 4 years ago

Nextshot will not work correctly on Nextcloud instances without pretty URLs. For example - enabling these short URLs is still not possible on snap Nextcloud installations. Right now Nextshot use share links like this: https://example.org/s/string

Without pretty URLs we need also "index.php" in URL, so like this: https://example.org/index.php/s/string

For now, I just slightly changed the part of the script responsible for the URL, but it would be great if option for change this were also in the configuration. :)

dshoreman commented 4 years ago

Does it work if you set server='https://example.org/index.php' in your config, or does this break something? In theory that should generate the URL you need since your example shows the same string being appended in both cases. Not to say a pretty URL option wouldn't be a bad idea, but that should at least get it working without hacks :wink:

mmigel commented 4 years ago

Unfortunately not, server return 405 response. :( With this change sending request looks like this:

Uploading screenshot...
Sending request to https://example.org/index.php/remote.php/dav/files/Username/Directory/Filename...
######################################################################## 100,0%##O#- #                                                                       

Upload failed. Expected 201 but server returned a 405 response

Aborted due to error`

So we have here problematic /index.php/remote.php/

dshoreman commented 4 years ago

Hi @mmigel, sorry it's been so long! I've dug a little deeper into this now and there are a few places the Nextcloud URL is used, and a couple will need to be patched to add the /index.php.

I'm working on some bits now while I wait for an Ubuntu ISO to download, then I can get a basic Nextcloud instance rigged up without Pretty URLs so that I can test it out and make any further tweaks.

dshoreman commented 4 years ago

@mmigel This should be fixed on develop now, thanks for reporting the bug!

There are still some other things to finish before 1.4 is out, so please do reopen this issue if you try the develop branch and find it still doesn't work for you. There were some changes around Nextcloud 18 where "gallery" became "photos", but that doesn't seem to affect the link that actually gets copied so it should be ok.