Push notification generation and delivery service
2.7K
.ruby-versionbrew install postgresqlbrew install redis-serverElloProtobufs gemThis project uses dotenv-rails to
manage application configuration in development. To get started, you
need to cp .env.example .env to setup the local development
environment variables.
We are using basic auth for service authentication. It's not a robost
enough solution once we have multiple services in play, but it will
suffice for now without making things overly complicated. Check the
.env file for the proper environment variables related to basic auth.
The same values will need to be used by clients that communicate with
the service.
In order to communicate with SNS, the notifications service needs to be configured with an access key, secret, and specified region. The key pair only needs access to SNS, not other AWS components.
Since protocol buffers are a binary communication format, you have to test the notification creation end-points with encoded binary directly. Chrome extensions like Postman and XHR Poster don't work well for this because of how they treat backslashes in the raw body as real backslashes rather than escaping characters for multi-byte characters.
As a result, testing with curl is recommended:
curl http://lvh.me:3000/notifications/create --data-binary @./relative/path/to/request_object -H "Content-Type: application/octet-stream" -H "Accept: application/octet-stream"
In the example above, the encoded data for a notification creation has been saved to a test file, which is sent as binary by curl. You can easily encode test objects from the Rails console:
f = File.open('./request_object', 'w:ASCII-8BIT')
ElloProtobufs::SomeService::CreateResourceRequest.new({ object_param: 'value' }).encode_to(f)
f.close
The response from the server will also be binary information, and in order to decode it, you will have to decode it into a response object:
f = File.open('./response_object', 'r:ASCII-8BIT')
response = ElloProtobufs::SomeService::CreateResourceResponse.decode_from(f)
f.close
Ello Notifications is released under the MIT License
Ello was created by idealists who believe that the essential nature of all human beings is to be kind, considerate, helpful, intelligent, responsible, and respectful of others. To that end, we will be enforcing the Ello rules within all of our open source projects. If you don’t follow the rules, you risk being ignored, banned, or reported for abuse.
Content type
Image
Digest
Size
317.3 MB
Last updated
over 9 years ago
docker pull ello/ello-notifications