epubreader icon indicating copy to clipboard operation
epubreader copied to clipboard

NC21 - Not saving anything

Open lemonlim3 opened this issue 3 years ago • 22 comments

Latest release opens books fine but does not save progress, bookmarks, settings etc.

lemonlim3 avatar Apr 30 '21 19:04 lemonlim3

Same issue here, please fix it.

thangisme avatar May 09 '21 10:05 thangisme

I have the same issue in NC 20 with the version 1.4.6.

I reverted to the version 1.4.5 and it retains at least the last position !

EDIT : after switching to NextCloud 22 and the master branch, it saves the last position :+1:

sysadminstory avatar May 10 '21 20:05 sysadminstory

Any update on this?

thangisme avatar May 21 '21 03:05 thangisme

It would be reallly awesome to enable the saving of comments/annotations so that EPUBs can be reviewed by colleagues.

russs95 avatar May 30 '21 14:05 russs95

Same issue here.

EDIT: Display settings (page width, custom colors, etc.) don't seem to save either.

maxnatamo avatar Jul 11 '21 15:07 maxnatamo

New and fresh install Nextcloud 23 with EPUB/CBZ/PDF ebook reader 1.4.7 Does not save anything,sadly. I made a new One-Click-Install on a dedicated remote server. Everything works fine but this ebook reader.

ghost avatar Jan 23 '22 19:01 ghost

I think I discovered why it won't save anything on some instance :

  • the reader seems to uses url without the index.php in it (aka using mod_rewrite from apache) even if it is not activated by nextcloud
  • the reader seems to use the folder "apps" even if the apps is another folder than "apps", but this must be double checked

So as for now, if you can activated the URL using "mod_rewrite" (or check if there is no missing "RewriteBase /" in the .htaccess file) it should save everything.

sysadminstory avatar Jan 23 '22 23:01 sysadminstory

muffin-1 = Mameka, sry. I tried to figure it out but didn't get it working to save the preferences or read pages. The app is installed in the default folder "app". I installed a default Nextcloud installation. Rewriting is activated. I get a green button from Nextcloud check without one warning. Rewriting for Caldav/Webdav works. All other apps are working fine. I get no errors in my logs. At the end I give up.

muffin-1 avatar Jan 24 '22 14:01 muffin-1

muffin-1 = Mameka, sry. I tried to figure it out but didn't get it working to save the preferences or read pages. The app is installed in the default folder "app". I installed a default Nextcloud installation. Rewriting is activated. I get a green button from Nextcloud check without one warning. Rewriting for Caldav/Webdav works. All other apps are working fine. I get no errors in my logs. At the end I give up.

The issue is in the epubreader app, not in your nextcloud installation.

I tried to fix the saving for epub files in PR #42

Could other users try this fix and give me feedback ?

sysadminstory avatar Jan 26 '22 00:01 sysadminstory

I have the same issue in NC 20 with the version 1.4.6.

I reverted to the version 1.4.5 and it retains at least the last position !

EDIT : after switching to NextCloud 22 and the master branch, it saves the last position 👍

how did you manage to revert it? when I just copy untarred 1.4.5 release, it produces an internal server error.

ickam avatar Feb 27 '22 16:02 ickam

I "reverted" it by moving the app to the standard app folder "apps", instead of the customer one I created.

IMHO, to get the last position saving to work, you must have the latest version n the "apps" folder, and no other "epubreader" folder in any custom apps directory.

sysadminstory avatar Feb 27 '22 16:02 sysadminstory

I "reverted" it by moving the app to the standard app folder "apps", instead of the customer one I created.

IMHO, to get the last position saving to work, you must have the latest version n the "apps" folder, and no other "epubreader" folder in any custom apps directory.

I tried the latest version of epubreader on clean installs of NC 22 and 23 and it didn't work. Are you saying that by default the app is installed into the wrong folder?

ickam avatar Feb 27 '22 16:02 ickam

I "reverted" it by moving the app to the standard app folder "apps", instead of the customer one I created. IMHO, to get the last position saving to work, you must have the latest version n the "apps" folder, and no other "epubreader" folder in any custom apps directory.

