Chat module

Talk about anything that doesn't fit in the other catagories :) (and of course is about Group-Office)

Moderator: Developers

szeplast
Posts: 4
Joined: Mon Dec 30, 2013 2:35 pm

Chat module

Postby szeplast » Thu Mar 02, 2017 10:45 pm

Hi! I've finished the installation a new GO server. This is a test server in virtualbox, later I'll install on a real server. But I can't figure out what wrong with the chat. I've done evrything (really hope) what I read on this site:
https://www.group-office.com/blog/post? ... 4931744115

I can log in into GO, chat is on, but it doesn't log in into the server. Just ask user name and password. Any idea?
lalves
Posts: 6
Joined: Tue Feb 23, 2016 9:06 pm

Re: Chat module

Postby lalves » Tue Mar 07, 2017 2:21 am

Hi Szeplast.

When I installed and configured the GO for the first time, I had the same issue.
After long research, I found the fix for this issue.

First, install and configure the require file from the installation manual.

After install and configured the files edit /etc/prosody/prosody.cfg.lua.

Put these settings or change them:

Then comment out authentication = "internal_plain":
and set:
-- authentication = "internal_plain"
authentication = "external"
external_auth_command = "/usr/local/GroupOfficeProsodyAuth.php"
external_auth_protocol = "generic"
cross_domain_bosh = true
consider_bosh_secure = true -- trust bosh connection

bosh_ports = {
{
port = 5280;
path = "http-bind";
interface = "your server ip";
}
}

Save the file and restart prosody service:

service prosody restart

Before you enable the chat module we need to edit the bosh connector on chat config file:

Go to /usr/share/groupoffice/module/chat and edit the file ChatModule.php :

On public static function getBoshURi() and public static function getXmppHost() edit the
$jabberhost:


