Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change url #80

Closed
getzze opened this issue Jul 31, 2021 · 2 comments
Closed

Change url #80

getzze opened this issue Jul 31, 2021 · 2 comments

Comments

@getzze
Copy link

getzze commented Jul 31, 2021

Hi,
I installed Rocket.chat with the testing branch (6e94ffa).
I just had to comment line 147 mongo --eval "printjson(rs.initiate())" in scripts/install, but I managed to install it.

I also had another problem (introduced with the last commit I am afraid), I installed it in rocketchat.maindomain.tld with the path /, which resulted in an error 404 when opening https://rocketchat.maindomain.tld.
In the rocketchat.service files, ROOT_URL was indeed defined as ROOT_URL=https://rocketchat.maindomain.tld/:3000. Where I could find my server! But this url was not very practical so I needed to change it.
After changing it to ROOT_URL=https://rocketchat.maindomain.tld/, I was still not able to open rocket chat at this address.
Then I found this page explaining that ROOT_URL becomes stored in mongodb at the first connection, so you have to change it there also:
https://www.ryadel.com/en/rocket-chat-change-root_url-site-url-rocketchat/

The steps to change url:

> mongo
> use rocketchat
> db.rocketchat_settings.update({"_id" : "Site_Url"},{$set:{value:"<YOUR NEW URL>"}})

I thought it would be useful to implement the change_url script.

@ericgaspar
Copy link
Member

Thanks for the feedback. RocketChat should be working now.

@getzze
Copy link
Author

getzze commented Nov 24, 2021

The update to version 4.1.2 worked well, thanks!
But the change_url script is not working.
ROOT_URL is not changed in rocketchat.service and more importantly "Site_Url" is not changed in mongodb, as I described in my first message.
Maybe adding the following to the change_url script could work:

db_name=$(ynh_sanitize_dbid --db_name=$app)
new_url="https://${new_domain}${new_path}"
ynh_mongo_exec --database="$db_name" --command='db.rocketchat_settings.update({"_id" : "Site_Url"}, {$set: {value: "'${new_url}'"}});'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants