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

OPDS catalog error #128

Open
merrx opened this issue Jul 18, 2020 · 6 comments
Open

OPDS catalog error #128

merrx opened this issue Jul 18, 2020 · 6 comments

Comments

@merrx
Copy link

merrx commented Jul 18, 2020

I use the fork from @noci2012, which worked fine with Nextcloud 18.

After updating to NC 19 I have the issue that I get the login credentials pop up, which normally is located on https://my-next-cloud/index.php/apps/files_opds directly on https://my-next-cloud. And if I change the URL on my mobile app (for accessing the OPDS catalog) to the root URL of the cloud, it could navigate like normal.

In short the .../app/files_opds URL doesn't work any more, but in general the app does work with the wrong URL.
Unfortunately the nextcloud doesn't forward to the normal login page (https://my-next-cloud/login) any more, if the app is enabled.

I tried the master branch on noci2012/owncloud-apps (and the config patches, but they don't affect files_opds).
NC 19.0.1

@Yetangitu
Copy link
Owner

OPDS Catalog was made for an ancient version of Owncloud and really shows its age, it also lacks many more 'advanced' options like search and sharding. I'm looking into making a new OPDS interface for Own/Nextcloud which does offer more of these options. I'll see if I can produce one more update to get the current version working in NC19, after that it is most likely curtains for this incarnation of OPDS Catalog.

@merrx
Copy link
Author

merrx commented Aug 18, 2020

A new up to date version with the features of recent Own/Nextcloud sounds very good. Thanks in advance.
Can you link the new incarnation somewhere (main page or this issue), when you start/finished working on it?

@Yetangitu
Copy link
Owner

Once I have something worth presenting I'll link to it here.

@4oo4
Copy link

4oo4 commented Feb 7, 2021

@Yetangitu Has any progress been made, and can we assist with anything?

Cheers

@qroac
Copy link

qroac commented Apr 18, 2021

@Yetangitu just read your announcement here. If you need any testers before presenting in public, I'm in ;)

@4oo4
Copy link

4oo4 commented May 29, 2021

I think @Yetangitu has moved on from this, so it might have to be fixed by someone else. I upgraded my server instance to 20.x, and I think I see where the issue is and a possible solution.

This is where the HTTP basic auth prompt comes from:

public static function authenticateUser() {
$request = \OC::$server->getRequest();
// force basic auth, enables access through browser
if (!isset($request->server['PHP_AUTH_USER'])) {
$defaults = new \OC_Defaults();
$realm = $defaults->getName();
header ("HTTP/1.0 401 Unauthorized");
header ('WWW-Authenticate: Basic realm="' . $realm. '"');
exit();
}
$user = $request->server['PHP_AUTH_USER'];
$pass = $request->server['PHP_AUTH_PW'];
try {
//if (!\OC::$server->getUserSession()->logClientIn($user, $pass, $request, $throttler)) {
if (!self::logClientIn($user, $pass, $request)) {
// unknown user and/or password
self::changeHttpStatus(401);
exit();

I think Nextcloud also moved away from global HTTP basic auth in between versions 18 and 19, since I don't see a basic auth header when I use my instance without OPDS. So it looks like the OPDS app expects an HTTP basic auth header that isn't normally there anymore. I'd need to look through the commits on the server repo to confirm that.

I think the best way to fix it is to scope that HTTP basic auth check to just the feed URL, since that's the only place it will actually be used.

Also, I noticed that the reader app is broken since it depends on OPDS, so I think when this is fixed then reader will hopefully work too. Though, there may be other inconsistencies in both apps that need to be looked at too.

public function get($fileId, $name=null) {
if ($this->appManager->isInstalled('files_opds')) {
if ($meta = \OCA\Files_Opds\Meta::get($fileId)) {
if (!empty($name) && array_key_exists($name, $meta)) {
return [$item => $meta[$name]];
} else {
return $meta;
}
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants