stephenmcd / gnotty

IRC web client and bot framework
http://gnotty.jupo.org
BSD 2-Clause "Simplified" License
162 stars 27 forks source link

Question | Archiving all messages #14

Closed shon closed 11 years ago

shon commented 11 years ago

I have setup gnotty+django pointing to our freenode irc channel. I was expecting all irc logs in archive. However there is none. Is there any config to enable logging?

I start gnotty like below

gnottify -l DEBUG irc-host=irc.freenode.net --irc-channel=#<my-channel> \
-n <nick> --bot-class=gnotty.bots.Voltron -p 8000

python manage.py runserver   8080

I have sqlite as my backend. May be I am missing something obvious.

stephenmcd commented 11 years ago

You have to run gnottify as a Django management command to pick up the Django integration, which adds message logging. From the README:

Running the Gnotty server when integrated with Django is simply a matter of running the gnottify Django management command:

$ python manage.py gnottify [options]
stephenmcd commented 11 years ago

PS: All the options should be the same.

shon commented 11 years ago

Yes I tried that. But that creates a redirection loop.

python manage.py gnottify -l DEBUG irc-host=irc.freenode.net \
--irc-channel=<channel> -n <nick>  --bot-class=gnotty.bots.Voltron -p 8000

With as I open localhost:8000, browser detects redirection loop. Also in this case gnotty nick does not join the channel.

stephenmcd commented 11 years ago

The -p option specifies the websocket port - you're not meant to access it directly. You described using 8080 above with Django's runserver command - you'd need to access localhost:8080 given everything you've described so far.

shon commented 11 years ago

For sure it's my Django integration.

Django version is 1.4.3, if it matters.

stephenmcd commented 11 years ago

Yes you need to run both.

shon commented 11 years ago

Ok my confusion. Thanks for help and thanks for this really useful piece of software.

stephenmcd commented 11 years ago

You're welcome!

dextraz commented 11 years ago

How do you deploy this with apache, I have been able to run it locally with manage.py , now wondering how it can play with apache. Any help or pointers? Thanks for the awesome library

stephenmcd commented 11 years ago

I've exposed the websocket server directly to the internet.

If you want to use Apache you'll need to work out how to get it to proxy websockets. Please report back your findings :-)

dextraz commented 11 years ago

I will look into that, but my question is how do I start gnotty without using manage.py since in production I can't do that?

stephenmcd commented 11 years ago

You're confusing the characteristics of the manage.py tool, and the runserver command.

Like I said I expose the websocket server directly to the internet using manage.py gnottify, which has nothing to do with runserver.

dextraz commented 11 years ago

That's very true, I was wrong. This is my scenario, I have successfully setup the example project and the chat works fine, thanks for the hardwork :-). But now I have to start gnotty using manage.py gnottify in my terminal for the chat to work, now my confusion is, when I close the terminal the gnotty shuts down too, now I was wondering how this would play in production ie intergrate it with a site running django/apache/mod_wsgi? Thanks for your support, very much appreciated. :-)

stephenmcd commented 11 years ago

We're well outside the scope of gnotty now, so forgive me if I don't reply again after this, but do a Google search for "process managers". I use one called supervisord.

Good luck.

dextraz commented 11 years ago

Thankyou for your help. That is exactly what I needed. Thankyou again :-)

stephenmcd commented 11 years ago

You're welcome!