aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
blob: 4a8f34d64bf1dbe16675c2d5156b3d81c212e174 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# Aclog [![Build Status](https://travis-ci.org/rhenium/aclog.png?branch=master)](https://travis-ci.org/rhenium/aclog) [![Coverage Status](https://coveralls.io/repos/rhenium/aclog/badge.png)](https://coveralls.io/r/rhenium/aclog)
Collects favs and retweets in real time by UserStreams.

## Aclog is
* powered by Ruby on Rails
* completely free and open source ([The MIT License](https://github.com/rhenium/aclog/blob/master/LICENSE.txt))
* Scalable structure

        |------------|           |-----------| (MsgPack) |---------|   |---|
        |            -------------           ------------- Worker  =====   |
        | Web Server (MsgPack-RPC)           -------------    Node ===== T |
        |            -------------           |           |---------|   | w |
        |-----| |----|           |           ------------- Worker  ===== i |
              | |                | Collector -------------    Node ===== t |
        |-----| |----|           |           |           |---------|   | t |
        |            -------------           ------------- Worker  ===== e |
        | DB (MySQL)                         -------------    Node ===== r |
        |            -------------           |    :      |---------|   |   |
        |------------|           |-----------|    :           :        |---|

## Status
* *unstable*
* Working on [aclog.koba789.com](http://aclog.koba789.com)

## Features
* Collecting favorites and retweets from Twitter Streaming API
* Protected account support
* JSON API (with OAuth Echo)
* Atom feed

## Requirements
* Linux (WorkerNode optionally needs epoll)
* Ruby 2.2+
* MySQL/MariaDB 5.5.14+ (needs utf8mb4 support)
* memcached
* JavaScript runtime (see https://github.com/rails/execjs)

## Installation
### Database
* Create MySQL user

### Application Server
* Clone the source

        $ # We'll install aclog into /var/webapps/aclog
        $ cd /var/webapps
        $ git clone https://github.com/rhenium/aclog.git
        $ cd /var/webapps/aclog

* Install Gems

        $ bundle install

* Configure

        $ # Copy the example aclog config
        $ cp config/settings.yml.example config/settings.yml
        $ # Edit it
        $ vi config/settings.yml

        $ # Copy the example aclog database config
        $ cp config/database.yml.example config/database.yml
        $ vi config/database.yml

        $ # Set random secret_token
        $ cp config/secrets.yml.example config/secrets.yml
        $ sed -i s/replace_here/$(rake secret)/g config/secrets.yml

        $ # Setup database. This will create database and tables on MySQL server.
        $ RAILS_ENV=production bundle exec rake db:setup

* Start your aclog

    * Rake

            $ RAILS_ENV=production bundle exec rake web:start
            $ RAILS_ENV=production bundle exec rake collector:start

    * systemd

            $ cp example/systemd/aclog-{webserver,collector}.service /usr/lib/systemd/system/
            $ systemctl start aclog-webserver.service
            $ systemctl start aclog-collector.service

### Collector worker nodes
* Copy the source

        $ cd /var/webapps
        $ git clone https://github.com/rhenium/aclog.git
        $ cd /var/webapps/aclog/worker_node

* Install Gems

        $ bundle install

* Configure it

        $ # Copy the example collector config
        $ cp settings.yml.example settings.yml
        $ # Edit it
        $ vi settings.yml

* Start worker

    * Rake

            $ bundle exec rake worker_node:run

    * systemd

            $ cp example/systemd/aclog-worker-node.service /usr/lib/systemd/system/
            $ systemctl start aclog-worker-node.service

## Special Thanks
* KOBA789 ([@KOBA789](https://twitter.com/KOBA789) / [koba789.com](http://koba789.com)) - Hosting aclog.koba789.com
* rot ([@aayh](https://twitter.com/aayh)) - Web UI design

## Contributing
1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request