Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
node-pushserver
Advanced tools
Readme
Push Server is a cross-plateform push server based on node-apn and node-gcm. Push Server currently supports iOS (APN) and android (GCM) platforms. It uses mongoDB to store the push tokens. Note that this server is not meant to be used as a front facing server as there's no particular security implemented.
node-pushserver uses mongodb to store the user / token associations. So you need to have a Mongo database setup beforehand
See MongoDB (MongoDB Download page).
$ npm install node-pushserver -g
$ git clone git://github.com/Smile-SA/node-pushserver.git
$ cd node-pushserver
$ npm install -g
If you checked out this project from github, you can find a configuration file example named 'example.config.json'.
{
"webPort": 8000,
"mongodbUrl": "mongodb://username:password@localhost/database",
"gcm": {
"apiKey": "YOUR_API_KEY_HERE"
},
"apn": {
"connection": {
"gateway": "gateway.sandbox.push.apple.com",
"cert": "/path/to/cert.pem",
"key": "/path/to/key.pem"
},
"feedback": {
"address": "feedback.sandbox.push.apple.com",
"cert": "/path/to/cert.pem",
"key": "/path/to/key.pem",
"interval": 43200,
"batchFeedback": true
}
}
}
Checkout GCM documentation to get your API key.
Read Apple's Notification guide to know how to get your certificates for APN.
Please refer to node-apn's documentation to see all the available parameters and find how to convert your certificates into the expected format.
You can use the "process.env.MY_ENV_VAR" syntax in the config.json file. It will automatically be replaced by the value of the corresponding environment variable.
$ pushserver -c /path/to/config.json
You can override your configuration with the "-o" or "--override" option by providing a key=value option. The key can be of the form key.subKey. If the value begins with process.env, it is evaluated. For example, if your mongodbUrl comes from an environment variable:
$ pushserver -c /path/to/config.json -o mongodbUrl=process.env.MY_ENV_VAR
If you want to set you GCM API key via the command line:
$ pushserver -c /path/to/config.json -o gcm.apiKey=YOUR_API_KEY
You can easily send push messages using the web interface available at http://domain:port/
.
http://domain:port/send (POST)
{
"users": ["user1"],
"android": {
"collapseKey": "optional",
"data": {
"message": "Your message here"
}
},
"ios": {
"badge": 0,
"alert": "Your message here",
"sound": "soundName"
}
}
http://domain:port/sendBatch (POST)
{
"notifications": [{
"users": ["user1", "user2"],
"android": {
"collapseKey": "optional",
"data": {
"message": "Your message here"
}
},
"ios": {
"badge": 0,
"alert": "Foo bar",
"sound": "soundName"
}
},{
"users": ["user4"],
"android": {
"collapseKey": "optional",
"data": {
"message": "Your other message here"
}
}
}
]
}
http://domain:port/subscribe (POST)
{
"user":"user1",
"type":"android",
"token":"CAFEBABE"
}
http://domain:port/unsubscribe (POST)
{
"token":"CAFEBABE"
}
or
{
"user":"user1"
}
http://domain:port/users (GET)
{
"users": [
"vilem"
]
}
http://domain:port/users/{user}/associations (GET)
{
"associations": [
{
"user": "vilem",
"type": "ios",
"token": "06546b81450fc50fb3e26e513081f54642d7af3dedb57d9a4c557cc36a81dd252"
}
]
}
Take a look at the history.
MIT :
Copyright (C) 2012 Smile Mobile Team
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
FAQs
Cross-platform Push Notifications. A project providing a generic API to push messages using Apple's APN and Google's GCM services.
The npm package node-pushserver receives a total of 1 weekly downloads. As such, node-pushserver popularity was classified as not popular.
We found that node-pushserver demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.