How to upload files in root directory?


#1

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?


(Rafael dos Santos Silva) #2

Discourse have a plugin to get push notifications already:


(Tom Newsom) #3

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.


(Rafael dos Santos Silva) #4

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?


(Tom Newsom) #5

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


#6

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?


(Mario) #7

did you solve the problem?

I want to add sendpulse files (Web Push Notifications - FREE Web Push Service | 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?


(Ionuț Staicu) #8

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.