Giter Site home page Giter Site logo

rocketchat_nextcloud's Introduction

Rocket Chat Official App

Place this app in nextcloud/apps/

Not tested yet with 4.8.x and 5.x.x

Rocket Chat Configuration

  • If you get something like "refused to connect" and/or "ERR_BLOCKED_BY_RESPONSE" then you need to go to "Administration -> General -> Options to X-Frame-Options" and add your Nextcloud URL e.g. https://rgwit.mydomain.com
  • In order to add members to a chat about a file directly from the discussion view an admin must go to "Administration -> Layout -> User Interface" and check "Show top navbar in embedded layout"
  • To be able to register users and get an auth token, your RocketChat server MUST have the Environment Variable "CREATE_TOKENS_FOR_USERS=true" set. In a standard installation, just add it (without double quotes, for sure) in /lib/systemd/system/rocketchat.service
  • UPDATE SINCE 4.8.x The user that will authenticate in the NextCloud MUST HAVE THE ROLE OF BOT!

NextCloud Configuration

  • As an NextCloud admin go to "Settings -> Administration -> Rocket Chat"
  • Provide the Rocket Chat installation URL, Admin user name and Password and Click Connect and Register

Browser Notifications

While using NextCloud you can receive notifications from Rocket chat by allowing the browser to send desktop notifications.

You can learn how to enable browser notifications here: https://support.google.com/chrome/answer/3220216?co=GENIE.Platform%3DDesktop&hl=en

Full documented video to install both platforms from scratch in Ubuntu 20.0.x here:

https://youtu.be/AshE2uG87GE

rocketchat_nextcloud's People

Contributors

engelgabriel avatar florisvangeel avatar ruvenss avatar vitormattos avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rocketchat_nextcloud's Issues

Docker installation and CREATE_TOKENS_FOR_USERS

I'm new to docker but installed rocketchat via docker as it was recommended. It's been a learning curve, seems the default mongo image version is deprecated so learning to upgrade that was fun. So its all running well but I need to include the "CREATE_TOKENS_FOR_USERS=true" but am having trouble achieving this.

The example is the readme is snap specific, please let me know how to do this in an established docker container which doesn't appear to run systemd.

Thank you

Reset credentials when logging in with another account on the same browser

When I log in in rocketchat_nextcloud with the admin account, then log out, and log in with my member account, the rocketchat_nextcloud app is already logged in with my admin account.

What I'm expecting is that rocketchat_nextcloud app is tied with my current account, and does not remember the credentials of the previous account I used.

Why can't this be FREE and EASY ?

I'm trying to install this in my own server. This is a military server and can't access internet in any way.

I have a working install in Docker, but after my first access, I face a 4 steps registration (for my LOCAL copy?).

I think if it is free and open source, when we do a local stand alone install then we don't need anything else to get it up and ready to use.

It is very annoying all these online account creation to just use a local server. Complex, annoying and burocratic.

I register online, then can't find any way to take a registration token to fill the "REG_TOKEN" docker environment variable.

Why all of this? If it is local, then it is LOCAL. If it is free, then it is FREE. If it is Docker, then please, please, let us run it without all these close control. Let it go.

So I'll give up to use this. It is open, free but I simply can't use it because my corp server can't reach the internet just to tell you I'm using your free product.

And.... if I'm wrong and there is any way to run a local server without all these online registrations bureaucracy, please let this more clear because I couldn't find.

Login token doesn't work for LDAP

Hello,

I have configure Nextcloud and RocketChat to use OpenLDAP to authent user.

From Nextcloud, the automatic authent doesn't work.

I d'ont know if prob is from Nextcloud or Rocket.

I can post some log if you telle me what log you want :)

Have a good day.

There was an issue connecting to NextCloud

Trying to connect Nextcloud and Rocketchat.

I tried:

  • "Administration -> General -> Options to X-Frame-Options" and add your Nextcloud URL e.g.

Here, I am not quite sure. While I did enter my Nextcloud URL, the description for this field actually says that there are two options: deny and sameorigin. Entering an URL does not seem to be foreseen. Can someone please confirm that entering a URL is still the right thing to do?

  • your RocketChat server MUST have the Environment Variable "CREATE_TOKENS_FOR_USERS=true" set. In a standard installation, just add it (without double quotes, for sure) in /lib/systemd/system/rocketchat.service

