strukturag / nextcloud-spreedme

Spreed.ME Nextcloud app
https://www.spreed.me
GNU Affero General Public License v3.0
56 stars 26 forks source link

No one else here #35

Closed kbaegis closed 8 years ago

kbaegis commented 8 years ago

After extensive config testing, I'm pretty sure this isn't a duplicate of issue #22.

Symptom: Users all logged in as "Me", unable to set persistent configurations or see other users. As far as I can tell, the username is not being effectively pulled from nextcloud into the application. Spreed sees the clients come in, issues tokens, etc. The websessions are useless, and the ../admin/debug command doesn't detect any issues.

Configs: OwnCloudConfig.js - https://paste.ubuntu.com/22227456/ app php - http://pastebin.com/XeE1KR17 spreed server - http://pastebin.com/p5hTGtv6 apache vhost - http://pastebin.com/fDhqsSZx

Very frustrating since 1) there is no detection by the app for this issue, 2) spreed works great without owncloud in front of it.

screen shot 2016-08-04 at 5 28 02 am screen shot 2016-08-04 at 5 07 04 am
kbaegis commented 8 years ago

Digging some more, it looks like my passwords were mismatched or something. That could easily be checked by the admin script. :) Also, "authorizeRoomJoin = false" doesn't work for me (step 4.ii.a).

leonklingele commented 8 years ago

Hi @kbaegis,

thanks for posting the config files. The issue is caused by your Apache configuration. It should look like this:

<Location /webrtc>
    ProxyPass http://127.0.0.1:8080/webrtc
    ProxyPassReverse /webrtc
</Location>

<Location /webrtc/ws>
    ProxyPass ws://127.0.0.1:8080/webrtc/ws
</Location>

ProxyVia On
ProxyPreserveHost On
RequestHeader set X-Forwarded-Proto 'https' env=HTTPS

If this does not help, please also post the output of your browser developer console (see below on how to access it). We're currently simplifying the setup instructions: https://github.com/strukturag/nextcloud-spreedme/pull/34

Also you can disable the https server of spreed-webrtc, as you have already set up Apache to use spreed-webrtc's http server as a reverse proxy.

The admin/debug endpoint has no access to any private configuration from spreed-webrtc (e.g. the shared secret), so it can't check whether these two match.

How to open your browser's developer console:

  1. Open the Spreed.ME app in ownCloud
  2. Append ?debug to the URL, i.e. https://domain.com/index.php/apps/spreedme/?debug
  3. Right click on the ownCloud site
  4. Click "Inspect element" (very bottom)
  5. Check what it says in the console and paste it here

EDIT: Use const SPREED_WEBRTC_ORIGIN = 'https://host.domain'; in config.php as spreed-webrtc are available on the same domain + port.

Also, "authorizeRoomJoin = false" doesn't work for me (step 4.ii.a).

This should work as soon as you have fixed your Apache config. 😃 Setting authorizeRoomJoin = false will allow anyone to join a room, setting it to true will only allow authorized users to join (i.e. people logged in to oC / people invited by a Temporary Password).

leonklingele commented 8 years ago

Any news on this @kbaegis?

kbaegis commented 8 years ago

Yes, the most recent app-update deconfigured the app. I'll let you know when I reconfigure it.

kbaegis commented 8 years ago

Okay, I'm trying to reconfigure it now. Here's the fundamental problem: there's nothing whatsoever telling you how these values are used. I gain no better understanding from the comments/documentation like, "clients are redirect here" or "these files are served by owncloud". Instead it's all "set me to this value", "set me to this other value". This is simply unusable if you have a more complex or differing deployment.

I have nextcloud set to (hostname)/cloud/. This completely breaks your config files and solution, and it's a very simple and common setup.

I'll keep playing with it. I've already spend around 10 hours trying to get this to work, which is time that could've been saved w/ documentation.

kbaegis commented 8 years ago

OwnCloudConfig.js - http://hastebin.com/bitufoxike.lisp server.conf - http://hastebin.com/utumalutat.ini config.php - http://hastebin.com/erubaniyuy.tex vhost - http://hastebin.com/hepewiguqe.apache

screen shot 2016-08-15 at 12 14 24 pm screen shot 2016-08-15 at 12 14 04 pm
leonklingele commented 8 years ago

I have nextcloud set to (hostname)/cloud/. This completely breaks your config files and solution, and it's a very simple and common setup.

It doesn't. We support running NC in a subpath.

I'll keep playing with it. I've already spend around 10 hours trying to get this to work, which is time that could've been saved w/ documentation.

We have improved the docs in the latest release and will reduce all manual configuration to a minimum.

Here's what's wrong with your configuration:

  1. (server.conf) Set basePath = /webrtc/
  2. (server.conf) Don't use the [https] block in server.conf. Only enable listen in the [http] section, as you will configure Apache in step 5. to act as a reverse proxy to make Spreed WebRTC available on the same domain as your NC instance is currently running.
  3. (config.php) Set const SPREED_WEBRTC_ORIGIN = ''; (empty string), as Spreed WebRTC and NC are available on the same origin.
  4. (config.php) Set const SPREED_WEBRTC_BASEPATH = '/webrtc/'; as Spreed WebRTC is available on the /webrtc/ subpath (see step 1.)
  5. (Apache conf) Remove every Apache Spreed WebRTC configuration you currently have and use https://github.com/strukturag/nextcloud-spreedme/blob/master/doc/example-config-apache.md#apache-configuration-sniplet instead. Do not change anything from the default sniplet – It should work for you.

