├── .gitignore ├── .travis.yml ├── Dockerfile ├── Gemfile ├── LICENSE ├── Procfile ├── README.md ├── app.rb ├── bin ├── bot ├── jbot ├── jserver └── server ├── config.rb ├── config.ru ├── g0v.json ├── logbot.rb.example ├── post-receiv.sh ├── public ├── applications.js ├── emoji.js ├── images │ └── img_dropdown_violet.svg └── live.js ├── sass ├── _solarized.sass ├── embed.sass ├── screen.g0v-sidebar.sass ├── screen.sass └── widget.sass ├── screenshot.png ├── test └── test_app.rb ├── utils ├── crawler │ ├── README.md │ ├── format.ls │ ├── index.ls │ ├── package.json │ └── search.ls ├── emoji-updater │ ├── .gitignore │ ├── index.js │ └── package.json └── migrate_db.rb ├── views ├── _embed.erb ├── _footer.erb ├── channel.erb ├── live.erb ├── oembed.erb ├── quote.erb └── widget.erb └── yahns.rb /.gitignore: -------------------------------------------------------------------------------- 1 | .swp 2 | /public/*.css 3 | /public/md5.min.js 4 | .sass-cache 5 | .DS_Store 6 | /fire_app_log.txt 7 | public/index.html 8 | *.rdb 9 | /logbot.rb 10 | /Gemfile.lock 11 | /tmp 12 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | language: ruby 3 | 4 | before_install: 5 | - rvm get head 6 | - rvm reload 7 | - rvm use --install $TRAVIS_RUBY_VERSION --binary --latest 8 | install: 'gem install bundler; bundle install --retry=3' 9 | script: 'ruby -r bundler/setup -Ilib test/test_app.rb' 10 | 11 | matrix: 12 | include: 13 | - rvm: 2.2.5 14 | - rvm: 2.3.2 15 | - rvm: 2.4.0 16 | - rvm: jruby-9 17 | env: JRUBY_OPTS=--debug 18 | - rvm: rbx 19 | 20 | allow_failures: 21 | - rvm: rbx 22 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | from ubuntu:precise 2 | run echo "deb http://ppa.launchpad.net/brightbox/ruby-ng/ubuntu precise main" >> /etc/apt/sources.list 3 | run echo "deb http://ppa.launchpad.net/chris-lea/redis-server/ubuntu precise main" >> /etc/apt/sources.list 4 | run gpg --keyserver keyserver.ubuntu.com --recv-keys F5DA5F09C3173AA6 B9316A7BC7917B12 5 | run gpg --armor --export F5DA5F09C3173AA6 | apt-key add - 6 | run gpg --armor --export B9316A7BC7917B12 | apt-key add - 7 | run apt-get update -qq 8 | run apt-get install -qq --force-yes -y ca-certificates ruby2.2 redis-server 9 | add . / 10 | run apt-get install --force-yes -y build-essential ruby2.2-dev 11 | run bundle install 12 | run compass compile 13 | run cp logbot.rb.example logbot.rb 14 | run /bin/sh post-receiv.sh 15 | expose 6379 16 | expose 15000 17 | env LOGBOT_NICK logbot_ 18 | env LOGBOT_SERVER irc.freenode.net 19 | env LOGBOT_CHANNELS #test56 20 | cmd ["sh", "-c", "/usr/bin/redis-server | foreman start"] 21 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | 2 | source 'https://rubygems.org' 3 | 4 | gem 'jellyfish', '~>1.1.1' # web 5 | gem 'rack', '~>1.5.2' # web 6 | gem 'cinch', '~>2.3.3' # agent 7 | gem 'redis', '~>3.3.2' # used in web and agent 8 | 9 | # All of below are optional/selectional: 10 | group :server do 11 | gem 'foreman', '~>0.82.0' 12 | 13 | platform(:ruby) do 14 | gem 'yahns', '~>1.9.0' 15 | end 16 | 17 | platform(:jruby) do 18 | gem 'trinidad', '~>1.4.6' 19 | end 20 | end 21 | 22 | # compile assets 23 | group :assets do 24 | gem 'compass', '~>0.12.4' 25 | gem 'sass', '~>3.2.17' 26 | end 27 | 28 | group :test do 29 | gem 'pork', '~>2.0.0' 30 | end 31 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013 Shao-Chung Chen 2 | 3 | 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: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | 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. 8 | -------------------------------------------------------------------------------- /Procfile: -------------------------------------------------------------------------------- 1 | web: yahns -c yahns.rb 2 | logbot: ruby logbot.rb 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Logbot [![Build Status](https://secure.travis-ci.org/g0v/Logbot.png?branch=master)](http://travis-ci.org/g0v/Logbot) 2 | 3 | ====== 4 | Logbot is a simple IRC logger with realtime web-based viewer. 5 | 6 | 7 | Screenshot 8 | ---------- 9 | ![Logbot screenshot](https://raw.github.com/g0v/Logbot/master/screenshot.png) 10 | 11 | 12 | How to Deploy 13 | ------------- 14 | * Use Docker 15 | 1. Install [Docker](https://www.docker.com/) 16 | 2. Run `docker run -d -p 15000:15000 -e LOGBOT_NICK=xxxx -e LOGBOT_CHANNELS=#x,#y,#z -e LOGBOT_SERVER=168.95.1.1 audreyt/logbot` 17 | 3. Visit [http://localhost:15000](http://localhost:15000) 18 | 19 | * Manual installation 20 | 1. Ruby (1.9.3+) and Redis server must be installed 21 | 2. Run `bundle install` to install required Ruby gems 22 | 3. Run `compass compile` to compile Sass files 23 | 4. Fire up your `redis-server` 24 | 5. Specify target channels in `logbot.rb` 25 | 6. Run `foreman start` to launch web server (WEBrick) and Logbot agent 26 | 7. Visit [http://localhost:15000](http://localhost:15000). 27 | 28 | 29 | How to Contribute 30 | ----------------- 31 | Just hack it and send me pull requests ;) 32 | 33 | 34 | License 35 | ------- 36 | Licensed under the [MIT license](http://opensource.org/licenses/mit-license.php). 37 | 38 | Copyright (c) 2013 Shao-Chung Chen 39 | 40 | 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: 41 | 42 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 43 | 44 | 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. 45 | -------------------------------------------------------------------------------- /app.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | Encoding.default_internal = "utf-8" 3 | Encoding.default_external = "utf-8" 4 | 5 | require "json" 6 | require "time" 7 | require "date" 8 | require "erb" 9 | require "cgi" 10 | 11 | require "redis" 12 | require "jellyfish" 13 | 14 | # ruby 1.9- compatibility 15 | unless respond_to?(:__dir__, true) 16 | def __dir__ 17 | File.dirname(__FILE__) 18 | end 19 | end 20 | 21 | module Routes 22 | CHANNEL = '(?[\w\-\.]+)' 23 | DATE = '(?[\w\-]+)' 24 | TIME = '(?