Iframe in nextcloud with rocket chat [FRANCAIS] Activer rocket chat directement dans nextcloud

English Version :

Hello to all,

I come to see you because I have various problems that do not seem very serious but which indicate that something is misconfigured.

All the basic functionalities seem to work (I can access my domain correctly, the chat is working etc…)

However, I want to connect my rocket chat with nextcloud, so I have except that during the integration itself inside nextcloud Firefox refuses to open the page and it 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.

The other problem is the webdav link, this one seems to work unstable because when I want to retrieve a file on the server and I select it, the loading does not take place (the files of nextcloud are however visible from the rocket server)

note that a message from rocket appeared several times telling me that I was trying to connect to localhost and offered to redirect everything to my domain name which is secure, perhaps I should not have accepted.

Here is what the apache logs say:

[Fri Apr 08 12:09:17.803453 2022] [proxy:error] [pid 345590] (111)Connection refused: AH00957: http: attempt to connect to 127.0.0.1:3000 (*) failed
[Fri Apr 08 12:09:17.803658 2022] [proxy_http:error] [pid 345590] [client xx.xx.xx.xx.xx:46098] AH01114: HTTP: failed to make connection to backend: localhost, referer: my_chat.com/admin/cloud

My vhost file :

<VirtualHost *:80>

ServerName my_chat.com
RewriteEngine on
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
RewriteCond %{SERVER_PORT} !^443$

<VirtualHost *:443>
ServerAdmin admin@localhost.fr
ServerName my_chat.com

LogLevel info
ErrorLog /var/log/chat.domain.com_error.log
TransferLog /var/log/chat.domain.com_access.log

SSLEngine On

SSLCertificateFile /etc/letsencrypt/live/my_chat.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/my_chat.com/privkey.pem

Require all granted

RewriteEngine On
RewriteCond %{HTTP:CONNECTION} Upgrade [NC]
RewriteCond %{HTTP:Upgrade} =websocket [NC]
RewriteRule /(.*)           ws://localhost:3000/$1 [P,L]
RewriteCond %{HTTP:Upgrade} !=websocket [NC]
RewriteRule /(.*)           http://localhost:3000/$1 [P,L]

ProxyPassReverse /          http://localhost:3000/

I’m using debian 11 and installed rocket via snap, If you need any other information, don’t hesitate.

I thank you all in advance

Sincerely

PS :
I saw that this video was available Installing RocketChat and NextCloud in the same instance and embedding Rocket Chat inside NextCloud - YouTube

So I followed what had to be deactivated to allow me the integration there Unfortunately it doesn’t work even though I followed this video to the letter

I thought I understood while doing research that firefox or chrome refuse the page because I don’t have the right header in my vhost.

So I’m trying to find out which header would be succeptible to match so that the integration works. Assuming of course that the problem comes from there (yes if we believe anyway the help page of firefox)

So far even something permissive and not recommended like this header Header always set X-Frame-Options “ALLOWALL” didn’t change anything. So I’m continuing my research and waiting for someone with more experience to answer

EDIT : I’m still looking.

I’ll keep looking in the meantime, if I find it I’ll let you know so that it can be useful to other people
French Version :
Bonjour Ă  tous,

Je viens vous voir car j’ai divers problèmes qui ne semblent pas très graves mais qui indiquent que quelque chose est mal configuré.

Toutes les fonctionnalités de base semblent fonctionner (je peux accéder à mon domaine correctement, le chat fonctionne etc…).

Cependant, je veux connecter mon rocket chat avec nextcloud, donc j’ai sauf que pendant l’intégration elle-même dans nextcloud Firefox refuse d’ouvrir la page et il me dit ceci :

Firefox ne peut pas ouvrir cette page

Pour protéger votre sécurité, my_chat.com ne permettra pas à Firefox d’afficher la page si elle est intégrée par un autre site. Pour afficher cette page, vous devez l’ouvrir dans une nouvelle fenêtre.

