RocketChat / RocketChat/Rocket.Chat

Can not upload and image with ROOT_URL change, Changing Root Url does not affect ${ __meteor_runtime_config__.ROOT_URL_PATH_PREFIX }

Open
#10,861 1 comment 0 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:

I am runnning 4 instances of Rocketchat behind Nginx. My root URL is https://xx.yyyy.com. I am using pm2 with example-pm2.json and modified it to reflect the ROOT_URL and port. With the app comes up fine and Chat is working fine. But when I try to upload an image/file in to the chat, it still seems to try to connect http://localhost:3000/ufs so the upload is failng. Also I noticed that even after the root url change the RocketChat.settings.get('Site_Url') always returns localhost:3000

Server Setup Information:
  • Version of Rocket.Chat Server:
  • Operating System:
  • Deployment Method(snap/docker/tar/etc):
  • Number of Running Instances:
  • DB Replicaset Oplog:
  • Node Version:
  • mongoDB Version:
    image
    image

This can also be reproduced in the local with a single instance.

Steps to Reproduce:
  1. Change the root url in to localhost:3333 from localhost:3000.
  2. run the example-build-run.sh
    3.try to upload an image.
Expected behavior:

An image is uploaded and shows up in the chat window.

Actual behavior:

image

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 with the ROOT_URL configuration and the example-build-run.sh entry point, then reproduce the upload using localhost:3333 while checking meteor_runtime_config.ROOT_URL_PATH_PREFIX and the /ufs target. Done means an image uploads successfully through the changed root URL instead of attempting localhost:3000.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nginx
Domain
backend, devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.