Skip to content
This repository was archived by the owner on Nov 26, 2018. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
161cc30
Restoring .env.example #31
unbracketed Jun 5, 2014
3bfd391
Restoring use of dotenv #31
unbracketed Jul 9, 2014
af6afc3
Removes unused connecntion field from chatbot admin detail view
unbracketed Jul 9, 2014
f3762f2
Removes unused server_identifier field from chatbot admin detail view
unbracketed Jul 9, 2014
9f301ba
Updates docs to match current state of the site; use #botbot-warmup f…
unbracketed Jul 9, 2014
f39719a
Remove section about env vars since those are in the .env file now #31
unbracketed Jul 9, 2014
48f8213
Remove the temporary quickstart instructions #31
unbracketed Jul 10, 2014
f76a8de
Update to use STORAGE_URL for consistency
unbracketed Jul 11, 2014
39b0fa4
Manual merge with master
unbracketed Jul 11, 2014
822ce9a
Use config value for REDIS_PLUGIN_QUEUE_URL; fixes #78
unbracketed Jul 11, 2014
a6e202f
Remove django-dotenv
unbracketed Jul 11, 2014
baad5ba
Updates DATABASE_URL to STORAGE_URL
unbracketed Jul 11, 2014
9f918c3
Update getting started docs to cover manual refresh action
unbracketed Jul 11, 2014
1764e10
[WIP] start updating docs to explain managing environment and services
unbracketed Jul 11, 2014
2b7feb8
Update instruction to be clear about reloading config
unbracketed Sep 3, 2014
43f19a7
Finish up docs about running services and django commands
unbracketed Sep 3, 2014
4896bd9
Manual merge with master
unbracketed Sep 3, 2014
78ef780
Minor update to description of botbot-war
unbracketed Sep 5, 2014
eb50737
Adds architecture diagram to developer docs
unbracketed Sep 5, 2014
07c87e8
Minor adjustment to add channel step
unbracketed Sep 5, 2014
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Required
SECRET_KEY=supersecretkeyhere
WEB_PORT=8000
EMAIL_BACKEND='django.core.mail.backends.console.EmailBackend'
GOPATH=$VIRTUAL_ENV
WEB_SECRET_KEY=somerandomstring
STORAGE_URL=postgres://user:pass@localhost:5432/botbot
REDIS_PLUGIN_STORAGE_URL=redis://localhost:6379/0
REDIS_PLUGIN_QUEUE_URL=redis://localhost:6379/1
REDIS_SSEQUEUE_URL=redis://localhost:6379/2
SSE_ENDPOINT_URL=http://localhost:3000/
SSE_HOST=localhost:3000

# Optional
# MEMCACHE_URL=127.0.0.1:11211
# STATIC_ROOT=/var/www/botbot/static
# MEDIA_ROOT=/var/www/botbot/uploads
# DEBUG=True
# SMTP_URL=smtp://user:pass@host:port
# SMTP_TLS=True
# ALLOWED_HOSTS=host1,host2
# INCLUDE_DJANGO_ADMIN=False
# EXCLUDE_NICKS=nick1,nick2
59 changes: 0 additions & 59 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,62 +13,3 @@ Botbot is collection of tools for running IRC bots. It has primarily been
used with Freenode channels but works with other IRC networks or servers.

