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

DokuWiki inclusion is not operational #9

Open
knieselpriem opened this issue Mar 14, 2023 · 4 comments
Open

DokuWiki inclusion is not operational #9

knieselpriem opened this issue Mar 14, 2023 · 4 comments
Labels
documentation Issues related to missing or bad documentation.

Comments

@knieselpriem
Copy link

NextCoud Version 25.0.3
Users are authenticated by SAMBA AD (LDAP)

[PHP] Fehler: Error: Undefined array key "path" at /var/www/nextcloud/apps/dokuwiki/lib/Service/AuthDokuWiki.php#139 at <>

  1. /var/www/nextcloud/apps/dokuwiki/lib/Service/AuthDokuWiki.php line 139
    OC\Log\ErrorHandler::onError()
  2. <>
    OCA\DokuWiki\Service\AuthDokuWiki->__construct()
  3. /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php line 108
    ReflectionClass->newInstanceArgs()
  4. /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php line 116
    OC\AppFramework\Utility\SimpleContainer->buildClass()
  5. /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php line 133
    OC\AppFramework\Utility\SimpleContainer->resolve()
  6. /var/www/nextcloud/lib/private/AppFramework/DependencyInjection/DIContainer.php line 465
    OC\AppFramework\Utility\SimpleContainer->query()
  7. /var/www/nextcloud/lib/private/AppFramework/DependencyInjection/DIContainer.php line 437
    OC\AppFramework\DependencyInjection\DIContainer->queryNoFallback()
  8. /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php line 89
    OC\AppFramework\DependencyInjection\DIContainer->query()
  9. <>
    OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility{closure}("*** sensitive parameters replaced ***")
  10. /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php line 108
    array_map()
  11. /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php line 116
    OC\AppFramework\Utility\SimpleContainer->buildClass()
  12. /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php line 133
    OC\AppFramework\Utility\SimpleContainer->resolve()
  13. /var/www/nextcloud/lib/private/AppFramework/DependencyInjection/DIContainer.php line 465
    OC\AppFramework\Utility\SimpleContainer->query()
  14. /var/www/nextcloud/lib/private/AppFramework/DependencyInjection/DIContainer.php line 437
    OC\AppFramework\DependencyInjection\DIContainer->queryNoFallback()
  15. /var/www/nextcloud/lib/private/AppFramework/App.php line 159
    OC\AppFramework\DependencyInjection\DIContainer->query()
  16. /var/www/nextcloud/lib/private/Route/Router.php line 298
    OC\AppFramework\App::main()
  17. /var/www/nextcloud/lib/base.php line 1047
    OC\Route\Router->match()
  18. /var/www/nextcloud/index.php line 36
    OC::handleRequest()

GET /index.php/apps/dokuwiki/page/index

[index] Fehler: Exception: xmlRequest(wiki.getPage) failed (-1) at <>

  1. /var/www/nextcloud/apps/dokuwiki/lib/Service/AuthDokuWiki.php line 274
    OCA\DokuWiki\Service\AuthDokuWiki->handleError()
  2. /var/www/nextcloud/apps/dokuwiki/lib/Service/AuthDokuWiki.php line 488
    OCA\DokuWiki\Service\AuthDokuWiki->xmlRequest()
  3. /var/www/nextcloud/apps/dokuwiki/lib/Service/AuthDokuWiki.php line 451
    OCA\DokuWiki\Service\AuthDokuWiki->getPage()
  4. /var/www/nextcloud/apps/dokuwiki/lib/Controller/PageController.php line 125
    OCA\DokuWiki\Service\AuthDokuWiki->refresh()
  5. /var/www/nextcloud/apps/dokuwiki/lib/Controller/PageController.php line 99
    OCA\DokuWiki\Controller\PageController->frame()
  6. <>
    OCA\DokuWiki\Controller\PageController->index()
  7. /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 225
    call_user_func_array()
  8. /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 133
    OC\AppFramework\Http\Dispatcher->executeController()
  9. /var/www/nextcloud/lib/private/AppFramework/App.php line 172
    OC\AppFramework\Http\Dispatcher->dispatch()
  10. /var/www/nextcloud/lib/private/Route/Router.php line 298
    OC\AppFramework\App::main()
  11. /var/www/nextcloud/lib/base.php line 1047
    OC\Route\Router->match()
  12. /var/www/nextcloud/index.php line 36
    OC::handleRequest()

GET /index.php/apps/dokuwiki/page/index

@rotdrop
Copy link
Owner

rotdrop commented Mar 14, 2023

This array key refers to the path component of the DokuWiki URL. E.g. in my test-setup the DokuWiki URL is something like

https://dev1.test.tld/dokuwiki

There are also some restriction caused by a "same site" policy (see https://developer.mozilla.org/en-US/docs/Web/Security/Same-origin_policy) which probably is in use meaning that Nextcloud and Dokuwiki must virtually reside on the same server.

Can you please shine some light on your configuration?

Of course, the error message generated by the app is not really helpful ...

@knieselpriem
Copy link
Author

knieselpriem commented Mar 15, 2023

URL's:

  • Nextcloud: cloud.server.lan
  • DokuWIki: wiki.server.lan

This URL is configured in the settings of the app: https://wiki.server.lan

I didn't read about those restrictions in the documentation of the app. If this is the cause of the exception, this app makes no sense for my intention to use.

@rotdrop
Copy link
Owner

rotdrop commented Mar 15, 2023

URL's:

* Nextcloud: `cloud.server.lan`

* DokuWIki: `wiki.server.lan`

This URL is configured in the settings of the app: https://wiki.server.lan

I didn't read about those restrictions in the documentation of the app. If this is the cause of the exception, this app makes no sense for my intention to use.

Caution. You are maybe a bit too fast with you conclusion. Some explanations and hints for the web-server setup can be found here:

https://github.com/rotdrop/nextcloud-roundcube#adminstration-web-server-setup

In short: if you have access to the web-server configuration of the server running you Nextcloud instance then you can map the Dokuwiki instance into the Nextcloud site by means of a proxy configuration. There are some more possibilities depending on you setup.

For the code quality of this app, there are two points:

  1. Of course, the undefined array key bug should be fixed
  2. The app should try to detect configurations which are known to be problematic. However, also the same-site policy depends on your web-server setup (the CSP policy configured in Nextcloud)
  3. The documentation should be updated. I will probably simply copy over the sections from that nextcloud-roundcube app as the embedding technique and problems are similar.

@rotdrop
Copy link
Owner

rotdrop commented Mar 15, 2023

For the moment, you could try to change line 139 in that file

$this->dwPath = $urlParts['path'];

to look like this

      $this->dwPath  = $urlParts['path'] ?? '';

This will not change the CSP policy but fix the undefined array key bug.

@rotdrop rotdrop added the documentation Issues related to missing or bad documentation. label Apr 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Issues related to missing or bad documentation.
Projects
None yet
Development

No branches or pull requests

2 participants