Navigation

    Kopano
    • Register
    • Login
    • Search
    • Categories
    • Get Official Kopano Support
    • Recent
    Statement regarding the closure of the Kopano community forum and the end of the community edition

    WebApp - Rocket.Chat Plugin

    WebApp & Plugins
    7
    16
    2060
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • geri
      geri last edited by

      Update:
      Version 1.0.1: https://cloud.siedl.net/nextcloud/index.php/s/MeoZE86QZNGEt5e

      • Added config option for Rocket.Chat installations that are not accessible on the http-root of the configured hostname.
      • Also added some descriptions in the config file.

      Thanks for any feedback.

      Regards, Geri

      1 Reply Last reply Reply Quote 1
      • tiredofit
        tiredofit last edited by

        Hi @geri
        Thanks for this! We are big fans of Rocketchat in my organization.
        I however do struggle with getting this plugin to work.
        The plugin does not appear in the plugins list unless i perform a chmod -R 777 /usr/share/kopano-webapp/plugins/rchat
        Also, when I update the config-rchat.php file with my own host, clicking on the menu item does nothing, and actually limits the ability to save any options in the webclient there after unless I perform a webpage reload. I can’t tell anything in the Dev console or logs that there is anything happening.

        Has anyone else experienced such issue?

        1 Reply Last reply Reply Quote 0
        • geri
          geri last edited by

          Hi @tiredofit
          My guess would be a connection error between the kopano and Rocket.Chat server (which i missed to handle in my code, hence the update).
          Keep in mind, the kopano-server connects to the Rocket.Chat server directly, so the configured hostname/path needs to accessible from the kopano-server (https, for authentication purposes) and the browser on the client-pc.
          Regarding the chmod issue, did you install the deb file directly on manually unpack it?
          The permissions in the file are set to 755, which should be enough for it to work, since the plugin does not write anything to disk.
          Generally speaking, the user that is running the webserver needs to be able to read the files, no writing is required.
          Also, i case that may explain the permission thing: WebApp plugins are cached in the session, so for them to appear, you need to logout/login again into WebApp, reloading is not enough.

          Also:
          Update 1.0.2: https://cloud.siedl.net/nextcloud/index.php/s/3yKYARgGwfSZe2c

          • Added error handling for connection issues between kopano-server and Rocket.Chat - You should now receive a (more ore less) meaningful error message when clicking the menu entry, instead of nothing happening.

          @kopano staff
          Would it be possible to update the download link in the initial post, i now added a folder link, where new updates will be posted?

          fbartels 1 Reply Last reply Reply Quote 0
          • fbartels
            fbartels Kopano @geri last edited by

            @geri link updated

            Regards Felix

            Resources:
            https://kopano.com/blog/how-to-get-kopano/
            https://documentation.kopano.io/
            https://kb.kopano.io/

            Support overview:
            https://kopano.com/support/

            geri 1 Reply Last reply Reply Quote 1
            • geri
              geri @fbartels last edited by

              @fbartels
              Thank you

              1 Reply Last reply Reply Quote 0
              • TheChief79
                TheChief79 last edited by TheChief79

                Your plugin ist not working for me. When i click on the RocketChat link i get an error 400: Rocket.Chat - Serverside Error
                Received non-JSON response from https://rocketchat.xxx.local/api/v1/login

                With curl on the same machine API Login works and returns a valid JSON.

                On the rocketchat server i just see the fowllowing in the nging log:

                [23/Jun/2020:10:00:56 +0000] "POST /api/v1/login HTTP/1.0" 400 182 "-" "-"
                [23/Jun/2020:10:01:26 +0000] "POST /api/v1/login HTTP/1.0" 400 182 "-" "-"
                [23/Jun/2020:10:01:33 +0000] "POST /api/v1/login HTTP/1.0" 400 182 "-" "-"
                

                Any ideas? Rocketchat is running with NGINX reverse proxy.

                1 Reply Last reply Reply Quote 0
                • TheChief79
                  TheChief79 last edited by

                  I think i found the error. I always set PLUGIN_RCHAT_HOST to https://my.chat.server instead of my.chat.server. But in module.rchat.php i found this line:

                  $res = $this->sendPost('https://' . PLUGIN_RCHAT_HOST . '/' . (defined('PLUGIN_RCHAT_PATH') ? PLUGIN_RCHAT_PATH : '') . 'api/v1/login', array('user' => $this->username, 'password' => $this->password));
                  

                  So i removed https:// in my plugin config. Still not working. So i checked plugin.rchat.php and there https:// was missing.

                  function injectPluginSettings(&$data) {
                  
                      $defaultIcon = PATH_PLUGIN_DIR . '/rchat/resources/icons/icon_default.png';
                      $pluginData = array(
                        'enable' => PLUGIN_RCHAT_USER_DEFAULT_ENABLE,
                        'button-title' => PLUGIN_RCHAT_BUTTON_TITLE,
                  -      'url' => 'PLUGIN_RCHAT_HOST . '/' . (defined('PLUGIN_RCHAT_PATH') ? PLUGIN_RCHAT_PATH : ''),
                  +      'url' => 'https://'.PLUGIN_RCHAT_HOST . '/' . (defined('PLUGIN_RCHAT_PATH') ? PLUGIN_RCHAT_PATH : ''),
                        'autostart' => defined('PLUGIN_RCHAT_AUTOSTART') ? !!PLUGIN_RCHAT_AUTOSTART : false,
                        'icon' => defined('PLUGIN_RCHAT_ICON') ? PATH_PLUGIN_DIR. '/rchat/' . PLUGIN_RCHAT_ICON : $defaultIcon
                      );
                  

                  Maybe PLUGIN_RCHAT_HOST should contain the whole url with http(s)://

                  1 Reply Last reply Reply Quote 0
                  • TheChief79
                    TheChief79 last edited by

                    Also working when you set PLUGIN_RCHAT_HOST to https://my.chat.server and change

                    $res = $this->sendPost('https://' . PLUGIN_RCHAT_HOST . '/' . (defined('PLUGIN_RCHAT_PATH') ? PLUGIN_RCHAT_PATH : '') . 'api/v1/login', array('user' => $this->username, 'password' => $this->password));
                    

                    to

                    $res = $this->sendPost(PLUGIN_RCHAT_HOST . '/' . (defined('PLUGIN_RCHAT_PATH') ? PLUGIN_RCHAT_PATH : '') . 'api/v1/login', array('user' => $this->username, 'password' => $this->password));
                    

                    and comment out

                    #        'header'  => 'Host: ' . PLUGIN_RCHAT_HOST,
                    

                    Also working for me.

                    1 Reply Last reply Reply Quote 0
                    • geri
                      geri last edited by

                      Hi @TheChief79 ,

                      Thanks for your detailed analysis of the problem you encountered.
                      The reasons why the https:// is hardcoded, were the following:

                      • If your rocket.chat installation is not reachable via https, but your WebApp is, you will not be able the open the tab anyhow, since modern browsers security policy do not permit opening insecure pages in iframes inside of secure pages.
                        In DeskApp it will still work though, since its not iframes used there, but i’d still recommend SSL encryption.
                        (And if WebApp is not SSL encrypted, there’s definitely something wrong tbh)
                      • To make it easier on myself to add the proper host-header, which apparently is not required since it works for you even without it behind a proxy, i guess php already adds it itself.

                      Also about the missing https:// in plugin.rchat.php:
                      I rechecked my source, and all the .deb files available for download and nowhere is the https is missing.
                      Could you maybe have removed it earlier in you debugging process and forgot?

                      I’ll add the option for the chatserver hostname to work with added http(s):// protocol, and if it is not set add it.
                      I’ll do some tests about the host-header beforehand though (and remove it if its really not required), and hopefully be able to implement the following planned features:

                      • Cache the rocket.chat session in the WebApp settings, and reuse it if its still valid, so you don’t get a new session everytime (This apparently invalidates other sessions (in your browser for example) if they were not active in some time)
                      • Make the desktop notifications when clicked automatically focus the chat-tab (and eventually even the right channel, if possible) in WebApp, instead of only the browser/DeskApp.

                      Kind regards, geri

                      1 Reply Last reply Reply Quote 0
                      • TheChief79
                        TheChief79 last edited by

                        Thank you for your answer.

                        It could be that i removed https:// by myself while debugging my problem and i understand your explanation. I re-checked your lates .deb and there in both files the “https://” is present. So it seems to be ok. I will re-test with your debs and a clean install of your plugin.

                        Thanks for your help.

                        onex.de 1 Reply Last reply Reply Quote 0
                        • onex.de
                          onex.de @TheChief79 last edited by

                          After installing this PlugIn, the Threema PlugIn didn’t work anymore :(

                          robsie 1 Reply Last reply Reply Quote 0
                          • robsie
                            robsie @onex.de last edited by

                            @onex-de said in WebApp - Rocket.Chat Plugin:

                            Threema

                            Would you like to use Threema in addition to Rocket.Chat?

                            mhope 1 Reply Last reply Reply Quote 0
                            • mhope
                              mhope @robsie last edited by mhope

                              Hi @robsie,
                              the plugin worked great for me/us until a few weeks ago. Then in Rocket.Chat the channellist on the left side is empty (see picture).
                              Any ideas on how to fix this?

                              • Kopano 8.7.25, Webapp 5.3 runnig on Univention 4.4
                              • RC 4.8.1 Enterprise Snap

                              Screenshot

                              Any help is kindly appreciated :)

                              Kind regards,

                              Marco

                              1 Reply Last reply Reply Quote 0
                              • geri
                                geri last edited by

                                Hi @mhope ,
                                this seems to be an issue with recent versions of rocket.chat when viewed in outdated browsers.
                                I had this happen to me too, when trying to open it in an ancient version of opera, even without the kopano plugin (looked exactly like your screenshot).
                                You could still open channels using the search, but the list was broken.

                                Kind regards,
                                Geri

                                1 Reply Last reply Reply Quote 0
                                • First post
                                  Last post