[Documentation](http://botbot.readthedocs.org/en/latest/)


Quickstart Guide:
=================

```
mkvirtualenv botbotenv
cdvirtualenv

# Set necessary environment variables e.g. in:
vi bin/postactivate

export GOPATH=$VIRTUAL_ENV
export WEB_SECRET_KEY=somerandomstring
export STORAGE_URL=postgres://user:pass@localhost:5432/botbot
export REDIS_PLUGIN_STORAGE_URL=redis://localhost:6379/0
export REDIS_PLUGIN_QUEUE_URL=redis://localhost:6379/1
export REDIS_SSEQUEUE_URL=redis://localhost:6379/2
export SSE_ENDPOINT_URL=http://localhost:3000/
export SSE_HOST=localhost:3000

source bin/postactivate

# Clone and install the Django part
mkdir src
cd src
git clone git@github.com:BotBotMe/botbot-web.git
pip install -e botbot-web
pip install -r botbot-web/requirements.txt

# Install the Go related part
cd ..
go get github.com/BotBotMe/botbot-bot
go get github.com/BotBotMe/botbot-eventsource

# Setup the database
manage.py dbshell
CREATE EXTENSION hstore;
CREATE EXTENSION unaccent;
ALTER FUNCTION unaccent(text) IMMUTABLE;

manage.py syncdb
manage.py migrate
manage.py collectstatic
manage.py createsuperuser

# Run all of the services at once with Foreman
ln -s src/botbot-web/Procfile
foreman start

# Or each one manually
botbot-bot
botbot-eventsource
manage.py runserver
manage.py run_plugins
```

Go to http://127.0.0.1:8000/admin/ and setup a bot and a channel.
Finally ppen http://127.0.0.1:8000/.
2 changes: 1 addition & 1 deletion botbot/apps/bots/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ class MembershipInline(admin.TabularInline):


class ChatBotAdmin(admin.ModelAdmin):
exclude = ('connection', 'server_identifier')
list_display = ('__unicode__', 'is_active')
list_editable = ('is_active',)
list_filter = ('is_active',)
readonly_fields = ('connection', 'server_identifier')

# Disable bulk delete, because it doesn't call delete, so skips REFRESH
actions = None
Expand Down
12 changes: 6 additions & 6 deletions docs/getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,21 +42,21 @@ Now that your bot is connected to a network or server, you can start having it j

1. Go to ``http://localhost:8000/admin/bots/channel/add/``
2. Select your bot from the dropdown
3. **Channel**: ``#botbot-test``
3. **Channel**: ``#botbot-warmup``
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#botwar is sort of an official test bed channel for bots. Doesn't really matter either way, just thought I'd mention it.

4. Select **'Is public'**
5. In the **Active Plugins** section click *Add another Active Plugin* and select **Ping**.
5. Several useful plugins will already be configured. At a minimum, ``ping`` and ``logger`` will be helpful for testing the bot.
6. Save. In the ``honcho`` console output you should see messages similar to::

12:14:42 bot.1 | 2013/09/19 12:14:42 Command: REFRESH
12:14:42 bot.1 | 2013/09/19 12:14:42 Reloading configuration from database
12:14:42 bot.1 | 2013/09/19 12:14:42 config.Channel: [#botbot-test ]
12:14:42 bot.1 | 2013/09/19 12:14:42 [RAW1] -->JOIN #botbot-test
12:14:42 bot.1 | 2013/09/19 12:14:42 config.Channel: [#botbot-warmup ]
12:14:42 bot.1 | 2013/09/19 12:14:42 [RAW1] -->JOIN #botbot-warmup

7. In your IRC client, join `#botbot-test <irc://irc.freenode.net:6667/botbot-test>`_. Try issuing a `ping` command (using your bot's nick in place of "mybot"). The bot should respond with a friendly message.
7. In your IRC client, join `#botbot-warmup <irc://irc.freenode.net:6667/botbot-warmup>`_. Try issuing a `ping` command (using your bot's nick in place of "mybot"). The bot should respond with a friendly message.
8. Go back to the home page ``http://localhost:8000``, you should see the channel listed as a public channel.
9. **Add another Active Plugin** and this time select **Logger**.
10. **Save**. Your ``honcho`` console should once again show a refresh
11. In your IRC client, go to `#botbot-test <irc:irc.freenode.net:6667/botbot-test>`_ and post a message. You should now have a log available at ``http://localhost:8000/freenode/botbot-test``. Each message you post in the channel shows up in the ``honcho`` console.
11. In your IRC client, go to `#botbot-warmup <irc:irc.freenode.net:6667/botbot-warmup>`_ and post a message. You should now have a log available at ``http://localhost:8000/freenode/botbot-warmup``. Each message you post in the channel shows up in the ``honcho`` console.


.. warning:
Expand Down
31 changes: 2 additions & 29 deletions docs/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ Postgresql with hStore extension
Go
~~

Version 1.3 or higher required

* **OS X**: ``brew install go``
* **Ubuntu**: ``apt-get install golang-go``

Expand Down Expand Up @@ -78,35 +80,6 @@ You should now be able to access the site at ``http://localhost:8000``. Log in w

See :doc:`getting_started` for instructions on configuring a bot.

Environment Variables to override
---------------------------------::

# Django (required)
WEB_SECRET_KEY=supersecretkeyhere

# DB Storage where channel/bot information is stored
STORAGE_URL=postgres://user:pass@localhost:5432/botbot

# Pipes
REDIS_PLUGIN_STORAGE_URL=redis://localhost:6379/1
REDIS_PLUGIN_QUEUE_URL=redis://localhost:6379/2
REDIS_SSEQUEUE_URL=redis://localhost:6379/3

# The host and port eventsource is delivering and the browser is listening
# for live changes.
SSE_ENDPOINT_URL=http://localhost:3000/

# Specific Django settings to override
# MEMCACHE_URL=127.0.0.1:11211
# STATIC_ROOT=/var/www/botbot/static
# MEDIA_ROOT=/var/www/botbot/uploads
# DEBUG=True
# SMTP_URL=smtp://user:pass@host:port
# SMTP_TLS=True
# ALLOWED_HOSTS=host1,host2
# INCLUDE_DJANGO_ADMIN=False
# EXCLUDE_NICKS=nick1,nick2

Serving In Production
---------------------

Expand Down
5 changes: 5 additions & 0 deletions manage.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#!/usr/bin/env python
import sys
import dotenv


dotenv.read_dotenv()


if __name__ == "__main__":
if (len(sys.argv) > 1 and
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ webassets==0.9.0
django-assets==0.8.0
yuicompressor==2.4.8
honcho==0.5.0
django-dotenv==1.2

djorm-ext-pgfulltext==0.9.0
djorm-ext-pgarray==0.9.0
Expand Down