My installation is in Docker via docker-compose. So I added the environment variable to my docker-compose.yml file (and for good measure I prepended "OVERWRITE_SETTINGS_".

Not sure what else I could/should do.

Has anyone gotten this integration to work yet?

Thanks

Regenerate admin auth token

Please add the ability to automatically regenerate the administrative token at certain intervals, because the integration stops working as soon as its lifespan comes to an end and a manual override is needed.

Error in the journactl of rocketchat

mars 30 18:55:50 X RocketChat[1614954]: {"level":50,"time":"2022-03-30T16:55:50.799Z","pid":1614954,"hostname":"CX","name":"System","msg":"Exception while invoking method logoutCleanUp 'Match error: Expected object, got null'"}

I don't know if its important but i got this error when i connect to the app

where is version 0.9.7?

In the NC app store the description for this app talks about 0.9.7.

But I can only find 0.9.6.

So where is 0.9.7?

Thanks

There was an issue connecting to NextCloud

Hey everybody,

first of all heads up for this extension! We both love rocket.chat and nextcloud and are really looking forward to this new user experience. Nevertheless I'm getting stuck while connection our rocket.chat instance with our cextcloud server.

I added the CREATE_TOKENS_FOR_USERS=true in the docker-compose.yml under environment, but when I'm trying to log into rocket.chat through the nextcloud settings, I'm always getting this error:

There was an issue connecting to NextCloud, please report it to https://github.com/RocketChat/nextcloud/

No other informations. What can I do? :/
Thanks for your help!

Docker issue solved

i was investigating why docker's nextcloud is not working with this app..

I think its cause php's version is not ok...

Take a look on my test:

docker-compose exec nextcloud /bin/bash
cd /var/www/html/custom_apps/rocketchat_nextcloud
make

make composer
make[1]: Entering directory '/var/www/html/custom_apps/rocketchat_nextcloud'
No composer command available, downloading a copy from the web
mkdir -p /var/www/html/custom_apps/rocketchat_nextcloud/build/tools
curl -sS https://getcomposer.org/installer | php
All settings correct for using Composer
Downloading...

Composer (version 2.4.1) successfully installed to: /var/www/html/custom_apps/rocketchat_nextcloud/composer.phar
Use it: php composer.phar

mv composer.phar /var/www/html/custom_apps/rocketchat_nextcloud/build/tools
php /var/www/html/custom_apps/rocketchat_nextcloud/build/tools/composer.phar install --prefer-dist
Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
Your lock file does not contain a compatible set of packages. Please run composer update.

  Problem 1
    - phpspec/prophecy is locked to version v1.10.3 and an update of this package was not requested.
    - phpspec/prophecy v1.10.3 requires php ^5.3|^7.0 -> your php version (8.0.22) does not satisfy that requirement.
  Problem 2
    - phpunit/php-code-coverage is locked to version 4.0.8 and an update of this package was not requested.
    - phpunit/php-code-coverage 4.0.8 requires php ^5.6 || ^7.0 -> your php version (8.0.22) does not satisfy that requirement.
  Problem 3
    - phpunit/php-timer is locked to version 1.0.9 and an update of this package was not requested.
    - phpunit/php-timer 1.0.9 requires php ^5.3.3 || ^7.0 -> your php version (8.0.22) does not satisfy that requirement.
  Problem 4
    - phpunit/php-token-stream is locked to version 2.0.2 and an update of this package was not requested.
    - phpunit/php-token-stream 2.0.2 requires php ^7.0 -> your php version (8.0.22) does not satisfy that requirement.
  Problem 5
    - phpunit/phpunit is locked to version 5.7.27 and an update of this package was not requested.
    - phpunit/phpunit 5.7.27 requires php ^5.6 || ^7.0 -> your php version (8.0.22) does not satisfy that requirement.
  Problem 6
    - phpunit/phpunit-mock-objects is locked to version 3.4.4 and an update of this package was not requested.
    - phpunit/phpunit-mock-objects 3.4.4 requires php ^5.6 || ^7.0 -> your php version (8.0.22) does not satisfy that requirement.
  Problem 7
    - sebastian/diff is locked to version 1.4.3 and an update of this package was not requested.
    - sebastian/diff 1.4.3 requires php ^5.3.3 || ^7.0 -> your php version (8.0.22) does not satisfy that requirement.
  Problem 8
    - sebastian/environment is locked to version 2.0.0 and an update of this package was not requested.
    - sebastian/environment 2.0.0 requires php ^5.6 || ^7.0 -> your php version (8.0.22) does not satisfy that requirement.
  Problem 9
    - sebastian/diff 1.4.3 requires php ^5.3.3 || ^7.0 -> your php version (8.0.22) does not satisfy that requirement.
    - sebastian/comparator 1.2.4 requires sebastian/diff ~1.2 -> satisfiable by sebastian/diff[1.4.3].
    - sebastian/comparator is locked to version 1.2.4 and an update of this package was not requested.

make[1]: *** [Makefile:77: composer] Error 2
make[1]: Leaving directory '/var/www/html/custom_apps/rocketchat_nextcloud'
make: *** [Makefile:59: build] Error 2

php --version
PHP 8.0.22 (cli) (built: Aug  4 2022 21:58:17) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.22, Copyright (c) Zend Technologies
    with Zend OPcache v8.0.22, Copyright (c), by Zend Technologie

As you can see its needs php 5~7 and inside the container we got version 8..

So we need to downgrade php on Nextcloud image to version 7 or ask dev to upgrade app's to php 8..

The first option is solved like this:

git clone https://github.com/nextcloud/docker.git
cd docker/22/apache
vim Dockerfile

Look for: 
FROM php:8.0-apache-bullseye

Change to:
FROM php:7.4.30-apache-bullseye

Save and exit

docker build -t nextcloud-apache-php7:22.2.10 .

Use this brand new image nextcloud-apache-php7:22.2.10 on you docker project

Cheers :)

