Green-Party-of-Canada-Members / gpc-decidim

Decidim For the Green Party of Canada
https://wedecide.green.ca/
GNU Affero General Public License v3.0
1 stars 0 forks source link

Fixing up rocketchat after the barbarian #62

Closed BigSnicker closed 1 year ago

BigSnicker commented 1 year ago

Gents,

My apologies, but I was trying to get static assets served via CDN and have managed to remove the static assets entirely!

I tried using the CDN prefix via the GUI, to get the static assets (only) served via Cloudflare at cdn.chat2.green.ca:

image

That broke everything, so I had to log into MongoDB and reset the CDN Prefix back to "" by hand (https://docs.rocket.chat/guides/administration/admin-panel/advanced-admin-settings/cdn)

That worked and helped recover the server, but the static assets (e.g. avatars) are no longer being served in the web clients.

image

It appears to still work correctly for the PC client, but that could just be due to cacheing.

Sorry!

BigSnicker commented 1 year ago

Very important new data point!

Static assets work fine when accessed via https://captain.deploy.green.ca, just not when chat2.green.ca is used!

This is true even after I delete the domain from captain and readd it.

Not sure what's going on... it might be possibly due to the fact that I made CDN prefix changes directly on leadership-1 node, and not via caprover?

BigSnicker commented 1 year ago

It appears this is only happening in my firefox browser. chat2.green.ca seems to work fine in other browsers.

Hopefully this is just as local cacheing issue, so please ignore if everything works.

microstudi commented 1 year ago

It should be working right know. Some notes:

  1. Cloudflare cannot provide 2on level subdomains, so adding a proxy for a think like `*.chat2, doesn't work. Better avoid that.
  2. You don't need to do anything special to have cdn if you are using the proxy feature of Cloudflare in you main domain (as chat2.green.ca does). Static assets are cached by cloudflare so no need to specify an external CDN endpoint.
  3. Finally, looks like you are changing the main domain from chat2.green.ca to chat.green.ca, this needs to take into account that some integrations might be affected. For instance, the Oauth configuration in drupal needs to be aware of that (I've already added chat.green.ca as an allowed endpoint)
BigSnicker commented 1 year ago

VERY important notes for @Laurence-Montgomery as well! Thank you!