How to upload files in root directory?

Hi, I am trying to integrate onesignal push notifications with discourse and it requires to upload some SDK files in root directory - Link.

Can anyone guide me on how to upload these files in root directory?

1 Like

Discourse have a plugin to get push notifications already:

https://meta.discourse.org/t/discourse-push-notifications/46692?u=falco

But only for a subset of browsers and devices (and even then, not reliably)

@SMT - The “root” of your discourse instance lives inside the docker container. SSH in to your server and cd /var/discourse then ./launcher enter app. Trouble is, anything you store here will be wiped when you run an update.

One signal doesn’t support iOS also, so what’s the difference?

Also, discourse already supplies a manifest.json, so he will need to overthrown nginx/rails router. What are the pros?

There was me taking the iOS badge on the Onesignal front page at face value :smiley:

Hi, yes but currently with this plugin, I can’t send a custom push to all users that’s why I need to integrate onesignal. Also with the plugin can we automatically subscribe all users for push notifications?

did you solve the problem?

I want to add sendpulse files (Send Web Push Notifications Free (Unlimited) | Sendpulse) to root directory but I have the same problem…

I have to:

  1. Copy and paste code into your website template before the closing head tag

  2. Download the setup files below for the Chrome browser support. Unzip the archive and upload the files into the top-level directory ( root , or ‘/’) of your website.

So…

cd /var/discourse then ./launcher enter app

What next?

Hey guys, a bit late at the party, but here is how I solved this:

  1. First step is to make your server to run nginx behind a proxy. You can find this right here.
  • mkdir -p /var/www/discourse-static
  1. On the nginx config file (/etc/nginx/sites-enabled/discourse.conf), just after location / {} block, add the following:
location ~ (file1.txt|file2.json|file3.zip) {
  root /var/www/discourse-static;
}

Save and check the config by running nginx -T. If everything is fine (i.e. a wall of text will quickly scroll), then you can go on and sudo service nginx restart.

And that’s all.


Discourse push plugin is a bit limited and requires users to actually know where to look and what to look for in order to enable notifications.

4 Likes