Installation

Kinyua W, M edited this page May 21, 2016 · 43 revisions

Install required ubuntu packages

sudo apt-get install python-pip python-dev build-essential mongodb git

Create directories to store certificates and private keys

sudo mkdir -p /var/airnotifier/pemdir

Get AirNotifier app

cd ~
git clone git://github.com/airnotifier/airnotifier.git airnotifier
cd airnotifier
# Install required python packages
sudo pip install -r requirements.txt

Setup AirNotifier

Copy airnotifier.conf-sample to airnotifier.conf, and change the settings accordingly. (change pemdir to /var/airnotifier/pemdir)

Run the command below to set up the initial admin user:

python install.py

Start AirNotifier app

sudo python airnotifier.py >> airnotifier.log 2>> airnotifier.err

Set up AirNotifier

  • In your browser: http://your_server_ip_address:8801 - Login as admin/admin
  • Create a new an application
iOS push notification settings
  • In the application page you need to upload the certificate + key. Follow the steps indicated in developer.apple.com to create a new Development Push Notification certificate. To summarize, in keychain you'll create a signing request file (it will also generate a public and private key) and upload it to developer.apple.com.
  • Download the generated aps_development.cer and double click on it to install it in keychain.
  • Convert the aps_development.cer file into aps_development.pem file
openssl x509 -in aps_development.cer -inform der -out aps_development.pem
  • From keychain export the private key in privatekey.p12 (you'll need to enter an export password). This private key has for name what you enter as "Common name" in during the signing request generation,
  • Extract the key from this p12 file:
openssl pkcs12 -in Certificates.p12 -nocerts -out privatekey_with_password.key

You'll have to enter the export password and add a new PEM phrase.

  • Remove the PEM phrase from the key:
openssl rsa -in privatekey_with_password.key -out privatekey.key
  • Upload both aps_development.pem and privatekey.key to AirNotifier.
  • Launch the server, no error message should appear.
Android push notification settings
  • Set up a GCM Client App on Android
  • Enable google cloud messaging service for the App
  • Copy and paste the API key and the project number to your Airnotifier application settings accordingly
WNS push notification settings
MPNS push notification settings

Set up iptables rules (optional)

sudo vim /etc/iptables.up.rules

Add:

-A INPUT -p tcp -m state --state NEW,ESTABLISHED -s YOUR_SERVER_IP -d YOUR_SERVER_IP --dport 27017 -j ACCEPT
-A INPUT -p tcp -m state --state NEW --dport 8801 -j ACCEPT
sudo /sbin/iptables -F
sudo /sbin/iptables-restore < /etc/iptables.up.rules

(Credits to Jerome Mouneyrac)

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.