Hope this helps. 😺

Edit: Add missing quotation mark in configuration provided.

kbaegis commented 8 years ago

I think I had been getting frustrated. Thank you for the excellent recommendations. I'm still having problems with the websocket configuration. It's returning a 500.

kbaegis commented 8 years ago

Error log is handing out: [Mon Aug 15 18:14:52.356935 2016] [proxy:warn] [pid 15074:tid 139733266671360] [client 172.21.4.254:41356] AH01144: No protocol handler was valid for the URL /webrtc/ws. If you are using a DSO version of mod_proxy, make sure the proxy submodules are included in the configuration using LoadModule.

I know that I compiled with apache2_modules_proxy_wstunnel support.

kbaegis commented 8 years ago

My httpd needed LoadModule proxy_wstunnel_module modules/mod_proxy_wstunnel.so. There's still an issue with auth though.

kbaegis commented 8 years ago
screen shot 2016-08-15 at 7 43 53 pm

So new spreed logs - http://hastebin.com/ruvisuzeda.axapta chrome developer console log - http://hastebin.com/idavatohov.vhdl Still showing "No one else here", no username (Me), and no persistence for any configs.

kbaegis commented 8 years ago

I'm no expert, but it seems like the problem is here: …Sid: "I07cu2uhzh03iOsuSRL7rLDEhDv9O50K", Userid: "", Suserid: ""…} Could that lead to my lack of a username/persistence/login?

I would assume that userid/suserid are actually supposed to be populated. I don't know how to fix this though because I'm almost certain that OWNCLOUD_TEMPORARY_PASSWORD_SIGNING_KEY and sharedsecret_secret are being parsed identically.

I guess this is a legit bug and not a config problem? Or please let us know how to remediate. :)

leonklingele commented 8 years ago

Can you post the output of your developer again – this time running the application in debug mode:

  1. Open the Spreed.ME app in Nextcloud
  2. Append ?debug to the URL, i.e. https://domain.com/index.php/apps/spreedme/?debug
  3. Right click on the Nextcloud site
  4. Click "Inspect element" (very bottom)
  5. Check what it says in the console and paste it here

Edit: Forget what I just said. You already did.

leonklingele commented 8 years ago

Can you please post the full output of the developer console?

kbaegis commented 8 years ago

Hope it's useful: http://hastebin.com/xenifiwoti.vhdl

leonklingele commented 8 years ago

Hi @kbaegis,

much more should be logged to your console. Please follow these steps again:

  1. Open the Spreed.ME app in Nextcloud
  2. Append ?debug to the URL, i.e. https://domain.com/index.php/apps/spreedme/?debug
  3. Right click on the Nextcloud site
  4. Click "Inspect element" (very bottom)
  5. Check what it says in the console and paste it here
kbaegis commented 8 years ago

Sorry, I'm afraid you're not actually being very clear. Which element in particular am I supposed to be inspecting? I'm giving you the console output. I've also attached a 5mb (extracted) har.

screen shot 2016-08-17 at 11 15 45 am

tine.home.har.zip

leonklingele commented 8 years ago

Can you please post the Spreed WebRTC, config.php and OwnCloudConfig.js, just to be sure..

kbaegis commented 8 years ago

Sure. js - http://hastebin.com/fexahomono.lisp spreed - http://hastebin.com/xovejunove.ini php - http://hastebin.com/luxiyuvadu.tex

leonklingele commented 8 years ago

In the js config, please set OWNCLOUD_ORIGIN: '' (empty string, as running on the same host) In the Spreed WebRTC config, do not use quotes around the shared secret. It should be sharedsecret_secret = <removed> (I don't know if it works with quotes, can't test it now)

If this doesn't work, it's likely a problem with your web server. Can you please check all logs (Spreed WebRTC, web server, Nextcloud).

leonklingele commented 8 years ago

Oops, I didn't even ask for your web server config. Can you please post it?

kbaegis commented 8 years ago

If you must. http://hastebin.com/iripuxanum.apache

kbaegis commented 8 years ago

Alright, changing origin to a blank string changed two things. My username populates, and I get persistent configuration from settings. It still asks me to "sign in" to create rooms, I still get No one else is here, and I can't chat or join a room.

leonklingele commented 8 years ago

Can you now please check the browser console again? :)

kbaegis commented 8 years ago

Huh. Getting a 403 forbidden: https://tine.home/webrtc/api/v1/sessions/sCOltcsHEUZks0CMIqMesJzXDkC-Pipe4p…2SHF4MklrV2JYLTU0THY5QW9teURxV3k1a3dvYUctcWFja3VCUFhzcWtYfDE0OTQ3NDE3NDE=/ Failed to load resource: the server responded with a status of 403 (Forbidden)

Spreed error - http://hastebin.com/wurabejuyo.vbs *Looks like I was right here. Userid being blank confuses it.

kbaegis commented 8 years ago

Fixed;tested;closed. Thanks a lot leonklingele!

leonklingele commented 8 years ago

Awesome! How did you fix it?