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

Investigate ext app for node backend #119

Open
2 of 3 tasks
juliushaertl opened this issue Aug 19, 2024 · 5 comments
Open
2 of 3 tasks

Investigate ext app for node backend #119

juliushaertl opened this issue Aug 19, 2024 · 5 comments
Assignees
Labels
backend: node enhancement New feature or request
Milestone

Comments

@juliushaertl
Copy link
Member

juliushaertl commented Aug 19, 2024

As a replacement for #27 we should see if we can build a AppAPI app https://docs.nextcloud.com/server/latest/admin_manual/ai/app_api_and_external_apps.html that just runs a docker container for the backend.

Started adding this for the local dev environment juliushaertl/nextcloud-docker-dev@a3e7cb8

@hweihwang
Copy link
Contributor

Initial efforts for ExApps:

https://github.com/hweihwang/whiteboard_websocket

@hweihwang
Copy link
Contributor

hweihwang commented Sep 30, 2024

Current progress:

  • Using docker-install and dockersocketproxy
  • The ExApp has been built out seems okay (Dockerfile for a express node server with socket.io, appinfo xml configs)
  • Successfully enabled the app and proxied the request at https://nextcloud.local/apps/app_api/proxy/whiteboard_websocket
  • The request to the express HTTP server route works fine.

=> However, I'm facing problems with the socket connection. Both websocket and polling connections are failing. The AppAPI documentation mentions: "There is a limitation of AppAPI ExApp proxy—the WebSocket connections are not supported." I was hoping polling might work, but it doesn't seem to connect.

image

image

@hweihwang
Copy link
Contributor

Updates:

  • When I debugged the Guzzle request in the app_api source, I noticed that the necessary query parameters for the socket connection (EIO, transport, t) are not being proxied. After modifying the code to include these queries, the request now proxies successfully, but some requests still fail while others succeed. I'm investigating why this inconsistency occurs—perhaps there's still missing information needed for the proxy.

=> In the app_api source, I've been modifying the ExAppProxyController a bit to include this to proxy the queries:

$queryParams = $this->request->getRequestUri();
$queryParams = explode('?', $queryParams);
$queryParams = $queryParams[1];
$path = $other . '?' . $queryParams;

image

@hweihwang
Copy link
Contributor

Hi @bigcat88 , Your expertise would be really helpful! Thank you!

@hweihwang
Copy link
Contributor

Fixed by this: nextcloud/app_api#412, thank you @edward-ly , @bigcat88 , @andrey18106

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend: node enhancement New feature or request
Projects
Status: 🏗️ In progress
Development

No branches or pull requests

2 participants