Rocket.Chat URL ../rocketchat/home? Redirect to subdomain

Hi@all,

I am currently testing Rocket.Chat on UCS5.

In the Rocket.Chat documentation it says the chat server runs on port 3000. As a UCS app it seems to be a bit different. I guess this is because of Docker?

The following variables are set on the UCS5 host:

root@gw01:~# ucr search --brief rocket
appcenter/apps/rocketchat/container: b04c0d1098e90e4b160c4886ba814abf9d3498acfbdb547b034271879bea3f5d
appcenter/apps/rocketchat/hostdn: cn=rocke-23634004,cn=memberserver,cn=computers,dc=gehr,dc=lan
appcenter/apps/rocketchat/image: docker.software-univention.de/rocketchat-rocketchat:3.18.2
appcenter/apps/rocketchat/ip: 172.16.1.0/24
appcenter/apps/rocketchat/ports/3000: 40001
appcenter/apps/rocketchat/status: installed
appcenter/apps/rocketchat/ucs: 4.4
appcenter/apps/rocketchat/version: 3.18.2
rocketchat/autostart: yes
ucs/web/overview/entries/service/rocketchat/description/de: Open Source Team Communication
ucs/web/overview/entries/service/rocketchat/description: Open Source Team Communication
ucs/web/overview/entries/service/rocketchat/icon: /univention/js/dijit/themes/umc/icons/scalable/apps-rocketchat_20211101074333.svg
ucs/web/overview/entries/service/rocketchat/label/de: Rocket.Chat
ucs/web/overview/entries/service/rocketchat/label: Rocket.Chat
ucs/web/overview/entries/service/rocketchat/link-target: newwindow
ucs/web/overview/entries/service/rocketchat/link: /rocketchat/
ucs/web/overview/entries/service/rocketchat/port_http: 80
ucs/web/overview/entries/service/rocketchat/port_https: 443

To get to the chat server I have to call the following URL in the browser:

https://gw01.gehr.lan/rocketchat/home

Without the appended ../home it does not work. Although in the settings (in Rocket.Chat as admin) the URL is configured only with ../rocketchat. See:

grafik

But I would like to direct this to a subdomain anyway. On the pfSense, the HA proxy additionally listens on an additional virtual LAN IP. This causes all calls from https://chat.externedomain.de to arrive at this UCS5 node.

Now I would like to use /etc/univention/templates/files/etc/apache2/sites-available/ssl.d/50rockchat-subdomain

<IfModule mod_rewrite.c>
  RewriteEngine on
  RewriteRule .................
</IfModule>

and

/etc/univention/templates/info/rocketchat-subdomain.info

Type: subfile
Multifile: etc/apache2/sites-available/default-ssl.conf
Subfile: etc/apache2/sites-available/ssl.d/50rocketchat-subdomain
ucr update
ucr commit /etc/apache2/sites-available/default-ssl.conf

Rewrite everything that arrives at ‘chat.externedomain.com’ to ‘…/rocketchat/home’.

Can someone help me to formulate the RewriteRule? Does my intention work at all?

with best
sven

I have managed to make it work. However, I do not know if it is elegant.

<IfModule mod_rewrite.c>
  RewriteEngine on
  RewriteCond %{HTTP_HOST} ^chat.externedomain.com$
  RewriteRule ^(.*)$ https://chat.externedomain.com/rocketchat/home/ [R=301,L]
</IfModule>

Maybe someone has a tip for me :slight_smile:

If it is possible Rocket.Chat or the Indian that I have no subfolder in the URL would be nice.

grafik

Mastodon