I tried the latest version of epubreader on clean installs of NC 22 and 23 and it didn't work. Are you saying that by default the app is installed into the wrong folder?

Does your install have URL rewriting activated ? I think it's a needed condition too !

sysadminstory avatar Feb 27 '22 16:02 sysadminstory

do you mean mod_rewrtite? It was enabled on the .htaccess file, but I was running from docker and I am not very familiar with it. I'm going to spin up a dietpi vm and I'll see how I get on on that

ickam avatar Feb 27 '22 19:02 ickam

do you mean mod_rewrtite? It was enabled on the .htaccess file, but I was running from docker and I am not very familiar with it. I'm going to spin up a dietpi vm and I'll see how I get on on that

The mod_rewrite needs to be activated on Apache side and on the next loud instance. The URL of your "apps" should not contain "index.php"

sysadminstory avatar Feb 27 '22 19:02 sysadminstory

It is enabled in both places

root@DietPi:~# a2enmod rewrite Module rewrite already enabled

RewriteEngine on RewriteCond %{HTTP_USER_AGENT} DavClnt RewriteRule ^$ /remote.php/webdav/ [L,R=302] RewriteRule .* - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization}] RewriteRule ^\.well-known/carddav /remote.php/dav/ [R=301,L] RewriteRule ^\.well-known/caldav /remote.php/dav/ [R=301,L] RewriteRule ^remote/(.*) remote.php [QSA,L] RewriteRule ^(?:build|tests|config|lib|3rdparty|templates)/.* - [R=404,L] RewriteRule ^\.well-known/(?!acme-challenge|pki-validation) /index.php [QSA,L] RewriteRule ^(?:\.(?!well-known)|autotest|occ|issue|indie|db_|console).* - [R>

but it still doesn't make a difference :(

ickam avatar Feb 27 '22 20:02 ickam

HA! Got it working after manually implementing your PR @sysadminstory Thanks so much, man <3

ickam avatar Feb 27 '22 20:02 ickam

HA! Got it working after manually implementing your PR @sysadminstory Thanks so much, man <3

Having said that, it only remembers an approximate position, it's a couple pages off (for epub anyway, I haven't tested PDF yet). I wonder why that is.

ickam avatar Feb 27 '22 20:02 ickam

My PR is very experimental (and to be honest, it seems to break some other things ; I need to dig very deep to fix this IMHO).

You need to "force" Nextcloud to use the "Pretty URLs" to make it work in the actual version : https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#pretty-urls

sysadminstory avatar Feb 27 '22 21:02 sysadminstory

These lines

'overwrite.cli.url' => 'https://example.org/nextcloud', 'htaccess.RewriteBase' => '/nextcloud',

were already present in my config file and the progress sync didn't work until I implemented the PR

ickam avatar Feb 27 '22 21:02 ickam

The way the URLs are handled in nextcloud is very obscure to me ; it seems it's more complicated than I thought, because, for me this configuration works for me (outside docker).

sysadminstory avatar Mar 01 '22 18:03 sysadminstory

Hi, I found the issue really intrusive, and digged a bit to understand where it could be going wrong, here are my findings:

  • If you check the Network logs, you'll notice that the static files (CSS, JS) are being fetched from a /custom_apps/epubreader/ URL, such as http://example.nextcloud.com/custom_apps/epubreader/vendor/epubjs/hooks.min.js. This is because the static files reside in that directory and are picked up.
  • However if you check the save/fetch URLs, you'll notice that they're being fetched through a similar path /custom_apps/epubreader/. This is where the catch is. For example your browser is making the save POST request to http://example.nextcloud.com/custom_apps/epubreader/bookmark/cursor. It should however have made the POST request to http://example.nextcloud.com/apps/epubreader/bookmark/cursor.

Why?

If you look at the Nextcloud custom apps design, all of them need to write a routes.php (e.g. https://github.com/e-alfred/epubreader/blob/master/appinfo/routes.php) and Nextcloud would serve it over the /apps/<appName> route.

Temporary workaround

Use a Chrome extension like Requestly. This can rewrite the requests on the fly. Example configuration:

image

rounakdatta avatar Mar 15 '22 18:03 rounakdatta