autoinstallers

Well, with all the configuration issues I've sat with trying to get a self-hosted rocket.chat server running, I'd ask if there is an easier auto-installer. Because I've followed soooooo many help files and guide files, I'm still struggling to get rocketchat installed and working properly.

Integration with existing RocketChat users

Hello!

I tried to look through all the documentation but I couldn't find much regarding existing accounts in a RocketChat instance
At this time I have a RocketChat instance that has been used for the past few years. New Nextcloud docker setup with no users yet. (Minus the default admin account)

My understanding of the current available documentation, if I enable integration it would automatically create new RocketChat accounts as users sign into Nextcloud.

Is there a way to link up the two accounts (Nextcloud/RocketChat) - do I need to make sure username/email address/password is the same?

These are two standalone instances at this time, no LDAP in this environment.

Auto login don't work

Hi many many thanks for this app, the autocreation of account works but i got this error in firefox

PHP Version : 8.0.15
Nextcloud 23.0.0.2

Error: Promised response from onMessage listener went out of scope
Uncaught TypeError: document.querySelector(...) is null
NextJS
NextJS 2
chat.js:9:26

Maybe its
a header X-Frame-Options unvalid « https://X.org/ » : « https://Xorg/ » is not a valid directive

my directive its ALLOW-FROM https://cloud.XXX.org

Maybe its my X-Frame-Options that is not got maybe we could document more this part ?

Cannot declare class OCA\RocketIntegration\AppInfo\Application

Hi there and thank you very much for this new app integration! :)

Trying to enable the app version 0.9.3, I get this error message:

PHP Fatal error: Cannot declare class OCA\RocketIntegration\AppInfo\Application, because the name is already in use in /usr/local/www/nextcloud/apps/rocketchat_nextcloud/lib/AppInfo/Application.php on line 0

Best regards

Nextcloud version 24

Hi,
the Rocket.Chat Nextcloud app is no longer working on Nextcloud version 24.
Are you still planning to maintain this app in the future?
Rik

Error downloading

Hello,

When I try to download the application on my nextcloud server I get the following error:

An error occurred during the request. Cannot continue.
Could not extract app rocketchat_nextcloud: Out-of-path file extraction {/volume1/@tmp/oc_tmp_sajp56-folder/rocketchat_nextcloud/vendor/bin/phpunit --> ../phpunit/phpunit/phpunit/phpunit}