L’autre problème est le lien webdav, celui-ci semble fonctionner de manière instable car lorsque je veux récupérer un fichier sur le serveur et que je le sélectionne, le chargement n’a pas lieu (les fichiers de nextcloud sont pourtant visibles depuis le serveur de rocket)

à noter qu’un message de rocket est apparu plusieurs fois me disant que j’essayais de me connecter à localhost et me proposait de tout rediriger vers mon nom de domaine qui est sécurisé, peut-être n’aurais-je pas dû accepter.

Voici ce que disent les journaux d’apache :

[Fri Apr 08 12:09:17.803453 2022] [proxy:error] [pid 345590] (111)Connexion refusée : AH00957 : http : tentative de connexion à 127.0.0.1:3000 (*) échouée
[Fri Apr 08 12:09:17.803658 2022] [proxy_http:error] [pid 345590] [client xx.xx.xx.xx.xx:46098] AH01114 : HTTP : Ă©chec de la connexion au backend : localhost, referer : my_chat.com/admin/cloud

Mon fichier vhost :

<VirtualHost *:80>

Nom du serveur mon_chat.com
RewriteEngine on
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
RewriteCond %{SERVER_PORT} !^443$

<VirtualHost *:443>
ServerAdmin admin@localhost.fr
Nom du serveur mon_chat.com

LogLevel info
ErrorLog /var/log/chat.domain.com_error.log
TransferLog /var/log/chat.domain.com_access.log

SSLEngine On

SSLCertificateFile /etc/letsencrypt/live/my_chat.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/my_chat.com/privkey.pem

Exiger tous les accords

RewriteEngine On
RewriteCond %{HTTP:CONNECTION} Mise Ă  jour [NC]
RewriteCond %{HTTP:CONNEXION} Mise Ă  jour =websocket [NC]
RewriteRule /(.*) ws://localhost:3000/$1 [P,L]
RewriteCond %{HTTP:Upgrade} !=websocket [NC]
RewriteRule /(.*) http://localhost:3000/$1 [P,L]

ProxyPassReverse / http://localhost:3000/

J’utilise debian 11 et j’ai installé rocket via snap, Si vous avez besoin d’autres informations, n’hésitez pas.

Je vous remercie d’avance

Sincèrement

PS :
J’ai vu que cette vidéo était disponible Installer RocketChat et NextCloud dans la même instance et intégrer Rocket Chat à l’intérieur de NextCloud - YouTube.

J’ai donc suivi ce qu’il fallait désactiver pour me permettre l’intégration là Malheureusement cela ne fonctionne pas bien que j’ai suivi cette vidéo à la lettre

J’ai crû comprendre en faisant des recherches que firefox où chrome refuse la page car je n’ai pas le header qu’il faut dans mes vhost.

Je suis donc en train d’essayer de chercher lequel header serait succeptible de correspondre pour que l’intégration fonctionne. En partant du principe bien sûr que le problème viennent de là (oui si on en crois en tout cas la page d’aide de firefox)

Pour l’instant même quelque chose de permissif et de pas recommandé comme cette header ci Header always set X-Frame-Options “ALLOWALL” n’a pas réussit à changer quoique ce soit. Donc je continue mes recherches en attendant que quel’qu’un de plus expérimenté répondent

EDIT: Je suis toujours en train de chercher.
Je vais continuer à chercher en attendant, si je trouve je vous tiendrais informé que ça puissent servir à d’autres personnes

Up please Last clarification if it can help I have a snap install but I don’t think it has anything to do with it if I believe the number of similar problems I saw on the github account

No one has any answers? I still haven’t figured out how to solve this problem. If you need more information, I’ll be happy to help.

Check open.rocket.chat to see what they advise. Also read over their github for the integration.

Thank you so much for taking the time to respond!

It is already done

https://forums.rocket.chat/t/iframes-rocket-chat-and-nextcloud/13801/3

unfortunately no answers … A topic on the site of rocket was opened 1 year ago concerning this problem but the links are broken since.

And I also posted on the github although we are several to have raised the problem no concrete answer was brought (or then I did not see it)