Hi there,
I just came across quite a strange bug and I wanted to share it with you because it is quite cumbersome.
Yesterday I tried to install discourse_ynh on a subdomain () and after the initial setup the stylesheets were missing on my discourse and everything looked broken as you can see below. I hadn't had this issue before.
I discovered that the CSS was broken due to the fact that Discourse couldn't find the files (see screenshot below, that's the web inspector).
I then decided to change the url to domain.tld/forum using yunohost cli (yunohost app change-url discourse --domain domain.tld --path /forum). Soon after, the issue was gone!
I then decided to do the other way around: yunohost app change-url discourse --domain subdomain.domain.tld --path / And guess what, the issue hadn't come back!
So, in the end, how comes that Discourse_YNH doesn't setup properly when path is "/" ?
I have an idea:
I tried to install Discourse the same way on another server, same issue.
I then compared the two nginx config files: thery were the same.
I then compared the two discourse.conf in discourse/config/discourse.conf: Bingo, they were different at line 19* (relative_url_root ...). The Discourse malfunctioning had relative_url_root = / whereas the other one had relative_url_root =.
I have access to my server: *Through SSH | through the webadmin |
Are you in a special context or did you perform some particular tweaking on your YunoHost instance?: / yes*
If yes, please explain: I am the main developer of an Ansible-collection which installs Yunohost w/ Ansible. I also develop some bash scripting to perform a post-install of Yunohost and install themes + plugins.
Using, or trying to install package version/branch: Latest-stable (2.7.6).
Expected behavior
Discourse should install properly with subdomains like subdomain.domain.tld
Describe the bug
Hi there, I just came across quite a strange bug and I wanted to share it with you because it is quite cumbersome. Yesterday I tried to install discourse_ynh on a subdomain () and after the initial setup the stylesheets were missing on my discourse and everything looked broken as you can see below. I hadn't had this issue before.
![2022-06-15_14-27](https://user-images.githubusercontent.com/57273277/173831877-2751dac4-d8c1-46d6-bb25-741d258fb6ef.png)
I discovered that the CSS was broken due to the fact that Discourse couldn't find the files (see screenshot below, that's the web inspector).![2022-06-15_14-29](https://user-images.githubusercontent.com/57273277/173827088-408b6253-8bfa-4e49-9ed8-aa3653b7924e.png)
I then decided to change the url to
domain.tld/forum
using yunohost cli (yunohost app change-url discourse --domain domain.tld --path /forum
). Soon after, the issue was gone! I then decided to do the other way around:yunohost app change-url discourse --domain subdomain.domain.tld --path /
And guess what, the issue hadn't come back!So, in the end, how comes that Discourse_YNH doesn't setup properly when path is "/" ?
I have an idea:
discourse.conf
indiscourse/config/discourse.conf
: Bingo, they were different at line 19* (relative_url_root ...
). The Discourse malfunctioning hadrelative_url_root = /
whereas the other one hadrelative_url_root =
.conf/discourse_defaults.conf
introduces a bug line 196 (relative_url_root = "__PATH_URL__"). In my opinion and with my analysis, this discourse.conf file should be like thisrelative_url_root =
whensubdomain.domain.tld
and like thisrelative_url_root = /forum
whendomain.tld/forum
for example.Context
Expected behavior
Discourse should install properly with subdomains like
subdomain.domain.tld