I don't know if it's my server or the application itself but I would appreciate information about this error to know if there is a way to solve it.

Thanks

Documentation how to configure on nextcloud

Hi, I'm new rocketchat...

I'm using nextcloud for some time with Talk (chat & video).

I saw a FOSS publication of RocketChat (link)

I want to try but I get block on the part of configuration at Nextcloud > Settings > Rocketchat

Where do I find "Admin user ID", "Admin Token"?
There is a good guide you can give me to point me in the right direction how setup?

Application fails. Undefined Arraykey authtoken

after registering the app and getting the token and userid i now get this error in the nextcloud log:

{"reqId":"BEGRD6i3wBv04GcAMmrv","level":3,"time":"2022-03-02T14:31:20+00:00","remoteAddr":"2.65.13.161","user":"admin","app":"PHP","method":"GET","url":"/apps/rocketchat_nextcloud/","message":"Undefined array key \"authToken\" at /var/www/nextcloud/presentation/apps/rocketchat_nextcloud/lib/Rocket/User.php#241","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36","version":"23.0.2.1","exception":{"Exception":"Error","Message":"Undefined array key \"authToken\" at /var/www/nextcloud/presentation/apps/rocketchat_nextcloud/lib/Rocket/User.php#241","Code":0,"Trace":[{"file":"/var/www/nextcloud/presentation/apps/rocketchat_nextcloud/lib/Rocket/User.php","line":241,"function":"onError","class":"OC\\Log\\ErrorHandler","type":"::"},{"file":"/var/www/nextcloud/presentation/apps/rocketchat_nextcloud/lib/Controller/PageController.php","line":63,"function":"findByNcUserId","class":"OCA\\RocketchatNextcloud\\Rocket\\User","type":"->"},{"file":"/var/www/nextcloud/presentation/lib/private/AppFramework/Http/Dispatcher.php","line":217,"function":"index","class":"OCA\\RocketchatNextcloud\\Controller\\PageController","type":"->"},{"file":"/var/www/nextcloud/presentation/lib/private/AppFramework/Http/Dispatcher.php","line":126,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/presentation/lib/private/AppFramework/App.php","line":157,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/presentation/lib/private/Route/Router.php","line":302,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/nextcloud/presentation/lib/base.php","line":1006,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/nextcloud/presentation/index.php","line":36,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloud/presentation/lib/private/Log/ErrorHandler.php","Line":92,"CustomMessage":"--"}} {"reqId":"BEGRD6i3wBv04GcAMmrv","level":3,"time":"2022-03-02T14:31:20+00:00","remoteAddr":"2.65.13.161","user":"admin","app":"index","method":"GET","url":"/apps/rocketchat_nextcloud/","message":"OC\\Log::error(): Argument #1 ($message) must be of type string, null given, called in /var/www/nextcloud/presentation/lib/private/Log/PsrLoggerAdapter.php on line 140 in file '/var/www/nextcloud/presentation/lib/private/Log.php' line 142","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36","version":"23.0.2.1","exception":{"Exception":"Exception","Message":"OC\\Log::error(): Argument #1 ($message) must be of type string, null given, called in /var/www/nextcloud/presentation/lib/private/Log/PsrLoggerAdapter.php on line 140 in file '/var/www/nextcloud/presentation/lib/private/Log.php' line 142","Code":0,"Trace":[{"file":"/var/www/nextcloud/presentation/lib/private/AppFramework/App.php","line":157,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/presentation/lib/private/Route/Router.php","line":302,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/nextcloud/presentation/lib/base.php","line":1006,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/nextcloud/presentation/index.php","line":36,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloud/presentation/lib/private/AppFramework/Http/Dispatcher.php","Line":158,"Previous":{"Exception":"TypeError","Message":"OC\\Log::error(): Argument #1 ($message) must be of type string, null given, called in /var/www/nextcloud/presentation/lib/private/Log/PsrLoggerAdapter.php on line 140","Code":0,"Trace":[{"file":"/var/www/nextcloud/presentation/lib/private/Log/PsrLoggerAdapter.php","line":140,"function":"error","class":"OC\\Log","type":"->"},{"file":"/var/www/nextcloud/presentation/lib/private/AppFramework/ScopedPsrLogger.php","line":89,"function":"error","class":"OC\\Log\\PsrLoggerAdapter","type":"->"},{"file":"/var/www/nextcloud/presentation/apps/rocketchat_nextcloud/lib/Controller/PageController.php","line":64,"function":"error","class":"OC\\AppFramework\\ScopedPsrLogger","type":"->"},{"file":"/var/www/nextcloud/presentation/lib/private/AppFramework/Http/Dispatcher.php","line":217,"function":"index","class":"OCA\\RocketchatNextcloud\\Controller\\PageController","type":"->"},{"file":"/var/www/nextcloud/presentation/lib/private/AppFramework/Http/Dispatcher.php","line":126,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/presentation/lib/private/AppFramework/App.php","line":157,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/presentation/lib/private/Route/Router.php","line":302,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/nextcloud/presentation/lib/base.php","line":1006,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/nextcloud/presentation/index.php","line":36,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloud/presentation/lib/private/Log.php","Line":142},"CustomMessage":"--"}}

Release tested with 24.x

Hello and thank you for your good work!

The current version ist tested with Nextcloud min 22 and max 23. When do you plan to release a tested Rocket Chat App for Nextcloud 24?

Rocket-chat window in Nextcloud is blank

I have tried to integrate my nextcloud instance with rocket chat, but when I click on the rocket-chat icon in Nextcloud, the page is blank. There are no visible errors in the Nextcloud logs, and rocket-chat logs aren't showing anything other than

rocket-chat-rocketchat-1  | {"level":50,"time":"2022-08-03T12:57:56.060Z","pid":1,"hostname":"eba3900c8025","name":"System","msg":"Exception while invoking method permissions/get 'Match error: Failed Match.OneOf, Match.Maybe or Match.Optional validation'"}

I can successfully log into the rocket-chat web interface, and both instances are backed by LDAP.
I have used the same settings as can be found in the Youtube tutorial. I have added the bot role to the admin user in rocket chat too. Any ideas on what could be the issue?

Group limit

Add please limitation for groups. I have a lot of groups but want users only from several groups to access this application

Cannot link Nextcloud to RocketChat

I have successfully installed RocketChat server on Ubuntu20.04 via docker compose.. But when I go to the Nextcloud admin settings to connect it, the Admin User ID and Admin Token fields are greyed out. If I try and use my admin user and password, it says connecting and then just nothing happens. No log entries either. Any thoughts and how to fix this?

composer v2: match the expected JSON schema.

Nextcloud 22
node v14.19.0
npm@7

cd apps
git clone https://github.com/RocketChat/rocketchat_nextcloud.git
~/apps/rocketchat_nextcloud$ composer install

issue

                                                                                             
  [Composer\Json\JsonValidationException]                                                    
  "./composer.json" does not match the expected JSON schema:                                 
   - name : Does not match the regex pattern ^[a-z0-9]([_.-]?[a-z0-9]+)*/[a-z0-9](([_.]?|-{  
  0,2})[a-z0-9]+)*$                                                                          
                                                                                             

fixed compser.json you get it in a pull request.

composer install
npm install
npm run build

Enable the app via UI:

{"reqId":"vcENhwKUfnXbUMRKxzp1","level":3,"time":"2022-02-28T23:52:16+00:00","remoteAddr":"REDACTED","user":"REDACTED","app":"PHP","method":"POST","url":"/settings/apps/enable",

"message":"Cannot declare class OCA\\RocketIntegration\\AppInfo\\Application, because the name is already in use at 

/var/www/REDACTED/apps/rocketchat_nextcloud/lib/AppInfo/Application.php#0","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.109 Safari/537.36","version":"22.2.0.2"}

refused to connect inside of nextcloud

I'm guessing this can be fixed inside of my nginx RP configuration, if anyone is familiar with the code to bypass to allow this? iframe? Thanks for your time.

Notifications in Nexcloud

First of all:
Thank you, this is a fantastic feature!

With v 0.9.5 everything "just works". Registering the RC server from the NC settings, adding new RC users on-the-fly from NC (Even with CAS authentication on RC), all no problem.

Only bug we have found:
The Nextcloud Notifications don't seem to work.

I've found the RC options, in the NC personal settings, to activate mail and push notifications, they don't seem to have an effect when the user receives new RC messages. Maybe these options aren't supposed to trigger NC notification on new messages, some visual indication (of new RC activities) in the NC ui would be nice to have.

Internal server error, log related

Installed the app and configured an admin service user.
when navigating the browser to /apps/rocketchat_nextcloud/ an internal server error is triggered.

image

this is shown in data/nextcloud.log:
{
  "reqId": "9sO44sY7WCeHLY6XGIvG",
  "level": 3,
  "time": "2022-03-03T12:59:40+00:00",
  "remoteAddr": "10.50.0.254",
  "user": "superadmin",
  "app": "index",
  "method": "GET",
  "url": "/apps/rocketchat_nextcloud/",
  "message": "OC\\Log::error(): Argument #1 ($message) must be of type string, bool given, called in /var/www/nc22demo/lib/private/Log/PsrLoggerAdapter.php on line 140",
  "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.109 Safari/537.36",
  "version": "22.2.0.2",
  "exception": {
    "Exception": "Exception",
    "Message": "OC\\Log::error(): Argument #1 ($message) must be of type string, bool given, called in /var/www/nc22demo/lib/private/Log/PsrLoggerAdapter.php on line 140",
    "Code": 0,
    "Trace": [
      {
        "file": "/var/www/nc22demo/lib/private/AppFramework/App.php",
        "line": 156,
        "function": "dispatch",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->"
      },
      {
        "file": "/var/www/nc22demo/lib/private/Route/Router.php",
        "line": 301,
        "function": "main",
        "class": "OC\\AppFramework\\App",
        "type": "::"
      },
      {
        "file": "/var/www/nc22demo/lib/base.php",
        "line": 1000,
        "function": "match",
        "class": "OC\\Route\\Router",
        "type": "->"
      },
      {
        "file": "/var/www/nc22demo/index.php",
        "line": 36,
        "function": "handleRequest",
        "class": "OC",
        "type": "::"
      }
    ],
    "File": "/var/www/nc22demo/lib/private/AppFramework/Http/Dispatcher.php",
    "Line": 158,
    "Previous": {
      "Exception": "TypeError",
      "Message": "OC\\Log::error(): Argument #1 ($message) must be of type string, bool given, called in /var/www/nc22demo/lib/private/Log/PsrLoggerAdapter.php on line 140",
      "Code": 0,
      "Trace": [
        {
          "file": "/var/www/nc22demo/lib/private/Log/PsrLoggerAdapter.php",
          "line": 140,
          "function": "error",
          "class": "OC\\Log",
          "type": "->"
        },
        {
          "file": "/var/www/nc22demo/lib/private/AppFramework/ScopedPsrLogger.php",
          "line": 89,
          "function": "error",
          "class": "OC\\Log\\PsrLoggerAdapter",
          "type": "->"
        },
        {
          "file": "/var/www/nc22demo/apps/rocketchat_nextcloud/lib/Controller/PageController.php",
          "line": 64,
          "function": "error",
          "class": "OC\\AppFramework\\ScopedPsrLogger",
          "type": "->"
        },
        {
          "file": "/var/www/nc22demo/lib/private/AppFramework/Http/Dispatcher.php",
          "line": 217,
          "function": "index",
          "class": "OCA\\RocketchatNextcloud\\Controller\\PageController",
          "type": "->"
        },
        {
          "file": "/var/www/nc22demo/lib/private/AppFramework/Http/Dispatcher.php",
          "line": 126,
          "function": "executeController",
          "class": "OC\\AppFramework\\Http\\Dispatcher",
          "type": "->"
        },
        {
          "file": "/var/www/nc22demo/lib/private/AppFramework/App.php",
          "line": 156,
          "function": "dispatch",
          "class": "OC\\AppFramework\\Http\\Dispatcher",
          "type": "->"
        },
        {
          "file": "/var/www/nc22demo/lib/private/Route/Router.php",
          "line": 301,
          "function": "main",
          "class": "OC\\AppFramework\\App",
          "type": "::"
        },
        {
          "file": "/var/www/nc22demo/lib/base.php",
          "line": 1000,
          "function": "match",
          "class": "OC\\Route\\Router",
          "type": "->"
        },
        {
          "file": "/var/www/nc22demo/index.php",
          "line": 36,
          "function": "handleRequest",
          "class": "OC",
          "type": "::"
        }
      ],
      "File": "/var/www/nc22demo/lib/private/Log.php",
      "Line": 141
    },
    "CustomMessage": "--"
  }
}

class httpful\\request not found

When trying to configure the app in nextcloud and connect to a nextcloud instance i get:

{"reqId":"I5NYTnC5cIWNWYGchEww","level":3,"time":"2022-03-02T12:23:35+00:00","remoteAddr":"2.65.13.161","user":"admin","app":"index","method":"POST","url":"/apps/rocketchat_nextcloud/setup-url","message":"Class \"Httpful\\Request\" not found","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36","version":"23.0.2.1","exception":{"Exception":"Error","Message":"Class \"Httpful\\Request\" not found","Code":0,"Trace":[{"file":"/var/www/nextcloud/presentation/apps/rocketchat_nextcloud/lib/Rocket/User.php","line":63,"function":"__construct","class":"OCA\\RocketchatNextcloud\\Rocket\\Client","type":"->"},{"function":"__construct","class":"OCA\\RocketchatNextcloud\\Rocket\\User","type":"->"},{"file":"/var/www/nextcloud/presentation/lib/private/AppFramework/Utility/SimpleContainer.php","line":106,"function":"newInstanceArgs","class":"ReflectionClass","type":"->"},{"file":"/var/www/nextcloud/presentation/lib/private/AppFramework/Utility/SimpleContainer.php","line":114,"function":"buildClass","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/var/www/nextcloud/presentation/lib/private/AppFramework/Utility/SimpleContainer.php","line":131,"function":"resolve","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/var/www/nextcloud/presentation/lib/private/AppFramework/DependencyInjection/DIContainer.php","line":463,"function":"query","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/var/www/nextcloud/presentation/lib/private/AppFramework/DependencyInjection/DIContainer.php","line":435,"function":"queryNoFallback","class":"OC\\AppFramework\\DependencyInjection\\DIContainer","type":"->"},{"file":"/var/www/nextcloud/presentation/lib/private/AppFramework/Utility/SimpleContainer.php","line":87,"function":"query","class":"OC\\AppFramework\\DependencyInjection\\DIContainer","type":"->"},{"function":"OC\\AppFramework\\Utility\\{closure}","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/presentation/lib/private/AppFramework/Utility/SimpleContainer.php","line":106,"function":"array_map"},{"file":"/var/www/nextcloud/presentation/lib/private/AppFramework/Utility/SimpleContainer.php","line":114,"function":"buildClass","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/var/www/nextcloud/presentation/lib/private/AppFramework/Utility/SimpleContainer.php","line":131,"function":"resolve","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/var/www/nextcloud/presentation/lib/private/AppFramework/DependencyInjection/DIContainer.php","line":463,"function":"query","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/var/www/nextcloud/presentation/lib/private/AppFramework/DependencyInjection/DIContainer.php","line":435,"function":"queryNoFallback","class":"OC\\AppFramework\\DependencyInjection\\DIContainer","type":"->"},{"file":"/var/www/nextcloud/presentation/lib/private/AppFramework/App.php","line":144,"function":"query","class":"OC\\AppFramework\\DependencyInjection\\DIContainer","type":"->"},{"file":"/var/www/nextcloud/presentation/lib/private/Route/Router.php","line":302,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/nextcloud/presentation/lib/base.php","line":1006,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/nextcloud/presentation/index.php","line":36,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloud/presentation/apps/rocketchat_nextcloud/lib/Rocket/Client.php","Line":31,"CustomMessage":"--"}}

When doing local testing, the chat.js sends postMessage before the iframed rocket.chat application is ready to handle it

I am currently testing this integration between NC and rocket.chat.

Following the instructions (and after setting the env. variable CREATE_TOKENS_FOR_USERS=true in Rocket.chat) I am able to access the "rocket chat icon in NC".

Clicking on it has the browser end up on the login screen of Rocket.Chat.

When I look in Rocket.chat and in NC db (oc_rocket_users table), I can see that the integration has actually created the user correctly in both places.

There are no errors in the console but I can see that the token is actually set in the DOM and the postMessage for login-with-token is called.

If I change the chat.js to postpone the logout and login-with-token messages until 2 seconds after the "load" event is handled, then it works, and the user is signed in to rocket chat.

It is of course not a solution to the problem, but more of an attempt to see if it was a timing issue as suspected.

My Setup
I run applications in docker.

My updated chat.js

document.addEventListener("DOMContentLoaded", function () {
    var elements = document.getElementsByClassName('messenger--add-members-info');
    if (elements.length > 0) {
        setTimeout(function () {
            elements[0].classList.add('messenger--hidden');
        }, 7000);
    }

    // Always logout the user first, as it could be using a session of another user
    var token = document.querySelector('input[name=rocketchat_token]').value;
    var iframeDoc = document.querySelector('iframe');
	
    document.querySelector('iframe').addEventListener("load", function() {
	console.log("Scheduling login after load handler");
		
	setTimeout(function(){
		console.log("Logging out from combined handler");
		iframeDoc.contentWindow.postMessage({
				externalCommand: 'logout',
				token: token
			}, '*');	
	
		if(token) {
			console.log("Logging in from the combined handler", token);		
			iframeDoc.contentWindow.postMessage({
				externalCommand: 'login-with-token',
				token: token
			}, '*');		
		} else {
			console.log("Could bot find the token");
		}
	},2000);
	
    });

});

My question
Is this just something that happens locally (I have not had this running in a real environment yet), or does the Rocket.chat --> nextcloud integration need a better "ready" sign before the logout and login-with-token messages are sent to the iframe?


Rocket Chat logs out when reloading with existing user

I have connected an existing instance of Rocket Chat (4.5.4) with an existing instance of Nextcloud (Nextcloud Hub II (23.0.3)).
In both platforms, the user associated to my email address exist and I have even changed the password so that it matches in both servers. I have installed and configured the Rocket Chat app in Nextcloud as in the youtube video in the documentation. When clicking on the Rocket Chat tab on Nextcloud I am requested to enter a username and password.

I imagine it does not necessarily associate existing users with matching email address. However after login in, if I refresh the page or switch between Nextcloud tabs it logs out with the following error message:

  __action__ is not allowed

and this is the error log from the inspector console on Chromium:

Blocked autofocusing on a <input> element in a cross-origin subframe.

...

0f6307921c60cb01b70885b26651947c8262f4da.js?meteor_js_resource=true:1496 Uncaught (in promise) r {isClientSafe: true, error: 'error-action-not-allowed', reason: 'Login neccessary', details: {…}, message: 'Login neccessary [error-action-not-allowed]', …}

...

r {isClientSafe: true, error: 'error-invalid-user', reason: 'Invalid user', details: {…}, message: 'Invalid user [error-invalid-user]', …}

extracting error

I get this error when i try to download and install rocket.chat. Could not extract app rocketchat_nextcloud: Out-of-path file extraction {/volume4/@tmp/oc_tmp_u7ktM6-folder/rocketchat_nextcloud/vendor/bin/phpunit --> ../phpunit/phpunit/phpunit}

Unable to connect the rocket application to nextcloud

Hello,

I can't activate the rocket chat application directly in nextcloud, Firefox tells me this:

Firefox can't open this page

To protect your security, my_chat.com will not allow Firefox to display the page if it is integrated by another site. To view this page, you must open it in a new window.

I obviously followed your youtube video and read your documentation (video https://www.youtube.com/watch?v=AshE2uG87GE doc https://docs.rocket.chat/guides/administration/admin-panel/integrations/nextcloud-rocket.chat-app)

Header set Content-Security-Policy "script-src 'self' *my_chat.com;"
Header set Content-Security-Policy "frame-ancestors 'self' *my_chat.com;"

Alas nothing works, I added headers as above but still nothing .. Could you please tell me how to fix this problem?

NC 23 to 24 question.

When updating from 23.0.9 - 24.0.5, will rocket.chat still function correctly or are there breaking changes? Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.