public static function getBoshUri() {
// $jabberHost = 'your server ip';
// $boshUri = 'https://' . $jabberHost . ':5281/http-bind';
$proto = GO::request()->isHttps() ? 'https' : 'http';
$port = GO::request()->isHttps() ? 5281 : 5280;
return isset(GO::config()->chat_bosh_uri) ? GO::config()-
>chat_bosh_uri : $proto . '://' . self::getXmppHost() . ':' . $port . '/httpbind';
}
public static function getXmppHost() {
//$jabberHost = 'your server ip';
return isset(GO::config()->chat_xmpp_host) ? GO::config()-
>chat_xmpp_host : $_SERVER['HTTP_HOST'];
}
/**

Save the file.

Make sure config.php of Group-Office is readable by the prosody user!

Done!

Now login back to GO and the chat will work.
marri2k
Posts: 2
Joined: Mon Mar 27, 2017 12:05 pm

Re: Chat module

Postby marri2k » Fri Mar 31, 2017 8:04 pm

I have followed the above steps but not working :(

:(
afisher
Posts: 1
Joined: Sun Apr 09, 2017 1:31 pm

Re: Chat module

Postby afisher » Sat Apr 15, 2017 7:01 pm

Hi lalves,

This post was the one that brought me closest to the goal.
After consulting and following instructions in Merijn's post (https://www.group-office.com/blog/post? ... 4931744115), and adapting many much configurations to today's situation,
I finally get to have the prosody server running on my host.
Running $sudo prosodyctl status
I get
Prosody is running with PID xxxxx
All should be fine therefore.

However, once logged into my GO interface, first, the chat module did appear, but I could never see the login informations appear on the "sign in" tab. Yesterday, at login, the tab did show me the "sign in" form for a short moment, but it immediately disappeared, stating: "disconnected". Today, I don't even see the chat module anymore...

The prosody.log tells me there seem to be two issues:
1- From prosody.log, I get: /home/groupoffice/chat/groups.txt: No such file or directory
>> changed the path to the Chat folder in the GO root directory = /var/www/office/modules/chat/groups.txt
But file still does not exist...

2- From prosody.log, I get: MYDOMAIN:auth_external warn Unable to interpret data from auth process
related to previous?

Any hint?
szeplast
Posts: 4
Joined: Mon Dec 30, 2013 2:35 pm

Re: Chat module

Postby szeplast » Sun May 21, 2017 2:02 pm

lalves wrote:Hi Szeplast.

authentication = "external"
...
Now login back to GO and the chat will work.


Thanks a lot, but there's no mod_auth_external module for prosody. At least I couldn't find it - but a rather old ALPHA version.

Update: found at github, installed along with lua-lpty. No error, but still doesn't work.

May 21 17:43:44 general info Hello and welcome to Prosody version 0.9.10
May 21 17:43:44 general info Prosody is using the select backend for connection handling
May 21 17:43:44 portmanager info Activated service 'c2s' on [::]:5222, [*]:5222
May 21 17:43:44 portmanager info Activated service 'legacy_ssl' on no ports
May 21 17:43:44 portmanager info Activated service 's2s' on [::]:5269, [*]:5269
May 21 17:43:44 mod_posix info Prosody is about to detach from the console, disabling further console output
May 21 17:43:44 mod_posix info Successfully daemonized to PID 3346
May 21 17:43:44 portmanager info Activated service 'http' on [::]:5280, [*]:5280
May 21 17:43:44 portmanager info Activated service 'https' on [::]:5281, [*]:5281

No Chat in Groupoffice. Module is enabled.

On the other hand, you wrote that we should update jabber host name, but the mods are in comments. Shall we remove comments in the affected lines?

I have tried, anyway, but didn't make any good.

What about the domains in GO and Prosody? Shall the same domains exist?
lalves
Posts: 6
Joined: Tue Feb 23, 2016 9:06 pm

Re: Chat module

Postby lalves » Thu Jun 08, 2017 2:09 am

afisher wrote:Hi lalves,

This post was the one that brought me closest to the goal.
After consulting and following instructions in Merijn's post (https://www.group-office.com/blog/post?id=8568233904931744115), and adapting many much configurations to today's situation,
I finally get to have the prosody server running on my host.
Running $sudo prosodyctl status
I get
Prosody is running with PID xxxxx
All should be fine therefore.

However, once logged into my GO interface, first, the chat module did appear, but I could never see the login informations appear on the "sign in" tab. Yesterday, at login, the tab did show me the "sign in" form for a short moment, but it immediately disappeared, stating: "disconnected". Today, I don't even see the chat module anymore...

The prosody.log tells me there seem to be two issues:
1- From prosody.log, I get: /home/groupoffice/chat/groups.txt: No such file or directory
>> changed the path to the Chat folder in the GO root directory = /var/www/office/modules/chat/groups.txt
But file still does not exist...

2- From prosody.log, I get: MYDOMAIN:auth_external warn Unable to interpret data from auth process
related to previous?

Any hint?


Hi, afisher.

Sorry for late reply. I have been very busy.
It seems that prosody doesn't have permissions to read the config file of GroupOffice.

On the Tutorial, they say about it:

https://www.group-office.com/blog/post?id=8568233904931744115

Make sure config.php of Group-Office is readable by the prosody user!

I know because I had the same issue. I added the prosody user to the GroupOffice group: www-data
lalves
Posts: 6
Joined: Tue Feb 23, 2016 9:06 pm

Re: Chat module

Postby lalves » Thu Jun 08, 2017 2:17 am

szeplast wrote:
lalves wrote:Hi Szeplast.

authentication = "external"
...
Now login back to GO and the chat will work.


Thanks a lot, but there's no mod_auth_external module for prosody. At least I couldn't find it - but a rather old ALPHA version.

Update: found at github, installed along with lua-lpty. No error, but still doesn't work.

May 21 17:43:44 general info Hello and welcome to Prosody version 0.9.10
May 21 17:43:44 general info Prosody is using the select backend for connection handling
May 21 17:43:44 portmanager info Activated service 'c2s' on [::]:5222, [*]:5222
May 21 17:43:44 portmanager info Activated service 'legacy_ssl' on no ports
May 21 17:43:44 portmanager info Activated service 's2s' on [::]:5269, [*]:5269
May 21 17:43:44 mod_posix info Prosody is about to detach from the console, disabling further console output
May 21 17:43:44 mod_posix info Successfully daemonized to PID 3346
May 21 17:43:44 portmanager info Activated service 'http' on [::]:5280, [*]:5280
May 21 17:43:44 portmanager info Activated service 'https' on [::]:5281, [*]:5281

No Chat in Groupoffice. Module is enabled.

On the other hand, you wrote that we should update jabber host name, but the mods are in comments. Shall we remove comments in the affected lines?

I have tried, anyway, but didn't make any good.

What about the domains in GO and Prosody? Shall the same domains exist?


Hi, szeplast.

Sorry for late reply.

I can see here that the XMMP server prosody is working. Double check the external Auth mod is correctly enabled and if the prosody user is readable by GroupOffice user.

The other way that helped me to debug was using Firefox with console debug mode enabled. Doing so I could see what was preventing the chat module to run.
szeplast
Posts: 4
Joined: Mon Dec 30, 2013 2:35 pm

Re: Chat module

Postby szeplast » Thu Jun 08, 2017 7:15 am

lalves wrote:
szeplast wrote:
lalves wrote:I can see here that the XMMP server prosody is working. Double check the external Auth mod is correctly enabled and if the prosody user is readable by GroupOffice user.

The other way that helped me to debug was using Firefox with console debug mode enabled. Doing so I could see what was preventing the chat module to run.


The access rights are set as described - but I will check it again.

Anyway, we have got a new situation.

Chat is present for admin user (shows online state, but cannot create a room), but chat is hidden for any other users. Module permissions seems ok for me.

I can attach logs and screenshots later.
lalves
Posts: 6
Joined: Tue Feb 23, 2016 9:06 pm

Re: Chat module

Postby lalves » Thu Jun 08, 2017 11:10 pm

szeplast wrote:
lalves wrote:
szeplast wrote:


The access rights are set as described - but I will check it again.

Anyway, we have got a new situation.

Chat is present for admin user (shows online state, but cannot create a room), but chat is hidden for any other users. Module permissions seems ok for me.

I can attach logs and screenshots later.


If I understood right, you can connect chat using admin user but other users cannot use the chat? If is that the case, check chat permissions under Chat Permissions. Under Chat Permissions you can define the group that is allowed to use the chat.
szeplast
Posts: 4
Joined: Mon Dec 30, 2013 2:35 pm

Re: Chat module

Postby szeplast » Sun Jun 11, 2017 1:44 pm

lalves wrote:
If I understood right, you can connect chat using admin user but other users cannot use the chat? If is that the case, check chat permissions under Chat Permissions. Under Chat Permissions you can define the group that is allowed to use the chat.

U understood right but allowing all users to use the module didn't help.

I allowed "all users" for the first time, also tried to allow a specific user, but none helped.

Now its much clearer anyway, since after a reboot, no user can use the chat at all. Not even admin.

I'm getting slowly why this module is unsupported... :/

What do I have to change???

/usr/share/groupoffice/modules/chat/ChatModule.php :
------
public static function getBoshUri() {
$jabberHost = '192.168.1.82';
$boshUri = 'https://' . $jabberHost . ':5281/http-bind';

$proto = GO::request()->isHttps() ? 'https' : 'http';

$port = GO::request()->isHttps() ? 5281 : 5280;

return isset(GO::config()->chat_bosh_uri) ? GO::config()->chat_bosh_uri : $proto . '://' . self::getXmppHost() . ':' . $port . '/http-bind';
}

public static function getXmppHost() {
$jabberHost = '192.168.1.82';
return isset(GO::config()->chat_xmpp_host) ? GO::config()->chat_xmpp_host : $_SERVER['HTTP_HOST'];
}


root@mail:~# ls -ltr /etc/groupoffice/config.php
-rw-r--r-- 1 root www-data 902 máj 15 21:24 /etc/groupoffice/config.php
-------

/etc/prosody/prosody.cfg.lua lines 134-158/220 :
-------
authentication = "external"

external_auth_command = "/usr/bin/GroupOfficeProsodyAuth.php"
external_auth_protocol = "generic"
cross_domain_bosh = true
consider_bosh_secure = true -- trust bosh connection

bosh_ports = {
{
port = 5280;
path = "http-bind";
interface = "192.168.1.82";
}
}
--------

Client machine /etc/hosts:

192.168.1.82 <our.domain.name>

Same for the server

Chat module permissions as in the image:
https://goo.gl/photos/VfL5nh5Ttn6qAhQm8

Return to “GroupOffice main discussion”

Who is online

Users browsing this forum: No registered users and 2 guests

cron