Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

parkr/gossip

Repository files navigation

gossip

Fetch & store messages by room, author, and time.

Build Status

Running

Docker

To run this with Docker, simply:

~$ docker run -it --rm \
    --publish 8080:8080 \
    --volume $(pwd)/data:/data:rw \
    --env GOSSIP_DB_PATH=/data/gossip_production.sqlite3 \
    --env GOSSIP_AUTH_TOKEN=authtokentovalidateclients \
    --env GOSSIP_ROOMS='#jekyll,#octopress' \
    --env GOSSIP_DEFAULT_ROOM=jekyll \
    parkr/gossip \
    gossip -bind=:8080

API

Storing messages

Send a POST request to /api/messages/log with the following data as a URL-encoded string:

{
    "room": "#jekyll",
    "author": "parkr",
    "message": "hey y'all",
    "time": "Mon, 02 Jan 2006 15:04:05 MST"
}

Fetching messages

Send a GET request to /api/messages/log. You can optionally add a limit=N to the querystring to limit results. limit defaults to 10.

{
    "ok": "true",
    "values": [ ... ]
}

Server Configuration

Some environment variables are required to connect for proper functionality:

  • GOSSIP_DB_PATH
  • GOSSIP_AUTH_TOKEN (used to authenticate api requests from the client)
  • GOSSIP_SKIPPED_AUTHORS (optional, allows you to reject messages from certain authors during logging)
  • GOSSIP_DEFAULT_ROOM (default room without hash/pound sign, e.g. for #jekyll IRC room, should be 'jekyll')
  • GOSSIP_ROOMS (comma-separated list of rooms with hash/pound signs, e.g. '#jekyll,#octopress')

Optionally, set the GOSSIP_LOGFILE when running script/deploy.

Credits / License

Copyright (c) 2014 Parker Moore (@parkr)

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.

About

💬 Fetch & store messages by room, author, and time.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published