e-alfred / epubreader

EPUB/CBR/PDF reader app for Nextcloud
GNU Affero General Public License v3.0
81 stars 21 forks source link

NC21 - Not saving anything #33

Open lemonlim3 opened 3 years ago

lemonlim3 commented 3 years ago

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

thangisme commented 3 years ago

Same issue here, please fix it.

sysadminstory commented 3 years ago

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:

thangisme commented 3 years ago

Any update on this?

russs95 commented 3 years ago

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

maxnatamo commented 3 years ago

Same issue here.

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

ghost commented 2 years ago

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.

sysadminstory commented 2 years ago

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

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.

muffin-1 commented 2 years ago

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.

sysadminstory commented 2 years ago

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 ?

ickam commented 2 years ago

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.

sysadminstory commented 2 years ago

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.

ickam commented 2 years ago

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?

sysadminstory commented 2 years ago

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 !

ickam commented 2 years ago

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

sysadminstory commented 2 years ago

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"

ickam commented 2 years ago

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 commented 2 years ago

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

ickam commented 2 years ago

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.

sysadminstory commented 2 years ago

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

ickam commented 2 years ago

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

sysadminstory commented 2 years ago

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).

rounakdatta commented 2 years ago

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

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