RocketChat / RocketChat/Rocket.Chat

ROOT_URL env var is ignored after first run

Open
#21,434 0 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
46.1k
Forks
13.9k
Avg merge
3d 3h
Merged PRs (30d)
130

Description

Description:

The ROOT_URL environment variable is ignored after first run. Instead db.rocketchat_settings.Site_Url from mongodb is used.
There are even blogposts about this issue: https://www.ryadel.com/en/rocket-chat-change-root_url-site-url-rocketchat/

Steps to reproduce:
  1. Install rocketchat
  2. set ROOT_URL in the systemd service file
  3. start and setup rocketchat
  4. stop rocketchat
  5. change ROOT_URL in the systemd service file
  6. start rocketchat
Expected behavior:

Site_Url gets updated after every restart of rocketchat. Even better would be to not store it in mongodb at all to enable gracefull migration of parts of a cluster or use different values based on for example the used frontend url for this instance.

Actual behavior:

Site_Url (used for example for oauth redirects) is still set to the old value

Server Setup Information:
  • Debian Buster
  • Deployment Method: tar
  • Rocketchat Version 3.12.3
  • Number of Running Instances: 2
  • Apps Engine Version 1.23.0
  • Node Version v12.22.0
  • Database Migration218 (April 3, 2021 4:11 PM
  • MongoDB 4.2.13 / wiredTiger (oplog Enabled)
Client Setup Information
  • any
Relevant logs:

should not be needed

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how ROOT_URL is read during startup and how db.rocketchat_settings.Site_Url is persisted and used for OAuth redirects. Reproduce the restart scenario with two instances, then verify that the configured URL is handled consistently after every restart without breaking existing settings behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
mongodb, typescript
Domain
authentication, backend, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.